I am going a bit insane here. Look at the first 2 categories, then look at the duplicates for sports
PHP Code:
if ($_REQUEST['do']=='main')
{
$getcats=$db->query_read("SELECT * from " . TABLE_PREFIX . "ypcats
ORDER BY category ASC");
$rcount=1;
$rpertr= $vbulletin->options['ypmaincolumns'];
$rrows = $db->num_rows($getcats);
while ($mycats=$db->fetch_array($getcats))
{
if($mycats['parent']=='0'){
$catmain=$mycats['category'];
$catid=$mycats['id'];
if($mycats['catimage']!='')
{
$catimage="<img style=\"padding-right:4px;\" align=\"left\" border=\"0\" alt=\"".$catmain."\"
src=\"images/yellowpages/caticons/".$mycats['catimage']."\" />";
} else {
$catimage="";
}
}
//#################################
$subcats=null;
$getsubcats=$db->query_read("SELECT * from " . TABLE_PREFIX . "ypcats where parent=$catid
ORDER BY category ASC");
while ($getsub=$db->fetch_array($getsubcats))
{
if($getsub['parent'] >='0'){
$mysubcats=$getsub['category'];
$mysubid=$getsub['id'];
}
eval('$subcats .= "' . fetch_template('haitiwebs_yellowpagessubcats') . '";');
}
eval('$html .= "' . fetch_template('haitiwebs_yellowpagesmain') . '";');
if ($rcount == $rpertr && $rcount != $rrows)
$rcount = 0;
$rcount++;
} while ($rcount != 1 && $rcount > $rpertr)
{
eval('$html .= "' . fetch_template('haitiwebs_yellowpagesmain') . '";');
$rcount++;
}