//
// ------------------------------------------------------------------------- //
// Original Author: James Knickelbein
// Author Website : http://www.journeymilwaukee.com
// Licence Type : GPL
// ------------------------------------------------------------------------- //
include_once("header.php");
$bcoosConfig['title'] .= " - "._MI_MYADRESSES_NAME;
if ($bcoosConfig['startpage'] == "adresses") {
$xoopsOption['show_rblock'] = 1;
include_once(XOOPS_ROOT_PATH."/header.php");
make_cblock();
echo "
";
} else {
$xoopsOption['show_rblock'] = 0;
include_once(XOOPS_ROOT_PATH."/header.php");
}
$mytree = new XoopsTree($db->prefix("adresses_cat"), "cid", "pid");
$result = $db->query("SELECT cid, title, imgurl FROM ".$db->prefix("adresses_cat")." WHERE pid=0 ORDER BY title") or die("Error");
OpenTable();
echo ""._MI_MYADRESSES_NAME."";
echo "
";
$count = 0;
while ($myrow = $db->fetchArray($result)) {
$title = $myts->makeTboxData4Show($myrow['title']);
$totaldownload = getTotalItems($myrow['cid'], 1);
echo "";
if ( !empty($myrow['imgurl']) && $myrow['imgurl'] != "http://" ) {
echo " ";
}
echo "$title ($totaldownload) ";
// get child category objects
$arr = array();
$arr = $mytree->getFirstChild($myrow['cid'], "title");
$space = 0;
$chcount = 0;
foreach($arr as $ele) {
$chtitle = $myts->makeTboxData4Show($ele['title']);
if ($chcount > 8) {
echo "...";
break;
}
if ($space>0) {
echo ", ";
}
echo "".$chtitle."";
$space++;
$chcount++;
}
if ($count < 1) {
echo " | ";
}
$count++;
if ($count == 2) {
echo "
";
$count = 0;
}
}
echo "
";
list($numrows) = $db->fetchRow($db->query("SELECT COUNT(*) FROM ".$db->prefix("adresses_adresses")." WHERE status>0"));
echo "
";
printf(_MD_THEREARE, $numrows);
echo "";
if ($adressesConfig['rss_enable'] == 1) {
echo "";
}
CloseTable();
echo "
";
OpenTable();
echo ""._LATESTLISTINGS."
";
showNew($mytree);
echo "";
CloseTable();
include_once(XOOPS_ROOT_PATH."/modules/adresses/footer.php");
//---------------------------------------------------------------------------------------//
/**
* Shows the Latest Listings on the front page
*
* @param type $var description
* @return type description
*/
function showNew($mytree) {
global $myts, $db, $bcoosConfig, $xoopsModule, $adressesConfig;
$sql = "
SELECT
lid,
cid,
title,
url,
homepage,
adres,
zip,
city,
country,
phone,
mobile,
fax,
email,
opentime,
banner,
logourl,
status,
date,
hits,
rating,
votes,
comments,
description
FROM
".$db->prefix("adresses_adresses")."
WHERE
status>0
ORDER BY date DESC";
$result = $db->query($sql, $adressesConfig['newadresses'], 0);
while (list($lid, $cid, $dtitle, $url, $homepage, $adres, $zip, $city, $country, $phone, $mobile, $fax, $email, $opentime, $banner, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description)=$db->fetchRow($result)) {
$rating = number_format($rating, 2);
$dtitle = $myts->makeTboxData4Show($dtitle);
$url = $myts->makeTboxData4Show($url);
$homepage = $myts->makeTboxData4Show($homepage);
$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/dlformat.php");
}
}
?>