Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,037 members, 7,818,060 topics. Date: Sunday, 05 May 2024 at 06:26 AM

Need Help With This Code - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Need Help With This Code (2235 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."wink"; ?></a></h2>
</td>
</tr>
<tr>
<td>
<ul>
<?php
}
else
{
echo '<li><a href="'.$link.'">'.$row->name." (".$row->num_ads."wink".'</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"wink."/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)

I Need Online Banking Source Code In PHP, MSQL / Developing Accounting Application Using MS Excel And Access / Don't Joke With These Math Topics If You Want To Be A Successful Game Dev

(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. 13
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.