PDA

View Full Version : Skinned Latest Images


bugzlitey
08-09-2005, 11:24 AM
So I basically wrapped a table around my latest images to give it more of an integrated feel and the concept works but somehow the code for the table is misplaced and it's causing layout errors, not to mention it only looks as it should if I set the plugin to display one image. :angry:

I don't what should be moved around, but here is the code I have.

if($curcol == 0)
* * *{
* * * *echo '<table width="131" height="112" border="0" cellpadding="0" cellspacing="0">
* * * * * * * *<tr>
* * * * * * * * *<td width="9" height="8"><img src="http://www.macndabox.com/skins/hotGrey/images/otherDesigns_08.jpg" width="9" height="8" alt=""></td>
* * * * * * * * *<td width="100%" height="8" background="http://www.macndabox.com/skins/hotGrey/images/otherDesigns_09.jpg"></td>
* * * * * * * * <td width="8" height="8"><img src="http://www.macndabox.com/skins/hotGrey/images/otherDesigns_11.jpg" width="8" height="8" alt=""></td>
* * * * * * * </tr>
* * * * * * * <tr>
* * * * * * * * <td width="9" height="100%" background="http://www.macndabox.com/skins/hotGrey/images/otherDesigns_17.jpg"></td>';
* * *}

* * *echo '<td bgcolor="B53031" style="padding-bottom: 0px; padding-right: 1px;">';

* * *if($settings['Display Image Name'])
* * * *echo $link . $image['title'] . '</a><br />';

* * *if($settings['Display Author Name'])
* * * *echo $language['by'] . ' ' . $image['author'] . '<br />';

* * *if($settings['Display Thumbnail'])
* * * *echo $link . "<img src=\"plugins/p17_image_gallery/images/tb_".$image['filename']."\" /></a>";
*
*

* * *echo '</td>
* * * * * *<td width="8" height="100%" background="http://www.macndabox.com/skins/hotGrey/images/otherDesigns_18.jpg"></td>
* * * * </tr>
* * * * *<tr>
* * * * * *<td width="9" height="11"><img src="http://www.macndabox.com/skins/hotGrey/images/otherDesigns_19.jpg" width="9" height="11" alt=""></td>
* * * * * *<td width="100%" height="11" background="http://www.macndabox.com/skins/hotGrey/images/otherDesigns_20.jpg"></td>
* * * * * *<td width="8" height="11"><img src="http://www.macndabox.com/skins/hotGrey/images/otherDesigns_22.jpg" width="8" height="11" alt=""></td>
* * * * </tr>
</table>';

* * *$curcol++;

* * *if($curcol == $settings['Images per Row'])
* * *{
* * * *echo '</tr>';
* * * *$curcol = 0;

examples (http://www.macndabox.com/skins/hotGrey/images/imageGallery.jpg)

any help would be greatly appreciated... :blink:

masterpsk
08-09-2005, 04:39 PM
Ok 1st... sorry if i can help you now, and it looks you have a "</td> </tr></table>" missplaced...

I have an idea since a few weeks, but as i dont have many time now to start coding and try it, maybe is really easy but it could be really usefull ( at least to me)...

Making a "Box_Templates.php" and including it on every design...

In that way every time i need a "box" i can use something like:

&#60;?php
box&#40;open,3&#41;;
echo &#34;whatever i want inside&#34;;
box&#40;close,3&#41;;
?&#62;


In that way i will "open" the Box #3 then insert "whatever i want" and then I&#39;ll "close" my Box #3...

My Box_Templates.php could have all that boxes i want, using functions... "I think" in that way could be more easy and clean to do the skins/plugins...

As i said i cant try that now, i dont have time and im not good enoght to make it fast...

Maybe some Codder Member could help us :P

Now, try to think about this and your problem... you only need to use a perfect Box(open,X); and Box(close,X);... and u can forget about checking all that code to find the error... because all that Table code will be on Box_Template.php


Good Luck&#33;&#33;

bugzlitey
08-09-2005, 11:46 PM
I sorta understand what you&#39;re saying about the box template, but not really..I already have 3 or 4 different "perfectBox" templates and I&#39;m guessing x = fileName?

Do the individual templates (containting the html) need php headers or is the table information all it needs?

masterpsk
08-10-2005, 12:47 AM
Originally posted by bugzlitey@Aug 9 2005, 06:46 PM
I sorta understand what you&#39;re saying about the box template, but not really..I already have 3 or 4 different "perfectBox" templates and I&#39;m guessing x = fileName?


Arggg... i spend about 20 mins writing and trying to explain my idea and i decided to delete all this reply and start again, because my english is not so good to explain that... im sorry :P i think I&#39;ll do that file when i will have the time to do it and then i will share it... as i said maybe a real codder could help us...

And no.. "X" is not "FileName"... X is the number of the table... Box_Template.php will be a file with many tables in there and we can call to the desing by functions, is "almost" clear in my head but i cant explain it here lol...

Good Luck&#33;&#33;

Do the individual templates (containting the html) need php headers or is the table information all it needs?


Humm it will be simple as using requiere&#40;&#34;/Box_Template.php&#34;&#41; one time.... and then we can call all the tables we want...

bugzlitey
08-10-2005, 02:06 AM
Ok...I think I&#39;m tracking now.

So Step 1. create boxTemplate.php
Step 2. add tables to boxTemplated.php and name them 1, 2, 3 etc.
Step 3. Use an include/require script to open and close table,x

which can be placed anywhere in the site..

With an admin panel...this could actually be very very usefull...Especially with custom plugins...

But for now... should I remove the &#60;table&#62;&#60;/table&#62; or &#60;table&#62;&#60;tr&#62;&#60;/tr&#62;&#60;/table&#62;

masterpsk
08-10-2005, 02:14 AM
LOL... it wasnt so hard...

This is the BASE of the idea...

A Main File Named Template_Box.php.. (or whatever)... the file is something like this... you can have all the "boxes" you want...
&#60;?php
function box_1&#40;&#036;state&#41;
{
*if &#40;&#036;state == &#39;open&#39;&#41;
*{
* *echo &#39;
* * * *&#60;table cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; border=&#34;0&#34;&#62;
* * * * *&#60;tr&#62;
* * * * * *&#60;td&#62;TL&#60;/td&#62;
* * * * * *&#60;td&#62;TC&#60;/td&#62;
* * * * * *&#60;td&#62;TR&#60;/td&#62;
* * * * *&#60;/tr&#62;
* * * * *&#60;tr&#62;
* * * * * *&#60;td&#62;ML&#60;/td&#62;
* * * * * *&#60;td&#62;

* * * * *&#39;;
* *} else
* *if &#40;&#036;state == &#39;close&#39;&#41;
* * * *{
* * * * * *echo &#39;
* * * * * * * *&#60;/td&#62;
* * * * * * * *&#60;td&#62;MR&#60;/td&#62;
* * * * * * *&#60;/tr&#62;
* * * * * * *&#60;tr&#62;
* * * * * * * *&#60;td&#62;BL&#60;/td&#62;
* * * * * * * *&#60;td&#62;BC&#60;/td&#62;
* * * * * * * *&#60;td&#62;BR&#60;/td&#62;
* * * * * * *&#60;/tr&#62;
* * * * * *&#60;/table&#62;
* * * * * *&#39;;
* * * *}
* * * *else
* * * *echo &#34;wrong value, i dont know if i should open or close the box&#34;;
*}

?&#62;

*************
TL means Top Left
TC means Top Center
etc, etc, etc....
you can put images or customise your table with CSS...
*************

And wherever you need the boxes (lets say Design1.php) you can add something like this:

&#60;html xmlns=&#34;http&#58;//www.w3.org/1999/xhtml&#34;&#62;

&#60;head&#62;
*&#60;title&#62;Hello&#33;&#60;/title&#62;
&#60;/head&#62;

&#60;body&#62;

&#60;?
require&#40;&#34;./Template_Box.php&#34;&#41;;
echo&#40;&#34;Hello, World&#33;&#34; &#41;;


box_1&#40;&#34;open&#34;&#41;;

echo &#34;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam adipiscing purus nec eros. Fusce sagittis enim at ipsum. Praesent elit eros, iaculis iaculis, molestie non, mollis quis, erat. Proin pellentesque molestie wisi. Sed egestas nunc et nunc. Sed nonummy. Nullam urna. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur elementum justo. Nunc luctus lorem ac magna. Maecenas commodo sapien a tortor.&#34;;

box_1&#40;&#34;close&#34;&#41;;

?&#62;

&#60;/body&#62;

&#60;/html&#62;

And thats all&#33;&#33;&#33;... you can have boxes as many as you need&#33;&#33; you can use multiples desings and your code will be clean and you wont get lost :P...

Ok that is the base of the idea... then you can add variables, like width, height, etc, etc...


Good Luck&#33;&#33; Im almost sleeping on the keyboard, I need to go work tomorrow morning lol...

bugzlitey
08-10-2005, 02:20 AM
Cool&#33; So if I add my tables to that code of you&#39;re will it work?

and I removed the </tr></table> seems to work well in rows...testing columns now.

bugzlitey
08-10-2005, 02:31 AM
Columns dont work... anybody?

http://www.macndabox.com