click here to go to the site "; break; } print build_home(); } break; } case 'showframe': { if (isset($_GET['url'])) { $url=$_GET['url']; } if (isset($_GET['back'])) { $back=$_GET['back']; } if (isset($_GET['id'])) { $id=$_GET['id']; } //$back=$_SERVER['HTTP_REFERER']; showframe($url,$back,$id); break; } case 'brokenlink': { reportbrokenlink($_GET['id']); break; } case 'new': { include_once($jadevars["homepath"]."/jf2_new.inc.php"); print shownew(); break; } case 'favorite': { include_once($jadevars["homepath"]."/jf2_favorite.inc.php"); print showfavorite(); break; } case 'popular': { include_once($jadevars["homepath"]."/jf2_popular.inc.php"); print showPopular(); break; } case 'backlinks': { include_once($jadevars["homepath"]."/jf2_backlinks.inc.php"); print showBackLinks(); break; } case 'sow': { include_once($jadevars["homepath"]."/jf2_sow.inc.php"); print showSOW(); break; } case 'toprat': { include_once($jadevars["homepath"]."/jf2_rat.inc.php"); if ( isset($_GET['kind']) && $_GET['kind']=='usr' ) { $kind='usr'; } else { $kind='adm'; } if ( isset($_GET['stars']) && ($_GET['stars']<0 || $_GET['stars']>5 || !is_numeric($_GET['stars'])) ) { $stars=5; } else { if (isset($_GET['stars'])) { $stars = $_GET['stars']; } } print showRat($kind,$stars); break; } case 'addnew': { include_once($jadevars["homepath"]."/jf2_addnew.inc.php"); if (empty($_POST['url'])) { $url=$_GET['url']; } else { $url=$_POST['url']; } if (empty($_POST['idcat'])) { $idcat=$_GET['idcat']; } else { $idcat=$_POST['idcat']; } if (empty($idcat) or !isset($idcat)) { $idcat=$_POST['idcat'];} if (!is_numeric($idcat)) {$idcat=0;} $step=$_GET['step']; if (empty($step) or !isset($step)) { $step=$_POST['step'];} if (empty($step) or !isset($step)) { $step=0; } if (!is_numeric($step)) { $step=0; } addnewsite($idcat,$step,$url); break; } case 'suggestcat': { if (isset($_GET['idcat'])) { $idcat=$_GET['idcat']; } if (empty($idcat) or !isset($idcat)) { if (isset($_POST['idcat'])) { $idcat=$_POST['idcat']; } } if (!is_numeric($idcat)) { $idcat=0;} if (isset($_GET['step'])) { $step=$_GET['step']; } if (empty($step) or !isset($step)) { if (isset($_POST['step'])) { $step=$_POST['step']; } } if (empty($step) or !isset($step)) { $step=0;} if (!is_numeric($step)) { $step=0; } include_once($jadevars["homepath"]."/jf2_suggestcat.inc.php"); suggestcat($idcat,$step); break; } case 'tree': { include_once($jadevars["homepath"]."/jf2_tree.inc.php"); print showtree(); break; } case 'search': { if ($_POST['query']=="" AND $_SERVER['QUERY_STRING']=="") { include_once($jadevars["homepath"]."/jf2_home.inc.php"); print build_home(); break; } if (isset($_POST['query'])) { $query=$_POST['query']; } if (empty($query) or !isset($query)) { $query=rawurldecode($_GET['query']); } $query=trim($query); //$query=addslashes($query); $page=$_GET['page']; if (empty($page) or !isset($page)) { $page=1; } include_once($jadevars["homepath"]."/jf2_search.inc.php"); print showsearchresults($query,$page); break; } case 'rateit': { include_once($jadevars["homepath"]."/jf2_rateit.inc.php"); $id=$_GET['id']; if (is_numeric($id) AND $id!=0) { print rateit($id); } break; } default: { if (!($jadevars['dinamic'])) { //header("Location: http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/index.shtml"); $url="http://".$_SERVER['HTTP_HOST']."/index.shtml"; print "click here to go to the site "; break; } include_once($jadevars["homepath"]."/jf2_home.inc.php"); print build_home(); break; } } function jump($jumpto, $window) { /*********************************************************************/ /* This function makes posible to jump to the selected link, and if */ /* the jump2frame option is on it open the new link in a page with */ /* a frame givig the user a easy way to return to your site */ /*********************************************************************/ global $jadevars; include_once($jadevars["homepath"]."/jf2_network.inc.php"); include_once($jadevars["homepath"]."/jf2_other.inc.php"); $link = mysql_connect ($jadevars['host'], $jadevars['user'], $jadevars['password']) or mydie ('I cannot connect to the database.'); mysql_select_db ($jadevars['db']) or mydie(mysql_error(),"Error opening DB on jump"); $jumpto=$jumpto+1-1; $sqlquery="SELECT * FROM jade_sites WHERE id = $jumpto"; $result = mysql_query($sqlquery) or mydie(mysql_error(),$sqlquery); $link = mysql_fetch_array($result, MYSQL_ASSOC); $url=$link['url']; $hits=$link['numhits']+1; $title=$link['title']; mysql_free_result($result); /* Here is the anticheat option */ if ($jadevars['anticheats']==1) { /* First, delete all records. All records with date different that today */ $sqlquery="DELETE FROM jade_anticheat WHERE datelog <> NOW()"; $result = mysql_query($sqlquery) or mydie(mysql_error(),$sqlquery); /* Verify if user (IPAddress) clicked today */ $sqlquery="SELECT * FROM jade_anticheat WHERE idsite = $jumpto AND datelog = NOW() AND ipnum = ".getIPNum(); $result = mysql_query($sqlquery) or mydie(mysql_error(),$sqlquery); $numlinks = mysql_num_rows($result); if ($numlinks==0) { $sqlquery="INSERT INTO jade_anticheat(idsite, datelog, ipnum) VALUES(".$jumpto.", NOW(), ".getIPNum().")"; $result = mysql_query($sqlquery) or mydie(mysql_error(),$sqlquery); $sqlquery = "UPDATE jade_sites SET numhits = ".$hits." WHERE id = $jumpto"; $result = mysql_query($sqlquery) or mydie(mysql_error(),$sqlquery); } /* if anticheat is disabled or never enabled */ } else { $sqlquery = "UPDATE jade_sites SET numhits = ".$hits." WHERE id = $jumpto"; $result = mysql_query($sqlquery) or mydie(mysql_error(),$sqlquery); } /* end of anticheat */ if ($jadevars['jump2frame'] AND $window!='new') { ?> <? print "$title"; ?> <meta http-equiv="refresh" content="0;URL=<? print $url; ?>"> ' => $jadevars['home'].'/templates/'.$jadevars['template'].'/jade.css', '<%back2jade%>' => '', '<%brokenlink%>' => '', '<%closeframe%>' => '' )); print $retorno; return; } function reportbrokenlink($id=0) { global $jadevars; global $texts; if ($id==0) exit; $link = mysql_connect ($jadevars['host'], $jadevars['user'], $jadevars['password']) or mydie ('I cannot connect to the database.'); mysql_select_db ($jadevars['db']) or mydie(mysql_error(),"Error opening DB on reportbrokenlinks"); $sqlquery = "SELECT *, TO_DAYS(NOW()) - TO_DAYS(datereported) AS dias FROM jade_broken WHERE id=".$id; $result = mysql_query($sqlquery) or mydie(mysql_error(),$sqlquery); $numlinks = mysql_num_rows($result); if ($numlinks>0) { $site = mysql_fetch_array($result, MYSQL_ASSOC); $timesrep=$site['timesreported']+1; if ($site['dias'] <= 30 ) { $sqlquery = "UPDATE jade_broken SET timesreported = ".$timesrep.", lastreported=NOW() WHERE id=".$id; } else { $sqlquery = "UPDATE jade_broken SET timesreported = ".$timesrep.", datereported=NOW(), lastreported=NOW(), revised=0, ipreported = '".$_SERVER['REMOTE_ADDR']."' WHERE id=".$id; } $result = mysql_query($sqlquery) or mydie(mysql_error(),$sqlquery); } else { $sqlquery = "INSERT INTO jade_broken (id, datereported, ipreported) VALUES ("; $sqlquery.= "$id, NOW() , '".$_SERVER['REMOTE_ADDR']."')"; $result = mysql_query($sqlquery) or mydie(mysql_error(),$sqlquery); } $frmretorno=$texts['broken_msg_thx']; $newfile=""; $parametro=""; if ($jadevars['dinamic']) { $homepage = $jadevars['home'].$_SERVER['PHP_SELF']; } else { $homepage=$jadevars['home']."/index.shtml";} include_once($jadevars["homepath"]."/jf2_template.inc.php"); $retorno = tpl_ReplaceTags(tpl_ReadFile("top.tpl"), getJadeTags(1,'extra',0,'',$homepage)); $retorno .= tpl_ReplaceTags(tpl_ReadFile("other.tpl"), array( '<%home%>' => $jadevars['home'], '<%pagetitle%>' => $texts['addnew_soonprocess'], '<%adv%>' => getBannerAdv('addnew',0,2), '<%results%>' => $frmretorno, '<%num_cats_sites%>' => $texts['texts_indexing'].get_NumRecords('categs')." ".$texts['texts_categories'].$texts['texts_and'].get_NumRecords('sites')." ".$texts['texts_sites'], '<%lastupdate%>' => $texts['texts_lastupdate']." ".date("j-M-Y - H:m"))); $retorno .= tpl_ReplaceTags(tpl_ReadFile("bottom.tpl"), array( '<%adv%>' => getBannerAdv('addnew',0,3), '<%idcat%>' => 0, '<%home%>' => $jadevars['home'])); print $retorno; return; } ?> \n"; $retorno .= "function textCounter(field, countfield, maxlimit) {\n"; $retorno .= " if (field.value.length > maxlimit) \n"; $retorno .= " field.value = field.value.substring(0, maxlimit);\n"; $retorno .= " else \n"; $retorno .= " countfield.value = maxlimit - field.value.length;\n"; $retorno .= "}\n"; $retorno .= "function checkEmail(email) {\n"; $retorno .= " if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email.value)){ return (true) }\n"; $retorno .= " alert(\"".$texts['addnew'][33]."\")\n"; $retorno .= " return (false)\n"; $retorno .= "}\n"; $retorno .= "\n"; return $retorno; } ?> = 49 && $ascii_code <=57) continue; else return false; } return true;*/ } function getJadeTags($part=0, $kpage='', $idcat=0, $query='', $homepage='') { global $jadevars, $texts; if (($part==0) or ($kpage=='')) { return array(); exit; } if ($jadevars['dinamic']) { $newfile=""; $parametro=""; $homepage = $jadevars['home']."/".$jadevars['jadephp']; } else { $newfile=$jadevars['homepath']."/index.shtml"; $homepage = $jadevars['home']."/index.shtml";} switch ($part) { case 1: include_once($jadevars["homepath"]."/jf2_banner.inc.php"); include_once($jadevars["homepath"]."/jf2_other.inc.php"); $arreglo = array( '<%css%>' => $jadevars['home']."/templates/".$jadevars['template']."/jade.css", '<%templatedir%>' => $jadevars['home']."/templates/".$jadevars['template']."/", '<%idcat%>' => 0, '<%menuhome%>' => $texts['menu_home'], '<%menunew%>' => $texts['menu_new'], '<%menufav%>' => $texts['menu_favorites'], '<%menupop%>' => $texts['menu_popular'], '<%menubacklinks%>' => $texts['menu_backlinks'], '<%menuadd%>' => $texts['menu_addsite'], '<%menusuggestcat%>' => $texts['menu_suggestcategory'], '<%menusow%>' => $texts['menu_sow'], '<%menuadmrat5%>' => $texts['menu_admrat5'], '<%menuusrrat5%>' => $texts['menu_usrrat5'], '<%menutree%>' => $texts['menu_tree'], '<%txtsearch%>' => $texts['texts_search'], '<%query%>' => $keywords, '<%home%>' => $jadevars['home'], '<%homepage%>' => $homepage, '<%adv%>' => getBannerAdv($kpage,$idcat,$part), '<%meta_desc%>' => getMetaTags('metadesc',$idcat,$kpage), '<%meta_keyw%>' => getMetaTags('metakeyw',$idcat,$kpage), '<%meta_title%>' => getMetaTags('metatitle',$idcat,$kpage), '<%jadephp%>' => $jadevars["jadephp"], '<%myscripts%>' => getMyScripts($kpage) ); // '<%idcat%>' => 0, break; default: $arreglo = array(); break; } return $arreglo; } function getMyScripts($kpage='') { if ($kpage=='addnew') { return formscripts(); } return; } function build_detail($id) { /****************************************** * Function to build the site detail page * ******************************************/ global $jadevars, $texts; include_once("jf2_other.inc.php"); include_once("jf2_banner.inc.php"); include_once("jf2_template.inc.php"); $link = mysql_connect ($jadevars['host'], $jadevars['user'], $jadevars['password']) or mydie ('I cannot connect to the database.'); mysql_select_db ($jadevars['db']) or mydie(mysql_error(),"Errror opening DB on buil_category"); $sqlquery1="SELECT * FROM jade_sites WHERE isvalid=1 AND id=".$id; $result = mysql_query($sqlquery1) or mydie(mysql_error(),$sqlquery1); $homepage = $jadevars['home']."/".$jadevars['jadephp']; $newfile=""; $parametro='action=showdetail&id='.$id; $contents = tpl_ReplaceTags(tpl_ReadFile('top.tpl'), array( '<%css%>' => $jadevars['home']."/templates/".$jadevars['template']."/jade.css", '<%templatedir%>' => $jadevars['home']."/templates/".$jadevars['template']."/", '<%idcat%>' => 0, '<%menuhome%>' => $texts['menu_home'], '<%menunew%>' => $texts['menu_new'], '<%menufav%>' => $texts['menu_favorites'], '<%menupop%>' => $texts['menu_popular'], '<%menubacklinks%>' => $texts['menu_backlinks'], '<%menuadd%>' => $texts['menu_addsite'], '<%menusuggestcat%>' => $texts['menu_suggestcategory'], '<%menusow%>' => $texts['menu_sow'], '<%menuadmrat5%>' => $texts['menu_admrat5'], '<%menuusrrat5%>' => $texts['menu_usrrat5'], '<%menutree%>' => $texts['menu_tree'], '<%txtsearch%>' => $texts['texts_search'], '<%query%>' => $keywords, '<%home%>' => $jadevars['home'], '<%homepage%>' => $homepage, '<%adv%>' => getBannerAdv($kpage,$idcat,$part), '<%meta_desc%>' => getSiteTags('metadesc',$id), '<%meta_keyw%>' => getSiteTags('metakeyw',$id), '<%meta_title%>' => getSiteTags('metatitle',$id), '<%jadephp%>' => $jadevars["jadephp"], '<%myscripts%>' => getMyScripts($kpage) )); //getJadeTags(1,'SiteDetail',0,'',$homepage)); $contents .= tpl_ReplaceTags(tpl_ReadFile('other.tpl'), array( '<%home%>' => $jadevars['home'], '<%pagetitle%>' => $texts['title_sitedetails'], '<%results%>' => getSiteDetail($id), '<%adv%>' => getBannerAdv('popular',0,2), '<%num_cats_sites%>' => $texts['texts_indexing'].get_NumRecords('categs')." ".$texts['texts_categories'].$texts['texts_and'].get_NumRecords('sites')." ".$texts['texts_sites'], '<%lastupdate%>' => $texts['texts_lastupdate']." ".date("j-M-Y - H:m"))); $contents .= tpl_ReplaceTags(tpl_ReadFile('bottom.tpl'), array( '<%adv%>' => getBannerAdv('popular',0,3), '<%home%>' => $jadevars['home'])); $retorno = tpl_SendData("", $contents); return $retorno; } ?>