
oto kod:
Kod
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="center">';
}
?>
<td width="50%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2" width="80"><div align="center">
<?php
if (file_exists(JPATH_BASE."/images/com_adsmanager/categories/".$row->id."cat.jpg"))
echo '<a href="'.$link.'"><img class="imgcat" src="'.$this->get('baseurl').'/images/com_adsmanager/categories/'.$row->id.'cat.jpg" alt="'.$row->name.'" /></a>';
else
echo '<a href="'.$link.'"><img class="imgcat" src="'.$this->get('baseurl').'/components/com_adsmanager/images/default.gif" alt="'.$row->name.'" /></a>';
?>
</div></td>
<td>
<h2 class="adsmanager_main_cat"><a href="<?php echo $link; ?>" ><?php echo $row->name." (".$row->num_ads.")"; ?></a></h2>
</td>
</tr>
<tr>
<td>
<h3 class="adsmanager_sub_cat">
<?php
}
else
{
if ($first == false)
echo ' - ';
echo '<a href="'.$link.'">'.$row->name." (".$row->num_ads.")".'</a>';
$first = false;
}
if ($level == 0)
{
$this->recurseCategories( $row->id, $level+1, $children,$itemid);
}
if ($level == 0)
{
?>
</h3>
</td>
</tr>
</table>
</td>
<?php
if ($i==1)
{
echo '</tr>';
}
}
$i++;
if ($i == 2) $i=0;
}
}
}
function displayContents($contents,$itemid,$nbimages) {
?>
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="center">';
}
?>
<td width="50%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2" width="80"><div align="center">
<?php
if (file_exists(JPATH_BASE."/images/com_adsmanager/categories/".$row->id."cat.jpg"))
echo '<a href="'.$link.'"><img class="imgcat" src="'.$this->get('baseurl').'/images/com_adsmanager/categories/'.$row->id.'cat.jpg" alt="'.$row->name.'" /></a>';
else
echo '<a href="'.$link.'"><img class="imgcat" src="'.$this->get('baseurl').'/components/com_adsmanager/images/default.gif" alt="'.$row->name.'" /></a>';
?>
</div></td>
<td>
<h2 class="adsmanager_main_cat"><a href="<?php echo $link; ?>" ><?php echo $row->name." (".$row->num_ads.")"; ?></a></h2>
</td>
</tr>
<tr>
<td>
<h3 class="adsmanager_sub_cat">
<?php
}
else
{
if ($first == false)
echo ' - ';
echo '<a href="'.$link.'">'.$row->name." (".$row->num_ads.")".'</a>';
$first = false;
}
if ($level == 0)
{
$this->recurseCategories( $row->id, $level+1, $children,$itemid);
}
if ($level == 0)
{
?>
</h3>
</td>
</tr>
</table>
</td>
<?php
if ($i==1)
{
echo '</tr>';
}
}
$i++;
if ($i == 2) $i=0;
}
}
}
function displayContents($contents,$itemid,$nbimages) {
?>
Czy edycja tego fragmentu kodu powoduje dodanie następnej kolumny? Jak to edytować aby dodać jeszcze jedną kolumnę. proszę, zlitujcie się.
Kod
<?php
if ($i==1)
{
echo '</tr>';
}
}
$i++;
if ($i == 2) $i=0;
if ($i==1)
{
echo '</tr>';
}
}
$i++;
if ($i == 2) $i=0;