₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,027 members, 8,419,990 topics. Date: Thursday, 04 June 2026 at 08:56 AM

Toggle theme

Need Help With This Code - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingNeed Help With This Code (2330 Views)

1 Reply

Need Help With This Code by sandy0000(op): 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

5,000 Naira For Someone Who Can Reverse This CodePython Experts, Plz What Is Wrong With This CodeIs Something Wrong With This Code234

I Want To Learn How To Create Mobile ApplicationsProgramming A Converter For *.wma To *.mp3 - By SbucareerHow To Create A Responsive Login Form Using Html, Css And Bootstrap