$referer_filter='';
$ID=0;
$D=date("m/d/Y");
$DSTP='';
if(isset($_SERVER["HTTP_REFERER"])){
$referer_filter=$_SERVER['HTTP_REFERER'];
}
include "incisspambot.php";
if(isSpamBot($referer_filter)){
die ("Unable to serve spam!");
}
//$ID=intval($_GET["ID"]);
//$D=$_GET["D"];
include "pg_utf_connect.php";
$whozzat='';
$pEditor='';
$CCOLOR='';
$_ip='';
$_orig='';
$D=date("m/d/Y");
//echo "D=$D ";
$E='';
include('incutfcleanup.php');
include('incstarringroles.php');
$CCOLOR="WHITE";
if (isset($_COOKIE["rbname"])){
$whozzat=$_COOKIE["rbname"];
$pEditor=isEditor($whozzat);
echo "Hi there, $whozzat! ";
if($pEditor != ""){
$CCOLOR=CheckEditor($pEditor);
}
//echo $pEditor;
} else {
$pEditor="";
}
foreach ($_REQUEST as $key => $value){
$$key = $value;
//echo "$key: $value ";
}
$ID=intval($ID);
$yesterday=date("m/d/Y",strtotime($D)-(3600*24));
function isEditor($x){
$SSQL="select * from tbleditors where upper(cookie)='" . str_replace("'","''",strtoupper($x)) . "'";
$result = pg_query($SSQL) or die ("Error in query: $SSQL. " . pg_last_error());
$row = pg_fetch_object($result);
if ($row){
return $x;
}
return "";
}
function CheckEditor($X){
$ssql = "select * from tbleditors where cookie='$X'";
$result = pg_query($ssql) or die ("Error in query: $ssql. " . pg_last_error());
$row = pg_fetch_object($result);
if ($row)
return $row->color;
return "WHITE";
}
$_poster=isPoster($whozzat);
$_restricted=false;
$D=date("Y-m-d",strtotime($D));
if($D != date("Y-m-d")){
echo "Archived material ";
if($_poster==true || $pEditor != ''){
echo "Access okay";
}else{
echo "Access restricted";
$_restricted=true;
}
echo "";
}
$DD=$D;
$ssql="select id as dayzmax from tbltwar where rdate='" . $D . "' and published='YES' order by id desc limit 1";
$sresult = pg_query($ssql) or die ("Error in query: $ssql. " . pg_last_error());
if (pg_num_rows($sresult) > 0)
{
$srow = pg_fetch_object($sresult);
$dayzmax=$srow->dayzmax;
}
$NEXTID=$ID+1;
$PREVID=$ID-1;
if(isset($_SERVER["REMOTE_ADDR"])){
$_ip=$_SERVER["REMOTE_ADDR"];
}
if(isset($_SERVER["HTTP_REFERER"])){
$_orig=$_SERVER["HTTP_REFERER"];
}
$query = "select viewcount from tblpghitz where id=$ID";
$sresult = pg_query($query) or die ("Error in query: $query . " . pg_last_error());
$srow = pg_fetch_object($sresult);
if($srow){
$cnt=$srow->viewcount + 1;
$ssql="update tblpghitz set viewcount=$cnt,rdate='$D',dtstamp='" . date("Y-m-d H:i:s") . "',
ip_addr='$_ip',orig='$_orig',cookie='$whozzat' where id=$ID";
$sresult = pg_query($ssql) or die ("Error in query: $ssql. " . pg_last_error());
}else{
$cnt=1;
$ssql="insert into tblpghitz (id,viewcount,rdate,dtstamp,ip_addr,orig,cookie)
values ($ID,1,'$D','" . date("Y-m-d H:i:s") . "','$_ip','$_orig','$whozzat')";
$sresult = pg_query($ssql) or die ("Error in query: $ssql. " . pg_last_error());
}
$query = "SELECT id as maxid,rdate FROM tbltwar where published='YES' order by id desc limit 1";
//echo $query;
$sresult = pg_query($query) or die ("Error in query: $query. " . pg_last_error());
if (pg_num_rows($sresult) > 0)
{
$srow = pg_fetch_object($sresult);
$maxid = $srow->maxid;
$maxdate = $srow->rdate;
}
if(!isset($SO))
$SO="";
//$PREVID = "";
//$PREVDATE = date("Y-m-d");
$query = "SELECT id,rdate FROM tbltwar WHERE published='YES' and id ='" . $PREVID . "'";
//echo $query;
$sresult = pg_query($query) or die ("Error in query: $query. " . pg_last_error());
if (pg_num_rows($sresult) > 0)
{
$srow = pg_fetch_object($sresult);
$PREVID = $srow->id;
$PREVDATE = $srow->rdate;
}
$query = "SELECT id,rdate FROM tbltwar WHERE published='YES' and id ='" . $NEXTID . "'";
//echo $query;
$sresult = pg_query($query) or die ("Error in query: $query. " . pg_last_error());
$NEXTDATE=date("Y-m-d");
$NEXTID=$ID;
if (pg_num_rows($sresult) > 0)
{
$srow = pg_fetch_object($sresult);
$NEXTID = $srow->id;
$NEXTDATE = $srow->rdate;
}
/****************************************************************************/
$query = "SELECT * FROM tbltwar WHERE id = $ID";
//echo $query;
$sresult = pg_query($query) or die ("Error in query: $query. " . pg_last_error());
if (pg_num_rows($sresult) > 0)
{
$srow = pg_fetch_object($sresult);
$rdate = $srow->rdate;
$rbanner = $srow->rbanner;
$rHeadline = $srow->rheadline;
$rQuote = $srow->rquote;
$rcommented = $srow->commented;
$artOriginal = $srow->artoriginal ;
$rposter = $srow->poster;
$rTime = $srow->rtime;
$referrer = $srow->referrer;
$Classic = $srow->classic ;
$file_under = $srow->file_under ;
$TINDEX = $srow->tindex ;
$KILLED = $srow->killed ;
if(!isset($HC))
$HC=$srow->tindex;
$basedate=' since 2007-05-07';
$HC=$TINDEX;
if(strtotime($rdate) > strtotime("2007-05-06")){
$basedate="";
}
/****************************************************************************/
?>
include("inc_fontlinks.php"); ?>
//include('inclogz.php');
?>
//include "incfontz.php"; ?>
Article
/*==================================================================*/ ?>
/********************************************************************/ ?>
/********************************************************************
Top of page destination and write area for Ajax
************************************************************************/ ?>
/***********************************************************************
Logo and search field
************************************************************************/ ?>
/****************************************************************************
Nav bar shows today and the past five days...
****************************************************************************/
?>
// IDX is a counter; Increment if we haven't reached maxid yet ?>
if ($ID != $maxid){ ?>
$IDX = $ID+1 ?>
} ?>
if (isset($HC)){
if($HC=="P"){ ?>
// IDX is a counter; Increment if we haven't reached maxid yet ?>
if ($ID > 1) {?>
$IDX = $ID-1;
$IDXD = $DD=date("Y-m-d",strtotime("-1 day",strtotime($DD)));
?>
} ?>
/************************************************************************
The holding table, holds the presentation table and the sidebar
Could be replaced by a div, I suppose
****************************************************************************/ ?>
/************************************************************************
Left side, main presentation
****************************************************************************/ ?>
/************************************************************************
Top row reflect the subject color, date, and category
****************************************************************************/ ?>
if($HC==1){ ?>
} elseif ($HC==2){ ?>
} elseif ($HC==4){ ?>
} elseif ($HC==5){ ?>
} elseif ($HC==6){ ?>
}else{ ?>
} ?>
echo $rdate; ?> echo $rHeadline; ?>
/************************************************************************
Next row is the headline, linked to the source
****************************************************************************/ ?>
/************************************************************************
Next row is the headline, linked to the source
****************************************************************************/ ?>
echo $_restricted; ?>
if((!$_restricted) || (substr($rbanner,0,5) == "Good ")){ ?>
echo nl2br($srow->rquote); ?>
/****************************************************************************/
$query = "SELECT * FROM tblcontinued WHERE ";
$query = $query . "id =" . $srow->id;
//echo $query;
$sresult = pg_query($query) or die ("Error in query: $query. " . pg_last_error());
/****************************************************************************/
if (pg_num_rows($sresult) > 0)
{
$crow = pg_fetch_object($sresult);
echo "
Archived material is restricted to Rantburg regulars and members. If you need access email fred.pruitt=at=gmail.com with your nick to be added to the members list. There is no charge to join Rantburg as a member.
/****************************************************************************
Insert the comments
****************************************************************************/
$query = "SELECT * FROM tblcomments WHERE id = $ID ORDER BY cid";
//echo $query;
$sresult = pg_query($query) or die ("Error in query: $query. " . pg_last_error());
$i=1;
while($srow = pg_fetch_object($sresult))
{ ?>
}
function isPoster($X){
$ssql = "select id from tblposters where poster='$X'";
$result = pg_query($ssql) or die ("Error in query: $query. " . pg_error());
$row = pg_fetch_object($result);
if ($row)
return true;
return false;
}
?>