echo ' Mod '; break; case 1: echo ' Kil '; break; } $ontime = $mass1['lastdate']; $ontime2 = $ontime + 300; if (time() > $ontime2) { echo '<font color="#FF0000"> [Off]</font>'; } else { echo '<font color="#00AA00"> [ON]</font>'; } echo '(' . functions::display_date($mass['time']) . ')<br/>'; if ($set_user['smileys']) { $tekst = functions::smileys($mass['text'], $mass1['rights'] >= 1 ? 1 : 0); } else { $tekst = $mass['text']; } echo "{$tekst}<br/>"; if ($rights == 5 || $rights >= 6) { echo long2ip($mass['ip']) . " - {$mass['soft']}<br/><a href='index.php?act=del&id=" . $mass['id'] . "'>" . $lng['delete'] . "</a>"; } echo '</div>'; ++$i; } echo '<div class="phdr">' . $lng['total'] . ': ' . $countm . '</div>'; // Навигация по страницам if ($countm > $kmess) { echo '<p>' . functions::display_pagination('index.php?act=komm&id=' . $id . '&', $start, $countm, $kmess) . '</p>'; echo '<p><form action="index.php" method="get"><input type="hidden" name="act" value="komm"/><input type="hidden" name="id" value="' . $id . '"/><input type="text" name="page" size="2"/><input type="submit" value="' . $lng['to_page'] . ' >>"/></form></p>';
// Счетчик просмотров if (!mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_views` WHERE `user_id` = '{$user_id}' AND `file_id` = '" . $res['id'] . "'"), 0)) { mysql_query("INSERT INTO `cms_album_views` SET `user_id` = '{$user_id}', `file_id` = '" . $res['id'] . "', `time` = '" . time() . "'"); $views = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_album_views` WHERE `file_id` = '" . $res['id'] . "'"), 0); mysql_query("UPDATE `cms_album_files` SET `views` = '{$views}' WHERE `id` = '" . $res['id'] . "'"); } } else { /* ----------------------------------------------------------------- Предпросмотр изображения в списке ----------------------------------------------------------------- */ echo '<a href="album.php?act=show&al=' . $al . '&img=' . $res['id'] . '&user='******'id'] . '&view"><img src="../files/users/album/' . $user['id'] . '/' . $res['tmb_name'] . '" /></a>'; } if (!empty($res['description'])) { echo '<div class="gray">' . functions::smileys(functions::checkout($res['description'], 1)) . '</div>'; } echo '<div class="sub">'; if ($user['id'] == $user_id || core::$user_rights >= 6) { echo functions::display_menu(array('<a href="album.php?act=image_edit&img=' . $res['id'] . '&user='******'id'] . '">' . $lng['edit'] . '</a>', '<a href="album.php?act=image_move&img=' . $res['id'] . '&user='******'id'] . '">' . $lng['move'] . '</a>', '<a href="album.php?act=image_delete&img=' . $res['id'] . '&user='******'id'] . '">' . $lng['delete'] . '</a>')); if ($user['id'] == $user_id && $view) { echo ' | <a href="album.php?act=show&al=' . $al . '&user='******'id'] . '&view&img=' . $res['id'] . '&profile">' . $lng_profile['photo_profile'] . '</a>'; } } echo vote_photo($res) . '<div class="gray">' . $lng['count_views'] . ': ' . $res['views'] . ', ' . $lng['count_downloads'] . ': ' . $res['downloads'] . '</div>' . '<div class="gray">' . $lng['date'] . ': ' . functions::display_date($res['time']) . '</div>' . '<a href="album.php?act=comments&img=' . $res['id'] . '">' . $lng['comments'] . '</a> (' . $res['comm_count'] . ')<br />' . '<a href="album.php?act=image_download&img=' . $res['id'] . '">' . $lng['download'] . '</a>' . '</div></div>'; ++$i; } } else { echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>'; } echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
$pos1 = 100; } if (($pos2 = mb_strpos($tmp, ' ')) === false) { $pos2 = 100; } $int_lenght = $symbols + ($pos1 >= $pos2 ? $pos2 : $pos1) - $int_start; } // Заголовок статьи echo '<div class="phdr"><b>' . htmlentities($zag['name'], ENT_QUOTES, 'UTF-8') . '</b></div>'; if ($count_pages > 1) { echo '<div class="topmenu">' . functions::display_pagination('index.php?id=' . $id . '&', $start, $count_pages, 1) . '</div>'; } // Текст статьи $text = functions::checkout(mb_substr($req['text'], $int_start, $int_lenght), 1, 1); if ($set_user['smileys']) { $text = functions::smileys($text, $rights ? 1 : 0); } echo '<div class="list2">' . $text . '</div>'; // Ссылка на комментарии if ($set['mod_lib_comm'] || $rights >= 7) { $km = mysql_query("select `id` from `lib` where type = 'komm' and refid = '" . $id . "'"); $km1 = mysql_num_rows($km); $comm_link = "<a href='index.php?act=komm&id=" . $id . "'>" . $lng['comments'] . "</a> ({$km1})"; } else { $comm_link = ' '; } echo '<div class="phdr">' . $comm_link . '</div>'; if ($count_pages > 1) { echo '<div class="topmenu">' . functions::display_pagination('index.php?id=' . $id . '&', $start, $count_pages, 1) . '</div><div class="topmenu">' . '<form action="index.php?id=' . $id . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/>' . '</form></div>'; } if ($rights == 5 || $rights >= 6) {
$res_r = mysql_fetch_assoc($req_r); $req_c = mysql_query("SELECT * FROM `forum` WHERE `id` = '" . $res_r['refid'] . "'"); $res_c = mysql_fetch_assoc($req_c); require '../incfiles/head.php'; if ($datauser['postforum'] == 0) { if (!isset($_GET['yes'])) { $lng_faq = core::load_lng('faq'); echo '<p>' . $lng_faq['forum_rules_text'] . '</p>'; echo '<p><a href="index.php?act=nt&id=' . $id . '&yes">' . $lng_forum['agree'] . '</a> | <a href="index.php?id=' . $id . '">' . $lng_forum['not_agree'] . '</a></p>'; require '../incfiles/end.php'; exit; } } $msg_pre = functions::checkout($msg, 1, 1); if ($set_user['smileys']) { $msg_pre = functions::smileys($msg_pre, $datauser['rights'] ? 1 : 0); } $msg_pre = preg_replace('#\\[c\\](.*?)\\[/c\\]#si', '<div class="quote">\\1</div>', $msg_pre); echo '<div class="phdr"><a href="index.php?id=' . $id . '"><b>' . $lng['forum'] . '</b></a> | ' . $lng_forum['new_topic'] . '</div>'; if ($msg && $th && !isset($_POST['submit'])) { echo '<div class="list1"><img src="../theme/default/images/op.gif" border="0" alt="op" /> <span style="font-weight: bold">' . $th . '</span></div>' . '<div class="list2">' . functions::display_user($datauser, array('iphide' => 1, 'header' => '<span class="gray">(' . functions::display_date(time()) . ')</span>', 'body' => $msg_pre)) . '</div>'; } echo '<form name="form" action="index.php?act=nt&id=' . $id . '" method="post">' . '<div class="gmenu">' . '<p><h3>' . $lng['section'] . '</h3>' . '<a href="index.php?id=' . $res_c['id'] . '">' . $res_c['text'] . '</a> | <a href="index.php?id=' . $res_r['id'] . '">' . $res_r['text'] . '</a></p>' . '<p><h3>' . $lng_forum['new_topic_name'] . '</h3>'; echo '<select name="tiento"> <option value="0">No Prefix</option> <option value="1">Discuss</option> <option value="2">Share</option> <option value="3">Info</option> <option value="4">Tutorial</option> <option value="5">Help</option> <option value="6">Ask</option>
$smileys = array_chunk($smileys, $kmess, TRUE); if ($start) { $key = ($start - $start % $kmess) / $kmess; $smileys_view = $smileys[$key]; if (!count($smileys_view)) { $smileys_view = $smileys[0]; } $smileys = $smileys_view; } else { $smileys = $smileys[0]; } } $i = 0; foreach ($smileys as $value) { $smile = ':' . $value . ':'; echo ($i % 2 ? '<div class="list2">' : '<div class="list1">') . '<input type="checkbox" name="delete_sm[]" value="' . $value . '" /> ' . functions::smileys($smile, $rights >= 1 ? 1 : 0) . ' ' . $smile . ' ' . $lng['lng_or'] . ' ' . functions::trans($smile) . '</div>'; $i++; } if ($total) { echo '<div class="rmenu"><input type="submit" name="delete" value=" ' . $lng['delete'] . ' "/></div></form>'; } else { echo '<div class="menu"><p>' . $lng['list_empty'] . '<br /><a href="faq.php?act=smileys">' . $lng['add_smileys'] . '</a></p></div>'; } echo '<div class="phdr">' . $lng['total'] . ': ' . $total . ' / ' . $user_smileys . '</div>'; if ($total > $kmess) { echo '<div class="topmenu">' . functions::display_pagination('faq.php?act=my_smileys&', $start, $total, $kmess) . '</div>'; } echo '<p>' . ($total ? '<a href="faq.php?act=set_my_sm&clean">' . $lng['clear'] . '</a><br />' : '') . '<a href="' . $_SESSION['ref'] . '">' . $lng['back'] . '</a></p>'; break; case 'set_my_sm': /*
$post = functions::smileys($post, $res['rights'] >= 1 ? 1 : 0); } } else { // Для гостей обрабатываем имя и фильтруем ссылки $res['name'] = functions::checkout($res['name']); $post = functions::antilink(functions::checkout($res['text'], 0, 2)); } if ($res['edit_count']) { // Если пост редактировался, показываем кем и когда $post .= '<br /><span class="gray"><small>Изм. <b>' . $res['edit_who'] . '</b> (' . functions::display_date($res['edit_time']) . ') <b>[' . $res['edit_count'] . ']</b></small></span>'; } if (!empty($res['otvet'])) { // Ответ Администрации $otvet = functions::checkout($res['otvet'], 1, 1); if ($set_user['smileys']) { $otvet = functions::smileys($otvet, 1); } $post .= '<div class="reply"><b>' . $res['admin'] . '</b>: (' . functions::display_date($res['otime']) . ')<br/>' . $otvet . '</div>'; } if ($rights >= 6) { $subtext = '<a href="index.php?act=otvet&id=' . $res['gid'] . '">' . $lng['reply'] . '</a>' . ($rights >= $res['rights'] ? ' | <a href="index.php?act=edit&id=' . $res['gid'] . '">' . $lng['edit'] . '</a> | <a href="index.php?act=delpost&id=' . $res['gid'] . '">' . $lng['delete'] . '</a>' : ''); } else { $subtext = ''; } $arg = array('header' => $text, 'body' => '<div class="textx">' . $post . '</div>', 'sub' => $subtext); echo functions::display_user($res, $arg); echo '</div>'; } } else { echo '<div class="menu"><p>' . $lng['guestbook_empty'] . '</p></div>'; }
public static function auto_bb($form, $field) { if (self::$is_mobile) { return false; } $colors = array('ffffff', 'bcbcbc', '708090', '6c6c6c', '454545', 'fcc9c9', 'fe8c8c', 'fe5e5e', 'fd5b36', 'f82e00', 'ffe1c6', 'ffc998', 'fcad66', 'ff9331', 'ff810f', 'd8ffe0', '92f9a7', '34ff5d', 'b2fb82', '89f641', 'b7e9ec', '56e5ed', '21cad3', '03939b', '039b80', 'cac8e9', '9690ea', '6a60ec', '4866e7', '173bd3', 'f3cafb', 'e287f4', 'c238dd', 'a476af', 'b53dd2'); $i = 1; $font_color = '<table><tr>'; $bg_color = '<table><tr>'; foreach ($colors as $value) { $font_color .= '<a href="javascript:tag(\'[color=#' . $value . ']\', \'[/color]\', \'\');" style="background-color:#' . $value . ';"></a>'; $bg_color .= '<a href="javascript:tag(\'[bg=#' . $value . ']\', \'[/bg]\', \'\');" style="background-color:#' . $value . ';"></a>'; if (!($i % sqrt(count($colors)))) { $font_color .= '</tr><tr>'; $bg_color .= '</tr><tr>'; } ++$i; } $font_color .= '</tr></table>'; $bg_color .= '</tr></table>'; $smileys = !empty(self::$user_data['smileys']) ? unserialize(self::$user_data['smileys']) : ''; if (!empty($smileys)) { $res_sm = ''; $bb_smileys = '<small><a href="' . self::$system_set['homeurl'] . '/pages/faq.php?act=my_smileys" class="omenu">' . self::$lng['edit_list'] . '</a></small><br />'; foreach ($smileys as $value) { $res_sm .= '<a href="javascript:tag(\':\', \'' . $value . '\', \'\');">:' . $value . '</a> '; } $bb_smileys .= functions::smileys($res_sm, self::$user_data['rights'] >= 1 ? 1 : 0); } else { $bb_smileys = '<small><a href="' . self::$system_set['homeurl'] . '/pages/faq.php?act=smileys">' . self::$lng['add_smileys'] . '</a></small>'; } $out = '<style> .bb_hide{background-color: rgba(178,178,178,0.5); padding: 5px; border-radius: 3px; border: 1px solid #708090; display: none; overflow: auto; max-width: 300px; max-height: 150px; position: absolute;} .bb_opt:hover .bb_hide{display: block;} .bb_color a {float:left; width:9px; height:9px; margin:1px; border: 1px solid black;} </style> <script language="JavaScript" type="text/javascript"> function tag(text1, text2, text3) { if ((document.selection)) { document.' . $form . '.' . $field . '.focus(); document.' . $form . '.document.selection.createRange().text = text3+text1+document.' . $form . '.document.selection.createRange().text+text2+text3; } else if(document.forms[\'' . $form . '\'].elements[\'' . $field . '\'].selectionStart!=undefined) { var element = document.forms[\'' . $form . '\'].elements[\'' . $field . '\']; var str = element.value; var start = element.selectionStart; var length = element.selectionEnd - element.selectionStart; element.value = str.substr(0, start) + text3 + text1 + str.substr(start, length) + text2 + text3 + str.substr(start + length); } else document.' . $form . '.' . $field . '.value += text3+text1+text2+text3;}</script> <a href="javascript:tag(\'[b]\', \'[/b]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/bold.gif" alt="b" title="' . self::$lng['tag_bold'] . '" border="0"/></a> <a href="javascript:tag(\'[i]\', \'[/i]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/italics.gif" alt="i" title="' . self::$lng['tag_italic'] . '" border="0"/></a> <a href="javascript:tag(\'[u]\', \'[/u]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/underline.gif" alt="u" title="' . self::$lng['tag_underline'] . '" border="0"/></a> | <a href="javascript:tag(\'[left]\', \'[/left]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/text_align_left.png" alt="url" title="text align left" border="0"/></a> <a href="javascript:tag(\'[center]\', \'[/center]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/text_align_center.png" alt="url" title="text align center" border="0"/></a> <a href="javascript:tag(\'[right]\', \'[/right]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/text_align_right.png" alt="url" title="text align right" border="0"/></a> | <a href="javascript:tag(\'[s]\', \'[/s]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/strike.gif" alt="s" title="' . self::$lng['tag_strike'] . '" border="0"/></a> <a href="javascript:tag(\'[*]\', \'[/*]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/list.gif" alt="s" title="' . self::$lng['tag_list'] . '" border="0"/></a> | <a href="javascript:tag(\'[c]\', \'[/c]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/quote.gif" alt="quote" title="' . self::$lng['tag_quote'] . '" border="0"/></a> <a href="javascript:tag(\'[php]\', \'[/php]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/php.gif" alt="cod" title="' . self::$lng['tag_code'] . '" border="0"/></a> <a href="javascript:tag(\'[code]\', \'[/code]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/code.png" alt="url" title="code" border="0"/></a> | <a href="javascript:tag(\'[img]\', \'[/img]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/img.gif" alt="img" title="images" border="0"/></a> <a href="javascript:tag(\'[hide]\', \'[/hide]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/hide.gif" alt="cod" title="Hide untuk member saja" border="0"/></a> <a href="javascript:tag(\'[url=]\', \'[/url]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/link.gif" alt="url" title="' . self::$lng['tag_link'] . '" border="0"/></a> <a href="javascript:tag(\'[youtube]\', \'[/youtube]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/youtube.png" alt="url" title="youtube video" border="0"/></a> <a href="javascript:tag(\'[spoiler]\', \'[/spoiler]\', \'\')"><img src="' . self::$system_set['homeurl'] . '/images/bb/sp.png" alt="b" title="Spoiler" border="0"/></a> <span class="bb_opt" style="display: inline-block; cursor:pointer"> <img src="' . self::$system_set['homeurl'] . '/images/bb/color.gif" onmouseover="this.src=\'' . self::$system_set['homeurl'] . '/images/bb/color_on.gif\'" onmouseout="this.src=\'' . self::$system_set['homeurl'] . '/images/bb/color.gif\'" alt="color" title="' . self::$lng['color_bg'] . '" border="0"/> <div class="bb_hide bb_color">' . $font_color . '</div></span> <span class="bb_opt" style="display: inline-block; cursor:pointer"> <img src="' . self::$system_set['homeurl'] . '/images/bb/color_bg.gif" onmouseover="this.src=\'' . self::$system_set['homeurl'] . '/images/bb/color_bg_on.gif\'" onmouseout="this.src=\'' . self::$system_set['homeurl'] . '/images/bb/color_bg.gif\'" alt="color" title="' . self::$lng['color_text'] . '" border="0"/> <div class="bb_hide bb_color">' . $bg_color . '</div></span>'; if (self::$user_id) { $out .= ' <span class="bb_opt" style="display: inline-block; cursor:pointer"><img src="' . self::$system_set['homeurl'] . '/images/bb/smileys.gif" alt="sm" title="' . self::$lng['smileys'] . '" border="0"/> <div class="bb_hide">' . $bb_smileys . '</div></span>'; } $out .= ' <span class="bb_opt" style="display: inline-block; cursor:pointer"> <a href="' . self::$system_set['homeurl'] . '/pages/img.php"> <img src="' . self::$system_set['homeurl'] . '/images/bb/im.gif" alt="url" title="' . self::$lng['tag_link'] . '" border="0"/></a> <div class="bb_hide">To insert an image in a message, you necessary upload it to our server, to do this, use <a href="' . self::$system_set['homeurl'] . '/pages/upload_img.php" class="green"><b>image uploader</b></a>. After uploading image you get a code image, with which will be able to insert it into the message</div></span>'; return $out . ''; }
private function news() { global $lng; if ($this->settings['view'] > 0) { $reqtime = $this->settings['days'] ? time() - $this->settings['days'] * 86400 : 0; $req = mysql_query("SELECT * FROM `news` WHERE `time` > '{$reqtime}' ORDER BY `time` DESC LIMIT " . $this->settings['quantity']); if (mysql_num_rows($req) > 0) { $i = 0; $news = ''; while (($res = mysql_fetch_array($req)) !== false) { $text = $res['text']; // Если текст больше заданного предела, обрезаем if (mb_strlen($text) > $this->settings['size']) { $text = mb_substr($text, 0, $this->settings['size']); $text = htmlentities($text, ENT_QUOTES, 'UTF-8'); $text .= ' <a href="news/index.php">' . $lng['next'] . '...</a>'; } else { $text = htmlentities($text, ENT_QUOTES, 'UTF-8'); } // Если включены переносы, то обрабатываем if ($this->settings['breaks']) { $text = str_replace("\r\n", "<br/>", $text); } // Обрабатываем тэги if ($this->settings['tags']) { $text = bbcode::tags($text); } else { $text = bbcode::notags($text); } // Обрабатываем смайлы if ($this->settings['smileys']) { $text = functions::smileys($text); } // Определяем режим просмотра заголовка - текста $news .= '<div class="news"><div class ="textx">'; switch ($this->settings['view']) { case 2: $news .= '<a href="news/index.php">' . $res['name'] . '</a>'; break; case 3: $news .= $text; break; default: $news .= '<b>' . $res['name'] . '</b><br />' . $text; } // Ссылка на каменты if (!empty($res['kom']) && $this->settings['view'] != 2 && $this->settings['kom'] == 1) { $mes = mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 'm' AND `refid` = '" . $res['kom'] . "'"); $komm = mysql_result($mes, 0) - 1; if ($komm >= 0) { $news .= '<br /><a href="../forum/?id=' . $res['kom'] . '">' . $lng['discuss'] . '</a> (' . $komm . ')'; } } $news .= '</div></div>'; ++$i; } return $news; } else { return false; } } }
echo '<p><a href="index.php">' . $lng['admin_panel'] . '</a></p>'; require_once '../incfiles/end.php'; exit; } $name_cat = $lng_smileys[$do] ? $lng_smileys[$do] : $do; echo '<div class="mainblok"><div class="phdr"><a href="index.php?act=smileys"><b>' . $lng['smileys'] . '</b></a> | ' . htmlspecialchars($name_cat) . '</div>'; echo '<div class="omenu"><a href="?act=smileys&do=' . $do . '&mod=upload">Upload</a></div>'; $dir = glob($c . '*.{gif,jpg,png}', GLOB_BRACE); $total = count($dir); for ($i = $start; $i < $page * $kmess && $i < $total; $i++) { $smiley = explode('/', $dir[$i]); $smiley = array_pop($smiley); $format = functions::format($smiley); $smiley_code = str_replace('.' . $format, '', strtolower($smiley)); echo $i % 2 ? '<div class="menu">' : '<div class="menu">'; echo functions::smileys(':' . $smiley_code . '') . ' :' . $smiley_code . '<br /> <a href="?act=smileys&mod=unlink&do=' . $do . '&smiley=' . $smiley . '">' . $lng['delete'] . '</a> | <a href="?act=smileys&mod=rename&do=' . $do . '&smiley=' . $smiley . '">' . $lng['edit'] . '</a>'; echo '</div>'; } echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div></div>'; if ($total > $kmess) { echo '<div class="topmenu"><form action="?act=smileys&do=' . $do . '&mod=show_cat" method="post"> ' . functions::display_pagination('?act=smileys&do=' . $do . '&mod=show_cat&', $start, $total, $kmess) . ' <input type="text" name="page" size="2"/><input type="submit" value="Go!"/></form></div>'; } break; case 'upload': $c = '../images/smileys/user/' . $do . '/'; if (!is_dir($c)) { echo functions::display_error($lng['error_wrong_data']);
if ($id) { $query = mysql_query("SELECT `animes`.*, `animes_cat`.`name` as `catname`, `animes_cat`.`id` as `catid` FROM `animes` LEFT JOIN `animes_cat` ON `animes`.`refid`=`animes_cat`.`id` WHERE `animes`.`id`='{$id}'" . ($rights < 7 ? " AND `animes`.`time`<='" . time() . "'" : "") . " LIMIT 1;"); if (mysql_num_rows($query)) { //Показываем новость $res1 = mysql_fetch_assoc($query); $textl = 'Blogs | ' . htmlentities($res1['name'], ENT_QUOTES, 'UTF-8'); require_once '../incfiles/head.php'; echo '<div class="phdr"><h3>' . htmlentities($res1['name'], ENT_QUOTES, 'UTF-8') . '</h3></div>'; echo '<div class="list1">'; //Выводим картинку if (file_exists('../files/blogs/anime_icon_' . $id . '.jpg') !== false) { echo '<center><img style="float: center; margin: 5px 6px 2px 2px; border: 0px;" src="../files/blogs/anime_icon_' . $id . '.jpg" alt=""width="176" height="144"/> <br>'; } $text = functions::checkout($res1['text'], 1, 1); if ($set_user['smileys']) { $text = functions::smileys($text); } echo '<div class="textx">'; echo $text; echo '</div>'; echo '<div style="clear:both;"></div></div>'; //Обрабатываем голосование if (isset($_POST['plus_x']) || isset($_POST['plus_y'])) { if ($res1['user_id'] == $user_id) { $_SESSION['error'] = '<div class="list1 red">Anda tidak boleh menilai blog sendiri!</div>'; } else { $plus = mysql_result(mysql_query("SELECT COUNT(*) FROM `animes_rating` WHERE `news`='{$id}' AND `user_id`='{$user_id}' LIMIT 1;"), 0); if ($plus) { $_SESSION['error'] = '<div class="list1 red">Penilaian sudah diterima!</div>'; } else { mysql_query("INSERT INTO `animes_rating` SET\n `news`='{$id}',\n `user_id`='{$user_id}', `golos`='1';");
return functions::display_date($var[1]); } if ($total > $kmess) { $out .= '<div class="topmenu">' . functions::display_pagination('index.php?act=systems&', $start, $total, $kmess) . '</div>'; } $req = mysql_query("SELECT * FROM `cms_mail` WHERE `from_id`='{$user_id}' AND `sys`='1' AND `delete`!='{$user_id}' ORDER BY `time` DESC LIMIT " . $start . "," . $kmess); $mass_read = array(); for ($i = 0; ($row = mysql_fetch_assoc($req)) !== FALSE; ++$i) { $out .= $i % 2 ? '<div class="list1">' : '<div class="list2">'; if ($row['read'] == 0 && $row['from_id'] == $user_id) { $mass_read[] = $row['id']; } $post = $row['text']; $post = functions::checkout($post, 1, 1); if ($set_user['smileys']) { $post = functions::smileys($post); } $out .= '<strong>' . functions::checkout($row['them']) . '</strong> (' . functions::display_date($row['time']) . ')<br />'; $post = preg_replace_callback("/{TIME=(.+?)}/usi", 'time_parce', $post); //print_r($outmass); $out .= $post; $out .= '<div class="sub"><a href="index.php?act=delete&id=' . $row['id'] . '">' . $lng['delete'] . '</a></div>'; $out .= '</div>'; } //Ставим метку о прочтении if ($mass_read) { $result = implode(',', $mass_read); mysql_query("UPDATE `cms_mail` SET `read`='1' WHERE `from_id`='{$user_id}' AND `sys`='1' AND `id` IN (" . $result . ")"); } } else { $out .= '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>';
//////////////////////////////////////////////////////////////////////////////// // JohnCMS Mobile Content Management System // // Project site: http://johncms.com // // Support site: http://gazenwagen.com // //////////////////////////////////////////////////////////////////////////////// // Lead Developer: Oleg Kasyanov (AlkatraZ) alkatraz@gazenwagen.com // // Development Team: Eugene Ryabinin (john77) john77@gazenwagen.com // // Dmitry Liseenko (FlySelf) flyself@johncms.com // //////////////////////////////////////////////////////////////////////////////// */ defined('_IN_JOHNCMS') or die('Error: restricted access'); /* ----------------------------------------------------------------- Подробная информация, контактные данные ----------------------------------------------------------------- */ $textl = htmlspecialchars($user['name']) . ': ' . $lng['information']; require '../incfiles/head.php'; echo '<div class="phdr"><a href="profile.php?user='******'id'] . '"><b>' . $lng['profile'] . '</b></a> | ' . $lng['information'] . '</div>'; if ($user['id'] == $user_id || $rights >= 7 && $rights > $user['rights']) { echo '<div class="topmenu"><a href="profile.php?act=edit&user='******'id'] . '">' . $lng['edit'] . '</a></div>'; } echo '<div class="user"><p>' . functions::display_user($user, array('iphide' => 1)) . '</p></div>' . '<div class="list2"><p>' . '<h3><img src="../images/contacts.png" width="16" height="16" class="left" /> ' . $lng_profile['personal_data'] . '</h3>' . '<ul>'; if (file_exists('../files/users/photo/' . $user['id'] . '_small.jpg')) { echo '<a href="../files/users/photo/' . $user['id'] . '.jpg"><img src="../files/users/photo/' . $user['id'] . '_small.jpg" alt="' . $user['name'] . '" border="0" /></a>'; } echo '<li><span class="gray">' . $lng_profile['name'] . ':</span> ' . (empty($user['imname']) ? '' : $user['imname']) . '</li>' . '<li><span class="gray">' . $lng_profile['birt'] . ':</span> ' . (empty($user['dayb']) ? '' : sprintf("%02d", $user['dayb']) . '.' . sprintf("%02d", $user['monthb']) . '.' . $user['yearofbirth']) . '</li>' . '<li><span class="gray">' . $lng_profile['city'] . ':</span> ' . (empty($user['live']) ? '' : $user['live']) . '</li>' . '<li><span class="gray">' . $lng_profile['about'] . ':</span> ' . (empty($user['about']) ? '' : '<br />' . functions::smileys(bbcode::tags($user['about']))) . '</li>' . '</ul></p><p>' . '<h3><img src="../images/mail.png" width="16" height="16" class="left" /> ' . $lng_profile['communication'] . '</h3><ul>' . '<li><span class="gray">' . $lng_profile['phone_number'] . ':</span> ' . (empty($user['mibile']) ? '' : $user['mibile']) . '</li>' . '<li><span class="gray">E-mail:</span> '; if (!empty($user['mail']) && $user['mailvis'] || $rights >= 7 || $user['id'] == $user_id) { echo $user['mail'] . ($user['mailvis'] ? '' : '<span class="gray"> [' . $lng_profile['hidden'] . ']</span>'); } echo '</li>' . '<li><span class="gray">ICQ:</span> ' . (empty($user['icq']) ? '' : $user['icq']) . '</li>' . '<li><span class="gray">Skype:</span> ' . (empty($user['skype']) ? '' : $user['skype']) . '</li>' . '<li><span class="gray">Jabber:</span> ' . (empty($user['jabber']) ? '' : $user['jabber']) . '</li>' . '<li><span class="gray">' . $lng_profile['site'] . ':</span> ' . (empty($user['www']) ? '' : bbcode::tags($user['www'])) . '</li>' . '</ul></p></div>' . '<div class="phdr"><a href="profile.php?user='******'id'] . '">' . $lng['back'] . '</a></div>';
function __construct($arg = array()) { global $mod, $start, $kmess; $this->comments_table = $arg['comments_table']; $this->object_table = !empty($arg['object_table']) ? $arg['object_table'] : false; if (!empty($arg['sub_id_name']) && !empty($arg['sub_id'])) { $this->sub_id = $arg['sub_id']; $this->url = $arg['script'] . '&' . $arg['sub_id_name'] . '=' . $arg['sub_id']; } else { //TODO: Доработать на режим без sub_id $this->url = $arg['script']; } $this->item = isset($_GET['item']) ? abs(intval($_GET['item'])) : false; // Получаем данные пользователя if (core::$user_id) { $this->user_id = core::$user_id; $this->rights = core::$user_rights; $this->ban = core::$user_ban; } // Назначение пользовательских прав if (isset($arg['owner'])) { $this->owner = $arg['owner']; if (core::$user_id && $arg['owner'] == core::$user_id && !$this->ban) { $this->access_delete = isset($arg['owner_delete']) ? $arg['owner_delete'] : false; $this->access_reply = isset($arg['owner_reply']) ? $arg['owner_reply'] : false; $this->access_edit = isset($arg['owner_edit']) ? $arg['owner_edit'] : false; } } // Открываем доступ для Администрации if ($this->rights >= $this->access_level) { $this->access_reply = true; $this->access_edit = true; $this->access_delete = true; } switch ($mod) { case 'reply': /* ----------------------------------------------------------------- Отвечаем на комментарий ----------------------------------------------------------------- */ if ($this->item && $this->access_reply && !$this->ban) { echo '<div class="phdr"><a href="' . $this->url . '"><b>' . $arg['title'] . '</b></a> | ' . core::$lng['reply'] . '</div>'; $req = mysql_query("SELECT * FROM `" . $this->comments_table . "` WHERE `id` = '" . $this->item . "' AND `sub_id` = '" . $this->sub_id . "' LIMIT 1"); if (mysql_num_rows($req)) { $res = mysql_fetch_assoc($req); $attributes = unserialize($res['attributes']); if (!empty($res['reply']) && $attributes['reply_rights'] > $this->rights) { echo functions::display_error(core::$lng['error_reply_rights'], '<a href="' . $this->url . '">' . core::$lng['back'] . '</a>'); } elseif (isset($_POST['submit'])) { $message = $this->msg_check(); if (empty($message['error'])) { $attributes['reply_id'] = $this->user_id; $attributes['reply_rights'] = $this->rights; $attributes['reply_name'] = core::$user_data['name']; $attributes['reply_time'] = time(); mysql_query("UPDATE `" . $this->comments_table . "` SET\n `reply` = '" . mysql_real_escape_string($message['text']) . "',\n `attributes` = '" . mysql_real_escape_string(serialize($attributes)) . "'\n WHERE `id` = '" . $this->item . "'\n "); header('Location: ' . str_replace('&', '&', $this->url)); } else { echo functions::display_error($message['error'], '<a href="' . $this->url . '&mod=reply&item=' . $this->item . '">' . core::$lng['back'] . '</a>'); } } else { $text = '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?user='******'user_id'] . '"><b>' . $attributes['author_name'] . '</b></a>' . ' (' . functions::display_date($res['time']) . ')<br />' . functions::checkout($res['text']); $reply = functions::checkout($res['reply']); echo $this->msg_form('&mod=reply&item=' . $this->item, $text, $reply) . '<div class="phdr"><a href="' . $this->url . '">' . core::$lng['back'] . '</a></div>'; } } else { echo functions::display_error(core::$lng['error_wrong_data'], '<a href="' . $this->url . '">' . core::$lng['back'] . '</a>'); } } break; case 'edit': /* ----------------------------------------------------------------- Редактируем комментарий ----------------------------------------------------------------- */ if ($this->item && $this->access_edit && !$this->ban) { echo '<div class="phdr"><a href="' . $this->url . '"><b>' . $arg['title'] . '</b></a> | ' . core::$lng['edit'] . '</div>'; $req = mysql_query("SELECT * FROM `" . $this->comments_table . "` WHERE `id` = '" . $this->item . "' AND `sub_id` = '" . $this->sub_id . "' LIMIT 1"); if (mysql_num_rows($req)) { $res = mysql_fetch_assoc($req); $attributes = unserialize($res['attributes']); $user = functions::get_user($res['user_id']); if ($user['rights'] > core::$user_rights) { echo functions::display_error(core::$lng['error_edit_rights'], '<a href="' . $this->url . '">' . core::$lng['back'] . '</a>'); } elseif (isset($_POST['submit'])) { $message = $this->msg_check(); if (empty($message['error'])) { $attributes['edit_id'] = $this->user_id; $attributes['edit_name'] = core::$user_data['name']; $attributes['edit_time'] = time(); if (isset($attributes['edit_count'])) { ++$attributes['edit_count']; } else { $attributes['edit_count'] = 1; } mysql_query("UPDATE `" . $this->comments_table . "` SET\n `text` = '" . mysql_real_escape_string($message['text']) . "',\n `attributes` = '" . mysql_real_escape_string(serialize($attributes)) . "'\n WHERE `id` = '" . $this->item . "'\n "); header('Location: ' . str_replace('&', '&', $this->url)); } else { echo functions::display_error($message['error'], '<a href="' . $this->url . '&mod=edit&item=' . $this->item . '">' . core::$lng['back'] . '</a>'); } } else { $author = '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?user='******'user_id'] . '"><b>' . $attributes['author_name'] . '</b></a>'; $author .= ' (' . functions::display_date($res['time']) . ')<br />'; $text = functions::checkout($res['text']); echo $this->msg_form('&mod=edit&item=' . $this->item, $author, $text); } } else { echo functions::display_error(core::$lng['error_wrong_data'], '<a href="' . $this->url . '">' . core::$lng['back'] . '</a>'); } echo '<div class="phdr"><a href="' . $this->url . '">' . core::$lng['back'] . '</a></div>'; } break; case 'del': /* ----------------------------------------------------------------- Удаляем комментарий ----------------------------------------------------------------- */ if ($this->item && $this->access_delete && !$this->ban) { if (isset($_GET['yes'])) { //TODO: Продумать проверку на удаление постов администрации $req = mysql_query("SELECT * FROM `" . $this->comments_table . "` WHERE `id` = '" . $this->item . "' AND `sub_id` = '" . $this->sub_id . "' LIMIT 1"); if (mysql_num_rows($req)) { $res = mysql_fetch_assoc($req); if (isset($_GET['all'])) { // Удаляем все комментарии выбранного пользователя $count = mysql_result(mysql_query("SELECT COUNT(*) FROM `" . $this->comments_table . "` WHERE `sub_id` = '" . $this->sub_id . "' AND `user_id` = '" . $res['user_id'] . "'"), 0); mysql_query("DELETE FROM `" . $this->comments_table . "` WHERE `sub_id` = '" . $this->sub_id . "' AND `user_id` = '" . $res['user_id'] . "'"); } else { // Удаляем отдельный комментарий $count = 1; mysql_query("DELETE FROM `" . $this->comments_table . "` WHERE `id` = '" . $this->item . "'"); } // Вычитаем баллы из статистики пользователя $req_u = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $res['user_id'] . "'"); if (mysql_num_rows($req_u)) { $res_u = mysql_fetch_assoc($req_u); $count = $res_u['komm'] > $count ? $res_u['komm'] - $count : 0; mysql_query("UPDATE `users` SET `komm` = '{$count}' WHERE `id` = '" . $res['user_id'] . "'"); } // Обновляем счетчик комментариев $this->msg_total(1); } header('Location: ' . str_replace('&', '&', $this->url)); } else { echo '<div class="phdr"><a href="' . $this->url . '"><b>' . $arg['title'] . '</b></a> | ' . core::$lng['delete'] . '</div>' . '<div class="rmenu"><p>' . core::$lng['delete_confirmation'] . '<br />' . '<a href="' . $this->url . '&mod=del&item=' . $this->item . '&yes">' . core::$lng['delete'] . '</a> | ' . '<a href="' . $this->url . '">' . core::$lng['cancel'] . '</a><br />' . '<div class="sub">' . core::$lng['clear_user_msg'] . '<br />' . '<span class="red"><a href="' . $this->url . '&mod=del&item=' . $this->item . '&yes&all">' . core::$lng['clear'] . '</a></span>' . '</div></p></div>' . '<div class="phdr"><a href="' . $this->url . '">' . core::$lng['back'] . '</a></div>'; } } break; default: if (!empty($arg['context_top'])) { echo $arg['context_top']; } /* ----------------------------------------------------------------- Добавляем новый комментарий ----------------------------------------------------------------- */ if (!$this->ban && !functions::is_ignor($this->owner) && isset($_POST['submit']) && ($message = $this->msg_check(1)) !== false) { if (empty($message['error'])) { // Записываем комментарий в базу $this->add_comment($message['text']); $this->total = $this->msg_total(1); $_SESSION['code'] = $message['code']; } else { // Показываем ошибки, если есть echo functions::display_error($message['error']); $this->total = $this->msg_total(); } } else { $this->total = $this->msg_total(); } /* ----------------------------------------------------------------- Показываем форму ввода ----------------------------------------------------------------- */ if (!$this->ban && !functions::is_ignor($this->owner)) { echo $this->msg_form(); } /* ----------------------------------------------------------------- Показываем список комментариев ----------------------------------------------------------------- */ echo '<div class="phdr"><b>' . $arg['title'] . '</b></div>'; if ($this->total > $kmess) { echo '<div class="topmenu">' . functions::display_pagination($this->url . '&', $start, $this->total, $kmess) . '</div>'; } if ($this->total) { $req = mysql_query("SELECT `" . $this->comments_table . "`.*, `" . $this->comments_table . "`.`id` AS `subid`, `users`.`rights`, `users`.`lastdate`, `users`.`sex`, `users`.`status`, `users`.`datereg`, `users`.`id`\n FROM `" . $this->comments_table . "` LEFT JOIN `users` ON `" . $this->comments_table . "`.`user_id` = `users`.`id`\n WHERE `sub_id` = '" . $this->sub_id . "' ORDER BY `subid` DESC LIMIT {$start}, {$kmess}"); $i = 0; while (($res = mysql_fetch_assoc($req)) !== false) { $attributes = unserialize($res['attributes']); $res['name'] = $attributes['author_name']; $res['ip'] = $attributes['author_ip']; $res['ip_via_proxy'] = isset($attributes['author_ip_via_proxy']) ? $attributes['author_ip_via_proxy'] : 0; $res['browser'] = $attributes['author_browser']; echo $i % 2 ? '<div class="list2">' : '<div class="list1">'; $menu = array($this->access_reply ? '<a href="' . $this->url . '&mod=reply&item=' . $res['subid'] . '">' . core::$lng['reply'] . '</a>' : '', $this->access_edit ? '<a href="' . $this->url . '&mod=edit&item=' . $res['subid'] . '">' . core::$lng['edit'] . '</a>' : '', $this->access_delete ? '<a href="' . $this->url . '&mod=del&item=' . $res['subid'] . '">' . core::$lng['delete'] . '</a>' : ''); $text = functions::checkout($res['text'], 1, 1); if (core::$user_set['smileys']) { $text = functions::smileys($text, $res['rights'] >= 1 ? 1 : 0); } if (isset($attributes['edit_count'])) { $text .= '<br /><span class="gray"><small>' . core::$lng['edited'] . ': <b>' . $attributes['edit_name'] . '</b>' . ' (' . functions::display_date($attributes['edit_time']) . ') <b>' . '[' . $attributes['edit_count'] . ']</b></small></span>'; } if (!empty($res['reply'])) { $reply = functions::checkout($res['reply'], 1, 1); if (core::$user_set['smileys']) { $reply = functions::smileys($reply, $attributes['reply_rights'] >= 1 ? 1 : 0); } $text .= '<div class="' . ($attributes['reply_rights'] ? '' : 'g') . 'reply"><small>' . '<a href="' . core::$system_set['homeurl'] . '/users/profile.php?user='******'reply_id'] . '"><b>' . $attributes['reply_name'] . '</b></a>' . ' (' . functions::display_date($attributes['reply_time']) . ')</small><br/>' . $reply . '</div>'; } $user_arg = array('header' => ' <span class="gray">(' . functions::display_date($res['time']) . ')</span>', 'body' => $text, 'sub' => functions::display_menu($menu), 'iphide' => core::$user_rights ? false : true); echo functions::display_user($res, $user_arg); echo '</div>'; ++$i; } } else { echo '<div class="menu"><p>' . core::$lng['list_empty'] . '</p></div>'; } echo '<div class="phdr">' . core::$lng['total'] . ': ' . $this->total . '</div>'; if ($this->total > $kmess) { echo '<div class="topmenu">' . functions::display_pagination($this->url . '&', $start, $this->total, $kmess) . '</div>' . '<p><form action="' . $this->url . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . core::$lng['to_page'] . ' >>"/>' . '</form></p>'; } if (!empty($arg['context_bottom'])) { echo $arg['context_bottom']; } } }
for ($i = 0; $row = mysql_fetch_assoc($req); ++$i) { $count_message = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_mail`\n WHERE `user_id`='{$row['id']}'\n AND `from_id`='{$user_id}'\n AND `delete`!='{$user_id}'\n AND `sys`!='1'\n "), 0); $last_msg = mysql_fetch_assoc(mysql_query("SELECT *\n FROM `cms_mail`\n WHERE `from_id`='{$user_id}'\n AND `user_id` = '{$row['id']}'\n AND `delete` != '{$user_id}'\n ORDER BY `id` DESC\n LIMIT 1")); if (mb_strlen($last_msg['text']) > 500) { $text = mb_substr($last_msg['text'], 0, 500); $text = functions::checkout($text, 1, 1); if ($set_user['smileys']) { $text = functions::smileys($text, $res['rights'] ? 1 : 0); } $text = bbcode::notags($text); $text .= '...<a href="index.php?act=write&id=' . $row['id'] . '">' . $lng['continue'] . ' >></a>'; } else { // Или, обрабатываем тэги и выводим весь текст $text = functions::checkout($last_msg['text'], 1, 1); if ($set_user['smileys']) { $text = functions::smileys($text, $res['rights'] ? 1 : 0); } } $arg = array('header' => '<span class="gray">(' . functions::display_date($last_msg['time']) . ')</span>', 'body' => '<div style="font-size: small">' . $text . '</div>', 'sub' => '<p><a href="index.php?act=write&id=' . $row['id'] . '"><b>' . $lng_mail['correspondence'] . '</b></a> (' . $count_message . ') | <a href="index.php?act=ignor&id=' . $row['id'] . '&add">Игнор</a> | <a href="index.php?act=deluser&id=' . $row['id'] . '">' . $lng['delete'] . '</a></p>', 'iphide' => 1); if (!$last_msg['read']) { echo '<div class="gmenu">'; } else { echo $i % 2 ? '<div class="list1">' : '<div class="list2">'; } echo functions::display_user($row, $arg); echo '</div>'; } } else { echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>'; } echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>';
</div>'; } echo '<div class="phdr"><h3>Komentar</h3></div>'; $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `animes_comments` WHERE `refid`='{$id}';"), 0); if ($total) { if ($total > $kmess) { echo '<div class="topmenu">' . functions::display_pagination('index.php?act=comments&id=' . $id . '&', $start, $total, $kmess) . '</div>'; } $i = 1; $req = mysql_query("SELECT `animes_comments`.*, `animes_comments`.`time` as `mtime`, `animes_comments`.`id` as `mid`, `users`.* FROM `animes_comments` LEFT JOIN `users` ON `animes_comments`.`user_id`=`users`.`id` WHERE `animes_comments`.`refid`='{$id}' ORDER BY `animes_comments`.`time` DESC LIMIT " . $start . "," . $kmess); while (($row = mysql_fetch_assoc($req)) !== false) { echo $i % 2 ? '<div class="list1">' : '<div class="list2">'; $post = $row['text']; $post = functions::checkout($post, 1, 1); if ($set_user['smileys']) { $post = functions::smileys($post, $row['rights'] >= 1 ? 1 : 0); } if ($row['reply']) { $post .= '<div class="reply">' . functions::checkout($row['reply'], 1, 1) . '</div>'; } if ($rights >= 7) { $subtext = '<a href="index.php?act=comments&mod=replay&id=' . $id . '&com=' . $row['mid'] . '">Jawab</a> | <a href="index.php?act=comments&mod=delete&id=' . $id . '&com=' . $row['mid'] . '">Hapus</a>'; } else { $subtext = ''; } $text = ' <span class="gray">(' . functions::display_date($row['mtime']) . ')</span>'; $arg = array('header' => $text, 'body' => $post, 'sub' => $subtext); echo functions::display_user($row, $arg); echo '</div>'; ++$i; }
Показываем выбранную картинку ----------------------------------------------------------------- */ unset($_SESSION['ref']); $req_a = mysql_query("SELECT * FROM `cms_album_cat` WHERE `id` = '" . $res_obj['album_id'] . "'"); $res_a = mysql_fetch_assoc($req_a); if ($res_a['access'] == 1 && $owner['id'] != $user_id && $rights < 6 || $res_a['access'] == 2 && (!isset($_SESSION['ap']) || $_SESSION['ap'] != $res_a['password']) && $owner['id'] != $user_id) { // Если доступ закрыт require '../incfiles/head.php'; echo functions::display_error($lng['access_forbidden']) . '<div class="phdr"><a href="album.php?act=list&user='******'id'] . '">' . $lng_profile['album_list'] . '</a></div>'; require '../incfiles/end.php'; exit; } $context_top = '<div class="phdr"><a href="album.php"><b>' . $lng['photo_albums'] . '</b></a> | ' . '<a href="album.php?act=list&user='******'id'] . '">' . $lng['personal_2'] . '</a></div>' . '<div class="menu"><a href="album.php?act=show&al=' . $res_obj['album_id'] . '&img=' . $img . '&user='******'id'] . '&view"><img src="../files/users/album/' . $owner['id'] . '/' . $res_obj['tmb_name'] . '" /></a>'; if (!empty($res_obj['description'])) { $context_top .= '<div class="gray">' . functions::smileys(functions::checkout($res_obj['description'], 1)) . '</div>'; } $context_top .= '<div class="sub">' . '<a href="profile.php?user='******'id'] . '"><b>' . $owner['name'] . '</b></a> | ' . '<a href="album.php?act=show&al=' . $res_a['id'] . '&user='******'id'] . '">' . functions::checkout($res_a['name']) . '</a>'; if ($res_obj['access'] == 4 || $rights >= 7) { $context_top .= vote_photo($res_obj) . '<div class="gray">' . $lng['count_views'] . ': ' . $res_obj['views'] . ', ' . $lng['count_downloads'] . ': ' . $res_obj['downloads'] . '</div>' . '<a href="album.php?act=image_download&img=' . $res_obj['id'] . '">' . $lng['download'] . '</a>'; } $context_top .= '</div></div>'; /* ----------------------------------------------------------------- Параметры комментариев ----------------------------------------------------------------- */ $arg = array('comments_table' => 'cms_album_comments', 'object_table' => 'cms_album_files', 'script' => 'album.php?act=comments', 'sub_id_name' => 'img', 'sub_id' => $img, 'owner' => $owner['id'], 'owner_delete' => true, 'owner_reply' => true, 'owner_edit' => false, 'title' => $lng['comments'], 'context_top' => $context_top, 'context_bottom' => ''); /* ----------------------------------------------------------------- Ставим метку прочтения
} } echo '<table width="100%"><tr><td width="22" valign="top"><img src="' . $set['homeurl'] . '/images/k_' . $images . '.gif"/></td><td>' . '<b>' . $lng['karma'] . ' (' . $karma . ')</b>' . '<div class="sub">' . '<span class="green">' . $lng['vote_for'] . ' (' . $user['karma_plus'] . ')</span> | ' . '<span class="red">' . $lng['vote_against'] . ' (' . $user['karma_minus'] . ')</span>'; echo '</div></td></tr></table></div>'; $total = mysql_result(mysql_query("SELECT COUNT(*) FROM `karma_users` WHERE `karma_user` = '" . $user['id'] . "'" . ($type == 2 ? "" : " AND `type` = '{$type}'")), 0); if ($total) { $req = mysql_query("SELECT * FROM `karma_users` WHERE `karma_user` = '" . $user['id'] . "'" . ($type == 2 ? "" : " AND `type` = '{$type}'") . " ORDER BY `time` DESC LIMIT {$start}, {$kmess}"); while ($res = mysql_fetch_assoc($req)) { echo $i % 2 ? '<div class="list2">' : '<div class="list1">'; echo $res['type'] ? '<span class="green">+' . $res['points'] . '</span> ' : '<span class="red">-' . $res['points'] . '</span> '; echo $user_id == $res['user_id'] || !$res['user_id'] ? '<b>' . $res['name'] . '</b>' : '<a href="profile.php?user='******'user_id'] . '"><b>' . $res['name'] . '</b></a>'; echo ' <span class="gray">(' . functions::display_date($res['time']) . ')</span>'; if ($rights == 9) { echo ' <span class="red"><a href="profile.php?act=karma&mod=delete&user='******'id'] . '&id=' . $res['id'] . '&type=' . $type . '">[X]</a></span>'; } if (!empty($res['text'])) { echo '<br />' . functions::smileys(functions::checkout($res['text'])); } echo '</div>'; ++$i; } } else { echo '<div class="menu"><p>' . $lng['list_empty'] . '</p></div>'; } echo '<div class="phdr">' . $lng['total'] . ': ' . $total . '</div>'; if ($total > $kmess) { echo '<div class="topmenu">' . functions::display_pagination('profile.php?act=karma&user='******'id'] . '&type=' . $type . '&', $start, $total, $kmess) . '</div>' . '<p><form action="profile.php?act=karma&user='******'id'] . '&type=' . $type . '" method="post">' . '<input type="text" name="page" size="2"/>' . '<input type="submit" value="' . $lng['to_page'] . ' >>"/></form></p>'; } echo '<p>' . ($rights == 9 ? '<a href="profile.php?act=karma&user='******'id'] . '&mod=clean">' . $lng_karma['reset'] . '</a><br />' : '') . '<a href="profile.php?user='******'id'] . '">' . $lng['profile'] . '</a></p>'; } }