/*USE THIS TO INCLUDE THE POSTS ANYWHERE ON YOUR PAGE*/
/*SAVE THE FOLLOWING IN YOUR templates FOLDER AS template-top.html*/
|
%title% - %date% - AIM This Gallery - Link To This Gallery
|

%description%
|
|
%url% - Clicks: %clicks% - Category: %category%
|
|
Submitted By: %poster% - Rating: %rating% %ratebox% - %comments% comment(s)
|
/*SAVE THE FOLLOWING AS top.php IN THE SCRIPTS FOLDER, EDIT THE FIRST 3 VARIABLES TO YOUR LIKING*/
=time ORDER BY $order_by $order LIMIT $amount\") or die(mysql_error());
while($row=mysql_fetch_array($result))
{
$ratebox=\"
\";
if($row[ratedtally]==\"0\"){$rating=\"No Rating\";}else{$rating=substr(($row[ratedtotal]/$row[ratedtally]), 0, 3);}
$result2=mysql_query(\"SELECT linkid FROM babeloggerv4_comments WHERE linkid=$row[id]\");
$comments=mysql_num_rows($result2);
$date=date(\"$date_format\",$row[time]);
$description=nl2br($row[description]);
$temp=file_get_contents(\"templates/template-top.html\");
$gallery=str_replace(\"%url%\",substr($row[url],0,$max_url_chars),$temp);
$gallery=str_replace(\"%urltogallery%\",\"$script_url/index.php?gal=$row[id]\",$gallery);
$gallery=str_replace(\"%commentsurl%\",\"$script_url/comments.php?id=$row[id]\",$gallery);
$gallery=str_replace(\"%comments%\",\"$comments\",$gallery);
$gallery=str_replace(\"%categoryurl%\",\"$script_url/?cat=\".urlencode($row[category]).\"\",$gallery);
$gallery=str_replace(\"%category%\",\"$row[category]\",$gallery);
$gallery=str_replace(\"%outurl%\",\"out.php?id=$row[id]\",$gallery);
$gallery=str_replace(\"%title%\",htmlentities($row[title]),$gallery);
$gallery=str_replace(\"%seotitle%\",\"\".urlencode($row[title]).\"\",$gallery);
$gallery=str_replace(\"%description%\",\"$description\",$gallery);
$gallery=str_replace(\"%clicks%\",\"$row[clicks]\",$gallery);
$gallery=str_replace(\"%poster%\",\"$row[poster]\",$gallery);
$gallery=str_replace(\"%date%\",\"$date\",$gallery);
$gallery=str_replace(\"%rating%\",\"$rating\",$gallery);
$gallery=str_replace(\"%ratebox%\",\"$ratebox\",$gallery);
$gallery=str_replace(\"%imageurl%\",$script_url.$images_path.$row[imgname],$gallery);
print $gallery;
}
?>
|