// // ------------------------------------------------------------------------- // // Original Author: James Knickelbein // Author Website : http://www.journeymilwaukee.com // Licence Type : GPL // ------------------------------------------------------------------------- // include_once("header.php"); $query = $db->query("SELECT title,description FROM ".$db->prefix("adresses_cat")." WHERE cid='$cid'"); list($title,$desc) = $db->fetchRow($query); $bcoosConfig['title'] .= _MI_MYADRESSES_NAME." - ".$title; include_once(XOOPS_ROOT_PATH."/header.php"); $mytree = new XoopsTree($db->prefix("adresses_cat"), "cid", "pid"); $cid = intval($_GET['cid']); OpenTable(); echo ""._MI_MYADRESSES_NAME.""; if ($desc) { $myts->setType('admin'); $desc = $myts->makeTareaData4Show($desc, 1, 1, 1); echo $desc."

"; } if ( $_GET['show'] != "" ) { $show = intval($_GET['show']); } else { $show = $adressesConfig['perpage']; } if ( !isset($_GET['min']) ) { $min = 0; } else { $min = intval($_GET['min']); } if ( !isset($max) ) { $max = $min + $show; } if ( isset($_GET['orderby']) ) { $orderby = convertorderbyin($_GET['orderby']); } else { $orderby = "title ASC"; } echo "
"; $pathstring = ""._MODIFYCATEGORY." : "; $nicepath = $mytree->getNicePathFromId($cid, "title", "viewcat.php?"); $pathstring .= $nicepath; echo "".$pathstring."
"; // get child category objects $arr = array(); $arr = $mytree->getFirstChild($cid, "title"); if ( count($arr) > 0 ) { echo "

"._CATEGORIES."

"; $scount = 0; echo ""; foreach($arr as $ele) { $title = $myts->makeTboxData4Show($ele['title']); $totaldownload = getTotalItems($ele['cid'], 1); echo ""; $scount++; if ( $scount == 4 ) { echo ""; $scount = 0; } } echo "
$title ($totaldownload)


"; } $fullcountresult=$db->query("SELECT COUNT(*) FROM ".$db->prefix("adresses_adresses")." WHERE cid=$cid AND status>0"); list($numrows) = $db->fetchRow($fullcountresult); if ($numrows>0) { //if 2 or more items in result, show the sort menu if ($numrows>1) { $orderbyTrans = convertorderbytrans($orderby); echo "
"._SORTBY."   ".MD_TITLE." () "._DATE." () "._RATING." () "._MD_POPULARITY." ()
"; printf(_MD_CURSORTBY, $orderbyTrans); echo "


"; } $sql = " SELECT lid, title, url, homepage, adres, zip, city, country, phone, mobile, fax, email, opentime, banner, logourl, status, date, hits, rating, votes, description FROM ".$db->prefix("adresses_adresses")." WHERE cid=$cid AND status>0 ORDER BY $orderby"; $result = $db->query($sql, $show, $min); while (list($lid, $dtitle, $url, $homepage, $adres, $zip, $city, $country, $phone, $mobile, $fax, $email, $opentime, $banner, $logourl, $status, $time, $hits, $rating, $votes, $description)=$db->fetchRow($result)) { $rating = number_format($rating, 2); $dtitle = $myts->makeTboxData4Show($dtitle); $url = $myts->makeTboxData4Show($url); $adres = $myts->makeTboxData4Show($adres); $zip = $myts->makeTboxData4Show($zip); $city = $myts->makeTboxData4Show($city); $country = $myts->makeTboxData4Show($country); $phone = $myts->makeTboxData4Show($phone); $mobile = $myts->makeTboxData4Show($mobile); $fax = $myts->makeTboxData4Show($fax); $email = $myts->makeTboxData4Show($email); $opentime = $myts->makeTboxData4Show($opentime); $banner = $myts->makeTboxData4Show($banner); $logourl = $myts->makeTboxData4Show($logourl); $datetime = formatTimestamp($time, "s"); $description = $myts->makeTareaData4Show($description, 1, 1, 1); include("include/dlformatcat.php"); } $orderby = convertorderbyout($orderby); //Calculates how many pages exist. Which page one should be on, etc... $downloadpages = ceil($numrows / $show); //Page Numbering if ($downloadpages != 1 && $downloadpages != 0) { echo "

"; $prev = ($min - $show); if ($prev >= 0) { echo "   < "._PREVIOUS."  "; } $counter = 1; $currentpage = ($max / $show); while ( $counter <= $downloadpages ) { $mintemp = (($show * $counter) - $show); if ($counter == $currentpage) { echo "$counter "; } else { echo "$counter "; } $counter++; } if ( $numrows>$max ) { echo "   "._NEXT." >"; } } } echo "
"; CloseTable(); include_once("footer.php"); ?>