$tplb->copy_template = str_replace("[not_image_original]", "", $tplb->copy_template);
     $tplb->copy_template = str_replace("[/not_image_original]", "", $tplb->copy_template);
 } else {
     $tplb->set('{image_original}', $original_img);
     $tplb->copy_template = preg_replace("'\\[not_image_original\\](.*?)\\[/not_image_original\\]'is", "", $tplb->copy_template);
     $tplb->copy_template = str_replace("[image_original]", "", $tplb->copy_template);
     $tplb->copy_template = str_replace("[/image_original]", "", $tplb->copy_template);
 }
 unset($original_img);
 //конец показа оригинальной картинки
 //Показ рейтинга
 if ($rowb['allow_rate']) {
     if ($config['short_rating'] and $user_group[$member_id['user_group']]['allow_rating']) {
         $tplb->set('{rating}', ShortRating($rowb['id'], $rowb['rating'], $rowb['vote_num'], 1));
     } else {
         $tplb->set('{rating}', ShortRating($rowb['id'], $rowb['rating'], $rowb['vote_num'], 0));
     }
     $tplb->set('{vote-num}', $rowb['vote_num']);
     $tplb->set('[rating]', "");
     $tplb->set('[/rating]', "");
 } else {
     $tplb->set('{rating}', "");
     $tplb->set('{vote-num}', "");
     $tplb->set_block("'\\[rating\\](.*?)\\[/rating\\]'si", "");
 }
 //Конец показа рейтинга
 /* понеслась, куча тегов.. */
 if ($config['allow_alt_url'] == "yes") {
     $go_page = $config['http_home_url'] . "user/" . urlencode($rowb['autor']) . "/";
 } else {
     $go_page = "{$PHP_SELF}?subaction=userinfo&user=" . urlencode($rowb['autor']);
Beispiel #2
0
    $where = "member = '{$member_id['name']}'";
} else {
    $where = "ip ='{$_IP}'";
}
$row = $db->super_query("SELECT news_id FROM " . PREFIX . "_logs where news_id ='{$news_id}' AND {$where}");
if (!$row['news_id'] and count(explode(".", $_IP)) == 4) {
    $db->query("UPDATE " . PREFIX . "_post_extras SET rating=rating+'{$go_rate}', vote_num=vote_num+1 WHERE news_id ='{$news_id}'");
    if ($db->get_affected_rows()) {
        if ($is_logged) {
            $user_name = $member_id['name'];
        } else {
            $user_name = "noname";
        }
        $db->query("INSERT INTO " . PREFIX . "_logs (news_id, ip, member) values ('{$news_id}', '{$_IP}', '{$user_name}')");
        if ($config['allow_alt_url'] == "yes" and !$config['seo_type']) {
            $cprefix = "full_";
        } else {
            $cprefix = "full_" . $news_id;
        }
        clear_cache(array('news_', 'rss', $cprefix));
    }
}
$row = $db->super_query("SELECT news_id, rating, vote_num FROM " . PREFIX . "_post_extras WHERE news_id ='{$news_id}'");
if ($_REQUEST['mode'] == "short") {
    $buffer = ShortRating($row['news_id'], $row['rating'], $row['vote_num'], false);
} else {
    $buffer = ShowRating($row['news_id'], $row['rating'], $row['vote_num'], false);
}
$db->close();
@header("Content-type: text/html; charset=" . $config['charset']);
echo $buffer;