NuwanD Posted September 13, 2009 Share Posted September 13, 2009 Im using joomla 1.5.8 on this site - www.fastfind(dot)com(dot)fj on the search result page I want the raws to be on 2 different colors 1 after another. (please see image) ANY HELP WOULD BE GREAT.. Thanks in Advanced Cheers [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/174129-css-or-php-code-for-the-search-result-page/ Share on other sites More sharing options...
AviNahum Posted September 13, 2009 Share Posted September 13, 2009 simply, when you select the results from DB: <?php $x = 0; while ($results) { if ($x == 0) { $bgcolor = "black"; $x++; } else { $bgcolor = "white"; $x = 0; } echo "<div style='backgroung-color: {$bgcolor};'></div>"; } ?> Link to comment https://forums.phpfreaks.com/topic/174129-css-or-php-code-for-the-search-result-page/#findComment-917894 Share on other sites More sharing options...
NuwanD Posted September 13, 2009 Author Share Posted September 13, 2009 Hi aviavi, the following code is the one to get result from DB. How would i apply Your code to this..?? Thanks for helping me out.Cheers ------------------------------- <?php foreach ($this->links AS $link) { $fields = $this->fields[$link->link_id]; include $this->loadTemplate('sub_listingSummary.tpl.php'); } Link to comment https://forums.phpfreaks.com/topic/174129-css-or-php-code-for-the-search-result-page/#findComment-917908 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.