function main($page) { /* Login */ if (!$this->member_id['name']) { return $this->lang['pay_need_login']; } if (intval($page) <= 0) { $page = 1; } $tpl = $this->load("history"); $log = ""; $tpl_log = $this->T_preg_match($tpl, '~\\[history\\](.*?)\\[/history\\]~is'); $tpl_log_null = $this->T_preg_match($tpl, '~\\[not_history\\](.*?)\\[/not_history\\]~is'); $tpl_log_date = $this->T_preg_match($tpl_log, '~\\{date=(.*?)\\}~is'); $this->db_where(array("history_user_name = '{s}' " => $this->member_id['name'])); $history = $this->db_get_log($page, $this->config['paging']); $num_history = $this->db_get_log_num(); foreach ($history as $history_id => $history_value) { $time_log_theme = $tpl_log; $time_log_theme = str_replace("{date=" . $tpl_log_date . "}", langdate($tpl_log_date, $history_value['history_date']), $time_log_theme); $time_log_theme = str_replace("{comment}", $history_value['history_text'], $time_log_theme); $time_log_theme = str_replace("{balance}", $history_value['history_balance'] . " " . $this->pay_api->bf_declOfNum($history_value['history_balance']), $time_log_theme); $time_log_theme = str_replace("{summa}", $history_value['history_plus'] ? "<font color=\"green\">+" . $history_value['history_plus'] . " " . $history_value['history_currency'] . "</font>" : "<font color=\"red\">-" . $history_value['history_minus'] . " " . $history_value['history_currency'] . "</font>", $time_log_theme); $log .= $time_log_theme; } /* Paging */ if ($num_history > $this->config['paging']) { $tpl_log_page = $this->T_preg_match($tpl, '~\\[paging\\](.*?)\\[/paging\\]~is'); $tpl_log_page_link = $this->T_preg_match($tpl, '~\\[page_link\\](.*?)\\[/page_link\\]~is'); $tpl_log_page_this = $this->T_preg_match($tpl, '~\\[page_this\\](.*?)\\[/page_this\\]~is'); $tpl_log_page = preg_replace("'\\[page_link\\].*?\\[/page_link\\]'si", $this->pay_api->bf_paging($num_history, $page, $this->config_dle['http_home_url'] . $this->config['page'] . ".html/log/main/{p}", $tpl_log_page_link, $tpl_log_page_this), $tpl_log_page); $tpl_log_page = preg_replace("'\\[page_this\\].*?\\[/page_this\\]'si", "", $tpl_log_page); $this->set_element_block("paging", $tpl_log_page); } else { $this->set_element_block("paging", ""); } /* LOG NULL */ if ($log) { $this->set_element_block("not_history", ""); } else { $this->set_element_block("not_history", $tpl_log_null); } $this->set_element_block("history", $log); $this->set_element("{content}", $tpl); return $this->load("cabinet"); }
function select($public_admin, $server_time) { global $tpl, $db, $user_info, $pid; $user_id = $user_info['user_id']; $this->template; foreach ($this->query as $row_wall) { $tpl->set('{rec-id}', $row_wall['id']); //КНопка Показать полностью.. $expBR = explode('<br />', $row_wall['text']); $textLength = count($expBR); $strTXT = strlen($row_wall['text']); if ($textLength > 9 or $strTXT > 600) { $row_wall['text'] = '<div class="wall_strlen" id="hide_wall_rec' . $row_wall['id'] . '">' . $row_wall['text'] . '</div><div class="wall_strlen_full" onMouseDown="wall.FullText(' . $row_wall['id'] . ', this.id)" id="hide_wall_rec_lnk' . $row_wall['id'] . '">Показать полностью..</div>'; } //Прикрипленные файлы if ($row_wall['attach']) { $attach_arr = explode('||', $row_wall['attach']); $cnt_attach = 1; $cnt_attach_link = 1; $jid = 0; $attach_result = ''; foreach ($attach_arr as $attach_file) { $attach_type = explode('|', $attach_file); //Фото со стены сообщества if ($row_wall['tell_uid']) { $globParId = $row_wall['tell_uid']; } else { $globParId = $row_wall['public_id']; } if ($attach_type[0] == 'photo' and file_exists(ROOT_DIR . "/uploads/groups/{$globParId}/photos/c_{$attach_type[1]}")) { if ($cnt_attach < 2) { $attach_result .= "<div class=\"profile_wall_attach_photo cursor_pointer page_num{$row_wall['id']}\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$globParId}', '{$attach_type[1]}', '{$cnt_attach}')\"><img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/groups/{$globParId}/photos/{$attach_type[1]}\" align=\"left\" /></div>"; } else { $attach_result .= "<img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/groups/{$globParId}/photos/c_{$attach_type[1]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$globParId}', '{$attach_type[1]}', '{$cnt_attach}')\" class=\"cursor_pointer page_num{$row_wall['id']}\" />"; } $cnt_attach++; $resLinkTitle = ''; //Фото со стены юзера } elseif ($attach_type[0] == 'photo_u') { $attauthor_user_id = $row_wall['tell_uid']; if ($attach_type[1] == 'attach' and file_exists(ROOT_DIR . "/uploads/attach/{$attauthor_user_id}/c_{$attach_type[2]}")) { if ($cnt_attach < 2) { $attach_result .= "<div class=\"profile_wall_attach_photo cursor_pointer page_num{$row_wall['id']}\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$attauthor_user_id}', '{$attach_type[1]}', '{$cnt_attach}', 'photo_u')\"><img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/attach/{$attauthor_user_id}/{$attach_type[2]}\" align=\"left\" /></div>"; } else { $attach_result .= "<img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/attach/{$attauthor_user_id}/c_{$attach_type[2]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '', '{$attach_type[1]}', '{$cnt_attach}')\" class=\"cursor_pointer page_num{$row_wall['id']}\" />"; } $cnt_attach++; } elseif (file_exists(ROOT_DIR . "/uploads/users/{$attauthor_user_id}/albums/{$attach_type[2]}/c_{$attach_type[1]}")) { if ($cnt_attach < 2) { $attach_result .= "<div class=\"profile_wall_attach_photo cursor_pointer page_num{$row_wall['id']}\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$attauthor_user_id}', '{$attach_type[1]}', '{$cnt_attach}', 'photo_u')\"><img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/users/{$attauthor_user_id}/albums/{$attach_type[2]}/{$attach_type[1]}\" align=\"left\" /></div>"; } else { $attach_result .= "<img id=\"photo_wall_{$row_wall['id']}_{$cnt_attach}\" src=\"/uploads/users/{$attauthor_user_id}/albums/{$attach_type[2]}/c_{$attach_type[1]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" onClick=\"groups.wall_photo_view('{$row_wall['id']}', '{$row_wall['tell_uid']}', '{$attach_type[1]}', '{$cnt_attach}')\" class=\"cursor_pointer page_num{$row_wall['id']}\" />"; } $cnt_attach++; } $resLinkTitle = ''; //Видео } elseif ($attach_type[0] == 'video' and file_exists(ROOT_DIR . "/uploads/videos/{$attach_type[3]}/{$attach_type[1]}")) { $attach_result .= "<div align=\"left\" style=\"margin-top:0px;margin-right:3px\"><a href=\"/video{$attach_type[3]}_{$attach_type[2]}\" onClick=\"videos.show({$attach_type[2]}, this.href, location.href); return false\"><img src=\"/uploads/videos/{$attach_type[3]}/{$attach_type[1]}\" style=\"margin-top:3px;margin-right:3px\" align=\"left\" /></a></div>"; $resLinkTitle = ''; //Музыка } elseif ($attach_type[0] == 'audio') { $audioId = intval($attach_type[1]); $audioInfo = $db->super_query("SELECT artist, name, url FROM `" . PREFIX . "_audio` WHERE aid = '" . $audioId . "'"); if ($audioInfo) { $jid++; $attach_result .= '<div class="audioForSize' . $row_wall['id'] . '" id="audioForSize"><div class="audio_onetrack audio_wall_onemus"><div class="audio_playic cursor_pointer fl_l" onClick="music.newStartPlay(\'' . $jid . '\', ' . $row_wall['id'] . ')" id="icPlay_' . $row_wall['id'] . $jid . '"></div><div id="music_' . $row_wall['id'] . $jid . '" data="' . $audioInfo['url'] . '" class="fl_l" style="margin-top:-1px"><a href="/?go=search&type=5&query=' . $audioInfo['artist'] . '&n=1" onClick="Page.Go(this.href); return false"><b>' . stripslashes($audioInfo['artist']) . '</b></a> – ' . stripslashes($audioInfo['name']) . '</div><div id="play_time' . $row_wall['id'] . $jid . '" class="color777 fl_r no_display" style="margin-top:2px;margin-right:5px">00:00</div><div class="player_mini_mbar fl_l no_display player_mini_mbar_wall" id="ppbarPro' . $row_wall['id'] . $jid . '"></div></div></div>'; } $resLinkTitle = ''; //Смайлик } elseif ($attach_type[0] == 'smile' and file_exists(ROOT_DIR . "/uploads/smiles/{$attach_type[1]}")) { $attach_result .= '<img src=\\"/uploads/smiles/' . $attach_type[1] . '\\" style="margin-right:5px" />'; $resLinkTitle = ''; //Если ссылка } elseif ($attach_type[0] == 'link' and preg_match('/http:\\/\\/(.*?)+$/i', $attach_type[1]) and $cnt_attach_link == 1) { $count_num = count($attach_type); $domain_url_name = explode('/', $attach_type[1]); $rdomain_url_name = str_replace('http://', '', $domain_url_name[2]); $attach_type[3] = stripslashes($attach_type[3]); $attach_type[3] = substr($attach_type[3], 0, 200); $attach_type[2] = stripslashes($attach_type[2]); $str_title = substr($attach_type[2], 0, 55); if (stripos($attach_type[4], '/uploads/attach/') === false) { $attach_type[4] = '{theme}/images/no_ava_groups_100.gif'; $no_img = false; } else { $no_img = true; } if (!$attach_type[3]) { $attach_type[3] = ''; } if ($no_img and $attach_type[2]) { if ($row_wall['tell_comm']) { $no_border_link = 'border:0px'; } $attach_result .= '<div style="margin-top:2px" class="clear"><div class="attach_link_block_ic fl_l" style="margin-top:4px;margin-left:0px"></div><div class="attach_link_block_te"><div class="fl_l">Ссылка: <a href="/away.php?url=' . $attach_type[1] . '" target="_blank">' . $rdomain_url_name . '</a></div></div><div class="clear"></div><div class="wall_show_block_link" style="' . $no_border_link . '"><a href="/away.php?url=' . $attach_type[1] . '" target="_blank"><div style="width:108px;height:80px;float:left;text-align:center"><img src="' . $attach_type[4] . '" /></div></a><div class="attatch_link_title"><a href="/away.php?url=' . $attach_type[1] . '" target="_blank">' . $str_title . '</a></div><div style="max-height:50px;overflow:hidden">' . $attach_type[3] . '</div></div></div>'; $resLinkTitle = $attach_type[2]; $resLinkUrl = $attach_type[1]; } else { if ($attach_type[1] and $attach_type[2]) { $attach_result .= '<div style="margin-top:2px" class="clear"><div class="attach_link_block_ic fl_l" style="margin-top:4px;margin-left:0px"></div><div class="attach_link_block_te"><div class="fl_l">Ссылка: <a href="/away.php?url=' . $attach_type[1] . '" target="_blank">' . $rdomain_url_name . '</a></div></div></div><div class="clear"></div>'; $resLinkTitle = $attach_type[2]; $resLinkUrl = $attach_type[1]; } } $cnt_attach_link++; //Если документ } elseif ($attach_type[0] == 'doc') { $doc_id = intval($attach_type[1]); $row_doc = $db->super_query("SELECT dname, dsize FROM `" . PREFIX . "_doc` WHERE did = '{$doc_id}'"); if ($row_doc) { $attach_result .= '<div style="margin-top:5px;margin-bottom:5px" class="clear"><div class="doc_attach_ic fl_l" style="margin-top:4px;margin-left:0px"></div><div class="attach_link_block_te"><div class="fl_l">Файл <a href="/index.php?go=doc&act=download&did=' . $doc_id . '" target="_blank" onMouseOver="myhtml.title(\'' . $doc_id . $cnt_attach . $row_wall['id'] . '\', \'<b>Размер файла: ' . $row_doc['dsize'] . '</b>\', \'doc_\')" id="doc_' . $doc_id . $cnt_attach . $row_wall['id'] . '">' . $row_doc['dname'] . '</a></div></div></div><div class="clear"></div>'; $cnt_attach++; } //Если опрос } elseif ($attach_type[0] == 'vote') { $vote_id = intval($attach_type[1]); $row_vote = $db->super_query("SELECT title, answers, answer_num FROM `" . PREFIX . "_votes` WHERE id = '{$vote_id}'", false, "votes/vote_{$vote_id}"); if ($vote_id) { $checkMyVote = $db->super_query("SELECT COUNT(*) AS cnt FROM `" . PREFIX . "_votes_result` WHERE user_id = '{$user_id}' AND vote_id = '{$vote_id}'", false, "votes/check{$user_id}_{$vote_id}"); $row_vote['title'] = stripslashes($row_vote['title']); if (!$row_wall['text']) { $row_wall['text'] = $row_vote['title']; } $arr_answe_list = explode('|', stripslashes($row_vote['answers'])); $max = $row_vote['answer_num']; $sql_answer = $db->super_query("SELECT answer, COUNT(*) AS cnt FROM `" . PREFIX . "_votes_result` WHERE vote_id = '{$vote_id}' GROUP BY answer", 1, "votes/vote_answer_cnt_{$vote_id}"); $answer = array(); foreach ($sql_answer as $row_answer) { $answer[$row_answer['answer']]['cnt'] = $row_answer['cnt']; } $attach_result .= "<div class=\"clear\" style=\"height:10px\"></div><div id=\"result_vote_block{$vote_id}\"><div class=\"wall_vote_title\">{$row_vote['title']}</div>"; for ($ai = 0; $ai < sizeof($arr_answe_list); $ai++) { if (!$checkMyVote['cnt']) { $attach_result .= "<div class=\"wall_vote_oneanswe\" onClick=\"Votes.Send({$ai}, {$vote_id})\" id=\"wall_vote_oneanswe{$ai}\"><input type=\"radio\" name=\"answer\" /><span id=\"answer_load{$ai}\">{$arr_answe_list[$ai]}</span></div>"; } else { $num = $answer[$ai]['cnt']; if (!$num) { $num = 0; } if ($max != 0) { $proc = 100 * $num / $max; } else { $proc = 0; } $proc = round($proc, 2); $attach_result .= "<div class=\"wall_vote_oneanswe cursor_default\">\r\n\t\t\t\t\t\t\t\t\t{$arr_answe_list[$ai]}<br />\r\n\t\t\t\t\t\t\t\t\t<div class=\"wall_vote_proc fl_l\"><div class=\"wall_vote_proc_bg\" style=\"width:" . intval($proc) . "%\"></div><div style=\"margin-top:-16px\">{$num}</div></div>\r\n\t\t\t\t\t\t\t\t\t<div class=\"fl_l\" style=\"margin-top:-1px\"><b>{$proc}%</b></div>\r\n\t\t\t\t\t\t\t\t\t</div><div class=\"clear\"></div>"; } } if ($row_vote['answer_num']) { $answer_num_text = gram_record($row_vote['answer_num'], 'fave'); } else { $answer_num_text = 'человек'; } if ($row_vote['answer_num'] <= 1) { $answer_text2 = 'Проголосовал'; } else { $answer_text2 = 'Проголосовало'; } $attach_result .= "{$answer_text2} <b>{$row_vote['answer_num']}</b> {$answer_num_text}.<div class=\"clear\" style=\"margin-top:10px\"></div></div>"; } } else { $attach_result .= ''; } } if ($resLinkTitle and $row_wall['text'] == $resLinkUrl or !$row_wall['text']) { $row_wall['text'] = $resLinkTitle . $attach_result; } else { if ($attach_result) { $row_wall['text'] = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<a href="/away.php?url=$1" target="_blank">$1</a>', $row_wall['text']) . $attach_result; } else { $row_wall['text'] = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<a href="/away.php?url=$1" target="_blank">$1</a>', $row_wall['text']); } } } else { $row_wall['text'] = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<a href="/away.php?url=$1" target="_blank">$1</a>', $row_wall['text']); } $resLinkTitle = ''; //Если это запись с "рассказать друзьям" if ($row_wall['tell_uid']) { if ($row_wall['public']) { $rowUserTell = $db->super_query("SELECT title, photo FROM `" . PREFIX . "_communities` WHERE id = '{$row_wall['tell_uid']}'"); } else { $rowUserTell = $db->super_query("SELECT user_search_pref, user_photo FROM `" . PREFIX . "_users` WHERE user_id = '{$row_wall['tell_uid']}'"); } if (date('Y-m-d', $row_wall['tell_date']) == date('Y-m-d', $server_time)) { $dateTell = langdate('сегодня в H:i', $row_wall['tell_date']); } elseif (date('Y-m-d', $row_wall['tell_date']) == date('Y-m-d', $server_time - 84600)) { $dateTell = langdate('вчера в H:i', $row_wall['tell_date']); } else { $dateTell = langdate('j F Y в H:i', $row_wall['tell_date']); } if ($row_wall['public']) { $rowUserTell['user_search_pref'] = stripslashes($rowUserTell['title']); $tell_link = 'public'; if ($rowUserTell['photo']) { $avaTell = '/uploads/groups/' . $row_wall['tell_uid'] . '/50_' . $rowUserTell['photo']; } else { $avaTell = '{theme}/images/no_ava_50.png'; } } else { $tell_link = 'u'; if ($rowUserTell['user_photo']) { $avaTell = '/uploads/users/' . $row_wall['tell_uid'] . '/50_' . $rowUserTell['user_photo']; } else { $avaTell = '{theme}/images/no_ava_50.png'; } } if ($row_wall['tell_comm']) { $border_tell_class = 'wall_repost_border'; } else { $border_tell_class = 'wall_repost_border2'; } $row_wall['text'] = <<<HTML {$row_wall['tell_comm']} <div class="{$border_tell_class}"> <div class="wall_tell_info"><div class="wall_tell_ava"><a href="/{$tell_link}{$row_wall['tell_uid']}" onClick="Page.Go(this.href); return false"><img src="{$avaTell}" width="30" /></a></div><div class="wall_tell_name"><a href="/{$tell_link}{$row_wall['tell_uid']}" onClick="Page.Go(this.href); return false"><b>{$rowUserTell['user_search_pref']}</b></a></div><div class="wall_tell_date">{$dateTell}</div></div>{$row_wall['text']} <div class="clear"></div> </div> HTML; } $tpl->set('{text}', stripslashes($row_wall['text'])); $tpl->set('{name}', $row_wall['title']); $tpl->set('{user-id}', $row_wall['public_id']); if ($row_wall['adres']) { $tpl->set('{adres-id}', $row_wall['adres']); } else { $tpl->set('{adres-id}', 'public' . $row_wall['public_id']); } megaDate($row_wall['add_date']); if ($row_wall['photo']) { $tpl->set('{ava}', '/uploads/groups/' . $row_wall['public_id'] . '/50_' . $row_wall['photo']); } else { $tpl->set('{ava}', '{theme}/images/no_ava_50.png'); } //Мне нравится if (stripos($row_wall['likes_users'], "u{$user_id}|") !== false) { $tpl->set('{yes-like}', 'public_wall_like_yes'); $tpl->set('{yes-like-color}', 'public_wall_like_yes_color'); $tpl->set('{like-js-function}', 'groups.wall_remove_like(' . $row_wall['id'] . ', ' . $user_id . ')'); } else { $tpl->set('{yes-like}', ''); $tpl->set('{yes-like-color}', ''); $tpl->set('{like-js-function}', 'groups.wall_add_like(' . $row_wall['id'] . ', ' . $user_id . ')'); } if ($row_wall['likes_num']) { $tpl->set('{likes}', $row_wall['likes_num']); $tpl->set('{likes-text}', '<span id="like_text_num' . $row_wall['id'] . '">' . $row_wall['likes_num'] . '</span> ' . gram_record($row_wall['likes_num'], 'like')); } else { $tpl->set('{likes}', ''); $tpl->set('{likes-text}', '<span id="like_text_num' . $row_wall['id'] . '">0</span> человеку'); } //Выводим информцию о том кто смотрит страницу для себя $tpl->set('{viewer-id}', $user_id); if ($user_info['user_photo']) { $tpl->set('{viewer-ava}', '/uploads/users/' . $user_id . '/50_' . $user_info['user_photo']); } else { $tpl->set('{viewer-ava}', '{theme}/images/no_ava_50.png'); } //Админ if ($public_admin) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', ''); } else { $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", ""); } //Если есть комменты к записи, то выполняем след. действия / Приватность if ($row_wall['fasts_num']) { $tpl->set_block("'\\[comments-link\\](.*?)\\[/comments-link\\]'si", ""); } else { $tpl->set('[comments-link]', ''); $tpl->set('[/comments-link]', ''); } //Приватность комментирования записей if ($row_wall['comments'] or $public_admin) { $tpl->set('[privacy-comment]', ''); $tpl->set('[/privacy-comment]', ''); } else { $tpl->set_block("'\\[privacy-comment\\](.*?)\\[/privacy-comment\\]'si", ""); } $tpl->set('[record]', ''); $tpl->set('[/record]', ''); $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", ""); $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", ""); $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); $tpl->compile($this->compile); //Если есть комменты к записи, то открываем форму ответа уже в развернутом виде и выводим комменты к записи if ($row_wall['comments'] or $public_admin) { if ($row_wall['fasts_num']) { //Помещаем все комменты в id wall_fast_block_{id} это для JS $tpl->result[$this->compile] .= '<div id="wall_fast_block_' . $row_wall['id'] . '" class="public_wall_rec_comments">'; if ($row_wall['fasts_num'] > 3) { $comments_limit = $row_wall['fasts_num'] - 3; } else { $comments_limit = 0; } $sql_comments = $db->super_query("SELECT SQL_CALC_FOUND_ROWS tb1.id, public_id, text, add_date, tb2.user_photo, user_search_pref FROM `" . PREFIX . "_communities_wall` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.public_id = tb2.user_id AND tb1.fast_comm_id = '{$row_wall['id']}' ORDER by `add_date` ASC LIMIT {$comments_limit}, 3", 1); //Загружаем кнопку "Показать N запсии" $tpl->set('{gram-record-all-comm}', gram_record($row_wall['fasts_num'] - 3, 'prev') . ' ' . ($row_wall['fasts_num'] - 3) . ' ' . gram_record($row_wall['fasts_num'] - 3, 'comments')); if ($row_wall['fasts_num'] < 4) { $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); } else { $tpl->set('{rec-id}', $row_wall['id']); $tpl->set('[all-comm]', ''); $tpl->set('[/all-comm]', ''); } $tpl->set('{public-id}', $pid); $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", ""); $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", ""); $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", ""); $tpl->compile($this->compile); //Сообственно выводим комменты foreach ($sql_comments as $row_comments) { $tpl->set('{public-id}', $pid); $tpl->set('{name}', $row_comments['user_search_pref']); if ($row_comments['user_photo']) { $tpl->set('{ava}', $config['home_url'] . 'uploads/users/' . $row_comments['public_id'] . '/50_' . $row_comments['user_photo']); } else { $tpl->set('{ava}', '{theme}/images/no_ava_50.png'); } $tpl->set('{comm-id}', $row_comments['id']); $tpl->set('{user-id}', $row_comments['public_id']); $expBR2 = explode('<br />', $row_comments['text']); $textLength2 = count($expBR2); $strTXT2 = strlen($row_comments['text']); if ($textLength2 > 6 or $strTXT2 > 470) { $row_comments['text'] = '<div class="wall_strlen" id="hide_wall_rec' . $row_comments['id'] . '" style="max-height:102px"">' . $row_comments['text'] . '</div><div class="wall_strlen_full" onMouseDown="wall.FullText(' . $row_comments['id'] . ', this.id)" id="hide_wall_rec_lnk' . $row_comments['id'] . '">Показать полностью..</div>'; } $tpl->set('{text}', stripslashes($row_comments['text'])); megaDate($row_comments['add_date']); if ($public_admin or $user_id == $row_comments['public_id']) { $tpl->set('[owner]', ''); $tpl->set('[/owner]', ''); } else { $tpl->set_block("'\\[owner\\](.*?)\\[/owner\\]'si", ""); } $tpl->set('[comment]', ''); $tpl->set('[/comment]', ''); $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", ""); $tpl->set_block("'\\[comment-form\\](.*?)\\[/comment-form\\]'si", ""); $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); $tpl->compile($this->compile); } //Загружаем форму ответа $tpl->set('{rec-id}', $row_wall['id']); $tpl->set('{user-id}', $row_wall['public_id']); $tpl->set('[comment-form]', ''); $tpl->set('[/comment-form]', ''); $tpl->set_block("'\\[record\\](.*?)\\[/record\\]'si", ""); $tpl->set_block("'\\[comment\\](.*?)\\[/comment\\]'si", ""); $tpl->set_block("'\\[all-comm\\](.*?)\\[/all-comm\\]'si", ""); $tpl->compile($this->compile); //Закрываем блок для JS $tpl->result[$this->compile] .= '</div>'; } } } }
{$lang['message_pm_3']} [quote]{$text}[/quote] HTML; } $message = $db->safesql($parse->BB_Parse($parse->process(trim($message)), false)); $time = time() + $config['date_adjust'] * 60; $member_id['name'] = $db->safesql($member_id['name']); $db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('{$lang['message_pm']}', '{$message}', '{$row['user_id']}', '{$member_id['name']}', '{$time}', 'no', 'inbox')"); $db->query("UPDATE " . USERPREFIX . "_users SET pm_all=pm_all+1, pm_unread=pm_unread+1 WHERE user_id='{$row['user_id']}'"); if ($config['mail_pm']) { include_once ENGINE_DIR . '/classes/mail.class.php'; $mail = new dle_mail($config); $mail_template = $db->super_query("SELECT template FROM " . PREFIX . "_email WHERE name='pm' LIMIT 0,1"); $mail_template['template'] = stripslashes($mail_template['template']); $mail_template['template'] = str_replace("{%username%}", $row['name'], $mail_template['template']); $mail_template['template'] = str_replace("{%date%}", langdate("j F Y H:i", $time), $mail_template['template']); $mail_template['template'] = str_replace("{%fromusername%}", $member_id['name'], $mail_template['template']); $mail_template['template'] = str_replace("{%title%}", $lang['message_pm'], $mail_template['template']); $body = str_replace('\\n', "", $message); $body = str_replace('\\r', "", $body); $body = str_replace('"', '"', $message); $body = stripslashes(stripslashes($body)); $body = str_replace("<br />", "\n", $body); $body = strip_tags($body); $mail_template['template'] = str_replace("{%text%}", $body, $mail_template['template']); $mail->send($row['email'], $lang['mail_pm'], $mail_template['template']); } @header("Content-type: text/html; charset=" . $config['charset']); echo "ok";
function cal($cal_month, $cal_year, $events) { global $f, $r, $year, $month, $config, $lang, $langdateshortweekdays, $PHP_SELF; $next = true; if (intval($cal_year . $cal_month) >= date('Ym') and !$config['news_future']) { $next = false; } $cur_date = date('Ymj', time()); $cal_date = $cal_year . $cal_month; $cal_month = intval($cal_month); $cal_year = intval($cal_year); if ($cal_month < 0) { $cal_month = 1; } if ($cal_year < 0) { $cal_year = 2008; } $first_of_month = mktime(0, 0, 0, $cal_month, 7, $cal_year); $maxdays = date('t', $first_of_month) + 1; // 28-31 $prev_of_month = mktime(0, 0, 0, $cal_month - 1, 7, $cal_year); $next_of_month = mktime(0, 0, 0, $cal_month + 1, 7, $cal_year); $cal_day = 1; $weekday = date('w', $first_of_month); // 0-6 if ($config['allow_alt_url']) { $date_link['prev'] = '<a class="monthlink" onclick="doCalendar(' . date("'m','Y'", $prev_of_month) . ',\'right\'); return false;" href="' . $config['http_home_url'] . date('Y/m/', $prev_of_month) . '" title="' . $lang['prev_moth'] . '">«</a> '; $date_link['next'] = ' <a class="monthlink" onclick="doCalendar(' . date("'m','Y'", $next_of_month) . ',\'left\'); return false;" href="' . $config['http_home_url'] . date('Y/m/', $next_of_month) . '" title="' . $lang['next_moth'] . '">»</a>'; } else { $date_link['prev'] = '<a class="monthlink" onclick="doCalendar(' . date("'m','Y'", $prev_of_month) . ',\'right\'); return false;" href="' . $PHP_SELF . '?year=' . date("Y", $prev_of_month) . '&month=' . date("m", $prev_of_month) . '" title="' . $lang['prev_moth'] . '">«</a> '; $date_link['next'] = ' <a class="monthlink" onclick="doCalendar(' . date("'m','Y'", $next_of_month) . ',\'left\'); return false;" href="' . $PHP_SELF . '?year=' . date("Y", $next_of_month) . '&month=' . date("m", $next_of_month) . '" title="' . $lang['next_moth'] . '">»</a>'; } if (!$next) { $date_link['next'] = " »"; } $buffer = '<table id="calendar" class="calendar"><tr><th colspan="7" class="monthselect">' . $date_link['prev'] . langdate('F', $first_of_month, true) . ' ' . $cal_year . $date_link['next'] . '</th></tr><tr>'; $buffer = str_replace($f, $r, $buffer); # Дни недели: рабочая неделя for ($it = 1; $it < 6; $it++) { $buffer .= '<th class="workday">' . $langdateshortweekdays[$it] . '</th>'; } # Дни недели: субботний и воскресный дни $buffer .= '<th class="weekday">' . $langdateshortweekdays[6] . '</th>'; $buffer .= '<th class="weekday">' . $langdateshortweekdays[0] . '</th>'; $buffer .= '</tr><tr>'; if ($weekday > 0) { $buffer .= '<td colspan="' . $weekday . '"> </td>'; } while ($maxdays > $cal_day) { $cal_pos = $cal_date . $cal_day; if ($weekday == 7) { $buffer .= '</tr><tr>'; $weekday = 0; } # В данный день есть новость if (isset($events[$cal_day])) { $date['title'] = langdate('d F Y', $events[$cal_day], true); # Если суббота и воскресенье. if ($weekday == '5' or $weekday == '6') { if ($config['allow_alt_url']) { $buffer .= '<td ' . ($cal_pos == $cur_date ? ' class="day-active day-current" ' : ' class="day-active" ') . '><a class="day-active" href="' . $config['http_home_url'] . '' . date("Y/m/d", $events[$cal_day]) . '/" title="' . $lang['cal_post'] . ' ' . $date['title'] . '">' . $cal_day . '</a></td>'; } else { $buffer .= '<td ' . ($cal_pos == $cur_date ? ' class="day-active day-current" ' : ' class="day-active" ') . '><a class="day-active" href="' . $PHP_SELF . '?year=' . date("Y", $events[$cal_day]) . '&month=' . date("m", $events[$cal_day]) . '&day=' . date("d", $events[$cal_day]) . '" title="' . $lang['cal_post'] . ' ' . $date['title'] . '">' . $cal_day . '</a></td>'; } } else { if ($config['allow_alt_url']) { $buffer .= '<td ' . ($cal_pos == $cur_date ? ' class="day-active-v day-current" ' : ' class="day-active-v" ') . '><a class="day-active-v" href="' . $config['http_home_url'] . '' . date("Y/m/d", $events[$cal_day]) . '/" title="' . $lang['cal_post'] . ' ' . $date['title'] . '">' . $cal_day . '</a></td>'; } else { $buffer .= '<td ' . ($cal_pos == $cur_date ? ' class="day-active-v day-current" ' : ' class="day-active-v" ') . '><a class="day-active-v" href="' . $PHP_SELF . '?year=' . date("Y", $events[$cal_day]) . '&month=' . date("m", $events[$cal_day]) . '&day=' . date("d", $events[$cal_day]) . '" title="' . $lang['cal_post'] . ' ' . $date['title'] . '">' . $cal_day . '</a></td>'; } } } else { # Если суббота воскресенье if ($weekday == "5" or $weekday == "6") { $buffer .= '<td ' . ($cal_pos == $cur_date ? ' class="weekday day-current" ' : ' class="weekday" ') . '>' . $cal_day . '</td>'; } else { $buffer .= '<td ' . ($cal_pos == $cur_date ? ' class="day day-current" ' : ' class="day" ') . '>' . $cal_day . '</td>'; } } $cal_day++; $weekday++; } if ($weekday != 7) { $buffer .= '<td colspan="' . (7 - $weekday) . '"> </td>'; } return $buffer . '</tr></table>'; }
\t\t\t\$(".no_company").fadeOut(); \t}); \t \tif (\$("#company").val() != '') \t\t\$(".no_company").fadeOut(); }); </script> JS; $tpl->header($job->lang['vacancies'], true, $JS, array($config['http_home_url'] . 'engine/job/images/admin/jquery.autocomplete.css'), array($config['http_home_url'] . 'engine/job/javascript/jquery.metadata.js', $config['http_home_url'] . 'engine/job/javascript/jquery.validate.js', $config['http_home_url'] . 'engine/job/javascript/messages_ru.js')); if (empty($where)) { $tpl->echo = FALSE; if ($edit['id']) { $data[] = array('', "<b>ID</b>" . $edit['id']); } if ($edit['add_date']) { $data[] = array($job->lang['vacancy_added'], langdate('j F Yã. â H:i', $edit['add_date'])); } $data[] = array($job->lang['sphere'], $tpl->selection($job->GetSpheres('add'), 'sphere_id', $edit['sphere_id'], 'id="sphere_id"')); // $data[] = array($job->lang['specialty'], $tpl->selection($job->GetSpecialties($edit['sphere_id']), 'specialty_id', $edit['specialty_id'], 'id="specialty_id"')); $data[] = array($job->lang['specialty'], $tpl->InputText('specialty', empty($edit['sphere_id']) ? $job->lang['sel_sphere'] : $edit['specialty'], 'id="specialty"')); if ($job->use_country) { $data[] = array($job->lang['country'], $tpl->selection($job->GetCountries('add'), 'country_id', $edit['country_id'], "id='country_id'")); } if ($job->use_city) { $data[] = array($job->lang['city'], $tpl->selection($job->GetCities($edit['country_id']), 'city_id', $edit['city_id'], "id='city_id'")); } foreach (Vacancy::$fields as $field_name => $values_array) { $data[] = array($job->lang[$field_name], $tpl->selection(array("" => $job->lang['no_show']) + $values_array, $field_name, $edit[$field_name])); } $data[] = array($job->lang['sex'], $tpl->selection(array(0 => $job->lang['no_show'], "M" => $job->lang['sex_man'], "W" => $job->lang['sex_woman']), 'sex', $edit['sex'])); $data[] = array($job->lang['age'], $job->lang['from'] . $tpl->InputText('age_min', $edit['age_min'], 'size=10') . $job->lang['to'] . $tpl->InputText('age_max', $edit['age_max'], 'size=10'));
$tpl->set('{news_main}', $stats_main); $tpl->set('{news_moder}', $stats_news - $stats_approve); $tpl->set('{news_day}', $stats_day); $tpl->set('{news_week}', $stats_week); $tpl->set('{news_month}', $stats_month); $tpl->set('{comm_day}', $comments_day); $tpl->set('{comm_week}', $comments_week); $tpl->set('{comm_month}', $comments_month); $tpl->set('{user_day}', $user_day); $tpl->set('{user_week}', $user_week); $tpl->set('{user_month}', $user_month); $db->query("SELECT user_id, name, user_group, reg_date, lastdate, news_num, comm_num FROM " . USERPREFIX . "_users WHERE news_num > '0' ORDER BY news_num DESC LIMIT 0,10"); $top_table = "<thead><tr><td>{$lang['top_name']}</td><td align=\"center\">{$lang['top_status']}</td><td align=\"center\">{$lang['top_reg']}</td><td align=\"center\">{$lang['top_last']}</td><td align=\"center\">{$lang['top_nnum']}</td><td align=\"center\">{$lang['top_cnum']}</td><td align=\"center\">{$lang['top_pm']}</td></tr></thead>"; while ($row = $db->get_row()) { $registration = langdate($config['timestamp_active'], $row['reg_date']); $last = langdate($config['timestamp_active'], $row['lastdate']); if ($config['allow_alt_url']) { $user_name = $config['http_home_url'] . "user/" . urlencode($row['name']) . "/"; $user_name = "onclick=\"ShowProfile('" . urlencode($row['name']) . "', '" . htmlspecialchars($user_name, ENT_QUOTES, $config['charset']) . "', '" . $user_group[$member_id['user_group']]['admin_editusers'] . "'); return false;\""; $user_name = "<a {$user_name} class=\"pm_list\" href=\"" . $config['http_home_url'] . "user/" . urlencode($row['name']) . "/\">" . $row['name'] . "</a>"; } else { $user_name = "{$PHP_SELF}?subaction=userinfo&user="******"onclick=\"ShowProfile('" . urlencode($row['name']) . "', '" . htmlspecialchars($user_name, ENT_QUOTES, $config['charset']) . "', '" . $user_group[$member_id['user_group']]['admin_editusers'] . "'); return false;\""; $user_name = "<a {$user_name} class=\"pm_list\" href=\"{$PHP_SELF}?subaction=userinfo&user="******"\">" . $row['name'] . "</a>"; } $user_pm = "<a href=\"{$PHP_SELF}?do=pm&doaction=newpm&user="******"\">{$lang['top_pm']}</a>"; $top_table .= "<tr><td>{$user_name}</td><td align=\"center\">{$user_group[$row['user_group']]['group_prefix']}{$user_group[$row['user_group']]['group_name']}{$user_group[$row['user_group']]['group_suffix']}</td><td align=\"center\">{$registration}</td><td align=\"center\">{$last}</td><td align=\"center\">{$row['news_num']}</td><td align=\"center\">{$row['comm_num']}</td><td align=\"center\">[ {$user_pm} ]</td></tr>"; } $db->free(); $tpl->set('{topusers}', $top_table); $tpl->compile('content');
$full_link = $config['http_home_url'] . date('Y/m/d/', $row['date']) . $row['alt_name'] . ".html"; } } else { $full_link = $config['http_home_url'] . "index.php?newsid=" . $row['id']; } $title = stripslashes($row['title']); $row = $db->super_query("SELECT * FROM " . PREFIX . "_email WHERE name='comments' LIMIT 0,1"); $mail = new dle_mail($config, $row['use_html']); if (strpos($full_link, "//") === 0) { $full_link = "http:" . $full_link; } elseif (strpos($full_link, "/") === 0) { $full_link = "http://" . $_SERVER['HTTP_HOST'] . $full_link; } $row['template'] = stripslashes($row['template']); $row['template'] = str_replace("{%username%}", $name, $row['template']); $row['template'] = str_replace("{%date%}", langdate("j F Y H:i", $_TIME, true), $row['template']); $row['template'] = str_replace("{%link%}", $full_link, $row['template']); $row['template'] = str_replace("{%title%}", $title, $row['template']); $body = str_replace('\\n', "", $comments); $body = str_replace('\\r', "", $body); $body = stripslashes(stripslashes($body)); $body = str_replace("<br />", "\n", $body); $body = strip_tags($body); if ($row['use_html']) { $body = str_replace("\n", "<br />", $body); } $row['template'] = str_replace("{%text%}", $body, $row['template']); } if ($config['mail_comments']) { $body = str_replace("{%ip%}", $_IP, $row['template']); $body = str_replace("{%username_to%}", $lang['admin'], $body);
} if (count(explode("@", $row['foto'])) == 2) { $tpl->set('{foto}', 'http://www.gravatar.com/avatar/' . md5(trim($row['foto'])) . '?s=' . intval($user_group[$row['user_group']]['max_foto'])); } else { if ($row['foto'] and file_exists(ROOT_DIR . "/uploads/fotos/" . $row['foto'])) { $tpl->set('{foto}', $config['http_home_url'] . "uploads/fotos/" . $row['foto']); } else { $tpl->set('{foto}', "{THEME}/dleimages/noavatar.png"); } } if ($row['banned'] == 'yes') { $user_group[$row['user_group']]['group_name'] = $lang['user_ban']; } $tpl->set('{status}', $user_group[$row['user_group']]['group_prefix'] . $user_group[$row['user_group']]['group_name'] . $user_group[$row['user_group']]['group_suffix']); $tpl->set('{registration}', langdate("j F Y H:i", $row['reg_date'])); $tpl->set('{lastdate}', langdate("j F Y H:i", $row['lastdate'])); if ($row['lastdate'] + 1200 > $_TIME) { $tpl->set('[online]', ""); $tpl->set('[/online]', ""); $tpl->set_block("'\\[offline\\](.*?)\\[/offline\\]'si", ""); } else { $tpl->set('[offline]', ""); $tpl->set('[/offline]', ""); $tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si", ""); } if ($row['fullname']) { $tpl->set('[fullname]', ""); $tpl->set('[/fullname]', ""); $tpl->set('{fullname}', stripslashes($row['fullname'])); $tpl->set_block("'\\[not-fullname\\](.*?)\\[/not-fullname\\]'si", ""); } else {
if ($i != 0) { $opener = "\t</ul>\n"; $openertwo = "</li>"; } else { $opener = ""; $opener2 = ""; } # Monthly headers if ($dateheader_S != date("mY", $date)) { if ($num_months && $ma > $num_months) { break 1; } $m_amount = $mc; $mc = 0; $dateheader_S = date("mY", $date); $dateheader = langdate("F Y", $date); $dateheader_p = "{$openertwo}\n{$opener}\n<h1>{month}</h1>\n\t<ul class=\"ajforkmonthlist\">"; $dateheader_p = str_replace("{month}", $dateheader, $dateheader_p); echo $dateheader_p; $ma++; } if ($entrydayofmonth == date("d", $date)) { $multiple = 1; echo "<strong> , </strong>{$archivelink}"; } else { if ($mc == 0) { $openertwo = ""; } $daysingle = date("d", $date); echo "{$openertwo}\n\t\t<li><strong>{$daysingle}</strong>: {$archivelink}"; }
$tpl->set('{foto}', 'http://www.gravatar.com/avatar/' . md5(trim($row['foto'])) . '?s=' . intval($user_group[$row['user_group']]['max_foto'])); } else { if ($row['foto']) { $tpl->set('{foto}', $config['http_home_url'] . "uploads/fotos/" . $row['foto']); } else { $tpl->set('{foto}', "{THEME}/dleimages/noavatar.png"); } } } if ($row['is_register'] and $row['icq']) { $tpl->set('{icq}', stripslashes($row['icq'])); } else { $tpl->set('{icq}', '--'); } if ($row['is_register']) { $tpl->set('{registration}', langdate("d.m.Y", $row['reg_date'])); } else { $tpl->set('{registration}', '--'); } if ($row['is_register'] and $row['news_num']) { $tpl->set('{news_num}', $row['news_num']); } else { $tpl->set('{news_num}', '0'); } if ($row['is_register'] and $row['comm_num']) { $tpl->set('{comm_num}', $row['comm_num']); } else { $tpl->set('{comm_num}', '0'); } $tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si", ""); $tpl->set('{result-text}', "<div id='comm-id-" . $row['coms_id'] . "'>" . $row['story'] . "</div>");
} else { //Всталвяем саму запись в БД $db->query("INSERT INTO `" . PREFIX . "_communities_forum_msg` SET fid = '{$fid}', muser_id = '{$user_id}', msg = '{$msg}', mdate = '{$server_time}'"); $dbid = $db->insert_id(); } mozg_clear_cache_file("groups_forum/forum{$row['public_id']}"); //Обновляем данные в теме $db->query("UPDATE `" . PREFIX . "_communities_forum` SET msg_num = msg_num+1, lastdate = '{$server_time}', lastuser_id = '{$user_id}' WHERE fid = '{$fid}'"); $tpl->load_template('forum/msg.tpl'); $msg = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<a href="/away.php?url=$1" target="_blank">$1</a>', $msg); $tpl->set('{text}', stripslashes($msg)); $tpl->set('{name}', $user_info['user_search_pref']); $tpl->set('{online}', $lang['online']); $tpl->set('{mid}', $dbid); $tpl->set('{user-id}', $user_info['user_id']); $tpl->set('{date}', langdate('сегодня в H:i', $server_time)); $tpl->set('[admin-2]', ''); $tpl->set('[/admin-2]', ''); $tpl->set_block("'\\[not-owner\\](.*?)\\[/not-owner\\]'si", ""); if ($user_info['user_photo']) { $tpl->set('{ava}', "/uploads/users/{$user_info['user_id']}/50_{$user_info['user_photo']}"); } else { $tpl->set('{ava}', '{theme}/images/no_ava_50.png'); } $tpl->compile('content'); AjaxTpl(); } exit; break; //################### Показах предыдущих сообщений ###################// //################### Показах предыдущих сообщений ###################//
} } $resLinkTitle = ''; //Если это запись с "рассказать друзьям" if ($rec_info_groups['tell_uid']) { if ($rec_info_groups['public']) { $rowUserTell = $db->super_query("SELECT title, photo FROM `" . PREFIX . "_communities` WHERE id = '{$rec_info_groups['tell_uid']}'"); } else { $rowUserTell = $db->super_query("SELECT user_search_pref, user_photo FROM `" . PREFIX . "_users` WHERE user_id = '{$rec_info_groups['tell_uid']}'"); } if (date('Y-m-d', $rec_info_groups['tell_date']) == date('Y-m-d', $server_time)) { $dateTell = langdate('сегодня в H:i', $rec_info_groups['tell_date']); } elseif (date('Y-m-d', $rec_info_groups['tell_date']) == date('Y-m-d', $server_time - 84600)) { $dateTell = langdate('вчера в H:i', $rec_info_groups['tell_date']); } else { $dateTell = langdate('j F Y в H:i', $rec_info_groups['tell_date']); } if ($rec_info_groups['public']) { $rowUserTell['user_search_pref'] = stripslashes($rowUserTell['title']); $tell_link = 'public'; if ($rowUserTell['photo']) { $avaTell = '/uploads/groups/' . $rec_info_groups['tell_uid'] . '/50_' . $rowUserTell['photo']; } else { $avaTell = '{theme}/images/no_ava_50.png'; } } else { $tell_link = 'u'; if ($rowUserTell['user_photo']) { $avaTell = '/uploads/users/' . $rec_info_groups['tell_uid'] . '/50_' . $rowUserTell['user_photo']; } else { $avaTell = '{theme}/images/no_ava_50.png';
<option value="0"></option> {$selsorlist} </select> <div class="mgcler"></div> <div class="fllogall"> </div> <input type="submit" value="Найти" class="inp" style="margin-top:0px" /> </form> HTML; echohtmlstart('Список пользователей (' . $numRows['cnt'] . ')'); foreach ($sql_ as $row) { $format_reg_date = date('Y-m-d', $row['user_reg_date']); $lastvisit = date('Y-m-d', $row['user_last_visit']); $row['user_reg_date'] = langdate('j M Y в H:i', $row['user_reg_date']); $row['user_last_visit'] = langdate('j M Y в H:i', $row['user_last_visit']); if ($row['user_delet']) { $color = 'color:red'; } else { if ($row['user_ban']) { $color = 'color:blue'; } else { if ($row['user_group'] == 4) { $color = 'color:green'; } else { $color = ''; } } } $users .= <<<HTML <div style="background:#fff;float:left;padding:5px;width:170px;text-align:center;font-weight:bold;" title="Баланс: {$row['user_balance']} голосов"><a href="/u{$row['user_id']}" target="_blank" style="{$color}">{$row['user_search_pref']}</a></div>
function formdate($matches = array()) { global $news_date; return langdate($matches[1], $news_date); }
public function Start($CommCfg) { $this->New_Cfg($CommCfg); // создаем новый конфиг $where = array(); // проверка некоторых параметров конфига по версиях $allow_alt_url = $this->config['version_id'] >= '10.2' ? $this->config['allow_alt_url'] == '1' : $this->config['allow_alt_url'] == "yes"; $allow_cache = $this->config['version_id'] >= '10.2' ? $this->config['allow_cache'] == '1' : $this->config['allow_cache'] == "yes"; $allow_multi_category = $this->config['version_id'] >= '10.2' ? $this->config['allow_multi_category'] == '1' : $this->config['allow_multi_category'] == "yes"; if ($this->config['version_id'] >= '10.4' and $this->comm_cfg['rating_comm']) { // рейтинг комментариев только для DLE 10.4 и выще $where[] = "c.rating > {$this->comm_cfg[rating_comm]}"; } // работа с категориями if ($allow_multi_category) { if ($this->comm_cfg['stop_category']) { $where[] = "category NOT REGEXP '[[:<:]](" . $this->Explode_Category($this->comm_cfg['stop_category'], "multi") . ")[[:>:]]'"; } if ($this->comm_cfg['from_category']) { $where[] = "category REGEXP '[[:<:]](" . $this->Explode_Category($this->comm_cfg['from_category'], "multi") . ")[[:>:]]'"; } } else { if ($this->comm_cfg['stop_category']) { $where[] = "category NOT IN ('" . $this->Explode_Category($this->comm_cfg['stop_category']) . "')"; } if ($this->comm_cfg['from_category']) { $where[] = "category IN ('" . $this->Explode_Category($this->comm_cfg['from_category']) . "')"; } } if ($this->comm_cfg['news_xfield']) { // работа с доп полями новостей $where[] = $this->Explode_xField($this->comm_cfg['news_xfield'], "p.xfields"); } if ($this->comm_cfg['user_xfield']) { // работа с доп полями пользователей $where[] = $this->Explode_xField($this->comm_cfg['user_xfield'], "u.xfields"); } // работа с новостями if ($this->comm_cfg['stop_id']) { $where[] = $this->Explode_NewsID($this->comm_cfg['stop_id']); } if ($this->comm_cfg['from_id']) { $where[] = $this->Explode_NewsID($this->comm_cfg['from_id']); } if ($this->comm_cfg['ncomm']) { // выводим только с комментариями у новостей больше чем $where[] = "p.comm_num > {$this->comm_cfg[ncomm]}"; } if ($this->comm_cfg['fixed']) { // выводим только с зафиксированых новостей $where[] = "p.fixed = 1"; } if ($this->comm_cfg['tags']) { $t = explode(',', $this->comm_cfg['tags']); $t = implode('|', $t); $where[] = "p.tags regexp '[[:<:]](" . $t . ")[[:>:]]'"; } if ($this->comm_cfg['news_read']) { // выводим только с комментариями у новостей больше чем $where[] = "e.news_read > {$this->comm_cfg[news_read]}"; } if ($this->comm_cfg['rating_news']) { // выводим только с комментариями у новостей больше чем $where[] = "e.rating > {$this->comm_cfg[rating_news]}"; } if ($this->comm_cfg['only_avatar']) { // выводим только с аватарами $where[] = "u.foto != ''"; } if ($this->comm_cfg['only_news']) { // выводим только с новостями $where[] = "u.news_num > 0"; } if ($this->comm_cfg['only_fav']) { // выводим только с закладками $where[] = "u.favorites != ''"; } if ($this->comm_cfg['only_fullname']) { // выводим только с полным именем $where[] = "u.fullname != ''"; } if ($this->comm_cfg['only_land']) { // выводим только с место жительством $where[] = "u.land != ''"; } if ($this->comm_cfg['news_user']) { // выводим только если новостей больше чем $where[] = "u.news_num > {$this->comm_cfg[news_user]}"; } if ($this->comm_cfg['comm']) { // выводим только если комментариев больше чем $where[] = "u.comm_num > {$this->comm_cfg[comm]}"; } // префикс кэша $Comm_hash = md5($this->comm_cfg['max_comm'] . $this->comm_cfg['max_text'] . $this->comm_cfg['max_title'] . $this->comm_cfg['check_guest'] . $this->comm_cfg['stop_category'] . $this->comm_cfg['from_category'] . $this->comm_cfg['stop_id'] . $this->comm_cfg['from_id'] . $this->comm_cfg['only_avatar'] . $this->comm_cfg['only_news'] . $this->comm_cfg['news_user'] . $this->comm_cfg['comm'] . $this->comm_cfg['only_fav'] . $this->comm_cfg['only_fullname'] . $this->comm_cfg['only_land']); $is_change = false; if (!$allow_cache) { if ($this->config['version_id'] >= '10.2') { $this->config['allow_cache'] = '1'; } else { $this->config['allow_cache'] = "yes"; } $is_change = true; } $Comm = dle_cache("Comm_", $this->config['skin'] . $Comm_hash); // подгружаем из кэша if (!$Comm) { if (count($where) > 0) { $where = " AND " . implode(" AND ", $where); } else { $where = ""; } $sql = $this->db->query("SELECT c.id as comid, c.post_id, c.date, c.user_id, c.is_register, c.text, c.autor, c.email, c.approve, p.id, p.date as newsdate, p.title, p.category, p.comm_num, p.alt_name, e.news_id, e.news_read, e.rating, u.foto, u.user_group, u.user_id FROM " . PREFIX . "_comments as c, " . PREFIX . "_post as p, " . PREFIX . "_post_extras as e, " . PREFIX . "_users as u WHERE p.id=c.post_id AND e.news_id=c.post_id AND c.approve = 1 AND c.user_id = u.user_id {$where} ORDER BY c.date DESC LIMIT 0, " . $this->comm_cfg['max_comm']); $tpl = new dle_template(); $tpl->dir = TEMPLATE_DIR; $tpl->load_template('comm/comm.tpl'); $count_rows = $sql->num_rows; if ($count_rows > 0) { while ($row = $this->db->get_row($sql)) { $row['date'] = strtotime($row['date']); $row['category'] = intval($row['category']); // Обработка ссылки на комментарий $on_page = FALSE; if ($row['comm_num'] > $this->config['comm_nummers']) { $on_page = 'page,1,' . ceil($row['comm_num'] / $this->config['comm_nummers']) . ','; } if ($allow_alt_url) { if ($condition = $this->config['seo_type'] == 1 or $this->config['seo_type'] == 2) { if ($row['category'] and $this->config['seo_type'] == 2) { $full_link = $this->config['http_home_url'] . get_url($row['category']) . "/" . $on_page . $row['id'] . "-" . $row['alt_name'] . ".html"; } else { $full_link = $this->config['http_home_url'] . $on_page . $row['id'] . "-" . $row['alt_name'] . ".html"; } } else { $full_link = $this->config['http_home_url'] . date('Y/m/d/', $row['date']) . $on_page . $row['alt_name'] . ".html"; } } else { $full_link = $this->config['http_home_url'] . "index.php?newsid=" . $row['id']; } $full_link = $full_link . '#comment-id-' . $row['comid']; // Обработка текста комментария if (dle_strlen($row['text'], $this->config['charset']) > $this->comm_cfg['max_text']) { $text = stripslashes(dle_substr($row['text'], 0, $this->comm_cfg['max_text'], $this->config['charset']) . " ..."); } else { $text = stripslashes($row['text']); } // Обработка заголовка новости (title) if (dle_strlen($row['title'], $this->config['charset']) > $this->comm_cfg['max_title']) { $title = stripslashes(dle_substr($row['title'], 0, $this->comm_cfg['max_title'], $this->config['charset']) . " ..."); } else { $title = stripslashes($row['title']); } // Обработка ника автора комментария if ($row['is_register'] == 1) { if ($allow_alt_url) { $go_page = $this->config['http_home_url'] . "user/" . urlencode($row['autor']) . "/"; } else { $go_page = "{$PHP_SELF}?subaction=userinfo&user="******"onclick=\"ShowProfile('" . urlencode($row['autor']) . "', '" . htmlspecialchars($go_page, ENT_QUOTES, $this->config['charset']) . "', '" . $this->group[$this->member['user_group']]['admin_editusers'] . "'); return false;\""; } else { $go_page = "onclick=\"ShowProfile('" . urlencode($row['autor']) . "', '" . $go_page . "'); return false;\""; } if ($allow_alt_url) { $author = "<a {$go_page} href=\"" . $this->config['http_home_url'] . "user/" . urlencode($row['autor']) . "/\">" . $row['autor'] . "</a>"; } else { $author = "<a {$go_page} href=\"{$PHP_SELF}?subaction=userinfo&user="******"\">" . $row['autor'] . "</a>"; } } else { $author = strip_tags($row['autor']); } // Обработка фото автора комментария if ($row['foto'] and $row['is_register'] == 1) { if (count(explode("@", $row['foto'])) == 2) { $tpl->set('{foto}', '//www.gravatar.com/avatar/' . md5(trim($row['foto'])) . '?s=' . intval($this->group[$row['user_group']]['max_foto'])); } else { if ($this->config['version_id'] >= '10.5') { if (strpos($row['foto'], "//") === 0) { $avatar = "http:" . $row['foto']; } else { $avatar = $row['foto']; } $avatar = @parse_url($avatar); if ($avatar['host']) { $tpl->set('{foto}', $row['foto']); } else { $tpl->set('{foto}', $this->config['http_home_url'] . "uploads/fotos/" . $row['foto']); } } else { if ($row['foto'] and file_exists(ROOT_DIR . "/uploads/fotos/" . $row['foto'])) { $tpl->set('{foto}', $this->config['http_home_url'] . "uploads/fotos/" . $row['foto']); } } } } else { $tpl->set('{foto}', "{THEME}/dleimages/noavatar.png"); } // Обработка ссылки автора комментария if ($allow_alt_url) { $user_url = $this->config['http_home_url'] . "user/" . urlencode($row['autor']) . "/"; } else { $user_url = "{$PHP_SELF}?subaction=userinfo&user="******", H:i", $row['date'])); } elseif (date('Ymd', $row['date']) == date('Ymd', $_TIME - 86400)) { $tpl->set('{date}', $lang['time_gestern'] . langdate(", H:i", $row['date'])); } else { $tpl->set('{date}', langdate($this->config['timestamp_active'], $row['date'])); } $tpl->copy_template = preg_replace("#\\{date=(.+?)\\}#ie", "langdate('\\1', '{$row['date']}')", $tpl->copy_template); $tpl->set('{text}', $text); //текст комментария $tpl->set('{user_url}', $user_url); // ссылка на автора $tpl->set('{user_name}', $row['autor']); // просто ник автора $tpl->set('[user_url]', "<a href=\"" . $user_url . "\">"); // оборачиваем в ссылку $tpl->set('[/user_url]', "</a>"); // оборачиваем в ссылку $tpl->set('{author}', $author); // автор с ссылкой на профиль с модальным окном $tpl->set('[color]', $this->group[$row['user_group']]['group_prefix']); // префикс цвета группы $tpl->set('[/color]', $this->group[$row['user_group']]['group_suffix']); // суфикс цвета группы $tpl->set('{title}', $title); // укороченный заголовок $tpl->set('{long_title}', stripslashes($row['title'])); // полный заголовок $tpl->set('{rating}', $row['rating']); // рейтинг новости $tpl->set('{views}', $row['news_read']); // просмотров новости $tpl->set('{full_link}', $full_link); // линк на комментарий $tpl->set('{comm_num}', $row['comm_num']); // кол-во комментариев новости $tpl->set("{error}", ""); $tpl->set('[comm]', ""); $tpl->set('[/comm]', ""); $tpl->set_block("'\\[not-comm\\](.*?)\\[/not-comm\\]'si", ""); $tpl->compile('comm'); //компиляция шаблона } $this->db->free($sql); //очищаем от запросов } else { $tpl->set("{error}", "Комментариев нету!"); $tpl->set_block("'\\[comm\\](.*?)\\[/comm\\]'si", ""); $tpl->set('[not-comm]', ""); $tpl->set('[/not-comm]', ""); $tpl->compile('comm'); } $tpl->clear(); //очищаем шаблон $Comm = $tpl->result['comm']; if (preg_match_all('/<!--dle_spoiler(.*?)<!--\\/dle_spoiler-->/is', $Comm, $spoilers)) { foreach ($spoilers as $spoiler) { $Comm = str_replace($spoiler, '<div class="quote">Для просмотра содержимого спойлера, перейдите к выбранному комментарию.</div>', $Comm); } } if ($this->group[$this->member['user_group']]['allow_hide']) { $Comm = preg_replace("'\\[hide\\](.*?)\\[/hide\\]'si", "\\1", $Comm); } else { $Comm = preg_replace("'\\[hide\\](.*?)\\[/hide\\]'si", "<div class=\"quote\"> Для вашей группы скрытый текст не виден </div>", $Comm); } create_cache("Comm_", $Comm, $this->config['skin'] . $Comm_hash); //создаем кэш if ($is_change) { $this->config['allow_cache'] = false; } //выключаем кэш принудительно (возвращаем назад) } echo '<div class="iComm" id="iComm"><ul class="lastcomm">' . $Comm . '</ul> <!-- .lastcomm --></div>'; }
if ($row[news_num] == 0) { $news_link = "{$row['news_num']}"; } else { $news_link = "[<a href=\"{$config['http_home_url']}index.php?subaction=userinfo&user="******"\" target=\"_blank\">" . $row[news_num] . "</a>]"; } if ($row[comm_num] == 0) { $comms_link = $row['comm_num']; } else { $comms_link = "[<a onClick=\"return dropdownmenu(this, event, MenuBuild('" . $row['user_id'] . "'), '150px')\" href=\"#\" >" . $row[comm_num] . "</a>]"; } if ($row['banned'] == 'yes') { $group = "<font color=\"red\">" . $lang['user_ban'] . "</font>"; } else { $group = $user_group[$row['user_group']]['group_name']; } echo "\n <tr>\n <td style=\"padding:3px\">\n <a class=maintitle onClick=\"javascript:popupedit('{$row['user_id']}'); return(false)\" href=#>{$row['name']}</a>\n </td>\n <td>\n " . $row['ip'] . "</td>\n <td>\n " . langdate("d/m/Y - H:i", $row['reg_date']) . "</td>\n <td>\n " . langdate('d/m/Y - H:i', $row['lastdate']) . "</td>\n <td align=\"center\">\n " . $news_link . "</td>\n <td align=\"center\">\n " . $comms_link . "</td>\n <td>\n " . $group . "</td>\n </tr>\n\t <tr><td background=\"engine/skins/images/mline.gif\" height=1 colspan=7></td></tr>\n "; } if ($i == 0) { echo "<tr>\n <td height=18 colspan=7>\n <p align=center><br><b>{$lang['ip_empty']}<br><br></b>\n </tr>"; } echo <<<HTML </table> </td> <td background="engine/skins/images/tl_rb.gif"><img src="engine/skins/images/tl_rb.gif" width="6" height="1" border="0"></td> </tr> <tr> <td><img src="engine/skins/images/tl_lu.gif" width="4" height="6" border="0"></td> <td background="engine/skins/images/tl_ub.gif"><img src="engine/skins/images/tl_ub.gif" width="1" height="6" border="0"></td> <td><img src="engine/skins/images/tl_ru.gif" width="6" height="6" border="0"></td> </tr> </table>
if ($_POST['tags'] != "" and $approve) { $tags = array(); $_POST['tags'] = explode(",", $_POST['tags']); foreach ($_POST['tags'] as $value) { $tags[] = "('" . $row['id'] . "', '" . trim($value) . "')"; } $tags = implode(", ", $tags); $db->query("INSERT INTO " . PREFIX . "_tags (news_id, tag) VALUES " . $tags); } if (!$approve and $config['mail_news']) { include_once ENGINE_DIR . '/classes/mail.class.php'; $row = $db->super_query("SELECT * FROM " . PREFIX . "_email WHERE name='new_news' LIMIT 0,1"); $mail = new dle_mail($config, $row['use_html']); $row['template'] = stripslashes($row['template']); $row['template'] = str_replace("{%username%}", $member_id['name'], $row['template']); $row['template'] = str_replace("{%date%}", langdate("j F Y H:i", $added_time, true), $row['template']); $row['template'] = str_replace("{%title%}", stripslashes(stripslashes($title)), $row['template']); $category_list = explode(",", $category_list); $my_cat = array(); foreach ($category_list as $element) { $my_cat[] = $cat_info[$element]['name']; } $my_cat = stripslashes(implode(', ', $my_cat)); $row['template'] = str_replace("{%category%}", $my_cat, $row['template']); $mail->send($config['admin_mail'], $lang['mail_news'], $row['template']); } } if ($config['allow_alt_url']) { msgbox($lang['add_ok'], "{$msg} <a href=\"{$config['http_home_url']}" . "addnews.html\">{$lang['add_noch']}</a> {$lang['add_or']} <a href=\"{$config['http_home_url']}\">{$lang['all_prev']}</a>"); } else { msgbox($lang['add_ok'], "{$msg} <a href=\"{$PHP_SELF}?do=addnews\">{$lang['add_noch']}</a> {$lang['add_or']} <a href=\"{$config['http_home_url']}\">{$lang['all_prev']}</a>");
<script src='https://www.google.com/recaptcha/api.js?hl={$lang['wysiwyg_language']}' async defer></script> HTML; } $tpl->compile('addcomments'); $tpl->clear(); if (strpos($tpl->result['content'], "<!--dleaddcomments-->") !== false) { $tpl->result['content'] = str_replace("<!--dleaddcomments-->", $tpl->result['addcomments'], $tpl->result['content']); } else { $tpl->result['content'] .= $tpl->result['addcomments']; } unset($tpl->result['addcomments']); } elseif ($member_id['restricted']) { $tpl->load_template('info.tpl'); if ($member_id['restricted_days']) { $tpl->set('{error}', $lang['news_info_2']); $tpl->set('{date}', langdate("j F Y H:i", $member_id['restricted_date'])); } else { $tpl->set('{error}', $lang['news_info_3']); } $tpl->set('{title}', $lang['all_info']); $tpl->compile('content'); $tpl->clear(); } elseif (!$allow_add) { $tpl->load_template('info.tpl'); $tpl->set('{error}', $lang['news_info_6']); $tpl->set('{days}', $config['max_comments_days']); $tpl->set('{title}', $lang['all_info']); $tpl->compile('content'); $tpl->clear(); } elseif ($config['allow_comments']) { $tpl->load_template('info.tpl');
} else { $user_from = "{$PHP_SELF}?subaction=userinfo&user="******"onclick=\"ShowProfile('" . urlencode($row['user_from']) . "', '" . $user_from . "', '" . $user_group[$member_id['user_group']]['admin_editusers'] . "'); return false;\""; $user_from = "<a {$user_from} class=\"pm_list\" href=\"{$PHP_SELF}?subaction=userinfo&user="******"\">" . $row['user_from'] . "</a>"; } if ($row['pm_read']) { $subj = "<a class=\"pm_list\" href=\"{$PHP_SELF}?do=pm&doaction=readpm&pmid=" . $row['id'] . "\">" . stripslashes($row['subj']) . "</a>"; $icon = "{THEME}/dleimages/read.gif"; } else { $subj = "<a class=\"pm_list\" href=\"{$PHP_SELF}?do=pm&doaction=readpm&pmid=" . $row['id'] . "\"><b>" . stripslashes($row['subj']) . "</b></a>"; $icon = "{THEME}/dleimages/unread.gif"; } if ($row['reply']) { $icon = "{THEME}/dleimages/send.gif"; } $pmlist .= "<tr><td><img src=\"{$icon}\" border=\"0\" alt=\"\" /></td><td class=\"pm_list\">{$subj}</td><td class=\"pm_list\">{$user_from}</td><td class=\"pm_list\" align=\"center\">" . langdate("j.m.Y H:i", $row['date']) . "</td><td class=\"pm_list\" align=\"center\"><input name=\"selected_pm[]\" value=\"{$row['id']}\" type=\"checkbox\" /></td></tr>"; } $db->free(); $count_all = $db->super_query("SELECT FOUND_ROWS() as count"); $count_all = $count_all['count']; $pages = ""; if ($count_all and $count_all > $pm_per_page) { if (isset($cstart) and $cstart > 0) { $prev = $cstart / $pm_per_page; if ($prev == 1) { $pages .= "<a href=\"{$PHP_SELF}?{$user_query}\"> << </a> "; } else { $pages .= "<a href=\"{$PHP_SELF}?cstart={$prev}&{$user_query}\"> << </a> "; } } $enpages_count = @ceil($count_all / $pm_per_page);
/* понеслась, куча тегов.. */ if ($config['allow_alt_url'] == "yes") { $go_page = $config['http_home_url'] . "user/" . urlencode($rowb['autor']) . "/"; } else { $go_page = "{$PHP_SELF}?subaction=userinfo&user="******"' . $go_page . '" title="' . urlencode($rowb['autor']) . '">'); $tplb->set('[/profile]', '</a>'); $tplb->set('{login}', $rowb['autor']); $tplb->set('{author}', "<a onclick=\"ShowProfile('" . urlencode($rowb['autor']) . "', '" . $go_page . "', '" . $user_group[$member_id['user_group']]['admin_editusers'] . "'); return false;\" title=\"" . urlencode($rowb['autor']) . "\" href=\"" . $go_page . "\">" . $rowb['autor'] . "</a>"); if (date('Ymd', $rowb['date']) == date('Ymd', $_TIME)) { $tplb->set('{date}', $lang['time_heute'] . langdate(", H:i", $rowb['date'])); } elseif (date('Ymd', $rowb['date']) == date('Ymd', $_TIME - 86400)) { $tplb->set('{date}', $lang['time_gestern'] . langdate(", H:i", $rowb['date'])); } else { $tplb->set('{date}', langdate($config['timestamp_active'], $rowb['date'])); } // дата разного формата бывает... $tplb->copy_template = preg_replace("#\\{date=(.+?)\\}#ie", "langdate('\\1', '{$rowb['date']}')", $tplb->copy_template); $title = htmlspecialchars(strip_tags(stripslashes($rowb['title']))); $tplb->set('{title}', $title); if (preg_match("#\\{title limit=['\"](.+?)['\"]\\}#i", $tplb->copy_template, $t_matches)) { $t_count = intval($t_matches[1]); if ($t_count and dle_strlen($title, $config['charset']) > $t_count) { $title = dle_substr($title, 0, $t_count, $config['charset']) . "…"; } $tplb->set($t_matches[0], $title); } if ($user_group[$member_id['user_group']]['allow_hide']) { $rowb['short_story'] = str_ireplace(array("[hide]", "[/hide]"), "", $rowb['short_story']); } else {
\t minLength: 3, \t search: function( event, ui ) { \t \$('#specialty').autocomplete("option", "source", ajax_url + '?action=specialty&sphere=' + \$('#sphere_id').val()); \t } \t }); }); </script> JS; $tpl->header($job->lang['resumes'], true, $JS, array($config['http_home_url'] . 'engine/job/images/admin/jquery.autocomplete.css'), array($config['http_home_url'] . 'engine/job/javascript/jquery.metadata.js', $config['http_home_url'] . 'engine/job/javascript/jquery.validate.js', $config['http_home_url'] . 'engine/job/javascript/messages_ru.js')); if (empty($where)) { $tpl->echo = FALSE; if ($edit['id']) { $data[] = array('', "<b>ID</b>" . $edit['id']); } if ($edit['add_date']) { $data[] = array($job->lang['resume_added'], langdate('j F Yã. â H:i', $edit['add_date'])); } $data[] = array($job->lang['sphere'], $tpl->selection($job->GetSpheres('add'), 'sphere_id', $edit['sphere_id'], 'id="sphere_id"')); $data[] = array($job->lang['specialty'], $tpl->InputText('specialty', $edit['specialty'], "id='specialty'")); //$data[] = array($job->lang['specialty'], $tpl->selection($job->GetSpecialties($edit['sphere_id']), 'specialty_id', $edit['specialty_id'], 'id="specialty_id"')); if ($job->use_country) { $data[] = array($job->lang['country'], $tpl->selection($job->GetCountries('add'), 'country_id', $edit['country_id'], "id='country_id'")); } if ($job->use_city) { $data[] = array($job->lang['city'], $tpl->selection($job->GetCities($edit['country_id']), 'city_id', $edit['city_id'], "id='city_id'")); } foreach (Resume::$fields as $field_name => $values_array) { $data[] = array($job->lang[$field_name], $tpl->selection(array("" => $job->lang['no_show']) + $values_array, $field_name, $edit[$field_name])); } $data[] = array($job->lang['sex'], $tpl->selection(array(0 => $job->lang['no_show'], "M" => $job->lang['sex_man'], "W" => $job->lang['sex_woman']), 'sex', $edit['sex'])); $data[] = array($job->lang['age'], $tpl->InputText('age', $edit['age'], 'size=10'));
if ($member_id['icq']) { $tpl->set('{icq}', stripslashes($member_id['icq'])); } else { $tpl->set('{icq}', '--'); } if ($user_group[$member_id['user_group']]['icon']) { $tpl->set('{group-icon}', "<img src=\"" . $user_group[$member_id['user_group']]['icon'] . "\" border=\"0\" alt=\"\" />"); } else { $tpl->set('{group-icon}', ""); } $tpl->set('{group-name}', $user_group[$member_id['user_group']]['group_prefix'] . $user_group[$member_id['user_group']]['group_name'] . $user_group[$member_id['user_group']]['group_suffix']); $tpl->set('{news-num}', intval($member_id['news_num'])); $tpl->set('{comm-num}', intval($member_id['comm_num'])); if ($member_id['foto']) { $tpl->set('{foto}', $config['http_home_url'] . "uploads/fotos/" . $member_id['foto']); } else { $tpl->set('{foto}', "{THEME}/images/noavatar.png"); } $tpl->set('{date}', "--"); if ($member_id['reg_date']) { $tpl->set('{registration}', langdate("j.m.Y", $member_id['reg_date'])); } else { $tpl->set('{registration}', '--'); } $tpl->compile('content'); $tpl->clear(); $tpl->result['content'] = str_replace('{THEME}', $config['http_home_url'] . 'templates/' . $_REQUEST['skin'], $tpl->result['content']); $tpl->result['content'] = str_ireplace("[hide]", "", str_ireplace("[/hide]", "", $tpl->result['content'])); $tpl->result['content'] = "<div id=\"blind-animation\" style=\"display:none\">" . $tpl->result['content'] . "<div>"; echo $tpl->result['content']; }
if ($row['votes']) { $tpl->set('[poll]', ""); $tpl->set('[/poll]', ""); $tpl->set_block("'\\[not-poll\\](.*?)\\[/not-poll\\]'si", ""); } else { $tpl->set('[not-poll]', ""); $tpl->set('[/not-poll]', ""); $tpl->set_block("'\\[poll\\](.*?)\\[/poll\\]'si", ""); } if ($row['view_edit'] and $row['editdate']) { if (date(Ymd, $row['editdate']) == date(Ymd, $_TIME)) { $tpl->set('{edit-date}', $lang['time_heute'] . langdate(", H:i", $row['editdate'])); } elseif (date(Ymd, $row['editdate']) == date(Ymd, $_TIME - 86400)) { $tpl->set('{edit-date}', $lang['time_gestern'] . langdate(", H:i", $row['editdate'])); } else { $tpl->set('{edit-date}', langdate($config['timestamp_active'], $row['editdate'])); } $tpl->set('{editor}', $row['editor']); $tpl->set('{edit-reason}', $row['reason']); if ($row['reason']) { $tpl->set('[edit-reason]', ""); $tpl->set('[/edit-reason]', ""); } else { $tpl->set_block("'\\[edit-reason\\](.*?)\\[/edit-reason\\]'si", ""); } $tpl->set('[edit-date]', ""); $tpl->set('[/edit-date]', ""); } else { $tpl->set('{edit-date}', ""); $tpl->set('{editor}', ""); $tpl->set('{edit-reason}', "");
<td colspan="2"><select name="editlevel"> HTML; echo get_groups($row[user_group]); if ($row['banned'] == "yes") { $ifch = "checked"; } $row['days'] = intval($row['days']); if ($row['banned'] == "yes" and $row['days']) { $endban = $lang['ban_edate'] . " " . langdate("j F Y H:i", $row['banned_date']); } else { $endban = ""; } $restricted_selected = array(0 => '', 1 => '', 2 => '', 3 => ''); $restricted_selected[$row['restricted']] = 'selected'; if ($row['restricted'] and $row['restricted_days']) { $end_restricted = $lang['edit_tdate'] . " " . langdate("j M Y H:i", $row['restricted_date']); } else { $end_restricted = ""; } if ($row['restricted']) { $lang['restricted_none'] = $lang['restricted_clear']; } echo <<<HTML </select></td> </tr> <tr> <td style="padding:4px;">{$lang['user_gtlimit']}</td> <td colspan="2"><input size="17" name="time_limit" id="time_limit" class="edit bk" value="{$row['time_limit']}"> <img src="engine/skins/images/img.gif" align="absmiddle" id="t_trigger_ent" style="cursor: pointer; border: 0" title="{$lang['edit_ecal']}"/><a href="#" class="hintanchor" onMouseover="showhint('{$lang[hint_glhel]}', this, event, '250px')">[?]</a> <script type="text/javascript"> Calendar.setup({ inputField : "time_limit", // id of the input field
function main($page) { /* Login */ if (!$this->member_id['name']) { return $this->lang['pay_need_login']; } /* Status */ if (!$this->plugin_config['status']) { return $this->T_msg($this->lang['pay_error_title'], $this->lang['cabinet_off'], "Refund"); } /* Post */ if (isset($_POST['submit'])) { $post_requisites = $this->db->safesql($_POST['bs_requisites']); $post_summa = $this->pay_api->bf_convert($_POST['bs_summa']); $post_commission = $this->pay_api->bf_convert($post_summa / 100 * $this->plugin_config['com']); $error = ""; if (!isset($_POST['bs_hash']) or $_POST['bs_hash'] != $this->hash()) { $error = $this->lang['pay_hash_error']; } else { if (!$post_summa) { $error = $this->lang['pay_summa_error']; } else { if (!$post_requisites) { $error = str_replace("{link_to_user}", $this->config_dle['http_home_url'] . "user/" . urlencode($this->member_id['name']), $this->lang['refund_error_requisites']); } else { if ($post_summa > $this->member_id[$this->config['fname']]) { $error = $this->lang['refund_error_balance']; } else { if ($post_summa < $this->plugin_config['minimum']) { $error = $this->lang['refund_error_minimum'] . $this->plugin_config['minimum'] . " " . $this->pay_api->bf_declOfNum($this->plugin_config['minimum']); } } } } } if ($error) { return $this->T_msg($this->lang['pay_error_title'], $error, "Refund"); } // - Creat moneyback $redund_id = $this->db_creat_refund($this->member_id['name'], $post_summa, $post_commission, $post_requisites); $this->pay_api->minus($this->member_id['name'], $post_summa, $this->lang['refund_msgOk'], $this->pay_api->bf_declOfNum($post_summa), "refund", $redund_id); // - email if ($this->plugin_config['email']) { include_once ENGINE_DIR . '/classes/mail.class.php'; $mail = new dle_mail($this->config_dle, true); $mail->send($this->config_dle['admin_mail'], $this->lang['refund_email_title'], $this->lang['refund_email_msg'] . $this->config_dle['http_home_url'] . $this->config_dle['admin_path'] . "?mod=billing&c=Refund"); unset($mail); } } /* PAGE */ $this->set_element("{hash}", $this->hash()); $this->set_element("{requisites}", $this->xfield($this->plugin_config['requisites'])); $this->set_element("{minimum}", $this->plugin_config['minimum']); $this->set_element("{minimum_valuta}", $this->pay_api->bf_declOfNum($this->plugin_config['minimum'])); $this->set_element("{commission}", $this->plugin_config['com']); $this->set_element("{mask}", $this->plugin_config['format']); /* History */ $tpl = $this->load("Refund"); $log = ""; $tpl_log = $this->T_preg_match($tpl, '~\\[history\\](.*?)\\[/history\\]~is'); $tpl_log_null = $this->T_preg_match($tpl, '~\\[not_history\\](.*?)\\[/not_history\\]~is'); $tpl_log_date = $this->T_preg_match($tpl_log, '~\\{date=(.*?)\\}~is'); $this->db_where(array("refund_user = '******' " => $this->member_id['name'])); $history = $this->db_get_refund($page, $this->config['paging']); $num_history = $this->db_get_refund_num(); foreach ($history as $history_id => $history_value) { $time_log_theme = $tpl_log; $time_log_theme = str_replace("{date=" . $tpl_log_date . "}", langdate($tpl_log_date, $history_value['refund_date']), $time_log_theme); $time_log_theme = str_replace("{refund_requisites}", $history_value['refund_requisites'], $time_log_theme); $time_log_theme = str_replace("{refund_commission}", $history_value['refund_commission'], $time_log_theme); $time_log_theme = str_replace("{refund_commission_valuta}", $this->pay_api->bf_declOfNum($history_value['refund_commission']), $time_log_theme); $time_log_theme = str_replace("{refund_summa}", $history_value['refund_summa'], $time_log_theme); $time_log_theme = str_replace("{refund_summa_valuta}", $this->pay_api->bf_declOfNum($history_value['refund_summa']), $time_log_theme); $time_log_theme = str_replace("{refund_status}", $history_value['refund_date_return'] ? "<font color=\"green\">" . langdate($tpl_log_date, $history_value['refund_date_return']) . "</a>" : "<font color=\"red\">" . $this->lang['refund_wait'] . "</a>", $time_log_theme); $log .= $time_log_theme; } /* Paging */ if ($num_history > $this->config['paging']) { $tpl_log_page = $this->T_preg_match($tpl, '~\\[paging\\](.*?)\\[/paging\\]~is'); $tpl_log_page_link = $this->T_preg_match($tpl, '~\\[page_link\\](.*?)\\[/page_link\\]~is'); $tpl_log_page_this = $this->T_preg_match($tpl, '~\\[page_this\\](.*?)\\[/page_this\\]~is'); $tpl_log_page = preg_replace("'\\[page_link\\].*?\\[/page_link\\]'si", $this->pay_api->bf_paging($num_history, $page, $this->config_dle['http_home_url'] . $this->config['page'] . ".html/Refund/main/{p}", $tpl_log_page_link, $tpl_log_page_this), $tpl_log_page); $tpl_log_page = preg_replace("'\\[page_this\\].*?\\[/page_this\\]'si", "", $tpl_log_page); $this->set_element_block("paging", $tpl_log_page); } else { $this->set_element_block("paging", ""); } /* LOG NULL */ if ($log) { $this->set_element_block("not_history", ""); } else { $this->set_element_block("not_history", $tpl_log_null); } $this->set_element_block("history", $log); /* History END */ $tpl = $this->load("Refund"); $this->set_element("{content}", $tpl); return $this->load("cabinet", "Refund"); }
$tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si", ""); } $tpl->set('{editmail}', stripslashes($row['email'])); $tpl->set('{status}', $user_group[$row['user_group']]['group_prefix'] . $user_group[$row['user_group']]['group_name'] . $user_group[$row['user_group']]['group_suffix']); $tpl->set('{rate}', userrating($row['user_id'])); $tpl->set('{registration}', langdate("j F Y H:i", $row['reg_date'])); $tpl->set('{lastdate}', langdate("j F Y H:i", $row['lastdate'])); if ($user_group[$row['user_group']]['icon']) { $tpl->set('{group-icon}', "<img src=\"" . $user_group[$row['user_group']]['icon'] . "\" alt=\"\" />"); } else { $tpl->set('{group-icon}', ""); } if ($is_logged and $user_group[$row['user_group']]['time_limit'] and ($member_id['user_id'] == $row['user_id'] or $member_id['user_group'] < 3)) { $tpl->set_block("'\\[time_limit\\](.*?)\\[/time_limit\\]'si", "\\1"); if ($row['time_limit']) { $tpl->set('{time_limit}', langdate("j F Y H:i", $row['time_limit'])); } else { $tpl->set('{time_limit}', $lang['no_limit']); } } else { $tpl->set_block("'\\[time_limit\\](.*?)\\[/time_limit\\]'si", ""); } $_IP = $db->safesql($_SERVER['REMOTE_ADDR']); $tpl->set('{ip}', $_IP); $tpl->set('{allowed-ip}', stripslashes(str_replace("|", "\n", $row['allowed_ip']))); $tpl->set('{editinfo}', $parse->decodeBBCodes($row['info'], false)); if ($user_group[$row['user_group']]['allow_signature']) { $tpl->set('{editsignature}', $parse->decodeBBCodes($row['signature'], false)); } else { $tpl->set('{editsignature}', $lang['sig_not_allowed']); }
<div class="fllogall">Сортировка:</div> <select name="sort" class="inpu"> <option value="0"></option> {$selsorlist} </select> <div class="mgcler"></div> <div class="fllogall"> </div> <input type="submit" value="Найти" class="inp" style="margin-top:0px" /> </form> HTML; echohtmlstart('Список сообществ (' . $numRows['cnt'] . ')'); foreach ($sql_ as $row) { $row['title'] = stripslashes($row['title']); $row['date'] = langdate('j M Y в H:i', strtotime($row['date'])); if ($row['del']) { $color = 'color:red'; } else { if ($row['ban']) { $color = 'color:blue'; } else { $color = ''; } } $users .= <<<HTML <div style="background:#fff;float:left;padding:5px;width:100px;text-align:center;"><a href="/u{$row['real_admin']}" target="_blank">{$row['user_name']}</a></div> <div style="background:#fff;float:left;padding:5px;width:243px;text-align:center;margin-left:1px"><a href="?mod=groups&act=edit&id={$row['id']}" title="Записей на стене: {$row['rec_num']}" style="{$color}">{$row['title']}</a></div> <div style="background:#fff;float:left;padding:5px;width:75px;text-align:center;margin-left:1px">{$row['traf']}</div> <div style="background:#fff;float:left;padding:5px;width:110px;text-align:center;margin-left:1px">{$row['date']}</div> <div style="background:#fff;float:left;padding:4px;width:20px;text-align:center;font-weight:bold;margin-left:1px"><input type="checkbox" name="massaction_list[]" style="float:right;" value="{$row['id']}" /></div>
} else { $tpl->set('{pages}', ''); $template = preg_replace("'\\[PAGE=(.*?)\\](.*?)\\[/PAGE\\]'si", "", $template); } } if ($config['allow_alt_url'] == "yes") { $print_link = $config['http_home_url'] . "print:" . $static_result['name'] . ".html"; } else { $print_link = $config['http_home_url'] . "engine/print.php?do=static&page=" . $static_result['name']; } if (@date("Ymd", $static_result['date']) == date("Ymd", $_TIME)) { $tpl->set('{date}', $lang['time_heute'] . langdate(", H:i", $static_result['date'])); } elseif (@date("Ymd", $static_result['date']) == date("Ymd", $_TIME - 86400)) { $tpl->set('{date}', $lang['time_gestern'] . langdate(", H:i", $static_result['date'])); } else { $tpl->set('{date}', langdate($config['timestamp_active'], $static_result['date'])); } $news_date = $static_result['date']; $tpl->copy_template = preg_replace_callback("#\\{date=(.+?)\\}#i", "formdate", $tpl->copy_template); $tpl->set('{description}', $static_descr); $tpl->set('{static}', $template); $tpl->set('{views}', $static_result['views']); if ($config['allow_search_print']) { $tpl->set('[print-link]', "<a href=\"" . $print_link . "\">"); $tpl->set('[/print-link]', "</a>"); } else { $tpl->set('[print-link]', "<a href=\"" . $print_link . "\" rel=\"nofollow\">"); $tpl->set('[/print-link]', "</a>"); } if ($_GET['page'] == "dle-rules-page") { if ($do != "register") {
$row['text'] = preg_replace('`(http(?:s)?://\\w+[^\\s\\[\\]\\<]+)`i', '<a href="/away.php?url=$1" target="_blank">$1</a>', $row['text']); } $resLinkTitle = ''; //Если это запись с "рассказать друзьям" if ($row['tell_uid']) { if ($row['public']) { $rowUserTell = $db->super_query("SELECT title, photo FROM `" . PREFIX . "_communities` WHERE id = '{$row['tell_uid']}'"); } else { $rowUserTell = $db->super_query("SELECT user_search_pref, user_photo FROM `" . PREFIX . "_users` WHERE user_id = '{$row['tell_uid']}'"); } if (date('Y-m-d', $row['tell_date']) == date('Y-m-d', $server_time)) { $dateTell = langdate('сегодня в H:i', $row['tell_date']); } elseif (date('Y-m-d', $row['tell_date']) == date('Y-m-d', $server_time - 84600)) { $dateTell = langdate('вчера в H:i', $row['tell_date']); } else { $dateTell = langdate('j F Y в H:i', $row['tell_date']); } if ($row['public']) { $rowUserTell['user_search_pref'] = stripslashes($rowUserTell['title']); $tell_link = 'public'; if ($rowUserTell['photo']) { $avaTell = '/uploads/groups/' . $row['tell_uid'] . '/50_' . $rowUserTell['photo']; } else { $avaTell = '{theme}/images/no_ava_50.png'; } } else { $tell_link = 'u'; if ($rowUserTell['user_photo']) { $avaTell = '/uploads/users/' . $row['tell_uid'] . '/50_' . $rowUserTell['user_photo']; } else { $avaTell = '{theme}/images/no_ava_50.png';
function build_comments($template, $area, $allow_cache = false) { global $config, $tpl, $is_logged, $member_id, $user_group, $lang, $dle_login_hash, $_TIME, $allow_comments_ajax, $ajax_adds; $tpl->load_template($template); $tpl->copy_template = "<div id='comment-id-{id}'>" . $tpl->copy_template . "</div>"; $tpl->template = "<div id='comment-id-{id}'>" . $tpl->template . "</div>"; if (strpos($tpl->copy_template, "[xfvalue_") !== false) { $xfound = true; } else { $xfound = false; } if ($xfound) { $xfields = xfieldsload(true); } if ($area != 'ajax' and $config['comm_msort'] == "DESC") { $tpl->copy_template = "\n<div id=\"dle-ajax-comments\"></div>\n" . $tpl->copy_template; } if ($area != 'ajax') { $tpl->copy_template = "<form method=\"post\" action=\"\" name=\"dlemasscomments\" id=\"dlemasscomments\"><div id=\"dle-comments-list\">\n" . $tpl->copy_template; } if ($area != 'ajax') { $tpl->copy_template = "<a name=\"comment\"></a>" . $tpl->copy_template; } $rows = false; if ($allow_cache) { $rows = dle_cache("comm_" . $allow_cache, $this->query . " LIMIT " . $this->cstart . "," . $this->comments_per_pages); } if ($rows) { $rows = unserialize($rows); $full_cache = true; } else { $rows = $this->db->super_query($this->query . " LIMIT " . $this->cstart . "," . $this->comments_per_pages, true); if ($allow_cache) { create_cache("comm_" . $allow_cache, serialize($rows), $this->query . " LIMIT " . $this->cstart . "," . $this->comments_per_pages); } } if (count($rows)) { foreach ($rows as $row) { $this->intern_count++; $row['date'] = strtotime($row['date']); $row['gast_name'] = stripslashes($row['gast_name']); $row['gast_email'] = stripslashes($row['gast_email']); $row['name'] = stripslashes($row['name']); if (!$row['is_register'] or $row['name'] == '') { if ($row['gast_email'] != "") { $tpl->set('{author}', "<a href=\"mailto:" . htmlspecialchars($row['gast_email'], ENT_QUOTES) . "\">" . $row['gast_name'] . "</a>"); } else { $tpl->set('{author}', $row['gast_name']); } $tpl->set('{login}', $row['gast_name']); $tpl->set('[profile]', ""); $tpl->set('[/profile]', ""); } else { if ($config['allow_alt_url'] == "yes") { $go_page = $config['http_home_url'] . "user/" . urlencode($row['name']) . "/"; $tpl->set('[profile]', "<a href=\"" . $config['http_home_url'] . "user/" . urlencode($row['name']) . "/\">"); } else { $go_page = "{$PHP_SELF}?subaction=userinfo&user="******"<a href=\"{$PHP_SELF}?subaction=userinfo&user="******"\">"); } $go_page = "onclick=\"ShowProfile('" . urlencode($row['name']) . "', '" . htmlspecialchars($go_page) . "', '" . $user_group[$member_id['user_group']]['admin_editusers'] . "'); return false;\""; if ($config['allow_alt_url'] == "yes") { $tpl->set('{author}', "<a {$go_page} href=\"" . $config['http_home_url'] . "user/" . urlencode($row['name']) . "/\">" . $row['name'] . "</a>"); } else { $tpl->set('{author}', "<a {$go_page} href=\"{$PHP_SELF}?subaction=userinfo&user="******"\">" . $row['name'] . "</a>"); } $tpl->set('{login}', $row['name']); $tpl->set('[/profile]', "</a>"); } if ($is_logged and $member_id['user_group'] == '1') { $tpl->set('{ip}', "IP: <a onclick=\"return dropdownmenu(this, event, IPMenu('" . $row['ip'] . "', '" . $lang['ip_info'] . "', '" . $lang['ip_tools'] . "', '" . $lang['ip_ban'] . "'), '190px')\" href=\"https://www.nic.ru/whois/?ip={$row['ip']}\" target=\"_blank\">{$row['ip']}</a>"); } else { $tpl->set('{ip}', ''); } $edit_limit = false; if (!$user_group[$member_id['user_group']]['edit_limit']) { $edit_limit = true; } elseif ($row['date'] + $user_group[$member_id['user_group']]['edit_limit'] * 60 > $_TIME) { $edit_limit = true; } if ($is_logged and $edit_limit and ($member_id['name'] == $row['name'] and $row['is_register'] and $user_group[$member_id['user_group']]['allow_editc'] or $user_group[$member_id['user_group']]['edit_allc'])) { $tpl->set('[com-edit]', "<a onclick=\"ajax_comm_edit('" . $row['id'] . "', '" . $area . "'); return false;\" href=\"" . $config['http_home_url'] . "index.php?do=comments&action=comm_edit&id=" . $row['id'] . "&area=" . $area . "\">"); $tpl->set('[/com-edit]', "</a>"); $allow_comments_ajax = true; } else { $tpl->set_block("'\\[com-edit\\](.*?)\\[/com-edit\\]'si", ""); } if ($is_logged and $edit_limit and ($member_id['name'] == $row['name'] and $row['is_register'] and $user_group[$member_id['user_group']]['allow_delc'] or $member_id['user_group'] == '1' or $user_group[$member_id['user_group']]['del_allc'])) { $tpl->set('[com-del]', "<a href=\"javascript:DeleteComments('{$row['id']}', '{$dle_login_hash}')\">"); $tpl->set('[/com-del]', "</a>"); } else { $tpl->set_block("'\\[com-del\\](.*?)\\[/com-del\\]'si", ""); } if ($user_group[$member_id['user_group']]['del_allc'] and !$user_group[$member_id['user_group']]['edit_limit']) { $tpl->set('{mass-action}', "<input name=\"selected_comments[]\" value=\"{$row['id']}\" type=\"checkbox\" />"); } else { $tpl->set('{mass-action}', ""); } if ($area == 'lastcomments') { $tpl->set_block("'\\[fast\\](.*?)\\[/fast\\]'si", ""); } else { if ($user_group[$member_id['user_group']]['allow_addc'] and $config['allow_comments'] == "yes") { if (!$row['is_register'] or $row['name'] == '') { $row['name'] = $row['gast_name']; } else { $row['name'] = $row['name']; } $tpl->set('[fast]', "<a onmouseover=\"dle_copy_quote('" . str_replace(array(" ", "'"), array(" ", "&#039;"), $row['name']) . "');\" href=\"#\" onclick=\"dle_ins('" . str_replace(array(" ", "'"), array(" ", "&#039;"), $row['name']) . "'); return false;\">"); $tpl->set('[/fast]', "</a>"); } else { $tpl->set_block("'\\[fast\\](.*?)\\[/fast\\]'si", ""); } } $tpl->set('{mail}', $row['email']); $tpl->set('{id}', $row['id']); if (date('Ymd', $row['date']) == date('Ymd', $_TIME)) { $tpl->set('{date}', $lang['time_heute'] . langdate(", H:i", $row['date'])); } elseif (date('Ymd', $row['date']) == date('Ymd', $_TIME - 86400)) { $tpl->set('{date}', $lang['time_gestern'] . langdate(", H:i", $row['date'])); } else { $tpl->set('{date}', langdate($config['timestamp_comment'], $row['date'])); } $tpl->copy_template = preg_replace("#\\{date=(.+?)\\}#ie", "langdate('\\1', '{$row['date']}')", $tpl->copy_template); if ($area == 'lastcomments') { $row['category'] = intval($row['category']); if ($config['allow_alt_url'] == "yes") { if ($config['seo_type'] == 1 or $config['seo_type'] == 2) { if ($row['category'] and $config['seo_type'] == 2) { $full_link = $config['http_home_url'] . get_url($row['category']) . "/" . $row['post_id'] . "-" . $row['alt_name'] . ".html"; } else { $full_link = $config['http_home_url'] . $row['post_id'] . "-" . $row['alt_name'] . ".html"; } } else { $full_link = $config['http_home_url'] . date('Y/m/d/', strtotime($row['newsdate'])) . $row['alt_name'] . ".html"; } } else { $full_link = $config['http_home_url'] . "index.php?newsid=" . $row['post_id']; } $tpl->set('{news_title}', "<a href=\"" . $full_link . "\">" . stripslashes($row['title']) . "</a>"); } else { $tpl->set('{news_title}', ""); } if ($xfound) { $xfieldsdata = xfieldsdataload($row['xfields']); foreach ($xfields as $value) { $preg_safe_name = preg_quote($value[0], "'"); if ($value[5] != 1 or $member_id['user_group'] == 1 or $is_logged and $row['is_register'] and $member_id['name'] == $row['name']) { if (empty($xfieldsdata[$value[0]])) { $tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template); $tpl->copy_template = str_replace("[xfnotgiven_{$preg_safe_name}]", "", $tpl->copy_template); $tpl->copy_template = str_replace("[/xfnotgiven_{$preg_safe_name}]", "", $tpl->copy_template); } else { $tpl->copy_template = preg_replace("'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template); $tpl->copy_template = str_replace("[xfgiven_{$preg_safe_name}]", "", $tpl->copy_template); $tpl->copy_template = str_replace("[/xfgiven_{$preg_safe_name}]", "", $tpl->copy_template); } $tpl->copy_template = preg_replace("'\\[xfvalue_{$preg_safe_name}\\]'i", stripslashes($xfieldsdata[$value[0]]), $tpl->copy_template); } else { $tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template); $tpl->copy_template = preg_replace("'\\[xfvalue_{$preg_safe_name}\\]'i", "", $tpl->copy_template); $tpl->copy_template = preg_replace("'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template); } } } if ($area == 'ajax' and isset($ajax_adds)) { $tpl->set('{comment-id}', "--"); } elseif ($area == 'lastcomments') { $tpl->set('{comment-id}', $this->total_comments - $this->cstart - $this->intern_count + 1); } else { if ($config['comm_msort'] == "ASC") { $tpl->set('{comment-id}', $this->cstart + $this->intern_count); } else { $tpl->set('{comment-id}', $this->total_comments - $this->cstart - $this->intern_count + 1); } } if ($row['foto']) { $tpl->set('{foto}', $config['http_home_url'] . "uploads/fotos/" . $row['foto']); } else { $tpl->set('{foto}', "{THEME}/images/noavatar.png"); } if ($row['is_register'] and $row['fullname']) { $tpl->set('[fullname]', ""); $tpl->set('[/fullname]', ""); $tpl->set('{fullname}', stripslashes($row['fullname'])); $tpl->set_block("'\\[not-fullname\\](.*?)\\[/not-fullname\\]'si", ""); } else { $tpl->set_block("'\\[fullname\\](.*?)\\[/fullname\\]'si", ""); $tpl->set('{fullname}', ""); $tpl->set('[not-fullname]', ""); $tpl->set('[/not-fullname]', ""); } if ($row['is_register'] and $row['icq']) { $tpl->set('[icq]', ""); $tpl->set('[/icq]', ""); $tpl->set('{icq}', stripslashes($row['icq'])); $tpl->set_block("'\\[not-icq\\](.*?)\\[/not-icq\\]'si", ""); } else { $tpl->set_block("'\\[icq\\](.*?)\\[/icq\\]'si", ""); $tpl->set('{icq}', ""); $tpl->set('[not-icq]', ""); $tpl->set('[/not-icq]', ""); } if ($row['is_register'] and $row['land']) { $tpl->set('[land]', ""); $tpl->set('[/land]', ""); $tpl->set('{land}', stripslashes($row['land'])); $tpl->set_block("'\\[not-land\\](.*?)\\[/not-land\\]'si", ""); } else { $tpl->set_block("'\\[land\\](.*?)\\[/land\\]'si", ""); $tpl->set('{land}', ""); $tpl->set('[not-land]', ""); $tpl->set('[/not-land]', ""); } if ($row['comm_num']) { $tpl->set('[comm-num]', ""); $tpl->set('[/comm-num]', ""); $tpl->set('{comm-num}', $row['comm_num']); $tpl->set_block("'\\[not-comm-num\\](.*?)\\[/not-comm-num\\]'si", ""); } else { $tpl->set('{comm-num}', 0); $tpl->set('[not-comm-num]', ""); $tpl->set('[/not-comm-num]', ""); $tpl->set_block("'\\[comm-num\\](.*?)\\[/comm-num\\]'si", ""); } if ($row['news_num']) { $tpl->set('[news-num]', ""); $tpl->set('[/news-num]', ""); $tpl->set('{news-num}', $row['news_num']); $tpl->set_block("'\\[not-news-num\\](.*?)\\[/not-news-num\\]'si", ""); } else { $tpl->set('{news-num}', 0); $tpl->set('[not-news-num]', ""); $tpl->set('[/not-news-num]', ""); $tpl->set_block("'\\[news-num\\](.*?)\\[/news-num\\]'si", ""); } if ($row['is_register'] and $row['reg_date']) { $tpl->set('{registration}', langdate("j.m.Y", $row['reg_date'])); } else { $tpl->set('{registration}', '--'); } if ($row['is_register'] and $row['lastdate']) { $tpl->set('{lastdate}', langdate("j.m.Y", $row['lastdate'])); if ($row['lastdate'] + 1200 > $_TIME or $row['user_id'] and $row['user_id'] == $member_id['user_id']) { $tpl->set('[online]', ""); $tpl->set('[/online]', ""); $tpl->set_block("'\\[offline\\](.*?)\\[/offline\\]'si", ""); } else { $tpl->set('[offline]', ""); $tpl->set('[/offline]', ""); $tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si", ""); } } else { $tpl->set('{lastdate}', '--'); $tpl->set_block("'\\[offline\\](.*?)\\[/offline\\]'si", ""); $tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si", ""); } if ($row['is_register'] and $row['signature'] and $user_group[$row['user_group']]['allow_signature']) { $tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si", "\\1"); $tpl->set('{signature}', stripslashes($row['signature'])); } else { $tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si", ""); } if ($is_logged) { $tpl->set('[complaint]', "<a href=\"javascript:AddComplaint('" . $row['id'] . "', 'comments')\">"); $tpl->set('[/complaint]', "</a>"); } else { $tpl->set_block("'\\[complaint\\](.*?)\\[/complaint\\]'si", ""); } if (!$row['user_group']) { $row['user_group'] = 5; } if ($user_group[$row['user_group']]['icon']) { $tpl->set('{group-icon}', "<img src=\"" . $user_group[$row['user_group']]['icon'] . "\" alt=\"\" />"); } else { $tpl->set('{group-icon}', ""); } $tpl->set('{group-name}', $user_group[$row['user_group']]['group_prefix'] . $user_group[$row['user_group']]['group_name'] . $user_group[$row['user_group']]['group_suffix']); if (count($this->extras_rules)) { foreach ($this->extras_rules as $rules) { if ($rules[0] == 'set') { $tpl->set($rules[1], $rules[2]); } else { $tpl->set_block($rules[1], $rules[2]); } } } if ($user_group[$member_id['user_group']]['allow_hide']) { $row['text'] = str_ireplace("[hide]", "", str_ireplace("[/hide]", "", $row['text'])); } else { $row['text'] = preg_replace("#\\[hide\\](.+?)\\[/hide\\]#is", "<div class=\"quote\">" . $lang['news_regus'] . "</div>", $row['text']); } $tpl->set('{comment}', "<div id='comm-id-" . $row['id'] . "'>" . stripslashes($row['text']) . "</div>"); $tpl->compile('comments'); } } else { $tpl->result['comments'] = ""; if ($area != 'ajax' and $config['comm_msort'] == "DESC") { $tpl->result['comments'] = "\n<div id=\"dle-ajax-comments\"></div>\n"; } if ($area != 'ajax') { $tpl->result['comments'] = "<form method=\"post\" action=\"\" name=\"dlemasscomments\" id=\"dlemasscomments\"><div id=\"dle-comments-list\">\n" . $tpl->result['comments']; } if ($area != 'ajax') { $tpl->result['comments'] = "<a name=\"comment\"></a>" . $tpl->result['comments']; } } $tpl->clear(); if ($area != 'ajax' and $config['comm_msort'] == "ASC") { $tpl->result['comments'] .= "\n<div id=\"dle-ajax-comments\"></div>\n"; } if ($area != 'ajax' and $user_group[$member_id['user_group']]['del_allc'] and !$user_group[$member_id['user_group']]['edit_limit']) { $tpl->result['comments'] .= "\n<div class=\"mass_comments_action\">{$lang['mass_comments']} <select name=\"mass_action\"><option value=\"\">{$lang['edit_selact']}</option><option value=\"mass_combine\">{$lang['edit_selcomb']}</option><option value=\"mass_delete\">{$lang['edit_seldel']}</option></select> <input type=\"submit\" class=\"bbcodes\" value=\"{$lang['b_start']}\" /></div>\n<input type=\"hidden\" name=\"do\" value=\"comments\" /><input type=\"hidden\" name=\"dle_allow_hash\" value=\"{$dle_login_hash}\" /><input type=\"hidden\" name=\"area\" value=\"{$area}\" />"; } if ($area != 'ajax') { $tpl->result['comments'] .= "</div></form>\n"; } if (strpos($tpl->result['content'], "<!--dlecomments-->") !== false) { $tpl->result['content'] = str_replace("<!--dlecomments-->", $tpl->result['comments'], $tpl->result['content']); } else { $tpl->result['content'] .= $tpl->result['comments']; } }