nando99 Posted July 8, 2007 Share Posted July 8, 2007 ok - i'm working on http://www.aydoubleyou.com/UPLOAD/ its running the MSLS script from myspacepros. as you can see, its duplicating the layouts on the index page - unfortunately, it looks how I want it to look..lol.. 1 layout grey, 1 layout white... but i can't figure out how to do it with out duplicating the layout... heres the code for 1 layout <?php foreach($latestlayouts->results as $layout) : ?> <?php if(isset($layout->ad)): ?> <?php else : ?> <tr><td> <div class="list_layout_color"><table width="80%" cellpadding="5"> <tr> <td width="50%" align="center" valign="top"> <img title="cssbody=[bigimage] header=[] body=[<img src='<?=$layout->thumb_large?>' />]" class="" src="<?=$layout->thumb_small?>" border="1"/></td> <td width="50%" valign="top"><p class="list_title"><?=$layout->name?></p> <p class="list_date">Added on <?=$layout->date->month->long?> <?=$layout->date->day->number?>, <?=$layout->date->year->long?> <?=$layout->date->time->hour?>:<?=$layout->date->time->min?> <?=$layout->date->time->meridiem?></p> <p class="list_views"><?=$layout->views?> Views - <?=$layout->downloads?> Downloadeds</p> <p class="list_link_view"><a href="<?=$layout->preview_link?>">Preview</a> - <a href="<?=$layout->download_link?>">Download</a></p> </td> </tr> </table></div> </td></tr> <?php endif; ?> <?php endforeach; ?> heres what i'm using to switch the colors - which is also duplicating the layouts - i know why its duplicating - but its the only i can get grey. white, grey, white..etc... <?php foreach($latestlayouts->results as $layout) : ?> <?php if(isset($layout->ad)): ?> <?php else : ?> <tr><td> <div class="list_layout_color"><table width="80%" cellpadding="5"> <tr> <td width="50%" align="center" valign="top"> <img title="cssbody=[bigimage] header=[] body=[<img src='<?=$layout->thumb_large?>' />]" class="" src="<?=$layout->thumb_small?>" border="1"/></td> <td width="50%" valign="top"><p class="list_title"><?=$layout->name?></p> <p class="list_date">Added on <?=$layout->date->month->long?> <?=$layout->date->day->number?>, <?=$layout->date->year->long?> <?=$layout->date->time->hour?>:<?=$layout->date->time->min?> <?=$layout->date->time->meridiem?></p> <p class="list_views"><?=$layout->views?> Views - <?=$layout->downloads?> Downloadeds</p> <p class="list_link_view"><a href="<?=$layout->preview_link?>">Preview</a> - <a href="<?=$layout->download_link?>">Download</a></p> </td> </tr> </table></div> </td></tr> <?php endif; ?> <?php if(isset($layout->ad)): ?> <?php else : ?> <tr><td> <table width="80%" cellpadding="5"> <tr> <td width="50%" align="center" valign="top"> <img title="cssbody=[bigimage] header=[] body=[<img src='<?=$layout->thumb_large?>' />]" class="" src="<?=$layout->thumb_small?>" border="1"/></td> <td width="50%" valign="top"><p class="list_title"><?=$layout->name?></p> <p class="list_date">Added on <?=$layout->date->month->long?> <?=$layout->date->day->number?>, <?=$layout->date->year->long?> <?=$layout->date->time->hour?>:<?=$layout->date->time->min?> <?=$layout->date->time->meridiem?></p> <p class="list_views"><?=$layout->views?> Views - <?=$layout->downloads?> Downloadeds</p> <p class="list_link_view"><a href="<?=$layout->preview_link?>">Preview</a> - <a href="<?=$layout->download_link?>">Download</a></p> </td> </tr> </table> </td></tr> <?php endif; ?> <?php endforeach; ?> Any1 have any idea on how I can get it grey,white,grey,white, etc without it duplicating? Thanks in advance... Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 8, 2007 Share Posted July 8, 2007 why not make it all in 1 block, secondly you seem to have a bit of a syntaxical mess with your logical prompts/loops do you know much php? Quote Link to comment Share on other sites More sharing options...
nando99 Posted July 8, 2007 Author Share Posted July 8, 2007 I'm so so... plus the php you see is part of the script - I've only added/modified what I think needed to do what I want it to do. What do you mean, use 1 block? Any additional info is greatly appreciated.. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 8, 2007 Share Posted July 8, 2007 i'm looking at your link are you trying to do a foreach loop to display all those layouts? If so show me your array of data Quote Link to comment Share on other sites More sharing options...
nando99 Posted July 8, 2007 Author Share Posted July 8, 2007 Yes - the foreach loop is being used to display the layouts. I hate to sound like such a newbie, but what do you mean the array of data. Some info: the layouts are added through a admin panel. The foreach loops is just used to populate the page with the layouts. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted July 8, 2007 Share Posted July 8, 2007 welll $lattestlayouts has to be an array of some sort can I see that array, foreach loops are designed around arrays. Quote Link to comment Share on other sites More sharing options...
nando99 Posted July 8, 2007 Author Share Posted July 8, 2007 still lost.. where would I find it... I can't find anything that looks like an array of data.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.