Ich denke ich habe die Abfrage gefunden, die ich brauche:
if (!function_exists('theme_html_rating_box')) { //{THEMES}
function theme_html_rating_box()
{
global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $THEME_DIR;
global $template_image_rating, $lang_rate_pic;
if (!(USER_CAN_RATE_PICTURES && $CURRENT_ALBUM_DATA['votes'] == 'YES')) return '';
$votes = $CURRENT_PIC_DATA['votes'] ? sprintf($lang_rate_pic['rating'], round($CURRENT_PIC_DATA['pic_rating'] / 2000, 1), $CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];
$pid = $CURRENT_PIC_DATA['pid'];
if (defined('THEME_HAS_RATING_GRAPHICS')) {
$location= $THEME_DIR;
} else {
$location= '';
}
$params = array('{TITLE}' => $lang_rate_pic['rate_this_pic'],
'{VOTES}' => $votes,
'{RATE0}' => "ratepic.php?pic=$pid&rate=0",
'{RATE1}' => "ratepic.php?pic=$pid&rate=1",
'{RATE2}' => "ratepic.php?pic=$pid&rate=2",
'{RATE3}' => "ratepic.php?pic=$pid&rate=3",
'{RATE4}' => "ratepic.php?pic=$pid&rate=4",
'{RATE5}' => "ratepic.php?pic=$pid&rate=5",
'{RUBBISH}' => $lang_rate_pic['rubbish'],
'{POOR}' => $lang_rate_pic['poor'],
'{FAIR}' => $lang_rate_pic['fair'],
'{GOOD}' => $lang_rate_pic['good'],
'{EXCELLENT}' => $lang_rate_pic['excellent'],
'{GREAT}' => $lang_rate_pic['great'],
'{WIDTH}' => $CONFIG['picture_table_width'],
'{LOCATION}' => $location, //theme dir or default images directory
);
Jetzt muss ich nur noch wissen, wie ich folgendes da rein bringe damit die Bewertungsbox nicht angezeigt wird
$sql = "SELECT a.votes as votes_allowed, p.votes as votes, pic_rating, owner_id " . "FROM {$CONFIG['TABLE_PICTURES']} AS p, {$CONFIG['TABLE_ALBUMS']} AS a " . "WHERE p.aid = a.aid AND pid = '$pic' LIMIT 1";
$result = cpg_db_query($sql);
if (!mysql_num_rows($result)) return '';
Kann mir da jemand helfen?