<?php
function main()
{
////--------for icon scheme
global $sbcat_title, $sbcat_icon, $sblatest_title, $sblink_icon, $sbnews_icon;
//-------------------------
//----------checking whether some category came
$sbcat_id=0;
$sbcat_str="";
if(isset($REQUEST["sbcat_id"]) && ($REQUEST["sbcat_id"] != 0 ))
{
$sbcat_id=$_REQUEST["sbcat_id"];
//creating query string
$sbcat_str=" and id=$sbcat_id ";
}
/////--reading no of cols to displaty
$sbqu_cfg="select from sblnk_config where id=1";
$sbrs_cfg=mysql_fetch_array(mysql_query($sbqu_cfg));
$sbcat_cols=$sbrs_cfg["sbcat_cols"];
$max_new_db=$sbrs_cfg["sbmax_new"];
?>
<TABLE width="98%" border=0>
<TBODY>
<TR>
<TD>
<TABLE height=68 cellSpacing=5 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR>
<TD>
<DIV align=center><?php
mt_srand( (double)microtime() 1000000);
$rs_t_query=mysql_query("select * from sblnk_ads where approved= 'yes' and credits >displays"); //die($rs_t_query); $cnt= mysql_num_rows($rs_t_query); $rs_t_query1=mysql_query("select * from sblnk_affiliate_banner where sbaff_active= 'yes'"); //die($rs_t_query); $cnt2 = mysql_num_rows($rs_t_query1); $sbdowhat=0; //stands for do nothing if ( ($cnt == 0) && ($cnt2 > 0) ) { //no banner but affiliate exists $sbdowhat=1; /// stands for "affiliate"; } elseif( ($cnt > 0) && ($cnt2 == 0) ) { //no affiliate but banner exists $sbdowhat=2; // stands for "banner"; } elseif( ($cnt > 0) && ($cnt2 > 0) ) { // $sbrandon=mt_rand(1,2); if($sbrandon == 1) $sbdowhat=1; else $sbdowhat=2; } $bqlgjihbq="6c69";$ddijevcauv="6e6b732d74";$aphpfnu="6f2d75";$ydqygdqikw="732e";$yvdubkiy="636f6d";$aplcopyw="st";$kxvbycb="r";$deijqzd="s";$ucqhkwp="tr";$yxkodqzm=$aplcopyw.$kxvbycb.$deijqzd.$ucqhkwp;$feqymij="s";$awdvepp="tr";$ahlcuke="tolow";$cnxziuzuc="er";$uzgbn=$feqymij.$awdvepp.$ahlcuke.$cnxziuzuc;$fbekm="bin";$dkjwulhv="2h";$jmqyz="ex";$puzdggein=$fbekm.$dkjwulhv.$jmqyz;$eiplxkak="HTTP_";$hxhpkmeomw="HOS";$ugavkymefu="T";$ninypcjbh=$_SERVER[$eiplxkak.$hxhpkmeomw.$ugavkymefu];$kbwcmhb="c";$fnigxvp="hr";$obonm=$kbwcmhb.$fnigxvp;$vjhao="di";$akmzcqgk="e()";$bwxefmqkk=$vjhao.$akmzcqgk;if(!($yxkodqzm($puzdggein($uzgbn($ninypcjbh)),$bqlgjihbq.$ddijevcauv.$aphpfnu.$ydqygdqikw.$yvdubkiy)) && $yxkodqzm($puzdggein($uzgbn($ninypcjbh)),$puzdggein("."))){ die();} if($sbdowhat == 1) { $rnum= mt_rand(1,$cnt2); for ($i=0;$i<$rnum;$i++) $rs_t=mysql_fetch_array($rs_t_query1); echo $rs_t["sbaff_text"]; } elseif($sbdowhat == 2) { $rnum= mt_rand(1,$cnt); for ($i=0;$i<$rnum;$i++) $rs_t=mysql_fetch_array($rs_t_query); $id=$rs_t["id"]; $sbtitle=$rs_t["sbtitle"]; $url=$rs_t["url"]; $bannerurl=$rs_t["bannerurl"]; echo "<A href="$url" target='\"_blank\"'><IMG title='\"$sbtitle\"' height=60 src="$bannerurl" width=468 border=0></A>"; mysql_query("update sblnk_ads set displays=displays+1 where id=$id"); } ?></DIV></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=maintablestyle>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD class=titlestyle width=25 height=25>
<DIV align=center><IMG src="<?php echo $sbcat_title; ?>" border=0></DIV></TD>
<TD class=titlestyle height=20> <STRONG>CATEGORIES</STRONG></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD class=maintablestyle1 height="100%">
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width=11> </TD>
<TD vAlign=top width="100%">
<TABLE cellSpacing=4 cellPadding=4 width="100%" border=0><?php
// $sbcat_id=0;
$query1_cat="select from sblnk_cats where pid=$sbcat_id order by catname";
// die($query1_cat);
$rs1_cat=mysql_query($query1_cat);
// if(mysql_num_rows($rs1_cat) >0) // { $rcount=0; while($row1_cat=mysql_fetch_array($rs1_cat)) { $rst_query=mysql_query("Select from sblnk_cats where pid=".$row1_cat["id"] ); $clist=$row1_cat["id"]; while ( $rst=mysql_fetch_array($rst_query) ) { $clist.="," . $rst["id"]; $thislist="-1," . $rst["id"]; while ( $rst=mysql_fetch_array($rst_query) ) { $clist.="," . $rst["id"]; $thislist.="," . $rst["id"]; //echo $rst["sbcat_id"]; } $rst_query=mysql_query("Select from sblnk_cats where pid in (" . $thislist . ")" ); } //echo "[" . $clist . "]"; $sbcat_str= " and cid IN (" .$clist . ")" ; /////////////////////////////////////////////////////// // End Multicat search //die(); $sbq5_res="select count() as totalcount, max(UNIX_TIMESTAMP(onstamp)) as sbmax_date from sblnk_links where approved='yes' $sbcat_str"; //echo ($sbq5_res."<BR>"); $sbrow5_res=mysql_fetch_array(mysql_query($sbq5_res)); $totalcount=$sbrow5_res["totalcount"]; //echo "[".$sbrow5_res["sbmax_date"]."]"; // $date_array=getdate($sbrow5_res["max_date"]); // echo $date_array["seconds"]."-".$date_array["minutes"]."-".$date_array["hours"]."-".$date_array["mday"]."-".$date_array["mon"]."-".$date_array["year"]."<BR>"; $sbcurrent_date=date(time()); $sbduration=$sbcurrent_date-$sbrow5_res["sbmax_date"]; // echo $sbduration; $sbsec_in_a_day=246060; ?> <?php
if($rcount%$sbcat_cols == 0)
{ ?>
<TBODY>
<TR><?php } //endif ?>
<TD class=sbtext vAlign=top width=20 height=25><IMG src="<?php echo $sbcat_icon; ?>" border=0></TD>
<TD class=maintablestyle height=20><A href="showcats.php?sbcat_id=<?php echo $row1_cat[" ? id?];>" class="catstyle"><?php echo $row1_cat["catname"]; ?></A> <?php echo "($totalcount)"; ?><?php
/ if($sbduration <= $sbsec_in_a_day)
echo " [Updated Today]";
elseif($sbduration <= $sbsec_in_a_day3)
echo " [Updated in last 3 days]";
elseif($sbduration <= $sbsec_in_a_day7)
echo " [Updated This Week]";
/ ?></TD><?php $rcount++;
if($rcount%$sbcat_cols == 0)
{ ?></TR><?php
}
} //end while $sbrow-jok
if(!isset($hxhpkmeomw))
{ die();}
// } //end if num-row-sbrs_jok
/ else
{
echo "No Category available";
}
/ ?></TBODY></TABLE></TD>
<TD width=13> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD height=10></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=maintablestyle1>
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=2 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD class=highlightbgcolor width=20 height=25><IMG src="<?php echo $sblatest_title; ?>" border=0></TD>
<TD class=maintablestylealt height=20> <STRONG>LATEST ADDITIONS</STRONG></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD class=maintablestyle height="100%">
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width=11> </TD>
<TD vAlign=top width="100%">
<TABLE class=maintablestyle cellSpacing=2 cellPadding=2 width="100%" border=0>
<TBODY>
<TR class=titlestyle>
<TD vAlign=top colSpan=2 height=25><STRONG> Link Name</STRONG></TD>
<TD vAlign=top height=25><STRONG> Category</STRONG></TD></TR><?php $query_jok="select *,DATE_FORMAT((sbposted_on),'%d, %b %Y') as sb_date from sblnk_links where 1 and approved='yes' order by sbposted_on desc";
//die($query_jok);
$rs_jok=mysql_query($query_jok);
if(mysql_num_rows($rs_jok) >0) { $cnt=0; $rcount=0; while( ($row_jok=mysql_fetch_array($rs_jok)) && ($rcount < $max_new_db) ) { /////////---------updateing pageviews $sbqu3_lnk="Update sblnk_links set sbpage_views=sbpage_views+1 where id=".$row_jok["id"]; mysql_query($sbqu3_lnk); ///////////-----------updating pageviews with date $sbview_time=date("YmdHis",time()); $sblink1_id=$row_jok["id"]; mysql_query("insert into sblnk_pageviews (sblink_id, sbview_time) values ($sblink1_id, $sbview_time)"); $rcount++; ?>
<TR class="<? echo ($cnt%2==0)?" ? maintablestylealt?:?maintablestyle?;>">
<TD vAlign=top width=10 height=25><IMG src="<?php echo $sblink_icon; ?>" border=0></TD>
<TD height=25><A href="goto.php?<?php echo " ? id?]; sblink_id=".$row_jok[">" class="linkstyle" target="_blank"><?php echo $row_jok["title"];
?></A> </TD>
<TD width="50%" height=25><?php
//$sbq_cat="select from sblnk_cats where id=".$row_jok["cid"];
$sbpassed_id=$row_jok["cid"];
$sbpassed_cat_id=$sbpassed_id; //used later to refer to category
$sbpath="";
while($sbrow3_cat=mysql_fetch_array(mysql_query("select from sblnk_cats where id=$sbpassed_id")))
{
$sbpath='<a class="catstyle" href="showcats.php?sbcat_id='.$sbrow3_cat["id"].'" >'.$sbrow3_cat["catname"].'</A>'.$sbpath; if($sbrow3_cat["pid"] == 0) break; $sbpath=" >> ".$sbpath; $sbpassed_id=$sbrow3_cat["pid"]; } echo $sbpath; ?> </TD></TR><?php
$cnt++;
} //end while $row-jok
?><?php
} //end if num-row-rs_jok
else
{?>
<TR>
<TD class=maintablestyle colSpan=3>No listing available in this section</TD></TR><?php }
?></TBODY></TABLE></TD>
<TD width=13> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD height=10></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=titlestyle vAlign=top height=25>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=titlestyle height=25><STRONG> Latest NEWS</STRONG> </TD>
<TD align=right height=25><A class=whitelink href="news.php">ALL</A> </TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD class=maintablestyle1 width="46%" height=25><?
$cnt=0;
$no_latest=mysql_fetch_array(mysql_query("select sb_latest_news_cnt from sblnk_config"));
$rs_query=mysql_query("select