super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '$tid'"); $forum_id = $row_topic['forum_id']; $topic_title = stripslashes($row_topic['title']); $topic_title_last = urlencode($topic_title); $check_moderator = check_moderator($forums_array[$forum_id]['access_mod'], $forums_array[$forum_id]['moderators']); $check_write = check_access($forums_array[$forum_id]['access_write']); $page_n = @ceil(($row_topic['post'] + 1) / $forum_config['post_inpage']); if ($row_topic['topic_status'] and !$check_moderator) { $topic_status = false; } else { $topic_status = true; } if ($check_write and $topic_status) { $access_upload = check_access($forums_array[$forum_id]['access_upload']); $upload_var = array('area'=>"post", 'forum_id'=>$forum_id, 'topic_id'=>$tid, 'post_id'=>get_salt()); $tpl->load_template($tpl_dir.'addpost.tpl'); $tpl->set('{title}', $f_lang['app_reply']); $tpl->set('[not-wysywyg]', ""); $tpl->set('{wysiwyg}',''); $tpl->set('[/not-wysywyg]',""); include_once SYSTEM_DIR.'/forum/sources/components/bbcode.php'; if (!$is_logged) { $tpl->set('[not-logged]',''); $tpl->set('[/not-logged]',''); } else { $tpl->set_block("'\\[not-logged\\](.*?)\\[/not-logged\\]'si",""); } if (check_access($forum_config['post_captcha'])) { $tpl->set('[sec_code]',""); $tpl->set('[/sec_code]',""); $path = parse_url($config['http_home_url']); $anti_bot = !defined('FORUM_SUB_DOMAIN') ? 'system/modules/' : ''; $tpl->set('{sec_code}',""); } else { $tpl->set('{sec_code}',""); $tpl->set_block("'\\[sec_code\\](.*?)\\[/sec_code\\]'si",""); } $tpl->set('{bbcode}',$bb_code); $tpl->set('{text}',""); $add_post_action = $a_forum_url."act=post&code=add&page={$page_n}"; $tpl->copy_template = "
"; $tpl->compile('dle_forum'); $tpl->clear(); } else { $group_name = $user_group[$member_id['user_group']]['group_name']; forum_msg($f_lang['all_info'], $f_lang['topic_write'], 'user_group', $group_name); } if ($forum_config['forum_bar']) { $bbr_fid = $forum_id; $bbr_fname = $forums_array[$forum_id]['name']; $category_id = $forums_array[$forum_id]['main_id']; $bbr_cid = $category_id; $bbr_name = $cats_array[$category_id]['cat_name']; $bbr_tid = $tid; $bbr_tname = $topic_title; $bbr_app = $f_lang['app_reply']; } break; // ******************************************************************************** // FORWARD // ******************************************************************************** case "forward": if ($is_logged) { if (!$subaction) { $result = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '$tid'"); if ($result['tid']) { $topic_action_add = $a_forum_url."act=_topic&code=forward&subaction=send&tid={$tid}"; $tpl->load_template($tpl_dir.'send_frend.tpl'); $topic_link = $a_forum_url."showtopic={$tid}"; $tpl->set('{topic_title}', $result['title']); $tpl->set('{topic_link}', $topic_link); $tpl->set('{user_name}', $member_id['name']); $tpl->copy_template = ""; $tpl->compile('dle_forum'); $tpl->clear(); } else { forum_msg($f_lang['f_msg'], $f_lang['f_404']); } } else { $frend_name = strip_tags(stripslashes($_REQUEST['frend_name'])); $frend_mail = strip_tags(stripslashes($_REQUEST['frend_mail'])); $frend_title = strip_tags(stripslashes($_REQUEST['frend_title'])); $frend_text = strip_tags(stripslashes($_REQUEST['frend_text'])); if ($frend_name and $frend_mail and $frend_title and $frend_text) { $mail_tpl = $db->super_query("SELECT template FROM " . PREFIX . "_forum_email where name='frend_text' LIMIT 0,1"); $mail_tpl['template'] = stripslashes($mail_tpl['template']); $mail_result = str_replace("{%username_from%}", $member_id['name'], $mail_tpl['template']); $mail_result = str_replace("{%username_to%}", $frend_name, $mail_result); $mail_result = str_replace("{%text%}", $frend_text, $mail_result); include_once SYSTEM_DIR.'/classes/mail.class.php'; $mail = new dle_mail ($config); $mail->send ($frend_mail, $frend_title, $mail_result); $topic_link = $a_forum_url."showtopic={$tid}"; forum_msg($f_lang['f_msg'], $f_lang['mail_send'], "link", $topic_link); } else { forum_msg($f_lang['f_msg'], $f_lang['values_error']); } } } else { $group_name = $user_group[$member_id['user_group']]['group_name']; forum_msg($f_lang['f_msg'], $f_lang['page_deny'], "user_group", $group_name); } $bbr_app = $f_lang['title_forward']; break; // ******************************************************************************** // PRINT // ******************************************************************************** case "print": $row_topic = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '$tid'"); $forum_id = $row_topic['forum_id']; $check_read = check_access($forums_array[$forum_id]['access_read']); if ($check_read) { if ($row_topic['topic_descr']) { $row_topic['title'] = $row_topic['title'].', '.$row_topic['topic_descr']; } $result_posts = $db->query("SELECT p.*, u.* FROM " . PREFIX . "_forum_posts AS p LEFT JOIN " . USERPREFIX . "_users AS u ON p.post_author=u.name WHERE p.topic_id = '$tid' and p.hidden = '0' ORDER by pid"); while ($row = $db->get_row($result_posts)) { $row['post_date'] = strtotime($row['post_date']); $tpl->load_template($tpl_dir.'print/post.tpl'); $tpl->set('{author}', $row['post_author']); $tpl->set('{post-date}', show_date($row['post_date'])); $tpl->set('{text}', $row['post_text']); if ($member_id['forum_post'] >= $forum_config['post_hide']) { $tpl->set_block("'\[hide\](.*?)\[/hide\]'si","\\1"); } else { $hide_info = "Внимание! У вас нет прав, для просмотра скрытого текста. Необходимо $forum_config[post_hide] сообщений."; $tpl->set_block("'\\[hide\\](.*?)\\[/hide\\]'si","