; // $useroffset = ""; // if($xoopsUser) // { // $timezone = $xoopsUser->timezone(); // if(isset($timezone)) // $useroffset = $xoopsUser->timezone(); // else // $useroffset = $xoopsConfig['default_TZ']; // } // Specification for Japan: add $viewcount_judge for view count up judge $viewcount_judge = true ; $useroffset = ""; if($xoopsUser) { $timezone = $xoopsUser->timezone(); if(isset($timezone)) { $useroffset = $xoopsUser->timezone(); }else { $useroffset = $xoopsConfig['default_TZ']; } // Specification for Japan: view count up judge if (($xoopsUser->getVar("uid") == 1)||($xoopsUser->getVar("uid") ==$usid)) { $viewcount_judge = false ; } } // Specification for Japan: view count up judge if ($viewcount_judge == true ){ $xoopsDB->queryF("UPDATE ".$xoopsDB->prefix("ads_listing")." SET view=view+1 WHERE lid = '$lid'"); } $date = ($useroffset*3600) + $date; $date2 = $date + ($expire*86400); $date = formatTimestamp($date,"s"); $date2 = formatTimestamp($date2,"s"); $title = $myts->makeTboxData4Show($title); $expire = $myts->makeTboxData4Show($expire); $type = $myts->makeTboxData4Show($type); $description = $myts->makeTareaData4Show($description); $tel = $myts->makeTboxData4Show($tel); $price = $myts->makeTboxData4Show($price); $typeprice = $myts->makeTboxData4Show($typeprice); $submitter = $myts->makeTboxData4Show($submitter); $town = $myts->makeTboxData4Show($town); $country = $myts->makeTboxData4Show($country); $printA = "\""._ADS_PRINT."\" "; if ($usid > 0) { $xoopsTpl->assign('submitter', _ADS_ANNFROM . " $submitter"); } else { $xoopsTpl->assign('submitter', _ADS_ANNFROM . " $submitter"); } // Add PM by Tom //$contact_pm ="\"".sprintf(_SENDPMTO,$xoopsUser-getVar('uname'))."\" />"; //$xoopsTpl->assign('contact_pm', "$contact_pm"); $xoopsTpl->assign('read', "$view " . _ADS_VIEW2); if ($xoopsUser) { $calusern = $xoopsUser->getVar("uid", "E"); if ($usid == $calusern) { $xoopsTpl->assign('modify', "\""._ADS_MODIFANN."\" \""._ADS_SUPPRANN."\""); } if ($xoopsUser->isAdmin()) { $xoopsTpl->assign('admin', "\""._ADS_MODADMIN."\""); } } $xoopsTpl->assign('type', $type); $xoopsTpl->assign('title', $title); $xoopsTpl->assign('description', $description); if ($price > 0) { // Add Template assign by Tom $xoopsTpl->assign('price', '' . _ADS_PRICE2 . "".$xoopsModuleConfig['ads_monnaie']." $price - $typeprice"); $xoopsTpl->assign('price_head', _ADS_PRICE2 ); $xoopsTpl->assign('price_price', "".$xoopsModuleConfig['ads_monnaie']." $price"); $xoopsTpl->assign('price_typeprice', $typeprice); } $contact = '' . _ADS_CONTACT." "._ADS_BYMAIL2.""; // Add Template assign by Tom $xoopsTpl->assign('contact_head', _ADS_CONTACT); $xoopsTpl->assign('contact_email', ""._ADS_BYMAIL2.""); $xoopsTpl->assign('ads_mustlogin', ""._ADS_MUSTLOGIN.""); if (($xoopsModuleConfig['ads_login_ok'] == 1) || ($xoopsUser)){ $xoopsTpl->assign('ads_login_ok', "1" ); }else{ $xoopsTpl->assign('ads_login_ok', ""); } if ($tel) { $contact .= "
"._ADS_TEL." $tel"; // Add Template assign by Tom $xoopsTpl->assign('contact_tel_head', _ADS_TEL); $xoopsTpl->assign('contact_tel', "$tel"); } // Layout CHG by Tom $contact .= "
"; if ($town) { $contact .= "
"._ADS_TOWN." $town"; // Add Template assign by Tom $xoopsTpl->assign('local_town', "$town"); } if ($country) { $contact .= "
"._ADS_COUNTRY." $country"; // Add Template assign by Tom $xoopsTpl->assign('local_country', "$country"); } $xoopsTpl->assign('contact', $contact); // Add Template assign by Tom $xoopsTpl->assign('local_head', _ADS_LOCAL); if ($photo) { // add 'alt=' by Tom // $xoopsTpl->assign('photo', ""); $xoopsTpl->assign('photo', "\"$title\""); } $xoopsTpl->assign('date', _ADS_DATE2." $date "._ADS_DISPO." $date2    $printA"); }else { $xoopsTpl->assign('no_ad', _ADS_NOCLAS); } $result8 = $xoopsDB->query("select title from ".$xoopsDB->prefix("ads_categories")." where cid=$cid"); list($ctitle) = $xoopsDB->fetchRow($result8); $xoopsTpl->assign('friend', "\"\""); $xoopsTpl->assign('link_main', ""._ADS_MAIN.""); $xoopsTpl->assign('link_cat', ""._ADS_GORUB." $ctitle"); } # function categorynewgraphic ##################################################### function categorynewgraphic($cat) { global $xoopsDB; $newresult = $xoopsDB->query("select date from ".$xoopsDB->prefix("ads_listing")." where cid=$cat and valid = 'Yes' order by date desc limit 1"); list($timeann)= $xoopsDB->fetchRow($newresult); $count = 1; $startdate = (time()-(86400 * $count)); if ($startdate < $timeann) { return ""; } } ###################################################### $pa = isset( $_GET['pa'] ) ? $_GET['pa'] : '' ; $lid = isset( $_GET['lid'] ) ? $_GET['lid'] : '' ; $cid = isset( $_GET['cid'] ) ? $_GET['cid'] : '' ; $debut = isset( $_GET['debut'] ) ? $_GET['debut'] : '' ; switch($pa) { case "Adsview": $xoopsOption['template_main'] = 'ads_category.html'; include(XOOPS_ROOT_PATH."/header.php"); Adsview($cid, $debut); break; case "viewads": $xoopsOption['template_main'] = 'ads_item.html'; include(XOOPS_ROOT_PATH."/header.php"); viewads($lid); break; default: $xoopsOption['template_main'] = 'ads_index.html'; include(XOOPS_ROOT_PATH."/header.php"); index(); break; } include(XOOPS_ROOT_PATH."/footer.php"); ?>