INT, 'totalrows' => INT));
authenticate();
if ( $Globals['ppboards'] == "closed" && $User['adminedit'] != 1 )
{
diewell( $Globals['closedmsg'] );
}
if ( !isset($page) )
{
$page = 0;
}
$startRow_comview = $page * 10;
$query_comview = "SELECT * FROM {$Globals['pp_db_prefix']}comments WHERE comment != '' ORDER BY date DESC LIMIT $startRow_comview,10";
$comview = ppmysql_query($query_comview, $link);
$row_comview = mysql_fetch_assoc($comview);
if ( empty($totalrows) )
{
$all_comview = ppmysql_query("SELECT id FROM {$Globals['pp_db_prefix']}comments WHERE comment != ''", $link);
$totalrows = mysql_num_rows($all_comview);
}
if ( $totalrows < 1 )
{
diewell ( $Globals['pp_lang']['nocomments'] );
}
$totalpages = ceil($totalrows/10)-1;
$qscomview = null;
$comrow = array();
$x = 0;
topmenu();
do
{
$cclock = formatpptime( $row_comview['date'] );
$ccdate = formatppdate( $row_comview['date'] );
$result = ppmysql_query("SELECT bigimage,approved,cat,storecat,title,userid,width,height,date,filesize,rating,views,user FROM {$Globals['pp_db_prefix']}photos WHERE id={$row_comview['photo']} LIMIT 1", $link);
list( $bigimage, $approved, $cat, $storecat, $title, $theuser, $width, $height, $date, $filesize, $imgrating, $views, $user ) = mysql_fetch_row($result);
if ( $CatPerms['ugview'][$cat] == 0 && $CatPerms['catpass'][$cat] == "" )
{
if ( $storecat != 0 )
{
$cat = $storecat;
}
$ppdate = formatppdate( $date );
$filesize = $filesize/1024;
$filesize = sprintf("%1.1f", $filesize);
$filesize = number_format($filesize)."kb";
if ( $imgrating && $Globals['allowrate'] == "yes" )
{
$rating = number_format( $imgrating, 2 );
$ratingicon = " - {$Globals['pp_lang']['rating']}: ";
for ( $ri = 0; $ri < round($rating); $ri++ )
{
$ratingicon .= "";
}
}
else
{
$ratingicon = " - {$Globals['pp_lang']['rating']}: ";
$rating = $Globals['pp_lang']['na'];
}
$imgtag = get_imagethumb( $bigimage, $cat, $theuser, $approved );
$thumb = "$imgtag";
$post ="{$Globals['pp_lang']['post']}";
$rowcomments = un_htmlspecialchars($row_comview['comment']);
if ( VB3_ENHANCEDINT == "on" )
{
$rowcomments = convert_markups($rowcomments);
}
else
{
$rowcomments = convert_returns(convert_markups($rowcomments));
}
if ( $row_comview['rating'] > 0 )
{
$rowcomments .= "
{$Globals['pp_lang']['rating']}: {$row_comview['rating']}";
}
$comrow[$x]['width'] = $width;
$comrow[$x]['height'] = $height;
$comrow[$x]['views'] = $views;
$comrow[$x]['filesize'] = $filesize;
$comrow[$x]['thumb'] = $thumb;
$comrow[$x]['rowcomments'] = $rowcomments;
$comrow[$x]['title'] = $title;
$comrow[$x]['user'] = $user;
$comrow[$x]['rating'] = $rating;
$comrow[$x]['ppdate'] = $ppdate;
$comrow[$x]['ratingicon'] = $ratingicon;
$comrow[$x]['post'] = $post;
$comrow[$x]['ccdate'] = $ccdate;
$comrow[$x]['cclock'] = $cclock;
$comrow[$x]['username'] = $row_comview['username'];
$x++;
}
} while ( $row_comview = mysql_fetch_assoc($comview) );
$prevlink = null;
if ( $page > 0 )
{
$prevurl = max(0, $page - 1);
$prevlink = "« {$Globals['pp_lang']['prevpage']}";
}
$nextlink = null;
if ( $page < $totalpages )
{
if ( $prevlink )
{
$prevlink .= " · ";
}
$nexturl = min($totalpages, $page + 1);
$nextlink = "{$Globals['pp_lang']['nextpage']} »";
}
printheader( $cat, $Globals['pp_lang']['comments'] );
include( "$Globals[tmpldir]/menubar.tmpl" );
include( "$Globals[tmpldir]/comshow.tmpl" );
printfooter();
?>