"; OpenTable(); echo "
"._NUKECADSMAINCAT."

"; $sql = "select id_catg,catg,catg_desc,image from ".$prefix."_nukec_ads_catg where parentid=0 "; $applylanguage = sqlapplylanguage(); $sql .= "and".$applylanguage."order by catg"; $resultcatg =$db->sql_query($sql); echo ""; $count = 0; while (list($id_catg,$catg,$cdesc,$imagecatg) = $db->sql_fetchrow($resultcatg)) { $i = 0; if ($count == 2) { echo "\n"; $count = 0; } $listchild = ""; echo "\n"; /* Thanks to John Hoffmann from softlinux.org for the next 5 lines ;) */ $count++; if ($count == 2) { echo "\n"; } } if ($count == 2) { echo "
"; echo ""; echo ""; echo "
"; if ($UseImgCatg) { if ($imagecatg == "") { $imagecatgsrc= "noimage.gif"; } else { $imagecatgsrc = $imagecatg; } $imgdimension = @getimagesize("modules/".$module_name."/imagecatg/".$imagecatgsrc); if ($imgdimension) { $imgcatgwidth = $imgdimension[0]; $imgcatgheight = $imgdimension[1]; } echo ""; echo "\"".$catg."\""; echo ""; } echo ""; echo "".$catg.""; echo " ("; $listchild = getchildcategories($id_catg); $listchild = $id_catg."_".$listchild; echo countads_incategory($listchild); echo ")"; echo ""; if ($cdesc != "") { echo "
".$cdesc; } echo "
"; echo ""; $sql = "select id_catg,catg from ".$prefix."_nukec_ads_catg where parentid='".$id_catg."' order by id_catg"; $resultsub =$db->sql_query($sql); $jmlsub =$db->sql_numrows($resultsub); $sql .= " limit 0,10"; $resultsublimit =$db->sql_query($sql); $jmlsublimit =$db->sql_numrows($resultsublimit); $i = 0; $bts = 3; while (list($id_catg2,$catg2) = $db->sql_fetchrow($resultsublimit)) { $i++; echo ""; echo $catg2." "; echo " ("; $listchild2 = ""; $listchild2 = getchildcategories($id_catg2); $listchild2 = "$id_catg2"."_".$listchild2; echo countads_incategory($listchild2); echo ")"; echo " "; if ($i != $jmlsublimit){ echo ", "; } } if ($jmlsub > 10) { echo ", "._NUKECMORE.""; } $db->sql_freeresult($resultsub); echo "
"; echo "
\n"; } else { echo "\n"; } $sql = "select * from ".$prefix."_nukec_ads_ads where"; $applylanguage = sqlapplylanguage(); $sql .= $applylanguage."and "; $sql .= " validuntil > '".$NowUnixTime."' and active='1'"; $result =$db->sql_query($sql); $numrows =$db->sql_numrows($result); $sql = "select * from ".$prefix."_nukec_ads_catg where"; $sql .= $applylanguage; $result =$db->sql_query($sql); $catnum =$db->sql_numrows($result); echo "
"._NUKECTHEREARE." ".$numrows." "._NUKECADS." "._NUKECAND." ".$catnum." "._NUKECCATEGORIES." "._NUKECINDB."
"; CloseTable(); echo "
"; ShowCustomContent(); OpenTable(); $sql = "select id_ads,id_catg,title,ads_desc,imageads,curr,price,submitter,email,website,dateposted,hits from ".$prefix."_nukec_ads_ads where"; $applylanguage = sqlapplylanguage(); $sql .= $applylanguage." and (validuntil > '".$NowUnixTime."') and active = '1' "; $sql .= "order by dateposted DESC limit 0,".$PerPage.""; $res =$db->sql_query($sql); if (!$res) { die(mysql_error()); } $jml =$db->sql_numrows($res); if ($jml > 0) { echo _NUKECTHEREARE; if ($jml >= $PerPage) { echo " ".$PerPage." "; } else { echo " ".$jml." "; } echo _NUKECLASTPOSTED."

"; while (list($id_ads,$id_catg,$title,$ads_desc,$imageads,$curr,$price,$submitter,$email,$website,$dateposted,$hits) = $db->sql_fetchrow($res)) { themeads($id_ads,$id_catg,$title,$ads_desc,$imageads,$curr,$price,$submitter,$email,$website,$dateposted,$hits); echo "
"; } $db->sql_freeresult($res); } else { echo "
"._NUKECNOADS."
"; } CloseTable(); include("footer.php"); } function ViewDetail($id_ads) { global $cookie,$prefix,$db,$module_name,$AnonyComment,$user,$anonymous,$admin; global $Date_Format_code; include("header.php"); MenuNukeC(1); echo "
"; OpenTable(); $NowUnixTime = GetUnixTimeNow(); $sql = "select id_catg,title,ads_desc,imageads,curr,price,submitter,email,website,dateposted,validuntil,hits from ".$prefix."_nukec_ads_ads where id_ads='".$id_ads."'"; $res =$db->sql_query($sql); list($id_catg,$title,$ads_desc,$imageads,$curr,$price,$email,$submitter,$website,$dateposted,$validuntil,$hits) = $db->sql_fetchrow($res); if ($NowUnixTime > $validuntil) { /* Expired */ echo "
"._NUKECADSEXPIRED1."

"; echo _NUKECADSEXPIRED2." ".FormatDateAds($validuntil,$Date_Format_code); echo "

"._NUKECBACK.""; echo "
"; } else { $db->sql_query("update ".$prefix."_nukec_ads_ads set hits=hits+1 where id_ads='".$id_ads."'"); if ($id_catg != "") { echo "
".pathcatg($id_catg)."
"; echo "
\n"; } echo "
"._NUKECADSDETAIL."

\n"; themeadsdetail($id_ads,$id_catg,$title,$ads_desc,$imageads,$curr,$price,$email,$submitter,$website,$dateposted,$validuntil,$hits); echo "
"; OpenTable(); if (is_user($user) || ($AnonyComment == 1)) { if (is_user($user)) { $by = $cookie[0]; } else { $by = 1; } echo "
.:: "._NUKECPOSTCOMMENT." ::.

"; echo "\n" ."" ."\n" ."\n" ."\n" ."\n" ."\n" ."" ."\n" ."" ."" ."" ."
"._NUKECYOURNAME.":"; if (is_user($user)) { cookiedecode($user); echo "".$cookie[1]." [ "._LOGOUT." ]"; } else { echo "".$anonymous.""; echo " [ "._NUKECNEWUSER." ]"; } echo "
"._NUKECCOMMENTSUBJECT.":
"._NUKECCOMMENTSDESC.":
"; } else { echo "
"._NUKECCOMMENTNOTALLOWED."
"; } CloseTable(); } CloseTable(); include("footer.php"); } function SubmitComment($xid_ads,$commentby,$commsubject,$commentdesc) { global $prefix,$db,$module_name; if (($commsubject == "") || ($commentdesc == "")) { include ("header.php"); MenuNukeC(1); echo "
"; OpenTable(); echo "
"._NUKECPOSTCOMMENTERROR.""; echo "

"._NUKECCOMMENTALERT; echo "

"._NUKECGOBACK.""; echo "
"; CloseTable(); include ("footer.php"); } else { global $REMOTE_ADDR; $commsubject = FixQuotes(filter_text($commsubject, "nohtml")); $commentdesc = FixQuotes(nl2br(filter_text($commentdesc))); $sqlinsert =$db->sql_query("insert into ".$prefix."_nukec_ads_comments values(NULL,'".$xid_ads."','".$commentby."','".$commsubject."','".$commentdesc."','".$REMOTE_ADDR."',NOW())"); header("Location:modules.php?name=".$module_name."&op=ViewDetail&id_ads=$xid_ads"); } } function ViewCatg() { global $UseImgCatg,$page,$id_catg,$days,$module_name,$prefix,$db,$currentlang,$PerPage,$multilingual; include ("header.php"); MenuNukeC(1); echo "
"; $NowUnixTime = GetUnixTimeNow(); OpenTable(); if (!isset($page) || ($page == "")) { $page = 1; } echo "
"; if ($id_catg != "") { echo pathcatg($id_catg); echo "
\n"; $resultdesccatg =$db->sql_query("select catg_desc from ".$prefix."_nukec_ads_catg where id_catg='".$id_catg."'"); list ($catg_desc) = $db->sql_fetchrow($resultdesccatg); if ($catg_desc != "") { echo $catg_desc; echo "
"; } } else { $id_catg = 0; } $resultsubcatg =$db->sql_query("select id_catg,catg,image from ".$prefix."_nukec_ads_catg where parentid='".$id_catg."'"); $jmlcatg =$db->sql_numrows($resultsubcatg); $i = 0; if ($jmlcatg > 0) { if (!$UseImgCatg) { echo "[ "; } else { echo "\n"; } while (list($id_catgsub,$catgsub,$imagecatg) = $db->sql_fetchrow($resultsubcatg)) { $i++; if ($UseImgCatg) { if ($imagecatg == "") { $imgcatgsrc = "noimage.gif"; } else { $imgcatgsrc = $imagecatg; } if (!file_exists("modules/".$module_name."/imagecatg/".$imgcatgsrc)) { $imgcatgsrc = "noimage.gif"; } $imgdimension = @getimagesize("modules/".$module_name."/imagecatg/".$imgcatgsrc.""); if ($imgdimension) { $imgcatgwidth = $imgdimension[0]; $imgcatgheight = $imgdimension[1]; } if ($count == 8) { echo "\n"; $count = 0; } echo "\n"; $count++; if ($count == 8) { echo "\n"; } } else { echo "".$catgsub." "; if ($i != $jmlcatg) { echo " | "; } } } if (!$UseImgCatg) { echo " ]"; } else { if ($count == 8) { echo "
\n" ."\n" ."\"".$catgsub."\"
\n" ."".$catgsub."\n" ."
\n"; } else { echo "\n"; } } } echo "
"; CloseTable(); echo "
"; OpenTable(); $headermsg = "
"; $headermsg .= " "._NUKECADSINCATG." ".getcategoryname($id_catg).""; $headermsg .= "

"; echo $headermsg; $sqltotal = "select id_ads,id_catg,title,ads_desc,imageads,curr,price,submitter,email,website,dateposted,validuntil,hits from ".$prefix."_nukec_ads_ads where"; if ($id_catg != "") { $categorystring = getchildcategories($id_catg); $categoryarray = explode("_",$categorystring); if (sizeof($categoryarray) - 1 > 0) { $sqltotal .= " ("; } for ($i = 0;$i<=sizeof($categoryarray)-2;$i++) { $sqltotal .= " id_catg = '".$categoryarray[$i]."' "; if ($i != sizeof($categoryarray)-2) { $sqltotal .= " or "; } } if (sizeof($categoryarray) - 1 > 0) { $sqltotal .= " or id_catg='".$id_catg."') and "; } else { $sqltotal .= " id_catg='".$id_catg."' and "; } } $sqltotal .= " validuntil > '".$NowUnixTime."' and"; $applylanguage = sqlapplylanguage(); $sqltotal .= $applylanguage."and"; $sqltotal .= " active = 1 order by dateposted DESC"; $start = ($page-1)*$PerPage; $sqliklan = $sqltotal." limit ".$start.",".$PerPage; $resulttotaliklan =$db->sql_query($sqltotal); $totaliklan =$db->sql_numrows($resulttotaliklan); $jmlhalaman = ceil($totaliklan/$PerPage); $resultiklan =$db->sql_query($sqliklan); if ($jmlhalaman > 1) { echo "
[ "; if ($page > 1) { $previouspage =$page-1; echo ""._NUKECPREVIOUS." | "; } for ($hlm = 1;$hlm <= $jmlhalaman;$hlm++) { if ($hlm == $page) { echo "".$hlm.""; } else { echo "".$hlm." "; } if ($hlm != $jmlhalaman) { echo " | "; } } if ($page+1 <= $jmlhalaman) { $nextpage = $page +1; echo " | "._NUKECNEXT.""; } echo " ]
"; } echo "
"; $catgname = getcategoryname($id_catg); if ($totaliklan == 0) { echo "
"._NUKECNOADSIN." "; if ($id_catg != "") echo _NUKECINCATG." ".$catgname."
"; } else { echo "
"; $listchild = ""; $listchild = getchildcategories($id_catg); $listchild = $id_catg."_".$listchild; $jmladsin = countads_incategory($listchild); $pre = (($page-1) * $PerPage) + 1; if ($pre < 0) { $pre = 1; } $suf = ($pre-1) + $PerPage; if ($suf >= $totaliklan) { $suf = $totaliklan; } echo _NUKECVIEWING." ".$pre." - ".$suf." (".$totaliklan." "._NUKECTOTAL.") "._NUKECADSINCATG." ".$catgname."

"; while (list($xid_ads,$xid_catg,$xtitle,$xads_desc,$ximageads,$xcurr,$xprice,$xsubmitter,$xemail,$xwebsite,$xdateposted,$xvaliduntil,$xhits) = $db->sql_fetchrow($resultiklan)) { themeads ($xid_ads,$xid_catg,$xtitle,$xads_desc,$ximageads,$xcurr,$xprice,$xsubmitter,$xemail,$xwebsite,$xdateposted,$xhits); echo "
"; } } if ($jmlhalaman > 1) { echo "
[ "; if ($page > 1) { $previouspage =$page-1; echo ""._NUKECPREVIOUS." | "; } for ($hlm = 1;$hlm <= $jmlhalaman;$hlm++) { if ($hlm == $page) { echo "".$hlm.""; } else { echo "".$hlm." "; } if ($hlm != $jmlhalaman) { echo " | "; } } if ($page+1 <= $jmlhalaman) { $nextpage = $page +1; echo " | "._NUKECNEXT.""; } echo " ]
"; } echo "
"; CloseTable(); include ("footer.php"); } function viewads($days) { global $page,$id_catg,$module_name,$prefix,$db,$currentlang,$PerPage,$multilingual; include("header.php"); MenuNukeC(1); echo "
"; OpenTable(); if ((!$days) or ($days == "")) { $days = 1; } $nowdate = date("Y-m-d"); $datetemp = date("H i s m d Y"); $datearray = explode(" ",$datetemp); $HourtoFormat = $datearray[0]; $MinutetoFormat = $datearray[1]; $SecondtoFormat = $datearray[2]; $MonthtoFormat = $datearray[3]; $DaytoFormat = $datearray[4] - $days ; $YeartoFormat = $datearray[5]; $UnixTimeNow = GetUnixTimeNow(); if ($days == 1) { $DaytoFormat = $datearray[4]; } $StartTimeUnix = GetTimeUnix(0, 0, 0, $MonthtoFormat, $DaytoFormat, $YeartoFormat, 0, 0 , 0); $sql_result = "select id_ads,id_catg,title,ads_desc,imageads,curr,price,submitter,email,website,dateposted,hits from ".$prefix."_nukec_ads_ads"; $sql_result .= " where (dateposted > '".$StartTimeUnix."' and dateposted < '".$UnixTimeNow."') "; $applylanguage = sqlapplylanguage(); $sql_result .= "and".$applylanguage; $sql_result .= "and active='1' order by dateposted DESC"; $resulttotalads =$db->sql_query($sql_result); $totalads =$db->sql_numrows($resulttotalads); if ($totalads > 0) { $pre = (($page-1) * $PerPage) + 1; if ($pre < 0) { $pre = 1; } $suf = ($pre-1) + $PerPage; if ($suf >= $totalads) { $suf = $totalads; } echo "
\n" ."".$totalads." "._NUKECADSFOUND." "; if (($days == 1) || ($days == 2)) { echo "For "; if ($days == 1) { echo _TODAY; } else { echo _YESTERDAY; } } else { echo _NUKECFORLAST." ".$days." "._NUKECADSDAYS."
( "._NUKECFROM." ".FormatDateAds($StartTimeUnix,0)." - ".FormatDateAds($UnixTimeNow,0)." )"; } echo "
"._NUKECVIEWING." ".$pre." - ".$suf." (".$totalads." "._NUKECTOTAL.")
"; $totalpages = ceil($totalads/$PerPage); if (!$page) { $page = 1; } $start = ($page - 1) * $PerPage; $sql_result .= " limit ".$start.",".$PerPage; if ($totalpages >= 2) { echo "
"; echo "[ "; $back = $page - 1; if ($back >= 1 ) { //@RJR-Pwmg@Rncvkpwo@-@Eqratkijv@(e)@VgejIHZ.eqo echo "<< "._NUKECPREVIOUS." | "; } for ($i = 1;$i <= $totalpages;$i++) { if ($page == $i) { echo "".$page.""; } else { echo "".$i.""; } if ($i != $totalpages) { echo " | "; } } $next = $page + 1; if ($next <= $totalpages) { echo " | "._NUKECNEXT." >>"; } echo " ]"; echo "
"; } echo "
"; $j = 0; $resultads =$db->sql_query($sql_result); while (list($id_ads,$id_catg,$title,$ads_desc,$imageads,$curr,$price,$submitter,$email,$website,$dateposted,$hits) = $db->sql_fetchrow($resultads)) { themeads ($id_ads,$id_catg,$title,$ads_desc,$imageads,$curr,$price,$submitter,$email,$website,$dateposted,$hits); echo "
"; } $db->sql_freeresult($resultads); if ($totalpages >= 2) { echo "
"; echo "[ "; $back2 = $page - 1; if ($back2 >= 1 ) { echo "<< "._NUKECPREVIOUS." "; } for ($i = 1;$i <= $totalpages;$i++) { if ($page == $i) { echo "".$page.""; } else { echo "$i"; } if ($i != $totalpages) { echo " | "; } } $next = $page + 1; if ($next <= $totalpages) { echo " | "._NUKECNEXT." >> ]"; } echo "
"; } } else { echo "
"._NUKECNOADSFOUND."
"; } CloseTable(); include ("footer.php"); } function MostPop() { global $PopAds,$HitsPopular,$page,$id_catg,$module_name,$prefix,$db,$currentlang,$PerPage,$multilingual; include("header.php"); MenuNukeC(1); echo "
"; OpenTable(); if (($PerPage * $page) > $PopAds) { echo "
\"\"
\n" .""._NUKECOPS."
"; } else { $nowdate = date("Y-m-d"); $sql_result = "select id_ads,id_catg,title,ads_desc,imageads,curr,price,submitter,email,website,dateposted,hits from ".$prefix."_nukec_ads_ads"; $sql_result .= " where active = '1' "; $applylanguage = sqlapplylanguage(); $sql_result .= "and".$applylanguage; $sql_result .= " order by hits DESC"; $resulttotalads =$db->sql_query($sql_result); if (!$resulttotalads) { echo mysql_error(); } $totalads =$db->sql_numrows($resulttotalads); if ($totalads > 0) { $pre = (($page-1) * $PerPage) + 1; if ($pre <= $totalads) { $pre = $totalads; } $suf = ($pre-1) + $PerPage; if ($suf >= $totalads) { $suf = $totalads; } echo "
.:: ".$PopAds." "._NUKECMOSTPOPTITLE." ::.

"; if ($totalads > $PerPage) { $totalpages = ceil($PopAds/$PerPage); } else { $totalpage = 1; } if (!$page) { $page = 1; } $start = ($page - 1) * $PerPage; $sql_result .= " limit ".$start.",".$PerPage; if ($totalpages >= 2) { echo "
"; echo "[ "; $back = $page - 1; if ($back >= 1 ) { echo "<< "._NUKECPREVIOUS." | "; } for ($i = 1;$i <= $totalpages;$i++) { if ($page == $i) { echo "".$page.""; } else { echo "".$i.""; } if ($i != $totalpages) { echo " | "; } } $next = $page + 1; if ($next <= $totalpages) { echo " | "._NUKECNEXT." >>"; } echo " ]"; echo "
"; } echo "
"; $j = 0; $resultads =$db->sql_query($sql_result); while (list($id_ads,$id_catg,$title,$ads_desc,$imageads,$curr,$price,$submitter,$email,$website,$dateposted,$hits) = $db->sql_fetchrow($resultads)) { themeads ($id_ads,$id_catg,$title,$ads_desc,$imageads,$curr,$price,$submitter,$email,$website,$dateposted,$hits); echo "
"; } $db->sql_freeresult($resultads); if ($totalpages >= 2) { echo "
"; echo "[ "; $back2 = $page - 1; if ($back2 >= 1 ) { echo "<< "._NUKECPREVIOUS." "; } for ($i = 1;$i <= $totalpages;$i++) { if ($page == $i) { echo "".$page.""; } else { echo "".$i.""; } if ($i != $totalpages) { echo " | "; } } $next = $page + 1; if ($next <= $totalpages) { echo " | "._NUKECNEXT." >> ]"; } echo "
"; } } else { echo "
"._NUKECNOADSFOUND."
"; } } CloseTable(); include ("footer.php"); } function Disclaimer($no) { global $prefix,$db; include("header.php"); MenuNukeC(1); echo "
"; OpenTable(); $re =$db->sql_query("select title,content from ".$prefix."_nukec_ads_disclaimer where no='".$no."'"); list($title,$content) = $db->sql_fetchrow($re); echo "\n" ."".$title."

" ."".$content."" ."

"._NUKECGOBACK."" .""; CloseTable(); include("footer.php"); } switch($op) { case "mostpop":MostPop();break; case "viewads": viewads($days);break; case "ViewCatg":ViewCatg();break; case "SubmitComment":SubmitComment($xid_ads,$commentby,$commsubject,$commentdesc);break; case "ViewDetail": ViewDetail($id_ads);break; case "Disclaimer":Disclaimer($no);break; default : Index(); break; } ?>