= '$start'";
$sql .= " and stories.approvaldate <= '$end'";
}
if($topic != "All")
{
$sql .= " and stories.topic = '$topic'";
}
if($type != "All")
{
$sql .= " and stories.type = '$type'";
}
$sql .= " order by approvaldate desc, storyid desc limit 20";
$result = mysql_query($sql, $conn);
$num_of_rows = mysql_num_rows($result);
/*if($num_of_rows > 0)
{
/* -- Stories Query without approvaldate --
$sql2 = "select stories.*, countries.* from stories,countries
where stories.country = countries.countryid
order by approvaldate desc, storyid desc limit 10";
$result2 = mysql_query($sql2, $conn);
$num_of_rows2 = mysql_num_rows($result2);
} */
/* -- Topics Query -- */
$sql3 = "select * from topics order by topicname";
$result3 = mysql_query($sql3, $conn);
$num_of_rows3 = mysql_num_rows($result3);
?>
> PDF DIGEST FOR MONTH";
}
}
?>
";
if($num_of_rows4 > 0) { ?>

width="80" class="photo" alt="photo" />
' . $rows2['TITLE'] . '';
$divisionPoint = summarize($rows['TEXT'],2);
$byline = "
" . strtoupper($rows['CITY']) . ", " . ucfirst($rows['COUNTRYNAME']) . ",";
if($rows['REGION'] == 20)
{
$byline = " " . ucfirst($rows['COUNTRYNAME']) . ",";
}
}
$olddate = substr("$rows[APPROVALDATE]",5);
$getmonth = substr("$olddate",0,2);
$getdate = substr("$olddate",3);
$montharray = array ( January => '00' , February => '02' , March => '03' , April => '04' , May => '05' , June => '06' , July => '07' , August => '08' , September => '09' , October => '10' , November => '11' , December => '12');
$datearray = array ( 1 => '01' , 2 => '02' , 3 => '03' , 4 => '04' , 5 => '05' , 6 => '06' , 7 => '07' , 8 => '08' , 9 => '09');
$tempmonth= array_search("$getmonth", $montharray);
if( substr("$olddate",3,1) == 0)
{
$tempdate = array_search("$getdate", $datearray);
}
else
{
$tempdate = $getdate;
}
$finaldate = "$tempdate $tempmonth";
$approvaldate = "$tempdate";
$approvalmonth = "$tempmonth";
$approvalyear = substr("$rows[APPROVALDATE]",0,4);
echo "
Division point is $divisionPoint";
print "
$byline $approvaldate $approvalmonth $approvalyear (BWNS) -- " . substr($rows['TEXT'],0,$divisionPoint) . ".
";
print "
> GO TO STORY ";
}
}
?>
";
include("footer.php");
?>