Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,195,586 members, 7,958,815 topics. Date: Thursday, 26 September 2024 at 03:06 AM |
Nairaland Forum / Science/Technology / Programming / Need Help With This Code (2263 Views)
5,000 Naira For Someone Who Can Reverse This Code / Python Experts, Plz What Is Wrong With This Code / Is Something Wrong With This Code (2) (3) (4)
(1) (Reply)
Need Help With This Code by sandy0000: 7:22pm On Jul 19, 2012 |
Guys I need help changing the layout for the snapshot below. I need to change the subcategories (orange) to 3 colums. How can I edit the below code : function recurseCategories( $id, $level, &$children,$itemid) { if (@$children[$id]) { $i=0;$first=true; foreach ($children[$id] as $row) { $link = JRoute::_("index.php?option=com_adsmanager&view=list&catid=".$row->id."&Itemid=".$itemid); if ($level == 0) { if ($i==0) { echo '<tr align="left">'; } ?> <td width="90%"> <table class="xy" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <h2 class="adsmanager_main_cat"><a href="<?php echo $link; ?>" ><?php echo $row->name." (".$row->num_ads.""; ?></a></h2> </td> </tr> <tr> <td> <ul> <?php } else { echo '<li><a href="'.$link.'">'.$row->name." (".$row->num_ads."".'</a></li>'; } if ($level == 0) { $this->recurseCategories( $row->id, $level+1, $children,$itemid); } if ($level == 0) { ?> </ul> </td> </tr> </table> </td> <?php if ($i==3) { echo '</tr>'; } } $i++; if ($i == 1) $i=0; } } } function displayContents($contents,$itemid,$nbimages) { ?> <h1 class="contentheading"><?php echo JText::_('ADSMANAGER_LAST_ADS');?></h1> <div class='adsmanager_box_module' align="center"> <table class='adsmanager_inner_box' width="100%"> <tr align="center"> <?php foreach($contents as $row) { ?> <td> <?php $linkTarget = JRoute::_("index.php?option=com_adsmanager&view=details&id=".$row->id."&catid=".$row->catid."&Itemid=".$itemid); $ok = 0;$i=1; while(!$ok) { if ($i < $nbimages + 1) { $ext_name = chr(ord('a')+$i-1); $pic = JPATH_BASE."/images/com_adsmanager/ads/".$row->id.$ext_name."_t.jpg"; if (file_exists( $pic)) { echo "<div align='center'><a href='".$linkTarget."'><img src='".$this->get('baseurl')."/images/com_adsmanager/ads/".$row->id.$ext_name."_t.jpg' alt='".htmlspecialchars($row->ad_headline)."' border='0' /></a>"; $ok = 1; } } else if ($nbimages != 0) { echo "<div align='center'><a href='".$linkTarget."'><img src='".$this->get("baseurl"."/components/com_adsmanager/images/nopic.gif' alt='nopic' border='0' /></a>"; $ok = 1; } else { $ok = 1; } $i++; }
|
Re: Need Help With This Code by teey2(f): 3:28am On Jul 21, 2012 |
I'm not sure I totally understand the code but you maybe you make specific CSS rules with loops and if statements. Like use the loop to go through a number of rows, then the if statement to specify what CSS rule (like the margins and alignment) you want after a number of rows have lapsed. |
(1) (Reply)
11 African Startup Founders Who Built Million-dollar Internet Companies / MATLAB Programming Assignment Help - 15k / Learn The Fundamental Of Programming Using The Zoom App.
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14 |