#error_reporting(E_ALL);
#ini_set('display_errors', '1');
header('Content-Type: text/html; charset=utf-8');
session_start();
include("db.php");
$inforum = 1;
$stmt = $pdodb->prepare("SELECT ID,forumtitle,forumseo,nmembers,dblat,dblon,nostrpublic,nostrprivate,nostrpublic,nostrprivatehex,nostrpublichex FROM forums WHERE forumseo=:name2 LIMIT 1");
$stmt->bindParam(':name2',str_replace(" ","-",$_REQUEST["pl"]));
$stmt->execute();
while($i3=$stmt->fetch()) {
$forumid = $i3["ID"];
$forumname = $i3["forumtitle"];
$forumseo = $i3["forumseo"];
$nmembers = $i3["nmembers"];
$cat = $i3["forumtitle"];
$dblat = $i3["dblat"];
$dblon = $i3["dblon"];
$nostrprivate = $i3["nostrprivate"];
$nostrpublic = $i3["nostrpublic"];
$nostrprivatehex = $i3["nostrprivatehex"];
$nostrpublichex = $i3["nostrpublichex"];
}
if($forumname == ""){
$forumname = str_replace("-"," ",$_REQUEST["pl"]);
}
if($_SESSION["uid"] > 0){
/*
$stmt = $pdodb->prepare("UPDATE LOW_PRIORITY subscribeto SET newstuff=0 WHERE cid=:forumid AND mid=:mid");
$stmt->bindParam(':forumid',$forumid);
$stmt->bindParam(':mid',$_SESSION["uid"]);
$stmt->execute();
$nowis = intval(date("YmdHi"));
*/
# $stmt = $pdodb->prepare("UPDATE LOW_PRIORITY forums SET lastactionint=:nowis WHERE ID=:forumid");
# $stmt->bindParam(':forumid',$forumid);
# $stmt->bindParam(':nowis',$nowis);
# $stmt->execute();
}
$dt = "Foro para ".ucwords($forumname)." & Concurso Modelos, Agencia de Modelos, Fotografos modelos, Foro para mujeres latinas";
if($_REQUEST["page"] > 0){
$dt .= " (page ".$_REQUEST["page"].") ";
}
include("metas.php");
include("header2.php");
?>
if($_REQUEST["page"] > 0){
$start = ($_REQUEST["page"]*40);
}else{
$start = 0;
}
if($_REQUEST["switch"] == "new"){
$order = "ORDER BY forum.ID desc";
}else{
$order = "ORDER BY forum.lastvoteint desc";
}
if($dblon <> 0){
$distance = 100;
$stmt = $pdodb->prepare("SELECT girls.ID as ID,forum.titleis,forum.descis,forum.lastcomment,forum.seox,forum.country,forum.lastcommentpic,forum.classified, girls.mainpic,forum.timeposted,girls.username,forum.question,forum.nreplies,forum.forum,forum.forumseo,forum.votepoints,forum.views,forum.nreplies,forum.votes,forum.mainpic as newspic,urlis, SQRT(
POW(69.1 * (forum.dblat - :dblat), 2) +
POW(69.1 * (:dblon - forum.dblon) * COS(forum.dblat / 57.3), 2)) AS distance FROM forum LEFT JOIN girls ON girls.ID=forum.mid WHERE forum=:forumid HAVING distance < :distance ".$order." LIMIT :start,40");
$stmt->bindParam(':start',$start,PDO::PARAM_INT);
$stmt->bindParam(':distance',$distance);
$stmt->bindParam(':dblat',$dblat);
$stmt->bindParam(':dblon',$dblon);
$stmt->bindParam(':forumid',$forumid,PDO::PARAM_INT);
$stmt->execute();
}else{
$stmt = $pdodb->prepare("SELECT girls.ID as ID,forum.ID as fid, forum.titleis,forum.lastcomment,forum.descis,forum.seox,forum.country, girls.mainpic,forum.timeposted,girls.username,forum.question,forum.classified,forum.dating,forum.nreplies,forum.lastcommentpic,forum.forum,forum.forumseo,forum.votepoints,forum.views,forum.nreplies,forum.votes,forum.mainpic as newspic,urlis FROM forum LEFT JOIN girls ON girls.ID=forum.mid WHERE forum=:forumid ".$order." LIMIT :start,40");
$stmt->bindParam(':start',$start,PDO::PARAM_INT);
$stmt->bindParam(':forumid',$forumid,PDO::PARAM_INT);
$stmt->execute();
}
$i=0;
while($i3=$stmt->fetch()) {
include('newsitem.php');
}
if($stmt->rowCount() == 0){
echo 'no more entries';
}
?>