http://www.rctrader.com.au/index.php/component/option,com_weblinks/Itemid,23/ http://www.rctrader.com.au/index.php/component/option,com_weblinks/catid,17/Itemid,23/ http://www.rctrader.com.au/index.php/component/option,com_weblinks/catid,16/Itemid,23/ http://www.rctrader.com.au/index.php/component/option,com_weblinks/catid,15/Itemid,23/ http://www.rctrader.com.au/index.php/component/option,com_weblinks/catid,14/Itemid,23/ http://www.rctrader.com.au/index.php/component/option,com_weblinks/catid,2/Itemid,23/ http://www.rctrader.com.au/index.php/content/category/3/7/25/ http://www.rctrader.com.au/index.php/content/view/34/25/ http://www.rctrader.com.au/index.php/content/view/33/25/ http://www.rctrader.com.au/index.php/content/view/32/25/ http://www.rctrader.com.au/index.php/content/view/31/25/ http://www.rctrader.com.au/index.php/content/view/20/25/ http://www.rctrader.com.au/index.php/content/view/18/25/ http://www.rctrader.com.au/index.php/content/view/11/25/ http://www.rctrader.com.au/index.php/content/view/10/25/ http://www.rctrader.com.au/index.php/content/view/19/25/ http://www.rctrader.com.au/index.php/component/option,com_mjfrontpage/Itemid,28/ http://www.rctrader.com.au/index.php?option=com_adsmanager&page=show_all&text_search=&order=0&expand=0 get( 'show_mode', '1' )) ; $ads_limit=intval($params->get( 'ads_limit', '-1' )) ; $show_cat_icons=intval($params->get( 'show_cat_icons', '1' )) ; $show_cat_desc=intval($params->get( 'show_cat_desc', '1' )) ; $show_ad_icons=intval($params->get( 'show_ad_icons', '1' )) ; $show_ad_desc=intval($params->get( 'show_ad_desc', '1' )) ; $lev=$level; $lev++; $database->setQuery( "SELECT c.id, c.name,c.parent,c.description ". " FROM #__adsmanager_categories as c ". "WHERE c.published = 1 ORDER BY c.parent,c.ordering"); $listcats = $database->loadObjectList(); $cats = array(); $ordercats = array(); // first pass - collect children if(isset($listcats)) { foreach ($listcats as $c ) { $pt = $c->parent; $list_temp = @$cats [$pt] ? $cats [$pt] : array(); array_push( $list_temp, $c ); $cats [$pt] = $list_temp; $ordercats[$c->id] = $c; } } if ($show_mode == 1) { $database->setQuery( "SELECT a.id, a.ad_headline,a.ad_text,a.category ". " FROM #__adsmanager_ads as a ". " LEFT JOIN #__adsmanager_categories as c ON a.category = c.id ". " WHERE a.published = 1 AND c.published = 1". " ORDER BY a.date_created DESC ,a.id DESC"); $listads = $database->loadObjectList(); $ads = array(); // first pass - collect children if(isset($listads)) { foreach ($listads as $a ) { $pt = $a->category; $list_temp = @$ads [$pt] ? $ads [$pt] : array(); array_push( $list_temp, $a ); $ads [$pt] = $list_temp; } } } if (isset($ordercats[$catid])) { $row = $ordercats[$catid]; adsmanager_recursecategories($row->id, $lev,$cats,$ads,$Itemid,$show_cat_icons,$show_cat_desc,$show_ad_icons,$show_ad_desc,$ads_limit); if (isset($ads[$row->id])) { $i = 0; foreach($ads[$row->id] as $ad) { $i++; if ($i > $ads_limit) break; $element->name = $ad->ad_headline; $link = "index.php?option=com_adsmanager&page=show_ad&adid=".$ad->id."&Itemid=".$Itemid; $element->link = $link; $element->level = $level + 1 ; if ($show_ad_icons == 2) { if (($ad->id == 0)||(!file_exists($mosConfig_absolute_path."/images/com_adsmanager/ads/".$ad->id."a_t.jpg"))) { $element->image = 'nopic.gif'; $element->icon_path='/components/com_adsmanager/images/'; } else { $element->image = $ad->id.'a_t.jpg'; $element->icon_path='/images/com_adsmanager/ads/'; } } else if ($show_ad_icons == 1) { $element->image = 'adsmanager_ad.gif'; $element->icon_path='/mambots/com_sefservicemap/'; } else { $element->image = 'none'; } if ($show_ad_desc) $element->description=$ad->ad_text; if (function_exists ('AddExtMenuItem')) AddExtMenuItem ($element); else AddMenuItem($ad->ad_headline,$link, $level+1); } } } } function adsmanager_recursecategories($id, $level, $cats,$ads,$Itemid,$show_cat_icons,$show_cat_desc,$show_ad_icons,$show_ad_desc,$ads_limit) { global $mosConfig_absolute_path; if (@$cats[$id]) { foreach ($cats[$id] as $row) { $element->name = $row->name; $link = "index.php?option=com_adsmanager&page=show_category&catid=".$row->id."&Itemid=".$Itemid; $element->link = $link; $element->level = $level; if ($show_cat_icons == 2) { if (($row->id == 0)||(!file_exists($mosConfig_absolute_path.'/images/com_adsmanager/categories/'.$row->id.'cat_t.jpg'))) { $element->image = 'default.gif'; $element->icon_path='/components/com_adsmanager/images/'; } else { $element->image = $row->id.'cat_t.jpg'; $element->icon_path='/images/com_adsmanager/categories/'; } } else if ($show_cat_icons == 1) { $element->image = 'adsmanager_cat.gif'; $element->icon_path='/mambots/com_sefservicemap/'; } else { $element->image = 'none'; } if ($show_cat_desc) $element->description=$row->description; if (function_exists ('AddExtMenuItem')) AddExtMenuItem ($element); else AddMenuItem($row->title,$link, $level); adsmanager_recursecategories($row->id, $level + 1, $cats,$ads,$Itemid,$show_cat_icons,$show_cat_desc,$show_ad_icons,$show_ad_desc,$ads_limit); if (isset($ads[$row->id])) { $i = 0; foreach($ads[$row->id] as $ad) { $i++; if ($i > $ads_limit) break; $element->name = $ad->ad_headline; $link = "index.php?option=com_adsmanager&page=show_ad&adid=".$ad->id."&Itemid=".$Itemid; $element->link = $link; $element->level = $level + 1 ; if ($show_ad_icons == 2) { if (($ad->id == 0)||(!file_exists($mosConfig_absolute_path."/images/com_adsmanager/ads/".$ad->id."a_t.jpg"))) { $element->image = 'nopic.gif'; $element->icon_path='/components/com_adsmanager/images/'; } else { $element->image = $ad->id.'a_t.jpg'; $element->icon_path='/images/com_adsmanager/ads/'; } } else if ($show_ad_icons == 1) { $element->image = 'adsmanager_ad.gif'; $element->icon_path='/mambots/com_sefservicemap/'; } else { $element->image = 'none'; } if ($show_ad_desc) $element->description=$ad->ad_text; if (function_exists ('AddExtMenuItem')) AddExtMenuItem ($element); else AddMenuItem($ad->ad_headline,$link, $level+1); } } } } } function adsmanager_show_all($level,$Itemid,$params) { global $database,$my; $show_mode=intval($params->get( 'show_mode', '1' )) ; $ads_limit=intval($params->get( 'ads_limit', '-1' )) ; $show_cat_icons=intval($params->get( 'show_cat_icons', '1' )) ; $show_cat_desc=intval($params->get( 'show_cat_desc', '1' )) ; $show_ad_icons=intval($params->get( 'show_ad_icons', '1' )) ; $show_ad_desc=intval($params->get( 'show_ad_desc', '1' )) ; $lev=$level; $lev++; $database->setQuery( "SELECT c.id, c.name,c.parent,c.description ". " FROM #__adsmanager_categories as c ". "WHERE c.published = 1 ORDER BY c.parent,c.ordering"); $listcats = $database->loadObjectList(); $cats = array(); // first pass - collect children if(isset($listcats)) { foreach ($listcats as $c ) { $pt = $c->parent; $list_temp = @$cats [$pt] ? $cats [$pt] : array(); array_push( $list_temp, $c ); $cats [$pt] = $list_temp; } } if ($show_mode == 1) { $database->setQuery( "SELECT a.id, a.ad_headline,a.ad_text,a.category ". " FROM #__adsmanager_ads as a ". " LEFT JOIN #__adsmanager_categories as c ON a.category = c.id ". " WHERE a.published = 1 AND c.published = 1". " ORDER BY a.date_created DESC ,a.id DESC"); $listads = $database->loadObjectList(); $ads = array(); // first pass - collect children if(isset($listads)) { foreach ($listads as $a ) { $pt = $a->category; $list_temp = @$ads [$pt] ? $ads [$pt] : array(); array_push( $list_temp, $a ); $ads [$pt] = $list_temp; } } } adsmanager_recursecategories(0, $lev,$cats,$ads,$Itemid,$show_cat_icons,$show_cat_desc,$show_ad_icons,$show_ad_desc,$ads_limit); } function com_adsmanager_bot ($level,$link,$Itemid,$params) { $task = smGetParam($link,'page','show_all'); $sectionid = smGetParam($link,'sectionid',''); $catid = smGetParam($link,'catid',''); $adid = smGetParam($link,'adid',''); switch ($task) { case 'show_category': adsmanager_show_category($catid,$level,$Itemid,$params); break; case 'show_all': adsmanager_show_all($level,$Itemid,$params); break; default: break; } } ?>http://www.rctrader.com.au/index.php/content/blogsection/1/42/ http://www.rctrader.com.au/index.php/content/view/22/42/ http://www.rctrader.com.au/index.php/content/view/30/42/ http://www.rctrader.com.au/index.php/component/option,com_sefservicemap/Itemid,35/ http://www.rctrader.com.au/index.php/content/view/27/43/ http://www.rctrader.com.au/index.php/content/section/1/2/ http://www.rctrader.com.au/index.php/content/category/1/1/2/ http://www.rctrader.com.au/index.php/content/view/22/2/