getRank(trim($backlink_url))); if ($pr<0) {$pr=0;} if ($CHECK_GOOGLE_PR==1 && $pr<$MIN_GOOGLE_PR) {$error['pr']=1;} $temp_url=$backlink_url; $code=PageHeader($temp_url); $code=str_replace("\r"," ",$code); $code=str_replace("\n"," ",$code); preg_match_all("{Location:\ +(http://.*?)\ }is",$code,$temp); if (@strlen($temp[1][0])>10) {$temp_url=$temp[1][0];} $code=PageWithPost("",$temp_url,""); if ($category_id>0) { $cat_title=mysql_result(sql_execute("select title from categories where category_id='$category_id'",0,__FILE__,__LINE__),0); $category_url="http://japan-whores.com/japanese-".str_replace(" ","-",strtolower(trim($cat_title))).".shtml"; if (strpos($code,$category_url)===false && strpos($code,$SITE_MAIN_PAGE_URL)===false) {$is_not_found=1;} else {$is_not_found=0;} } else { if (strpos($code,$SITE_MAIN_PAGE_URL)===false) {$is_not_found=1;} else {$is_not_found=0;} } if ($CHECK_RECIP_LINK_ON_SUBMIT==1 && $is_not_found==1) {$error['recip']=1;} if ($PREMODERATION_NEW_LINK==1) {$is_confirmed=0;} else {$is_confirmed=1;} } if (!is_array($error)) { sql_execute(sql_placeholder("insert into categories_links set category_id=?, is_confirmed=?, is_enabled=1, is_not_found=?, title=?, url=?, backlink_url=?, user_email=?, user_icq=?, user_ip=?, google_pr=?, not_found_attempts=0, added_date=NOW(), last_check_date=NOW()", $category_id,$is_confirmed,$is_not_found,$title,$url,$backlink_url,$user_email,$user_icq,$ip,$pr),0,__FILE__,__LINE__); header("Location: link_exchange.shtml?action=done"); } } $categories_list=mysql_result2array(sql_execute("select * from categories order by place_on_page asc",0,__FILE__,__LINE__)); foreach ($categories_list as $k=>$v) { $categories_list[$k]['title_url']=str_replace(" ","-",strtolower(trim($v['title']))); } $search_keywords_list=mysql_result2array_list(sql_execute("select title from categories_searches order by place_on_page asc",0,__FILE__,__LINE__)); $categories_data=mysql_result2array_selectbox(sql_execute("select category_id,title from categories order by place_on_page asc",0,__FILE__,__LINE__)); $smarty->assign('MIN_GOOGLE_PR',$MIN_GOOGLE_PR); $smarty->assign('SITE_TITLE',$SITE_TITLE); $smarty->assign('SITE_MAIN_PAGE_URL',$SITE_MAIN_PAGE_URL); $smarty->assign('POSTFIX_CATEGORY_TITLE',$POSTFIX_CATEGORY_TITLE); $smarty->assign('error',$error); $smarty->assign('categories_data',$categories_data); $smarty->assign('search_keywords_list',$search_keywords_list); $smarty->assign('categories_list',$categories_list); $smarty->display("site_link_exchange.tpl"); ?>