$bgCommentDb = $DB->query(
"SELECT *
FROM ".$db_tab['gal_cat']."
LEFT JOIN ".$db_tab['gal_pics']."
ON pics_cat = cat_id
WHERE pics_id = '".$bgPicPid."'
AND pics_active = '1'
AND cat_rights_comment_view LIKE '%-".$USER['status']."-%'"
);
$bgCommentCount = $DB->num_rows($bgCommentDb);
if($bgCommentCount > 0){
$bgComment = $DB->fetch_array($bgCommentDb);
if($bg->getRights($USER['status'], $bgComment['cat_rights_comment_post'])){
eval("\$bgCommentFormat = \"".getTemplate
("format_text").
"\";");
$smilies = new smilies();
$bgCommentFormat .= $smilies->getSmilies(1);
$bgPid = $bgPicPid;
eval ("\$bgCommentPost = \"".getTemplate
("galerie/comment_post").
"\";");
}
$bgCommentOutDb = $DB->query(
"SELECT *
FROM ".$db_tab['gal_comment']."
LEFT JOIN ".$db_tab['user']."
ON user_id = comment_user
WHERE comment_subid = '".$bgPicPid."'
ORDER BY comment_date DESC
LIMIT 5"
);
while($bgCommentOut = $DB->fetch_array($bgCommentOutDb)){
if($bgCommentOut['user_id']> 0){
$bgCommentUser = "<a href=\"include.php?path=login/userinfo.php&id=".$bgCommentOut['user_id']."\" class=\"small\">".$bgCommentOut['user_nick']."</a>";
if(isonline($bgCommentOut['user_id'])){
eval ("\$bgCommentOnline = \"".getTemplate
("member_os_online").
"\";");
}
else{
eval ("\$bgCommentOnline = \"".getTemplate
("member_os_offline").
"\";");
}
}
else{
$bgCommentUser = "<font class=\"small\">Gast</font>";
eval ("\$bgCommentOnline = \"".getTemplate
("guest_os_icon").
"\";");
}
if($bgCommentOut['comment_user'] == $USER['id'] || $USER['status'] == "admin"){
$bgCommentOption = "<a href=\"include.php?path=galerie/commentdel.php&cid=".$bgCommentOut['comment_id']."\"><img src=\"images/delete.gif\" border=\"0\"></a> <a href=\"include.php?path=galerie/commentedit.php&cid=".$bgCommentOut['comment_id']."\"><img src=\"images/edit.gif\" border=\"0\"></a>";
}
$bgCommentDate = formattime($bgCommentOut['comment_date']);
$bgCommentText = $bgCommentText = $PARSE->parse($bgCommentOut['comment_text'], 1, 1, 1, 1, 1);
$bgCommentOutClass = rowcolor($bgCommentOutClass);
eval ("\$bgCommentRow .= \"".getTemplate
("galerie/comment_row").
"\";");
}
$bgCommentHeadNav = $bg->headNavi($bgComment['cat_id']);
eval ("\$bgPicOutCommentsShow.= \"".getTemplate
("galerie/pic_comment").
"\";");
}