message
252
system/forum/action/addpost.php
Normal file
@@ -0,0 +1,252 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
|
||||
if (check_access($forum_config['post_captcha']))
|
||||
{
|
||||
if ($_REQUEST['sec_code'] !== $_SESSION['sec_code_session'] and isset($_SESSION['sec_code_session']))
|
||||
{
|
||||
$post_captcha = true;
|
||||
|
||||
$_SESSION['sec_code_session'] = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$post_captcha = false;
|
||||
}
|
||||
|
||||
include_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
$post_text = $parse->process($post_text);
|
||||
|
||||
$post_text = $db->safesql($parse->BB_Parse($post_text, FALSE));
|
||||
|
||||
$post_text = auto_wrap ($post_text);
|
||||
|
||||
if (strlen($post_text) > $forum_config['post_maxlen'])
|
||||
{
|
||||
$post_maxlen = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$post_maxlen = false;
|
||||
}
|
||||
|
||||
$topic_title = $db->safesql(urldecode($topic_title));
|
||||
|
||||
if (!$is_logged)
|
||||
{
|
||||
$name = $db->safesql($parse->BB_Parse($parse->process($name), TRUE));
|
||||
|
||||
$mail = $db->safesql($parse->BB_Parse($parse->process($mail), TRUE));
|
||||
|
||||
$member_id['name'] = $name;
|
||||
|
||||
if ($name)
|
||||
{
|
||||
$db->query("SELECT name from " . USERPREFIX . "_users where LOWER(name) = '".strtolower($name)."'");
|
||||
|
||||
if (!$db->num_rows()){
|
||||
$name_ok = true;
|
||||
}else{
|
||||
$name_ok = false;
|
||||
$stop .= $f_lang['err_name'];
|
||||
}
|
||||
$db->free();
|
||||
}
|
||||
|
||||
if ($mail)
|
||||
{
|
||||
if(preg_match("/^[\.A-z0-9_\-]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $mail)){
|
||||
$mail_ok = true;
|
||||
}else{
|
||||
$mail_ok = false;
|
||||
$stop .= $f_lang['err_mail'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($name_ok and $mail_ok)
|
||||
{
|
||||
$add_post_ok = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$add_post_ok = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$add_post_ok = true;
|
||||
}
|
||||
|
||||
$_TIME = time()+($config['date_adjust']*60);
|
||||
|
||||
$topic_date = date ("Y-m-d H:i:s", $_TIME);
|
||||
|
||||
$_IP = $db->safesql($_SERVER['REMOTE_ADDR']);
|
||||
|
||||
if ($post_text and $topic_id and $forum_id and $add_post_ok and !$post_captcha and !$post_maxlen)
|
||||
{
|
||||
$postcount = intval ($forums_array[$forum_id]['postcount']);
|
||||
|
||||
if ($forum_config['post_update'])
|
||||
{
|
||||
$row = $db->super_query("SELECT pid, topic_id, post_author, DATE_FORMAT(post_date,'%Y-%m-%d') as post_date, post_text, is_register, post_ip FROM " . PREFIX . "_forum_posts WHERE topic_id = '$topic_id' ORDER BY pid DESC LIMIT 0,1");
|
||||
|
||||
$post_id = $row['pid'];
|
||||
|
||||
if ($row['post_author'] == $member_id['name'] AND $row['is_register']) $update_post = true;
|
||||
elseif ($row['ip'] == $_IP AND !$row['is_register'] AND !$is_logged) $update_post = true;
|
||||
|
||||
if ($row['post_date'] != date("Y-m-d", $_TIME)) $update_post = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!$update_post){
|
||||
|
||||
$db->query("INSERT INTO " . PREFIX . "_forum_posts (topic_id, post_date, post_author, post_text, post_ip, is_register, e_mail, is_count) values ('$topic_id', '$topic_date', '$member_id[name]', '$post_text', '$_IP', '$is_logged', '$mail', '$postcount')");
|
||||
|
||||
$new_pid = $db->insert_id();
|
||||
|
||||
// update table //
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET post = post+1, last_date = '$topic_date', last_poster_name = '$member_id[name]', last_post_id = '$new_pid' WHERE tid = '$topic_id'");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_forums SET posts = posts+1, f_last_tid = '$topic_id', f_last_title = '$topic_title', f_last_date = '$topic_date', f_last_poster_name = '$member_id[name]', last_post_id = '$new_pid' WHERE id = '$forum_id'");
|
||||
|
||||
if ($is_logged)
|
||||
{
|
||||
if ($postcount)
|
||||
{
|
||||
$db->query("UPDATE " . PREFIX . "_users SET forum_post = forum_post+1 WHERE name = '$member_id[name]'");
|
||||
}
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_views WHERE topic_id = '$topic_id' and user_id != '$member_id[user_id]'");
|
||||
}
|
||||
|
||||
if ($forum_config['set_sub_last_up'] and $is_parentid = $forums_array[$forum_id]['parentid'])
|
||||
{
|
||||
$db->query("UPDATE " . PREFIX . "_forum_forums SET f_last_tid = '$topic_id', f_last_title = '$topic_title', f_last_date ='$topic_date', f_last_poster_name = '$member_id[name]' WHERE id ='$is_parentid'");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$stop_subscription = true;
|
||||
|
||||
$post_text = $db->safesql($row['post_text'] . "<br /><br />" . stripslashes($post_text));
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts set post_text = '{$post_text}' WHERE pid = '{$post_id}'");
|
||||
|
||||
$new_pid = $post_id;
|
||||
}
|
||||
|
||||
if ($post_id)
|
||||
{
|
||||
if (stristr ($post_text, "[attachment="))
|
||||
{
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_files
|
||||
WHERE topic_id = '$topic_id' and file_attach = '0'");
|
||||
|
||||
while ($att = $db->get_row($result))
|
||||
{
|
||||
if (stristr ($post_text, "[attachment=".$att['file_id']."]") OR stristr ($post_text, "[attachment=".$att['file_id'].":url]"))
|
||||
{
|
||||
$update_id[] = $att['file_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($update_id)
|
||||
{
|
||||
$update_list = implode(',', $update_id);
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_files SET topic_id = '$topic_id', post_id = '$new_pid', file_attach = '1' WHERE file_id IN ({$update_list})");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$cache->clear ('forum_show_last');
|
||||
|
||||
$topic_location = $forum_url."/topic_{$topic_id}/{$page}#post-{$new_pid}";
|
||||
|
||||
if (!$ajax_adds)
|
||||
{
|
||||
header("Location: {$topic_location}");
|
||||
}
|
||||
|
||||
if ($forum_config['subscription'] AND !$stop_subscription)
|
||||
{
|
||||
$all_subscr = $db->query("SELECT name, email FROM ". PREFIX ."_forum_subscription AS t1 INNER JOIN ". PREFIX ."_users AS t2 ON t1.user_id = t2.user_id WHERE t1.topic_id = $topic_id and t1.user_id != '{$member_id['user_id']}'");
|
||||
|
||||
if ($db->num_rows($all_subscr))
|
||||
{
|
||||
include_once SYSTEM_DIR.'/classes/mail.class.php';
|
||||
|
||||
$mail = new dle_mail ($config);
|
||||
|
||||
$topic_link = $a_forum_url."showtopic={$topic_id}&lastpost=1#reply";
|
||||
|
||||
$topic_link_del = $config['http_home_url']."?do=forum&act=subscription&code=del&selected_id={$topic_id}";
|
||||
|
||||
$mail_tpl = $db->super_query("SELECT template FROM " . PREFIX . "_forum_email where name='subscription_text' LIMIT 0,1");
|
||||
|
||||
$mail_tpl['template'] = stripslashes($mail_tpl['template']);
|
||||
|
||||
while ($mail_row = $db->get_row($all_subscr))
|
||||
{
|
||||
$mail_result = str_replace("{%username_to%}", $mail_row['name'], $mail_tpl['template']);
|
||||
|
||||
$mail_result = str_replace("{%username_from%}", $member_id['name'], $mail_result);
|
||||
|
||||
$mail_result = str_replace("{%topic_name%}", $topic_title, $mail_result);
|
||||
|
||||
$mail_result = str_replace("{%topic_link%}", $topic_link, $mail_result);
|
||||
|
||||
$mail_result = str_replace("{%topic_link_del%}", $topic_link_del, $mail_result);
|
||||
|
||||
$mail_title = "Óâåäîìëåíèå îá îòâåòàõ íà ïîäïèñàííóþ òåìó";
|
||||
|
||||
$mail->send ($mail_row['email'], $mail_title, $mail_result);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$cache->clear ('forum_show_last');
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (!$add_post_ok)
|
||||
{
|
||||
forum_msg($f_lang['all_info'], $stop);
|
||||
|
||||
$add_post_error = $stop;
|
||||
}
|
||||
|
||||
elseif ($post_captcha)
|
||||
{
|
||||
forum_msg($f_lang['all_info'], $f_lang['captcha_stop']);
|
||||
|
||||
$add_post_error = $f_lang['ajax_stop_2'];
|
||||
}
|
||||
|
||||
elseif ($post_maxlen)
|
||||
{
|
||||
forum_msg($f_lang['all_info'], $f_lang['maxlen_stop']);
|
||||
|
||||
$add_post_error = $f_lang['ajax_stop_4'];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['all_info'], $f_lang['values_error']);
|
||||
|
||||
$add_post_error = $f_lang['ajax_stop_3'];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
325
system/forum/action/addtopic.php
Normal file
@@ -0,0 +1,325 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
|
||||
$forum_id = intval($_REQUEST['forum_id']);
|
||||
$postcount = intval ($forums_array[$forum_id]['postcount']);
|
||||
$subscription = intval($_REQUEST['subscription']);
|
||||
|
||||
// Îòêðûòèå íîâîé òåìû ïðè ìèíèìóìå ñîîáùåíèé íà ôîðóìå ó þçåðà
|
||||
if ($member_id['forum_post'] >= $forum_config['min_post'] OR $member_id['user_group'] < 2){
|
||||
$access_topic = check_access($forums_array[$forum_id]['access_topic']);
|
||||
}else{
|
||||
$access_topic = false;
|
||||
forum_msg($f_lang['all_info'], "Äëÿ îòêðûòèÿ íîâîé òåìû íóæíî èìåòü ìèíèìóì ".$forum_config['min_post']." ïîëåçíûõ ñîîáùåíèé íà ôîðóìå");
|
||||
}
|
||||
//Îòêðûòèå íîâîé òåìû ïðè ìèíèìóìå ñîîáùåíèé íà ôîðóìå ó þçåðà.
|
||||
|
||||
if ($access_topic)
|
||||
{
|
||||
if (!$_REQUEST['subaction'])
|
||||
{
|
||||
$access_upload = check_access($forums_array[$forum_id]['access_upload']);
|
||||
|
||||
$upload_var = array('area' => "topic", 'forum_id' => $forum_id, 'topic_id' => get_salt(),);
|
||||
|
||||
$tpl->set('[not-wysywyg]', "");
|
||||
|
||||
$tpl->set('{wysiwyg}','');
|
||||
|
||||
$tpl->set('[/not-wysywyg]',"");
|
||||
|
||||
include_once SYSTEM_DIR.'/forum/sources/components/bbcode.php';
|
||||
|
||||
$topic_action_add = $a_forum_url."act=add_topic&subaction=1";
|
||||
|
||||
$tpl->load_template($tpl_dir.'addtopic.tpl');
|
||||
|
||||
$tpl->set('{bbcode}',$bb_code);
|
||||
$tpl->set('{topic_title}',"");
|
||||
$tpl->set('{topic_descr}',"");
|
||||
$tpl->set('{text}',"");
|
||||
|
||||
if ($is_logged)
|
||||
{
|
||||
$tpl->set_block("'\\[not-logged\\](.*?)\\[/not-logged\\]'si","");
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set('[not-logged]','');
|
||||
$tpl->set('[/not-logged]','');
|
||||
}
|
||||
|
||||
if (check_access($forum_config['tools_poll']))
|
||||
{
|
||||
$tpl->set('[poll]','');
|
||||
$tpl->set('[/poll]','');
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\\[poll\\](.*?)\\[/poll\\]'si","");
|
||||
}
|
||||
|
||||
if (check_access($forum_config['topic_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}',"<span id=\"dle-captcha\"><img src=\"".$path['path'].$anti_bot."antibot.php\" alt=\"${lang['sec_image']}\" border=\"0\"></span>");
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set('{sec_code}',"");
|
||||
$tpl->set_block("'\\[sec_code\\](.*?)\\[/sec_code\\]'si","");
|
||||
}
|
||||
|
||||
$tpl->copy_template = "<form method=\"post\" name=\"forum-post-form\" id=\"forum-post-form\" action=\"{$topic_action_add}\">".$tpl->copy_template."
|
||||
<input type=\"hidden\" name=\"forum_id\" value=\"{$forum_id}\" />
|
||||
<input type=\"hidden\" name=\"add_tid\" value=\"{$upload_var['topic_id']}\" /></form>
|
||||
<div id=\"uploads-form\"></div>";
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (check_access($forum_config['topic_captcha']))
|
||||
{
|
||||
if ($_REQUEST['sec_code'] !== $_SESSION['sec_code_session'] and isset($_SESSION['sec_code_session']))
|
||||
{
|
||||
$topic_captcha = true;
|
||||
|
||||
$_SESSION['sec_code_session'] = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$topic_captcha = false;
|
||||
}
|
||||
|
||||
if (!$topic_captcha){
|
||||
|
||||
require_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
if (!$is_logged)
|
||||
{
|
||||
$name = $db->safesql($parse->process(trim($_POST['name'])));
|
||||
$mail = $db->safesql($parse->process(trim($_POST['mail'])));
|
||||
|
||||
$member_id['name'] = $name;
|
||||
|
||||
$db->query("SELECT name from " . USERPREFIX . "_users where LOWER(name) = '".strtolower($name)."'");
|
||||
|
||||
if (!$db->num_rows() > 0)
|
||||
{
|
||||
$name_ok = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$name_ok = false;
|
||||
}
|
||||
|
||||
$db->free();
|
||||
|
||||
if(preg_match("/^[\.A-z0-9_\-]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $mail))
|
||||
{
|
||||
$mail_ok = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$mail_ok = false;
|
||||
}
|
||||
|
||||
if ($name_ok and $mail_ok)
|
||||
{
|
||||
$access_add = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$access_add = false;
|
||||
|
||||
if (!$name_ok) $stop .= $f_lang['err_name'];
|
||||
|
||||
if (!$mail_ok) $stop .= $f_lang['err_mail'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$access_add = true;
|
||||
}
|
||||
|
||||
$topic_title = $db->safesql($parse->process($_POST['topic_title']));
|
||||
$topic_descr = $db->safesql($parse->process($_POST['topic_descr']));
|
||||
|
||||
$topic_text = $parse->process($_POST['post_text']);
|
||||
|
||||
$topic_text = $db->safesql($parse->BB_Parse($topic_text, FALSE));
|
||||
|
||||
$topic_text = auto_wrap ($topic_text);
|
||||
|
||||
if (strlen($topic_text) > $forum_config['post_maxlen'])
|
||||
{
|
||||
$post_maxlen = true;
|
||||
|
||||
$stop .= $f_lang['ajax_stop_4'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$post_maxlen = false;
|
||||
}
|
||||
|
||||
if ($topic_title and $topic_text and $access_add and !$post_maxlen)
|
||||
{
|
||||
$_IP = $db->safesql($_SERVER['REMOTE_ADDR']);
|
||||
|
||||
$vote_title = trim($db->safesql($parse->process($_POST['vote_title'])));
|
||||
$frage = trim($db->safesql($parse->process($_POST['frage'])));
|
||||
$vote_body = $db->safesql($parse->BB_Parse($parse->process($_POST['vote_body']), false));
|
||||
$poll_multiple = intval($_POST['poll_multiple']);
|
||||
|
||||
$_TIME = time()+($config['date_adjust']*60);
|
||||
$topic_date = date ("Y-m-d H:i:s", $_TIME);
|
||||
|
||||
if ($forum_config['meta_topic'])
|
||||
{
|
||||
$meta = forum_metatags($topic_title . ' ' . $topic_descr . ': ' . $topic_text);
|
||||
}
|
||||
else{ $meta = ""; }
|
||||
|
||||
$db->query("INSERT INTO " . PREFIX . "_forum_topics (forum_id, title, topic_descr, author_topic, start_date, last_date, last_poster_name, poll_title, frage, poll_body, multiple, meta_descr, meta_keywords) values ('$forum_id', '$topic_title', '$topic_descr', '$member_id[name]', '$topic_date', '$topic_date', '$member_id[name]', '$vote_title', '$frage', '$vote_body', '$poll_multiple', '$meta[description]', '$meta[keywords]')");
|
||||
|
||||
$topic_id = $db->insert_id();
|
||||
|
||||
$db->query("INSERT INTO " . PREFIX . "_forum_posts (topic_id, post_date, post_author, post_text, post_ip, is_register, e_mail, is_count) values ('$topic_id', '$topic_date', '$member_id[name]', '$topic_text', '$_IP', '$is_logged', '$mail', '$postcount')");
|
||||
|
||||
$new_pid = $db->insert_id();
|
||||
|
||||
set_first_post_id ($topic_id, $new_pid);
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_forums SET topics = topics+1, f_last_tid = '$topic_id', f_last_title = '$topic_title', f_last_date ='$topic_date', f_last_poster_name = '$member_id[name]' WHERE id ='$forum_id'");
|
||||
|
||||
if ($forum_config['set_topic_post'] and $postcount and $is_logged)
|
||||
{
|
||||
$db->query("UPDATE " . PREFIX . "_users SET forum_post = forum_post+1 WHERE name = '$member_id[name]'");
|
||||
}
|
||||
|
||||
if ($forum_config['set_sub_last_up'] and $is_parentid = $forums_array[$forum_id]['parentid'])
|
||||
{
|
||||
$db->query("UPDATE " . PREFIX . "_forum_forums SET f_last_tid = '$topic_id', f_last_title = '$topic_title', f_last_date = '$topic_date', f_last_poster_name = '$member_id[name]', last_post_id = '$new_pid' WHERE id = '$is_parentid'");
|
||||
}
|
||||
|
||||
if ($subscription and $is_logged)
|
||||
{
|
||||
$db->query("SELECT * FROM " . PREFIX . "_forum_subscription WHERE topic_id = '$topic_id' and user_id = '{$member_id['user_id']}'");
|
||||
|
||||
if (!$db->num_rows() and $topic_id)
|
||||
{
|
||||
$db->query("INSERT INTO " . PREFIX . "_forum_subscription (user_id, topic_id) values ('{$member_id['user_id']}', '$topic_id')");
|
||||
}
|
||||
}
|
||||
|
||||
if ($_REQUEST['add_tid'])
|
||||
{
|
||||
if (stristr ($topic_text, "[attachment="))
|
||||
{
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_files
|
||||
WHERE topic_id = '{$_REQUEST['add_tid']}' and file_attach = '0'");
|
||||
|
||||
while ($att = $db->get_row($result))
|
||||
{
|
||||
if (stristr($topic_text, "[attachment={$att['file_id']}]") OR stristr($topic_text, "/forum/files/{$att['onserver']}"))
|
||||
{
|
||||
$update_id[] = $att['file_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($update_id)
|
||||
{
|
||||
$update_list = implode(',', $update_id);
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_files SET topic_id = '$topic_id', post_id = '$new_pid', file_attach = '1' WHERE file_id IN ({$update_list})");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($forum_config['topic_email'])
|
||||
{
|
||||
$topic_link = $config['http_home_url']."?do=forum&showtopic={$topic_id}";
|
||||
|
||||
include_once SYSTEM_DIR.'/classes/mail.class.php';
|
||||
|
||||
$mail = new dle_mail ($config);
|
||||
|
||||
$mail_tpl = $db->super_query("SELECT template FROM " . PREFIX . "_forum_email where name='new_topic' LIMIT 0,1");
|
||||
|
||||
$mail_tpl['template'] = stripslashes($mail_tpl['template']);
|
||||
|
||||
$mail_result = str_replace("{%username%}", $member_id[name], $mail_tpl['template']);
|
||||
|
||||
$mail_result = str_replace("{%date%}", $topic_date, $mail_result);
|
||||
|
||||
$mail_result = str_replace("{%title%}", $topic_title, $mail_result);
|
||||
|
||||
$mail_result = str_replace("{%link%}", $topic_link, $mail_result);
|
||||
|
||||
$mail->send ($config['admin_mail'], "DLE Forum - NEW TOPIC", $mail_result);
|
||||
}
|
||||
|
||||
if ($forum_config['mod_rewrite'])
|
||||
{
|
||||
$topic_location = $forum_url."/topic_".$topic_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$topic_location = $forum_url."showtopic=".$topic_id;
|
||||
}
|
||||
|
||||
$cache->clear('forum_show_last');
|
||||
|
||||
header("Location: $topic_location");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['topic_add_stop'], 'stop', "<br />".$stop);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ($topic_captcha)
|
||||
{
|
||||
forum_msg($f_lang['all_info'], $f_lang['captcha_stop']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$group_name = $user_group[$member_id['user_group']]['group_name'];
|
||||
|
||||
forum_msg($f_lang['f_msg'], $f_lang['topic_add_ndeny'], '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_app = $f_lang['app_newtopic'];
|
||||
}
|
||||
|
||||
?>
|
||||
158
system/forum/action/forum.php
Normal file
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
$code = !empty($_POST['code']) ? $_POST['code'] : $_GET['code'];
|
||||
|
||||
$fid = intval($_REQUEST['fid']);
|
||||
|
||||
switch ($code)
|
||||
{
|
||||
// ********************************************************************************
|
||||
// FORUM CALCULATOR
|
||||
// ********************************************************************************
|
||||
case "calc":
|
||||
|
||||
if (is_moderation($fid, 0, 0))
|
||||
{
|
||||
$posts_in_forum = '0';
|
||||
|
||||
$result_topics = $db->query("SELECT tid FROM " . PREFIX . "_forum_topics WHERE forum_id = '$fid'");
|
||||
|
||||
while ($row = $db->get_row($result_topics))
|
||||
{
|
||||
$forum_topic++;
|
||||
|
||||
$p_count = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_posts WHERE topic_id = '$row[tid]'");
|
||||
$posts_in_forum = ($posts_in_forum + $p_count['count']);
|
||||
}
|
||||
|
||||
if (!$forum_config['set_topic_post'])
|
||||
{
|
||||
$posts_in_forum = ($posts_in_forum - $forum_topic);
|
||||
}
|
||||
|
||||
if ($forum_config['topic_sort']) $sort_type = "last_date";
|
||||
else $sort_type = "tid";
|
||||
|
||||
$row1 = $db->super_query("SELECT * FROM ". PREFIX ."_forum_topics WHERE forum_id = '$fid' ORDER by $sort_type DESC");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_forums SET posts = '$posts_in_forum', topics = '$forum_topic', f_last_tid = '$row1[tid]', f_last_title = '$row1[title]', f_last_date ='$row1[last_date]', f_last_poster_name = '$row1[last_poster_name]' WHERE id = '$fid'");
|
||||
|
||||
header("Location: $_SERVER[HTTP_REFERER]");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
header("Location: $_SERVER[HTTP_REFERER]");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// USER
|
||||
// ********************************************************************************
|
||||
case "user":
|
||||
|
||||
$mname = $db->safesql($_REQUEST['mname']);
|
||||
|
||||
if ($mname)
|
||||
{
|
||||
$get_count = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_topics WHERE author_topic = '$mname' and hidden = 0");
|
||||
|
||||
$count_all = $get_count['count'];
|
||||
}
|
||||
|
||||
if ($count_all){
|
||||
|
||||
if ($cstart)
|
||||
{
|
||||
$cstart = $cstart - 1;
|
||||
$cstart = $cstart * $forum_config['topic_inpage'];
|
||||
}
|
||||
|
||||
if ($forum_config['topic_sort'])
|
||||
{
|
||||
$sort_type = "last_date";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$sort_type = "tid";
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// TOPIC VIEWS
|
||||
// ********************************************************************************
|
||||
if ($is_logged)
|
||||
{
|
||||
$row_views = $db->query("SELECT topic_id FROM " . PREFIX . "_forum_views WHERE user_id = '$member_id[user_id]' and time > '$topic_a_time'");
|
||||
|
||||
$topic_views = array();
|
||||
|
||||
while ($row = $db->get_row($row_views))
|
||||
{
|
||||
$topic_views[$row['topic_id']] = '1';
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$row_views = explode(",", $_COOKIE['dle_forum_views']);
|
||||
|
||||
foreach ($row_views as $value)
|
||||
{
|
||||
$topic_views[$value] = '1';
|
||||
}
|
||||
}
|
||||
|
||||
$config_inpage = $forum_config['topic_inpage'];
|
||||
|
||||
$result_topics = $db->query("SELECT * FROM " . PREFIX . "_forum_topics WHERE author_topic = '$mname' and hidden = 0 ORDER BY fixed, ".$sort_type." DESC LIMIT ".$cstart.",".$forum_config['topic_inpage']."");
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/showtopics.php';
|
||||
|
||||
$icat = $forum_url."act=getforum&code=user&mname={$mname}&cstart=";
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/navigation.php';
|
||||
|
||||
$tpl->load_template($tpl_dir.'forum.tpl');
|
||||
|
||||
$tpl->set('{forum}', $f_lang['app_user_topic'].': '.$mname);
|
||||
|
||||
$tpl->set('{subforums}','');
|
||||
|
||||
$tpl->set('{topics}', $tpl->result['topics']);
|
||||
|
||||
$tpl->set('{info}', $msg_info);
|
||||
|
||||
$tpl->set('{navigation}', $tpl->result['navigation']);
|
||||
|
||||
$tpl->set_block("'\\[options\\](.*?)\\[/options\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[rules\\](.*?)\\[/rules\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[new_topic\\](.*?)\\[/new_topic\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[selected\\](.*?)\\[/selected\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[fast-search\\](.*?)\\[/fast-search\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[moderation\\](.*?)\\[/moderation\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si","");
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
|
||||
$tpl->clear();
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
|
||||
$bbr_app = $f_lang['app_user_topic'];
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
520
system/forum/action/moderation.php
Normal file
@@ -0,0 +1,520 @@
|
||||
<?php
|
||||
/*
|
||||
=====================================================
|
||||
DLE Forum - by DLE Files Group
|
||||
-----------------------------------------------------
|
||||
http://dle-files.ru/
|
||||
-----------------------------------------------------
|
||||
File: moderation.php
|
||||
=====================================================
|
||||
Copyright (c) 2008,2010 DLE Files Group
|
||||
=====================================================
|
||||
*/
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
$code = !empty($_POST['code']) ? $_POST['code'] : $_GET['code'];
|
||||
|
||||
$selectedtids = $_REQUEST['selected_id'];
|
||||
|
||||
$subaction = $_REQUEST['subaction'];
|
||||
|
||||
switch ($code)
|
||||
{
|
||||
// ********************************************************************************
|
||||
// OPEN TOPIC
|
||||
// ********************************************************************************
|
||||
case "01":
|
||||
|
||||
if ($selectedtids and is_moderation(0, $selectedtids, 0) OR group_moderation($selectedtids, 'forum_topic_set'))
|
||||
{
|
||||
if (!moderator_value('open_topic', $forum_id, $m_member) AND !group_moderation($selectedtids, 'forum_topic_set')) die();
|
||||
|
||||
$selectedtids = explode(",",$selectedtids);
|
||||
|
||||
foreach($selectedtids as $topic_id)
|
||||
{
|
||||
$topic_id = intval($topic_id);
|
||||
if ( $topic_id == 0 ) continue;
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET topic_status = '0' WHERE tid = '$topic_id'");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '0' WHERE topic_id = '$topic_id' and hidden NOT IN (1,6)");
|
||||
}
|
||||
|
||||
header("Location: $_SERVER[HTTP_REFERER]");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// CLOSE TOPIC
|
||||
// ********************************************************************************
|
||||
case "02":
|
||||
|
||||
if ($selectedtids and is_moderation(0, $selectedtids, 0) OR group_moderation($selectedtids, 'forum_topic_set'))
|
||||
{
|
||||
if (!moderator_value('close_topic', $forum_id, $m_member) AND !group_moderation($selectedtids, 'forum_topic_set')) die();
|
||||
|
||||
$selectedtids = explode(",",$selectedtids);
|
||||
|
||||
foreach($selectedtids as $topic_id)
|
||||
{
|
||||
$topic_id = intval($topic_id);
|
||||
if ( $topic_id == 0 ) continue;
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET topic_status = '1' WHERE tid = '$topic_id'");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '2' WHERE topic_id = '$topic_id' and hidden NOT IN (1,6)");
|
||||
}
|
||||
|
||||
header("Location: {$_SERVER['HTTP_REFERER']}");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// DEL TOPIC
|
||||
// ********************************************************************************
|
||||
case "03":
|
||||
|
||||
if ($selectedtids and is_moderation(0, $selectedtids, 0) OR group_moderation($selectedtids, 'forum_topic_del'))
|
||||
{
|
||||
if (!moderator_value('delete_topic', $forum_id, $m_member) AND !group_moderation($selectedtids, 'forum_topic_del')) die();
|
||||
|
||||
$selectedtids = explode(",",$selectedtids);
|
||||
|
||||
foreach($selectedtids as $topic_id)
|
||||
{
|
||||
$topic_id = intval($topic_id);
|
||||
if ( $topic_id == 0 ) continue;
|
||||
$row_topic = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '$topic_id'");
|
||||
|
||||
$topic_id = $row_topic['tid'];
|
||||
|
||||
$forum_id = $row_topic['forum_id'];
|
||||
|
||||
$post_all = $row_topic['post'];
|
||||
|
||||
if (!$forum_config['set_topic_post'])
|
||||
{
|
||||
$post_all = ($post_all - 1);
|
||||
}
|
||||
|
||||
if ($topic_id)
|
||||
{
|
||||
// user converting //
|
||||
if ($forum_config['set_post_num_up'])
|
||||
{
|
||||
$query = $db->query("SELECT distinct post_author FROM " . PREFIX . "_forum_posts WHERE topic_id = '$topic_id'");
|
||||
|
||||
while ($row = $db->get_row($query))
|
||||
{
|
||||
if ($forum_config['set_topic_post'])
|
||||
{
|
||||
$topic = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_topics WHERE author_topic = '$row[post_author]'");
|
||||
|
||||
$topic_num = $topic['count'];
|
||||
}
|
||||
|
||||
$post = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_posts WHERE post_author = '$row[post_author]'");
|
||||
|
||||
$post_num = $post['count'];
|
||||
|
||||
$update = ($topic_num + $post_num);
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_users SET forum_post = '$update' WHERE name ='$row[post_author]'");
|
||||
}
|
||||
}
|
||||
|
||||
// Óäàëåíèå âëîæåíèé âìåñòå ñ òåìîé
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE topic_id = '" . $topic_id . "'");
|
||||
|
||||
while ($row = $db->get_row($result)) {
|
||||
|
||||
if ($row['file_type'] == "file") {
|
||||
|
||||
unlink(UPLOAD_DIR."files/" . $row['onserver']);
|
||||
|
||||
} elseif ($row['file_type'] == "thumb") {
|
||||
|
||||
unlink(UPLOAD_DIR."thumbs/" . $row['onserver']);
|
||||
|
||||
unlink(UPLOAD_DIR."images/" . $row['onserver']);
|
||||
|
||||
} else {
|
||||
|
||||
unlink(UPLOAD_DIR."images/" . $row['onserver']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_files WHERE topic_id = '" . $topic_id . "'");
|
||||
|
||||
// êîíåö óäàëåíèÿ âëîæåíèé âìåñòå ñ òåìîé
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_posts WHERE topic_id = '$topic_id'");
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_topics WHERE `tid` = '$topic_id'");
|
||||
|
||||
$new_result = $db->super_query("SELECT * FROM ". PREFIX ."_forum_topics WHERE forum_id = '$forum_id' ORDER by start_date DESC");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_forums SET topics = topics-1, posts = posts-$post_all, f_last_tid = '$new_result[tid]', f_last_title = '$new_result[title]', f_last_date = '$new_result[last_date]', f_last_poster_name = '$new_result[last_poster_name]' WHERE id ='$forum_id'");
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_poll_log WHERE topic_id = '$topic_id'");
|
||||
|
||||
// del discuss id //
|
||||
$db->query("UPDATE " . PREFIX . "_post SET news_tid = '0' WHERE news_tid = '$topic_id'");
|
||||
|
||||
// del attachment //
|
||||
$db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE topic_id = '$topic_id'"); // and file_attach='1'
|
||||
|
||||
while($row = $db->get_row())
|
||||
{
|
||||
if ($row['file_type'] == "image")
|
||||
{
|
||||
@unlink(UPLOAD_DIR."images/".$row['onserver']);
|
||||
}
|
||||
|
||||
elseif ($row['file_type'] == "thumb")
|
||||
{
|
||||
@unlink(UPLOAD_DIR."thumbs/".$row['onserver']);
|
||||
|
||||
@unlink(UPLOAD_DIR."images/".$row['onserver']);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
@unlink(UPLOAD_DIR."files/".$row['onserver']);
|
||||
}
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_files WHERE file_id = '$row[file_id]'");
|
||||
} // end - del attachment //
|
||||
}
|
||||
}
|
||||
|
||||
if ($forum_config['mod_rewrite'])
|
||||
{
|
||||
$forum_location = "{$forum_url}/forum_{$forum_id}";
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_location = "{$forum_url}showforum={$forum_id}";
|
||||
}
|
||||
|
||||
header("Location: {$forum_location}");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// EDIT TOPIC TITLE
|
||||
// ********************************************************************************
|
||||
case "04":
|
||||
|
||||
$selectedtids = intval($selectedtids);
|
||||
|
||||
if (!$subaction and is_moderation(0, $selectedtids, 0) OR !$subaction and group_moderation($selectedtids, 'forum_topic_edit'))
|
||||
{
|
||||
if (!moderator_value('edit_topic', $forum_id, $m_member) AND !group_moderation($selectedtids, 'forum_topic_edit')) die();
|
||||
|
||||
$row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '{$selectedtids}'");
|
||||
|
||||
$topic_action_add = $a_forum_url."act=moderation&code=04&subaction=save&selected_id={$selectedtids}";
|
||||
|
||||
require_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
|
||||
$parse = new ParseFilter();
|
||||
|
||||
$parse->safe_mode = true;
|
||||
|
||||
$topic_title = $parse->decodeBBCodes($row['title'], false);
|
||||
$topic_descr = $parse->decodeBBCodes($row['topic_descr'], false);
|
||||
|
||||
$tpl->load_template($tpl_dir.'edittopic.tpl');
|
||||
|
||||
$tpl->set('{topic_title}', $topic_title);
|
||||
$tpl->set('{topic_descr}', $topic_descr);
|
||||
|
||||
if (check_access($forum_config['tools_poll']))
|
||||
{
|
||||
$tpl->set('[poll]','');
|
||||
$tpl->set('[/poll]','');
|
||||
|
||||
$tpl->set('{vote_title}', $parse->decodeBBCodes($row['poll_title'], false));
|
||||
$tpl->set('{frage}', $parse->decodeBBCodes($row['frage'], false));
|
||||
$tpl->set('{vote_body}', $parse->decodeBBCodes($row['poll_body'], false));
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\\[poll\\](.*?)\\[/poll\\]'si","");
|
||||
}
|
||||
|
||||
$tpl->copy_template = "<form method=\"post\" name=\"dle-comments-form\" id=\"dle-comments-form\" action=\"{$topic_action_add}\">".$tpl->copy_template."</form>";
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
if ($subaction == "save" and is_moderation(0, $selectedtids, 0) OR $subaction == "save" and group_moderation($selectedtids, 'forum_topic_edit'))
|
||||
{
|
||||
if (!moderator_value('edit_topic', $forum_id, $m_member) AND !group_moderation($selectedtids, 'forum_topic_edit')) die();
|
||||
|
||||
require_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
|
||||
$parse->safe_mode = true;
|
||||
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
$topic_title = $db->safesql($parse->process($_POST['topic_title']));
|
||||
$topic_descr = $db->safesql($parse->process($_POST['topic_descr']));
|
||||
$vote_title = trim($db->safesql($parse->process($_POST['vote_title'])));
|
||||
$frage = trim($db->safesql($parse->process($_POST['frage'])));
|
||||
$vote_body = $db->safesql($parse->BB_Parse($parse->process($_POST['vote_body']), false));
|
||||
$poll_multiple = intval($_POST['poll_multiple']);
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET title = '$topic_title', topic_descr = '$topic_descr', poll_title = '$vote_title', frage = '$frage', poll_body = '$vote_body', multiple = '$poll_multiple' WHERE tid = '$selectedtids'");
|
||||
|
||||
if ($forum_config['mod_rewrite'])
|
||||
{
|
||||
$topic_location = "{$forum_url}/topic_$selectedtids";
|
||||
} else
|
||||
{
|
||||
$topic_location = "{$forum_url}showtopic=$selectedtids";
|
||||
}
|
||||
|
||||
header("Location: $topic_location");
|
||||
}
|
||||
|
||||
$bbr_app = "Ðåäàêòèðîâàíèå òåìû";
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// MOVE TOPIC
|
||||
// ********************************************************************************
|
||||
case "05":
|
||||
|
||||
if ($selectedtids and is_moderation(0, $selectedtids, 0))
|
||||
{
|
||||
if (!moderator_value('move_topic', $is_mod['forum_id'], $m_member)) die();
|
||||
|
||||
$move_fid = $_REQUEST['move_fid'];
|
||||
|
||||
if (!$subaction)
|
||||
{
|
||||
$topic_action_add = "{$a_forum_url}act=moderation&code=05&subaction=move&selected_id=$selectedtids";
|
||||
|
||||
$tpl->load_template($tpl_dir.'movetopic.tpl');
|
||||
|
||||
$tpl->set('{topic_title}', $topic_title);
|
||||
$tpl->set('{forum}', $is_forum_name);
|
||||
$tpl->set('{forum_list}', forum_list());
|
||||
|
||||
$tpl->copy_template = "<form method=\"post\" action=\"{$topic_action_add}\">".$tpl->copy_template."</form>";
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
if ($subaction == "move" and $selectedtids and $move_fid)
|
||||
{
|
||||
$tid = $selectedtids;
|
||||
|
||||
$selectedtids = explode(",",$selectedtids);
|
||||
|
||||
$new_post_count = 0;
|
||||
|
||||
$postcount = intval ($forums_array[$move_fid]['postcount']);
|
||||
|
||||
foreach ($selectedtids as $topic_id)
|
||||
{
|
||||
$topic_id = intval($topic_id);
|
||||
if ( $topic_id == 0 ) continue;
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET forum_id = '$move_fid' WHERE tid = '$topic_id'");
|
||||
$tid_count++;
|
||||
|
||||
$post = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_posts WHERE topic_id = '$topic_id'");
|
||||
|
||||
$post_count = $post_count + $post['count'];
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts SET is_count = '$postcount' WHERE topic_id = '$topic_id'");
|
||||
}
|
||||
|
||||
$post_count = $post_count - $tid_count;
|
||||
|
||||
if ($forum_config['topic_sort']) $sort_type = "last_date";
|
||||
else $sort_type = "tid";
|
||||
|
||||
$row1 = $db->super_query("SELECT * FROM ". PREFIX ."_forum_topics WHERE forum_id = '{$is_mod['forum_id']}' ORDER by $sort_type DESC");
|
||||
|
||||
$row2 = $db->super_query("SELECT * FROM ". PREFIX ."_forum_topics WHERE forum_id = '$move_fid' ORDER by $sort_type DESC");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_forums SET posts = posts-$post_count, topics = topics-$tid_count, f_last_tid = '$row1[tid]', f_last_title = '$row1[title]', f_last_date ='$row1[last_date]', f_last_poster_name = '$row1[last_poster_name]' WHERE id = '{$is_mod['forum_id']}'");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_forums SET posts = posts+$post_count, topics = topics+$tid_count, f_last_tid = '$row2[tid]', f_last_title = '$row2[title]', f_last_date ='$row2[last_date]', f_last_poster_name = '$row2[last_poster_name]' WHERE id = '$move_fid'");
|
||||
|
||||
if ($forum_config['mod_rewrite'])
|
||||
{
|
||||
$topic_location = "{$forum_url}/topic_$tid";
|
||||
|
||||
$forum_location = "{$forum_url}/forum_$move_fid";
|
||||
}
|
||||
else
|
||||
{
|
||||
$topic_location = "{$forum_url}showtopic=$tid";
|
||||
|
||||
$forum_location = "{$forum_url}showforum=$move_fid";
|
||||
}
|
||||
|
||||
if ($tid_count > 1)
|
||||
{
|
||||
header("Location: $forum_location");
|
||||
}
|
||||
else
|
||||
{
|
||||
header("Location: $topic_location");
|
||||
}
|
||||
}
|
||||
|
||||
$bbr_app = "Ïåðåìåùåíèå òåìû";
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// HIDDEN TOPIC
|
||||
// ********************************************************************************
|
||||
case "06":
|
||||
|
||||
if ($selectedtids and is_moderation(0, $selectedtids, 0))
|
||||
{
|
||||
$selectedtids = explode(",",$selectedtids);
|
||||
|
||||
foreach($selectedtids as $topic_id)
|
||||
{
|
||||
$topic_id = intval($topic_id);
|
||||
if ( $topic_id == 0 ) continue;
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET hidden = '1' WHERE tid = '$topic_id'");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '6' WHERE topic_id = '$topic_id' and hidden NOT IN (1,2)");
|
||||
}
|
||||
|
||||
header("Location: {$_SERVER['HTTP_REFERER']}");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// NOT HIDDEN TOPIC
|
||||
// ********************************************************************************
|
||||
case "07":
|
||||
|
||||
if ($selectedtids and is_moderation(0, $selectedtids, 0))
|
||||
{
|
||||
$selectedtids = explode(",",$selectedtids);
|
||||
|
||||
foreach($selectedtids as $topic_id)
|
||||
{
|
||||
$topic_id = intval($topic_id);
|
||||
if ( $topic_id == 0 ) continue;
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET hidden = '0' WHERE tid = '$topic_id'");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '0' WHERE topic_id = '$topic_id' and hidden NOT IN (1,2)");
|
||||
}
|
||||
|
||||
header("Location: {$_SERVER['HTTP_REFERER']}");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// FIXED TOPIC
|
||||
// ********************************************************************************
|
||||
case "08":
|
||||
|
||||
if ($selectedtids and is_moderation(0, $selectedtids, 0))
|
||||
{
|
||||
if (!moderator_value('pin_topic', $forum_id, $m_member)) die();
|
||||
|
||||
$selectedtids = explode(",",$selectedtids);
|
||||
|
||||
foreach($selectedtids as $topic_id)
|
||||
{
|
||||
$topic_id = intval($topic_id);
|
||||
if ( $topic_id == 0 ) continue;
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET fixed = '0' WHERE tid = '$topic_id'");
|
||||
}
|
||||
|
||||
header("Location: {$_SERVER['HTTP_REFERER']}");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// NOT FIXED TOPIC
|
||||
// ********************************************************************************
|
||||
case "09":
|
||||
|
||||
if ($selectedtids and is_moderation(0, $selectedtids, 0))
|
||||
{
|
||||
if (!moderator_value('unpin_topic', $forum_id, $m_member)) die();
|
||||
|
||||
$selectedtids = explode(",",$selectedtids);
|
||||
|
||||
foreach($selectedtids as $topic_id)
|
||||
{
|
||||
$topic_id = intval($topic_id);
|
||||
if ( $topic_id == 0 ) continue;
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET fixed = '1' WHERE tid = '$topic_id'");
|
||||
}
|
||||
|
||||
header("Location: {$_SERVER['HTTP_REFERER']}");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// CALC
|
||||
// ********************************************************************************
|
||||
case "10":
|
||||
|
||||
$topic_id = intval($_REQUEST['tid']);
|
||||
|
||||
if ($topic_id and is_moderation(0, $topic_id, 0))
|
||||
{
|
||||
calk_topic_del ($topic_id);
|
||||
|
||||
header("Location: {$_SERVER['HTTP_REFERER']}");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// Default
|
||||
// ********************************************************************************
|
||||
default:
|
||||
|
||||
header("Location: {$_SERVER['HTTP_REFERER']}");
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
515
system/forum/action/post.php
Normal file
@@ -0,0 +1,515 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
$code = !empty($_POST['code']) ? $_POST['code'] : $_GET['code'];
|
||||
|
||||
$subaction = $_REQUEST['subaction'];
|
||||
|
||||
$selected_id = $_REQUEST['selected_id'];
|
||||
|
||||
switch ($code)
|
||||
{
|
||||
// ********************************************************************************
|
||||
// ADD POST
|
||||
// ********************************************************************************
|
||||
case "add":
|
||||
|
||||
$forum_id = intval($_POST['forum_id']);
|
||||
|
||||
$topic_id = intval($_POST['topic_id']);
|
||||
|
||||
$page = intval($_REQUEST['page']);
|
||||
|
||||
$post_id = $db->safesql($_POST['post_id']);
|
||||
|
||||
$topic_title = $_POST['topic_ti'];
|
||||
|
||||
$post_text = $_POST['post_text'];
|
||||
|
||||
$name = $_POST['name'];
|
||||
$mail = $_POST['mail'];
|
||||
|
||||
$check_write = check_access($forums_array[$forum_id]['access_write']);
|
||||
|
||||
if ($check_write)
|
||||
{
|
||||
require_once SYSTEM_DIR.'/forum/action/addpost.php';
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// EDIT POST
|
||||
// ********************************************************************************
|
||||
case "02":
|
||||
|
||||
$pid = intval($_REQUEST['pid']);
|
||||
|
||||
$page = intval($_REQUEST['p']);
|
||||
|
||||
$post_n = intval($_REQUEST['pn']);
|
||||
|
||||
if ($pid)
|
||||
{
|
||||
if (is_moderation(0, 0, $pid, 'forum_post_edit'))
|
||||
{
|
||||
include_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
$row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_posts WHERE `pid` = '$pid'");
|
||||
|
||||
$post_text = $parse->decodeBBCodes($row['post_text'], false);
|
||||
|
||||
$topic_id = $row['topic_id'];
|
||||
|
||||
$fid = $db->super_query("SELECT forum_id FROM " . PREFIX . "_forum_topics WHERE tid = '$topic_id'");
|
||||
|
||||
$forum_id = $fid['forum_id'];
|
||||
|
||||
$access_upload = check_access($forums_array[$forum_id]['access_upload']);
|
||||
|
||||
$upload_var = array('area'=>"post", 'forum_id'=>$forum_id, 'topic_id'=>$topic_id, 'post_id'=>$pid);
|
||||
|
||||
if ($row['pid'])
|
||||
{
|
||||
$edit_post_action = $a_forum_url."act=post&code=03&pid=$pid&topic_id=$topic_id&p=$page&pn=$post_n";
|
||||
|
||||
$tpl->load_template($tpl_dir.'addpost.tpl');
|
||||
|
||||
$tpl->set('{title}', $f_lang['app_post_edit']);
|
||||
|
||||
$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","");
|
||||
}
|
||||
|
||||
$tpl->set_block("'\\[sec_code\\](.*?)\\[/sec_code\\]'si","");
|
||||
|
||||
$tpl->set('{bbcode}',$bb_code);
|
||||
$tpl->set('{text}',$post_text);
|
||||
|
||||
$tpl->copy_template = "<form method=\"post\" name=\"forum-post-form\" id=\"forum-post-form\" action=\"{$edit_post_action}\">".$tpl->copy_template."</form><div id=\"uploads-form\"></div>";
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
$tpl->clear();
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// SAVE POST
|
||||
// ********************************************************************************
|
||||
case "03":
|
||||
|
||||
$pid = intval($_REQUEST['pid']);
|
||||
|
||||
$topic_id = intval($_REQUEST['topic_id']);
|
||||
|
||||
$page = intval($_REQUEST['p']);
|
||||
|
||||
$post_n = intval($_REQUEST['pn']);
|
||||
|
||||
if (is_moderation(0, 0, $pid, 'forum_post_edit'))
|
||||
{
|
||||
include_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
$post_text = $parse->process($_POST['post_text']);
|
||||
|
||||
$post_text = $db->safesql($parse->BB_Parse($post_text, FALSE));
|
||||
|
||||
$post_text = auto_wrap ($post_text);
|
||||
|
||||
if (strlen($post_text) > $forum_config['post_maxlen'])
|
||||
{
|
||||
$post_maxlen = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$post_maxlen = false;
|
||||
}
|
||||
|
||||
if ($post_text and !$post_maxlen)
|
||||
{
|
||||
$_TIME = time()+($config['date_adjust']*60);
|
||||
|
||||
$edit_info = ", edit_user = '{$member_id[name]}', edit_time = '{$_TIME}'";
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts SET post_text = '$post_text' {$edit_info} WHERE pid = '$pid'");
|
||||
|
||||
check_attachment($pid, $post_text);
|
||||
|
||||
if ($forum_config['mod_rewrite'])
|
||||
{
|
||||
$topic_location = $forum_url."/topic_{$topic_id}/$page#post-$post_n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$topic_location = $forum_url."showtopic=$topic_id&cstart=$page#post-$post_n";
|
||||
}
|
||||
|
||||
header("Location: $topic_location");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ($post_maxlen)
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['maxlen_stop']);
|
||||
}
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['topic_add_stop'], 'stop', '');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// DEL POST
|
||||
// ********************************************************************************
|
||||
case "04":
|
||||
|
||||
if (is_moderation(0, 0, $selected_id, 'forum_post_del'))
|
||||
{
|
||||
$selected_id = explode(",", $selected_id);
|
||||
|
||||
foreach ($selected_id as $post_id)
|
||||
{
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_posts WHERE pid = '$post_id'");
|
||||
|
||||
// Óäàëåíèå âëîæåíèé âìåñòå ñ ñîîáùåíèåì
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE post_id = '" . $post_id . "'");
|
||||
|
||||
while ($row = $db->get_row($result)) {
|
||||
|
||||
if ($row['file_type'] == "file") {
|
||||
|
||||
unlink(UPLOAD_DIR."files/" . $row['onserver']);
|
||||
|
||||
} elseif ($row['file_type'] == "thumb") {
|
||||
|
||||
unlink(UPLOAD_DIR."thumbs/" . $row['onserver']);
|
||||
|
||||
unlink(UPLOAD_DIR."images/" . $row['onserver']);
|
||||
|
||||
} else {
|
||||
|
||||
unlink(UPLOAD_DIR."images/" . $row['onserver']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_files WHERE post_id = '" . $post_id . "'");
|
||||
|
||||
// êîíåö óäàëåíèÿ âëîæåíèé âìåñòå ñ òåìîé
|
||||
|
||||
$update_id[] = $post_id;
|
||||
|
||||
$del_count++;
|
||||
}
|
||||
|
||||
if ($update_id)
|
||||
{
|
||||
$update_list = implode(',', $update_id);
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_files SET file_attach = '0' WHERE post_id IN ({$update_list})");
|
||||
}
|
||||
|
||||
if ($is_mod['topic_id'] and $del_count)
|
||||
{
|
||||
calk_topic_del ($is_mod['topic_id'], $del_count);
|
||||
}
|
||||
|
||||
if ($forum_config['mod_rewrite']) $topic_location = $forum_url."/topic_".$is_mod['topic_id'];
|
||||
|
||||
else $topic_location = $forum_url."showtopic=".$is_mod['topic_id'];
|
||||
|
||||
header("Location: $topic_location");
|
||||
}
|
||||
|
||||
else break;
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// UN HIDDEN POST
|
||||
// ********************************************************************************
|
||||
case "05":
|
||||
|
||||
if ($selected_id and is_moderation(0, 0, $selected_id))
|
||||
{
|
||||
$selected_id = explode(",", $selected_id);
|
||||
|
||||
foreach ($selected_id as $post_id)
|
||||
{
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '0' WHERE pid = '$post_id'");
|
||||
}
|
||||
|
||||
header("Location: $_SERVER[HTTP_REFERER]");
|
||||
}
|
||||
|
||||
else break;
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// HIDDEN POST
|
||||
// ********************************************************************************
|
||||
case "06":
|
||||
|
||||
if ($selected_id and is_moderation(0, 0, $selected_id))
|
||||
{
|
||||
$selected_id = explode(",", $selected_id);
|
||||
|
||||
foreach ($selected_id as $post_id)
|
||||
{
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts SET hidden = '1' WHERE pid = '$post_id'");
|
||||
}
|
||||
|
||||
header("Location: $_SERVER[HTTP_REFERER]");
|
||||
}
|
||||
|
||||
else break;
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// Combining POST
|
||||
// ********************************************************************************
|
||||
case "07":
|
||||
|
||||
if ($selected_id and is_moderation(0, 0, $selected_id, 'combining_post'))
|
||||
{
|
||||
$pid_list = $db->safesql($selected_id);
|
||||
|
||||
$db->query("SELECT * FROM " . PREFIX . "_forum_posts WHERE pid IN ($pid_list)");
|
||||
|
||||
$join_posts_error = false;
|
||||
|
||||
$post_author = array();
|
||||
|
||||
$posts_text = array();
|
||||
|
||||
$selected_id = array();
|
||||
|
||||
$topic_id = 0;
|
||||
|
||||
while ($row = $db->get_row())
|
||||
{
|
||||
$count++;
|
||||
|
||||
$selected_id[] = $row['pid'];
|
||||
|
||||
if ($count == 1)
|
||||
{
|
||||
$topic_id = $row['topic_id'];
|
||||
}
|
||||
|
||||
if (!in_array($row['post_author'], $post_author))
|
||||
{
|
||||
$post_author[] = $row['post_author'];
|
||||
}
|
||||
|
||||
if ($row['topic_id'] !== $topic_id)
|
||||
{
|
||||
$join_posts_error = true;
|
||||
}
|
||||
|
||||
$posts_text[] = $row['post_text'];
|
||||
}
|
||||
|
||||
if ($count > 1 and !$join_posts_error)
|
||||
{
|
||||
$new_post = implode("<br /><br />", $posts_text);
|
||||
|
||||
$new_post = $db->safesql($new_post);
|
||||
|
||||
foreach ($selected_id as $key => $value_pid)
|
||||
{
|
||||
$pid_count++;
|
||||
|
||||
if ($pid_count == 1)
|
||||
{
|
||||
$edit_info = ", edit_user = '{$member_id[name]}', edit_time = '{$_TIME}'";
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts SET post_text = '$new_post' {$edit_info} WHERE pid = '$value_pid'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_posts WHERE pid = '$value_pid'");
|
||||
|
||||
$del_count++;
|
||||
}
|
||||
}
|
||||
|
||||
$del_count = $del_count + 1;
|
||||
|
||||
calk_topic_del ($topic_id, $del_count);
|
||||
|
||||
if ($forum_config['mod_rewrite']) $topic_location = $forum_url . "/topic_" . $topic_id;
|
||||
|
||||
else $topic_location = $forum_url . "showtopic=" . $topic_id;
|
||||
|
||||
header("Location: $topic_location");
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// Move POST
|
||||
// ********************************************************************************
|
||||
case "08":
|
||||
|
||||
$new_topic = $_REQUEST['new_topic'];
|
||||
|
||||
$new_topic_id = 0;
|
||||
|
||||
if (intval($new_topic) != 0)
|
||||
{
|
||||
$new_topic_id = intval ($new_topic);
|
||||
}
|
||||
else
|
||||
{
|
||||
preg_match_all("#topic_([0-9]{1,10})#", $new_topic, $matches);
|
||||
|
||||
$new_topic_id = intval ($matches[1][0]);
|
||||
|
||||
if (!$new_topic_id)
|
||||
{
|
||||
preg_match_all("#showtopic=([0-9]{1,10})#", $new_topic, $matches);
|
||||
|
||||
$new_topic_id = intval ($matches[1][0]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($selected_id and is_moderation(0, 0, $selected_id, 'move_post'))
|
||||
{
|
||||
if (!$subaction)
|
||||
{
|
||||
$action_moveposts = $a_forum_url."act=post&code=08&subaction=move&selected_id={$selected_id}";
|
||||
|
||||
$tpl->load_template($tpl_dir.'moveposts.tpl');
|
||||
|
||||
$tpl->copy_template = "<form method=\"post\" action=\"{$action_moveposts}\">".$tpl->copy_template."</form>";
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
$tpl->clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($new_topic_id)
|
||||
{
|
||||
$row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = $new_topic_id");
|
||||
|
||||
$new_forum_id = $row['forum_id'];
|
||||
|
||||
if ($row['tid'])
|
||||
{
|
||||
// get info //
|
||||
$post_id = intval($selected_id);
|
||||
$row_post = $db->super_query("SELECT * FROM " . PREFIX . "_forum_posts WHERE pid = $post_id");
|
||||
$old_topic_id = $row_post['topic_id'];
|
||||
|
||||
$row2 = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = $old_topic_id");
|
||||
$old_forum_id = $row2['forum_id'];
|
||||
// - //
|
||||
|
||||
if ($old_topic_id == $new_topic_id)
|
||||
{
|
||||
die("error");
|
||||
}
|
||||
|
||||
$in_post_id = array();
|
||||
|
||||
$selected_id = explode(",", $selected_id);
|
||||
|
||||
foreach ($selected_id as $post_id)
|
||||
{
|
||||
$post_count++;
|
||||
|
||||
$in_post_id[] = $post_id;
|
||||
}
|
||||
|
||||
$post_id_list = implode(',', $in_post_id);
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts SET topic_id = $new_topic_id WHERE pid IN ({$post_id_list})");
|
||||
|
||||
if ($old_forum_id == $new_forum_id)
|
||||
{
|
||||
unset ($post_count);
|
||||
}
|
||||
|
||||
calk_topic_del ($new_topic_id, $post_count, '+');
|
||||
|
||||
calk_topic_del ($old_topic_id, $post_count, '-');
|
||||
|
||||
if ($forum_config['mod_rewrite']) $topic_location = $forum_url . "/topic_" . $new_topic_id;
|
||||
|
||||
else $topic_location = $forum_url . "showtopic=" . $new_topic_id;
|
||||
|
||||
header("Location: $topic_location");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// ERROR
|
||||
// ********************************************************************************
|
||||
default:
|
||||
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
|
||||
break;
|
||||
}
|
||||
?>
|
||||
352
system/forum/action/topic.php
Normal file
@@ -0,0 +1,352 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
|
||||
$code = !empty($_POST['code']) ? $_POST['code'] : $_GET['code'];
|
||||
|
||||
$subaction = $_REQUEST['subaction'];
|
||||
$tid = intval($_REQUEST['tid']);
|
||||
$pid = intval($_REQUEST['pid']);
|
||||
|
||||
switch ($code)
|
||||
{
|
||||
// ********************************************************************************
|
||||
// REPLY
|
||||
// ********************************************************************************
|
||||
case "reply":
|
||||
|
||||
$row_topic = $db->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}',"<span id=\"dle-captcha\"><img src=\"".$path['path'].$anti_bot."antibot.php\" alt=\"${lang['sec_image']}\" border=\"0\"></span>");
|
||||
}
|
||||
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 = "<form method=\"post\" name=\"forum-post-form\" id=\"forum-post-form\" action=\"{$add_post_action}\">".$tpl->copy_template."
|
||||
<input type=\"hidden\" name=\"topic_id\" id=\"topic_id\" value=\"{$tid}\" />
|
||||
<input type=\"hidden\" name=\"topic_ti\" id=\"topic_id\" value=\"{$topic_title_last}\" />
|
||||
<input type=\"hidden\" name=\"forum_id\" id=\"forum_id\" value=\"{$forum_id}\" />
|
||||
<input type=\"hidden\" name=\"post_id\" id=\"post_id\" value=\"{$upload_var['post_id']}\" /></form>
|
||||
<div id=\"uploads-form\"></div>";
|
||||
|
||||
$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 = "<form method=\"post\" name=\"dle-comments-form\" id=\"dle-comments-form\" action=\"{$topic_action_add}\">".$tpl->copy_template."</form>";
|
||||
|
||||
$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","<div class=\"quote\">".$hide_info."</div>");
|
||||
}
|
||||
|
||||
$tpl->compile('posts');
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
if (stristr ($tpl->result['posts'], "[attachment="))
|
||||
{
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/attachment.php';
|
||||
}
|
||||
|
||||
$tpl->load_template($tpl_dir.'print/topic.tpl');
|
||||
|
||||
$tpl->set('{topic_link}', $a_forum_url."showtopic=".$row_topic['tid']);
|
||||
|
||||
$tpl->set('{topic_title}', $row_topic['title']);
|
||||
|
||||
$tpl->set('{post_list}', $tpl->result['posts']);
|
||||
|
||||
$tpl->compile('topic_print');
|
||||
$tpl->clear();
|
||||
|
||||
die ($tpl->result['topic_print']);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// POST REPORT
|
||||
// ********************************************************************************
|
||||
case "report":
|
||||
|
||||
if ($is_logged AND !$forum_config['mod_report'])
|
||||
{
|
||||
if (!$subaction)
|
||||
{
|
||||
$report_action_add = $a_forum_url."act=_topic&code=report&subaction=add&tid={$tid}&pid={$pid}";
|
||||
|
||||
$tpl->load_template($tpl_dir.'report.tpl');
|
||||
|
||||
$tpl->copy_template = "<form method=\"post\" name=\"dle-comments-form\" id=\"dle-comments-form\" action=\"{$report_action_add}\">".$tpl->copy_template."</form>";
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$report = strip_tags(stripslashes($_REQUEST['report']));
|
||||
|
||||
if ($tid AND $pid AND $report)
|
||||
{
|
||||
$mail_tpl = $db->super_query("SELECT template FROM " . PREFIX . "_forum_email where name='report_text' LIMIT 0,1");
|
||||
|
||||
$mail_tpl['template'] = stripslashes($mail_tpl['template']);
|
||||
|
||||
$topic_link = $a_forum_url."showtopic={$tid}";
|
||||
|
||||
$mail_result = str_replace("{%username_from%}", $member_id['name'], $mail_tpl['template']);
|
||||
|
||||
$mail_result = str_replace("{%text%}", $report, $mail_result);
|
||||
|
||||
$mail_result = str_replace("{%topic_link%}", $topic_link, $mail_result);
|
||||
|
||||
$mail_result = str_replace("{%post_id%}", $pid, $mail_result);
|
||||
|
||||
include_once SYSTEM_DIR.'/classes/mail.class.php';
|
||||
|
||||
$mail = new dle_mail ($config);
|
||||
|
||||
$mail->send ($config['admin_mail'], "DLE Forum - REPORT", $mail_result);
|
||||
|
||||
forum_msg($f_lang['f_msg'], $f_lang['report_send'], "link", $topic_link);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['values_error']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
59
system/forum/ajax/addpost.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
include 'init.php';
|
||||
|
||||
$ajax_start = true;
|
||||
|
||||
$tpl = new dle_template;
|
||||
$tpl->dir = ROOT_DIR.'/templates/'.$_REQUEST['skin'];
|
||||
define('TEMPLATE_DIR', $tpl->dir);
|
||||
|
||||
$name = convert_unicode($_POST['name'], $config['charset']);
|
||||
$mail = convert_unicode($_POST['mail'], $config['charset']);
|
||||
|
||||
$post_text = trim(convert_unicode($_POST['post_text'], $config['charset']));
|
||||
|
||||
$topic_title = convert_unicode($_POST['topic_title'], $config['charset']);
|
||||
|
||||
$topic_id = intval($_POST['topic_id']);
|
||||
|
||||
$forum_id = intval($_POST['forum_id']);
|
||||
|
||||
$post_id = $_POST['post_id'];
|
||||
|
||||
$ajax_adds = TRUE;
|
||||
|
||||
$access_mod = array(1);
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/action/addpost.php';
|
||||
|
||||
$clear_value = "form.post_text.value = '';";
|
||||
|
||||
if(!$add_post_error){
|
||||
|
||||
$result_posts = $db->query("SELECT * FROM " . PREFIX . "_forum_posts LEFT JOIN " . USERPREFIX . "_users ON " . PREFIX . "_forum_posts.post_author=" . USERPREFIX . "_users.name WHERE " . PREFIX . "_forum_posts.topic_id = '$topic_id' ORDER BY pid DESC LIMIT 1");
|
||||
|
||||
$tid = $topic_id;
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/showposts.php';
|
||||
|
||||
$tpl->result['content'] = "<div id=\"blind-animation\" style=\"display:none\">".$tpl->result['posts']."<div>";
|
||||
$tpl->result['content'] = str_replace('{THEME}', $config['http_home_url'].'templates/'.$_REQUEST['skin'], $tpl->result['content']);
|
||||
|
||||
$tpl->result['content'] .= <<<HTML
|
||||
<script language='JavaScript' type="text/javascript">
|
||||
var timeval = new Date().getTime();
|
||||
var form = document.getElementById('forum-post-form');
|
||||
{$clear_value}
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$tpl->result['content'] = "<script language=\"JavaScript\" type=\"text/javascript\">\n alert ('".$add_post_error."');\n </script>";
|
||||
}
|
||||
|
||||
@header("Content-type: text/html; charset=".$config['charset']);
|
||||
echo $tpl->result['content'];
|
||||
?>
|
||||
208
system/forum/ajax/dle_forum.js
Normal file
@@ -0,0 +1,208 @@
|
||||
function ajax_post_edit ( p_id ){
|
||||
if ( ! c_cache[ p_id ] || c_cache[ p_id ] == '' ){
|
||||
c_cache[ p_id ] = $('#post-id-'+p_id).html();
|
||||
}
|
||||
ShowLoading('');
|
||||
$.get( forum_ajax + "editpost.php", { id: p_id, action: "edit" }, function(data){
|
||||
HideLoading('');
|
||||
RunAjaxJS('post-id-'+p_id, data);
|
||||
setTimeout(function() {
|
||||
$("html:not(:animated)"+( ! $.browser.opera ? ",body:not(:animated)" : "")).animate({scrollTop: $("#post-id-" + p_id).offset().top - 70}, 700);
|
||||
}, 100);
|
||||
});
|
||||
return false;
|
||||
};
|
||||
function ajax_cancel_post_edit( p_id ){
|
||||
if ( c_cache[ p_id ] != "" )
|
||||
{$("#post-id-"+p_id).html(c_cache[ p_id ]);}
|
||||
return false;
|
||||
};
|
||||
function ajax_save_post_edit( c_id ){
|
||||
var post_txt = '';
|
||||
comm_edit_id = c_id;
|
||||
post_txt = $('#forum_post_'+c_id).val();
|
||||
ShowLoading('');
|
||||
$.post(forum_ajax + "editpost.php", { id: c_id, post_text: post_txt, action: "save" }, function(data){
|
||||
HideLoading('');
|
||||
$("#post-id-"+c_id).html(data);
|
||||
});
|
||||
return false;
|
||||
};
|
||||
function doAddPost(){
|
||||
var form = document.getElementById('forum-post-form');
|
||||
if (form.post_text.value == '' || form.post_text.value == ''){alert ( dle_req_field );return false;}
|
||||
ShowLoading('');
|
||||
$.post(forum_ajax + "addpost.php", { topic_id: form.topic_id.value, forum_id: form.forum_id.value, post_id: form.post_id.value, topic_title: form.topic_title.value, name: form.name.value, mail: form.mail.value, post_text: form.post_text.value, skin: dle_skin }, function(data){
|
||||
HideLoading('');
|
||||
RunAjaxJS('ajax-post', data);
|
||||
if (data != 'error' && document.getElementById('blind-animation')) {
|
||||
$("html"+( ! $.browser.opera ? ",body" : "")).animate({scrollTop: $("#ajax-post").offset().top - 70}, 1100);
|
||||
setTimeout(function() { $('#blind-animation').show('blind',{},0)}, 0);
|
||||
}
|
||||
});
|
||||
};
|
||||
function postDelete(url){
|
||||
var agree=confirm( 'Âû äåéñòâèòåëüíî õîòèòå óäàëèòü ýòî ñîîáùåíèå?' );
|
||||
if (agree)
|
||||
document.location=url;
|
||||
};
|
||||
function topicDelete(url){
|
||||
var agree=confirm( 'Âû äåéñòâèòåëüíî õîòèòå óäàëèòü ýòó òåìó?' );
|
||||
if (agree)
|
||||
document.location=url;
|
||||
};
|
||||
function rowDelete(url){
|
||||
var agree=confirm( 'Âû äåéñòâèòåëüíî õîòèòå óäàëèòü ýòó çàïèñü?' );
|
||||
if (agree)
|
||||
document.location=url;
|
||||
};
|
||||
function TopicMenu( tid, forum_url, moderation ){
|
||||
var menu=new Array();
|
||||
if (moderation)
|
||||
{
|
||||
menu[0]='<a href="' + forum_url + 'act=moderation&code=calc&tid=' + tid + '">Ïåðåñ÷èòàòü âñå â òåìå</a>';
|
||||
}
|
||||
menu[1]='<a href="' + forum_url + 'act=subscription&code=add&tid=' + tid + '">Ïîäïèñêà íà òåìó</a>';
|
||||
menu[2]='<a href="' + forum_url + 'act=_topic&code=forward&tid=' + tid + '">Ñîîáùèòü äðóãó</a>';
|
||||
menu[3]='<a href="' + forum_url + 'act=_topic&code=print&tid=' + tid + '">Âåðñèÿ äëÿ ïå÷àòè</a>';
|
||||
return menu;
|
||||
};
|
||||
function ForumMenu( fid, moderation, forum_url ){
|
||||
var menu=new Array();
|
||||
if (moderation){
|
||||
menu[0]='<a href="' + forum_url + 'showforum=' + fid + '&code=hidden">Ïîêàçàòü âñå ñêðûòûå òåìû</a>';
|
||||
menu[1]='<a href="' + forum_url + 'act=getforum&code=calc&fid=' + fid + '">Ïåðåñ÷èòàòü âñå â ôîðóìå</a>';
|
||||
}
|
||||
menu[3]='<a href="' + forum_url + 'showforum=' + fid + '&code=today">Àêòèâíûå òåìû</a>';
|
||||
menu[4]='<a href="' + forum_url + 'showforum=' + fid + '&code=noreply">Òåìû áåç îòâåòîâ</a>';
|
||||
return menu;
|
||||
};
|
||||
function PostEditMenu( pid, forum_url, page, post_n ){
|
||||
var menu=new Array();
|
||||
menu[0]='<a onclick="ajax_post_edit(\'' + pid + '\'); return false;" href="#">' + menu_short + '</a>';
|
||||
menu[1]='<a href="' + forum_url + 'act=post&code=02&pid=' + pid + '&p=' + page + '&pn=' + post_n + '">' + menu_full + '</a>';
|
||||
return menu;
|
||||
};
|
||||
function FUserMenu( url, m_id, group, forum_url ){
|
||||
var menu=new Array();
|
||||
menu[0]='<a href="' + dle_root + 'user/' + url + '">' + menu_profile + '</a>';
|
||||
menu[1]='<a href="' + dle_root + 'index.php?do=pm&doaction=newpm&user=' + m_id + '">' + menu_send + '</a>';
|
||||
menu[2]='<a href="' + forum_url + 'act=getforum&code=user&mname=' + url + '">Íàéòè òåìû ïîëüçîâàòåëÿ</a>';
|
||||
if (group == '1') {
|
||||
menu[3]='<a onclick="window.open(\'' + dle_root + dle_admin + '?mod=editusers&action=edituser&id=' + m_id + '\', \'User\',\'toolbar=0,location=0,status=0, left=0, top=0, menubar=0,scrollbars=yes,resizable=0,width=540,height=500\'); return false;" href="#">' + menu_uedit + '</a>';
|
||||
}
|
||||
return menu;
|
||||
};
|
||||
function navigation(pages_count, url){
|
||||
var page = prompt("Ïåðåéòè ê ñòðàíèöå", "");
|
||||
if (page)
|
||||
{
|
||||
if (pages_count >= page)
|
||||
{
|
||||
window.location.href = url + page;
|
||||
}
|
||||
}
|
||||
};
|
||||
function PostLink(link){
|
||||
url = window.location;
|
||||
var enterCause = prompt("Êîïèðîâàíèå ïðÿìîé ññûëêè", url + "#post-" + link);
|
||||
};
|
||||
function select_id( sid ){
|
||||
var saved = new Array();
|
||||
var clean = new Array();
|
||||
var add = 1;
|
||||
tmp = document.modform.selected_id.value;
|
||||
if( tmp != "" )
|
||||
{
|
||||
saved = tmp.split(",");
|
||||
}
|
||||
for( i = 0 ; i < saved.length; i++ )
|
||||
{
|
||||
if ( saved[i] != "" )
|
||||
{
|
||||
if ( saved[i] == sid )
|
||||
{
|
||||
add = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
clean[clean.length] = saved[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( add )
|
||||
{
|
||||
clean[ clean.length ] = sid;
|
||||
}
|
||||
|
||||
newvalue = clean.join(',');
|
||||
document.modform.selected_id.value = newvalue;
|
||||
};
|
||||
function ShowHide( name, open ){
|
||||
if (document.getElementById( name ).style.display != "none")
|
||||
{
|
||||
document.getElementById( name ).style.display = "none";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById( name ).style.display = "";
|
||||
}
|
||||
|
||||
if (open)
|
||||
{
|
||||
document.getElementById( name ).style.display = "";
|
||||
}
|
||||
};
|
||||
function PostPreviewCompleted(){
|
||||
var post_main_obj = document.getElementById( 'post-preview' );
|
||||
var post_box_top = _get_obj_toppos( post_main_obj );
|
||||
if ( post_box_top )
|
||||
{
|
||||
scroll( 0, post_box_top - 70 );
|
||||
}
|
||||
};
|
||||
function PostPreview(){
|
||||
var post_text = "";
|
||||
post_text = document.getElementById('forum-post-form').post_text.value;
|
||||
if (post_text == ''){alert('Çàïîëíèòå âñå íåîáõîäèìûå ïîëÿ');return false}
|
||||
ShowLoading('');
|
||||
$.post(forum_ajax + "post.preview.php", { post_text: post_text, skin: dle_skin}, function(data){
|
||||
HideLoading('');
|
||||
$("#post-preview").html(data);
|
||||
});
|
||||
};
|
||||
function uploadsform(open_url){
|
||||
$("#uploads-form").remove();
|
||||
ShowLoading('');
|
||||
$.post(forum_ajax + "uploads.form.php", {open_url: open_url}, function(data){
|
||||
HideLoading('');
|
||||
$("body").append( data );
|
||||
$('#uploads-form').dialog({
|
||||
autoOpen: true,
|
||||
width: 470,
|
||||
buttons: {
|
||||
"Çàêðûòü": function() {
|
||||
$(this).dialog("close");
|
||||
$("#uploads-form").remove();
|
||||
}}});
|
||||
});
|
||||
return false;
|
||||
};
|
||||
function forum_ins(name){
|
||||
var input = document.getElementById('forum-post-form').post_text;
|
||||
if (dle_txt!= "")
|
||||
{
|
||||
input.value += dle_txt;
|
||||
}
|
||||
else
|
||||
{
|
||||
input.value += "[b]"+name+"[/b],"+"\n";
|
||||
}
|
||||
};
|
||||
function CtrlEnter(event, form){
|
||||
if((event.ctrlKey) && ((event.keyCode == 0xA)||(event.keyCode == 0xD)))
|
||||
{
|
||||
form.submit.click();
|
||||
}
|
||||
};
|
||||
104
system/forum/ajax/editpost.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
include 'init.php';
|
||||
|
||||
if (!$is_logged){die ("error");}
|
||||
|
||||
$id = intval($_REQUEST['id']);
|
||||
|
||||
if (!$id OR !is_moderation(0, 0, $id, 'forum_post_edit'))
|
||||
{
|
||||
die ("error");
|
||||
}
|
||||
|
||||
include_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
// ********************************************************************************
|
||||
// EDIT POST
|
||||
// ********************************************************************************
|
||||
if ($_REQUEST['action'] == "edit")
|
||||
{
|
||||
$row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_posts WHERE pid = $id");
|
||||
|
||||
if ($id != $row['pid']) die ("error");
|
||||
|
||||
$topic_id = $row['topic_id'];
|
||||
|
||||
$upload_var = array('area'=>"post", 'forum_id'=>$forum_id, 'topic_id'=>$topic_id, 'post_id'=>$id);
|
||||
|
||||
$ajax_post_id = $id;
|
||||
|
||||
$upload_var['reply'] = "reply";
|
||||
|
||||
$post_text = $parse->decodeBBCodes($row['post_text'], false);
|
||||
|
||||
$upload_var['bb_width'] = '99%';
|
||||
|
||||
include_once SYSTEM_DIR.'/forum/sources/components/bbcode.php';
|
||||
|
||||
$bb_code = str_replace ("{THEME}", $config['http_home_url']."templates/".$config['skin'], $bb_code);
|
||||
|
||||
|
||||
$buffer = <<<HTML
|
||||
<form method="post" name="forum_post_form_{$id}" id="forum_post_form_{$id}" action="">
|
||||
<div>{$bb_code}</div>
|
||||
<textarea id="forum_post_{$id}" name="forum_post_{$id}" onclick="setNewField(this.name, document.forum_post_form_{$id})" style="width:99%; height:150px;font-family:verdana; font-size:11px; border:1px solid #E0E0E0">{$post_text}</textarea><br>
|
||||
<div align="right" style="width:99%;"><input class=bbcodes title="$lang[bb_t_apply]" type=button onclick="ajax_save_post_edit('{$id}'); return false;" value="$lang[bb_b_apply]">
|
||||
<input class=bbcodes title="$lang[bb_t_cancel]" type=button onclick="ajax_cancel_post_edit('{$id}'); return false;" value="$lang[bb_b_cancel]">
|
||||
</div>
|
||||
</form>
|
||||
HTML;
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// SAVE POST
|
||||
// ********************************************************************************
|
||||
elseif ($_REQUEST['action'] == "save")
|
||||
{
|
||||
$post_text = trim(convert_unicode($_POST['post_text'], $config['charset']));
|
||||
|
||||
$post_text = $parse->process($post_text);
|
||||
|
||||
$post_text = $parse->BB_Parse($post_text, FALSE);
|
||||
|
||||
if (!$post_text) die ("error");
|
||||
|
||||
$post_text = auto_wrap ($post_text);
|
||||
|
||||
if (strlen($post_text) > $forum_config['post_maxlen'])
|
||||
{
|
||||
die ("<script language=\"JavaScript\" type=\"text/javascript\">\n alert ('The length of the message exceeds the limit!');\n </script>");
|
||||
}
|
||||
|
||||
$edit_info = ", edit_user = '{$member_id[name]}', edit_time = '{$_TIME}'";
|
||||
|
||||
$post_text = $db->safesql($post_text);
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_posts SET post_text = '$post_text' {$edit_info} WHERE pid = $id");
|
||||
|
||||
$post_text = preg_replace ("'\[hide\](.*?)\[/hide\]'si","\\1", $post_text);
|
||||
|
||||
check_attachment($pid, $post_text);
|
||||
|
||||
if (stristr ($post_text, "[attachment="))
|
||||
{
|
||||
$row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_posts WHERE pid = $id");
|
||||
|
||||
$tid = $row['topic_id'];
|
||||
|
||||
$ajax_edit_attach = TRUE;
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/attachment.php';
|
||||
}
|
||||
|
||||
$buffer = stripslashes($post_text);
|
||||
|
||||
$buffer = stripslashes($buffer);
|
||||
}
|
||||
|
||||
else die ("error");
|
||||
|
||||
@header("Content-type: text/html; charset=".$config['charset']);
|
||||
echo $buffer;
|
||||
?>
|
||||
130
system/forum/ajax/init.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
@error_reporting(7);
|
||||
@ini_set('display_errors', true);
|
||||
@ini_set('html_errors', false);
|
||||
|
||||
@session_start();
|
||||
|
||||
define('DATALIFEENGINE', true);
|
||||
define('ROOT_DIR', '../../..');
|
||||
define('SYSTEM_DIR', ROOT_DIR.'/system');
|
||||
|
||||
include SYSTEM_DIR.'/data/config.php';
|
||||
include SYSTEM_DIR.'/data/forum_config.php';
|
||||
include_once ROOT_DIR.'/language/'.$config['langs'].'/website.lng';
|
||||
require_once SYSTEM_DIR.'/classes/mysql.php';
|
||||
require_once SYSTEM_DIR.'/data/dbconfig.php';
|
||||
require_once SYSTEM_DIR.'/modules/functions.php';
|
||||
require_once SYSTEM_DIR.'/classes/templates.class.php';
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/init.php';
|
||||
|
||||
$_TIME = time () + ($config['date_adjust'] * 60);
|
||||
|
||||
$_REQUEST['skin'] = totranslit($_REQUEST['skin'], false, false);
|
||||
|
||||
if (! @is_dir( ROOT_DIR . '/templates/' . $_REQUEST['skin'] ))
|
||||
{
|
||||
$_REQUEST['skin'] = $config['skin'];
|
||||
}
|
||||
|
||||
$user_group = $cache->get ("usergroup");
|
||||
|
||||
if (!$user_group)
|
||||
{
|
||||
$user_group = array ();
|
||||
|
||||
$db->query("SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC");
|
||||
|
||||
while ($row = $db->get_row())
|
||||
{
|
||||
$user_group[$row['id']] = array ();
|
||||
|
||||
foreach ($row as $key => $value)
|
||||
{
|
||||
$user_group[$row['id']][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$cache->set ("usergroup", $user_group);
|
||||
|
||||
$db->free();
|
||||
}
|
||||
|
||||
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
|
||||
|
||||
require_once SYSTEM_DIR . '/modules/sitelogin.php';
|
||||
|
||||
if (!$is_logged)
|
||||
{
|
||||
$member_id['user_group'] = 5;
|
||||
}
|
||||
|
||||
if ($member_id['banned'])
|
||||
{
|
||||
die ("Hacking attempt!");
|
||||
}
|
||||
|
||||
if (!function_exists('convert_unicode'))
|
||||
{
|
||||
function decode_to_utf8 ($int=0)
|
||||
{
|
||||
$t = '';
|
||||
|
||||
if ( $int < 0 )
|
||||
{
|
||||
return chr(0);
|
||||
}
|
||||
else if ( $int <= 0x007f )
|
||||
{
|
||||
$t .= chr($int);
|
||||
}
|
||||
else if ( $int <= 0x07ff )
|
||||
{
|
||||
$t .= chr(0xc0 | ($int >> 6));
|
||||
$t .= chr(0x80 | ($int & 0x003f));
|
||||
}
|
||||
else if ( $int <= 0xffff )
|
||||
{
|
||||
$t .= chr(0xe0 | ($int >> 12));
|
||||
$t .= chr(0x80 | (($int >> 6) & 0x003f));
|
||||
$t .= chr(0x80 | ($int & 0x003f));
|
||||
}
|
||||
else if ( $int <= 0x10ffff )
|
||||
{
|
||||
$t .= chr(0xf0 | ($int >> 18));
|
||||
$t .= chr(0x80 | (($int >> 12) & 0x3f));
|
||||
$t .= chr(0x80 | (($int >> 6) & 0x3f));
|
||||
$t .= chr(0x80 | ($int & 0x3f));
|
||||
}
|
||||
else
|
||||
{
|
||||
return chr(0);
|
||||
}
|
||||
|
||||
return $t;
|
||||
}
|
||||
|
||||
function convert_unicode ($t, $to = 'windows-1251')
|
||||
{
|
||||
$to = strtolower($to);
|
||||
|
||||
if ($to == 'utf-8') {
|
||||
|
||||
$t = preg_replace( '#%u([0-9A-F]{1,4})#ie', "decode_to_utf8(hexdec('\\1'))", utf8_encode($t) );
|
||||
$t = urldecode ($t);
|
||||
|
||||
} else {
|
||||
|
||||
$t = preg_replace( '#%u([0-9A-F]{1,4})#ie', "'&#' . hexdec('\\1') . ';'", $t );
|
||||
$t = urldecode ($t);
|
||||
$t = @html_entity_decode($t, ENT_NOQUOTES, $to);
|
||||
|
||||
}
|
||||
|
||||
return $t;
|
||||
}
|
||||
}
|
||||
|
||||
$tpl_dir = 'forum/';
|
||||
|
||||
?>
|
||||
148
system/forum/ajax/poll.php
Normal file
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
/*
|
||||
=====================================================
|
||||
DLE Forum - by DLE Files Group
|
||||
-----------------------------------------------------
|
||||
http://dle-files.ru/
|
||||
-----------------------------------------------------
|
||||
File: poll.php
|
||||
=====================================================
|
||||
Copyright (c) 2008,2010 DLE Files Group
|
||||
=====================================================
|
||||
*/
|
||||
|
||||
include 'init.php';
|
||||
|
||||
function votes ($all, $ansid) {
|
||||
|
||||
$data = array();
|
||||
$alldata = array();
|
||||
|
||||
if ($all !="") {
|
||||
$all = explode("|", $all);
|
||||
|
||||
foreach ($all as $vote) {
|
||||
list($answerid, $answervalue) = explode(":", $vote);
|
||||
$data[$answerid] = intval($answervalue);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($ansid as $id) {
|
||||
$data[$id] ++;
|
||||
}
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$alldata[] = intval($key).":".intval($value);
|
||||
}
|
||||
|
||||
$alldata = implode("|", $alldata);
|
||||
|
||||
return $alldata;
|
||||
}
|
||||
|
||||
function get_votes ($all) {
|
||||
|
||||
$data = array();
|
||||
|
||||
if ($all != "") {
|
||||
$all = explode("|", $all);
|
||||
|
||||
foreach ($all as $vote) {
|
||||
list($answerid, $answervalue) = explode(":", $vote);
|
||||
$data[$answerid] = intval($answervalue);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
$topic_id = intval($_REQUEST['topic_id']);
|
||||
$answers = explode(" ", trim($_REQUEST['answer']));
|
||||
|
||||
$buffer = "";
|
||||
$vote_skin = strip_tags($_REQUEST['vote_skin']);
|
||||
$_IP = $db->safesql($_SERVER['REMOTE_ADDR']);
|
||||
|
||||
if ($is_logged)
|
||||
$log_id = intval($member_id['user_id']);
|
||||
else
|
||||
$log_id = $_IP;
|
||||
|
||||
$poll = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '{$topic_id}'");
|
||||
$log = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_poll_log WHERE topic_id = '{$topic_id}' AND member ='{$log_id}'");
|
||||
|
||||
if ($log['count'] AND $_REQUEST['action'] != "list") $_REQUEST['action'] = "results";
|
||||
$votes = "";
|
||||
|
||||
if ($_REQUEST['action'] == "vote") {
|
||||
|
||||
$votes = votes ($poll['answer'], $answers);
|
||||
$db->query("UPDATE ".PREFIX."_forum_topics set answer='$votes', poll_count=poll_count+".count($answers)." WHERE tid = '{$topic_id}'");
|
||||
$db->query("INSERT INTO ".PREFIX."_forum_poll_log (topic_id, member) VALUES('{$topic_id}', '$log_id')");
|
||||
|
||||
$_REQUEST['action'] = "results";
|
||||
}
|
||||
|
||||
if ($_REQUEST['action'] == "results") {
|
||||
|
||||
if ($votes == "") {$votes = $poll['answer']; $allcount = $poll['poll_count'];} else { $allcount = count($answers) + $poll['poll_count']; }
|
||||
|
||||
$answer = get_votes ($votes);
|
||||
$body = explode("<br />", stripslashes($poll['poll_body']));
|
||||
$pn = 0;
|
||||
|
||||
for ($i = 0; $i < sizeof($body); $i++) {
|
||||
|
||||
$num = $answer[$i];
|
||||
|
||||
if (!$num) $num = 0;
|
||||
|
||||
++$pn; if ($pn > 5) $pn = 1;
|
||||
|
||||
if ($allcount != 0) $proc = (100 * $num) / $allcount;
|
||||
else $proc = 0;
|
||||
|
||||
$proc = round($proc, 0);
|
||||
|
||||
$buffer .= <<<HTML
|
||||
{$body[$i]} - {$num} ({$proc}%)<br />
|
||||
<img src="{$config['http_home_url']}templates/{$vote_skin}/images/poll{$pn}.gif" height="10" width="{$proc}%" style="border:1px solid black"><br />
|
||||
HTML;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
elseif ($_REQUEST['action'] == "list") {
|
||||
|
||||
$body = explode("<br />", stripslashes($poll['poll_body']));
|
||||
|
||||
if (!$poll['multiple']){
|
||||
|
||||
for ($v = 0; $v < sizeof($body); $v++) {
|
||||
if (!$v) $sel = "checked"; else $sel = "";
|
||||
|
||||
$buffer .= <<<HTML
|
||||
<div><input name="dle_poll_votes" id="dle_poll_votes" type="radio" $sel value="{$v}"><label for="dle_poll_votes">{$body[$v]}</label></div>
|
||||
HTML;
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
for ($v = 0; $v < sizeof($body); $v++) {
|
||||
|
||||
$buffer .= <<<HTML
|
||||
<div><input name="dle_poll_votes[]" id="dle_poll_votes" type="checkbox" value="{$v}"><label for="dle_poll_votes">{$body[$v]}</label></div>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else die("error");
|
||||
|
||||
|
||||
@header("Content-type: text/css; charset=".$config['charset']);
|
||||
echo $buffer;
|
||||
?>
|
||||
38
system/forum/ajax/post.preview.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
include 'init.php';
|
||||
|
||||
require_once SYSTEM_DIR.'/classes/parse.class.php';
|
||||
|
||||
if (!@is_dir(ROOT_DIR.'/templates/'.$_REQUEST['skin']) OR $_REQUEST['skin'] == "") die ("Hacking attempt!");
|
||||
|
||||
$tpl = new dle_template;
|
||||
$tpl->dir = ROOT_DIR.'/templates/'.$_REQUEST['skin'];
|
||||
define('TEMPLATE_DIR', $tpl->dir);
|
||||
|
||||
$config['charset'] = ($lang['charset'] != '') ? $lang['charset'] : $config['charset'];
|
||||
|
||||
$_POST['post_text'] = convert_unicode($_POST['post_text'], $config['charset']);
|
||||
|
||||
$parse = new ParseFilter(Array(), Array(), 1, 1);
|
||||
|
||||
$post_text = $parse->process($_POST['post_text']);
|
||||
|
||||
$post_text = $parse->BB_Parse($post_text, FALSE);
|
||||
|
||||
if( function_exists( "get_magic_quotes_gpc" ) && get_magic_quotes_gpc() ) $post_text = stripslashes( $post_text );
|
||||
|
||||
$tpl->load_template('forum/msg.tpl');
|
||||
|
||||
$tpl->set('{title}', "Preview");
|
||||
$tpl->set('{msg}', $post_text);
|
||||
|
||||
$tpl->compile('content');
|
||||
$tpl->clear();
|
||||
|
||||
$tpl->result['content'] = str_replace('{THEME}', $config['http_home_url'].'templates/'.$_REQUEST['skin'], $tpl->result['content']);
|
||||
|
||||
@header("Content-type: text/css; charset=".$config['charset']);
|
||||
|
||||
echo $tpl->result['content'];
|
||||
|
||||
?>
|
||||
34
system/forum/ajax/uploads.form.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
include 'init.php';
|
||||
|
||||
$open_url = convert_unicode($_REQUEST['open_url'], $config['charset']);
|
||||
|
||||
echo <<<HTML
|
||||
<script language="javascript" type="text/javascript">
|
||||
$('#uploads-form').dialog({
|
||||
autoOpen: true,
|
||||
width: 470,
|
||||
buttons: {
|
||||
"Close": function() {
|
||||
$(this).dialog("close");
|
||||
$("#uploads-form").remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
$content = <<<HTML
|
||||
<iframe id="_AddUpload" src="{$open_url}" frameborder="0" width="100%" height="220px"></iframe>
|
||||
HTML;
|
||||
|
||||
@header("Content-type: text/html; charset=".$config['charset']);
|
||||
@header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
|
||||
@header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" );
|
||||
@header( "Cache-Control: no-store, no-cache, must-revalidate" );
|
||||
@header( "Cache-Control: post-check=0, pre-check=0", false );
|
||||
@header( "Pragma: no-cache" );
|
||||
|
||||
echo "<div id='uploads-form' title='Çàãðóçêà ôàéëîâ íà ñåðâåð' style='display:none'>".$content."</div>";
|
||||
|
||||
?>
|
||||
BIN
system/forum/images/post_icons/icon1.gif
Normal file
|
After Width: | Height: | Size: 672 B |
BIN
system/forum/images/post_icons/icon10.gif
Normal file
|
After Width: | Height: | Size: 672 B |
BIN
system/forum/images/post_icons/icon11.gif
Normal file
|
After Width: | Height: | Size: 689 B |
BIN
system/forum/images/post_icons/icon12.gif
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
system/forum/images/post_icons/icon13.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
system/forum/images/post_icons/icon14.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
system/forum/images/post_icons/icon2.gif
Normal file
|
After Width: | Height: | Size: 676 B |
BIN
system/forum/images/post_icons/icon3.gif
Normal file
|
After Width: | Height: | Size: 673 B |
BIN
system/forum/images/post_icons/icon4.gif
Normal file
|
After Width: | Height: | Size: 671 B |
BIN
system/forum/images/post_icons/icon5.gif
Normal file
|
After Width: | Height: | Size: 672 B |
BIN
system/forum/images/post_icons/icon6.gif
Normal file
|
After Width: | Height: | Size: 666 B |
BIN
system/forum/images/post_icons/icon7.gif
Normal file
|
After Width: | Height: | Size: 672 B |
BIN
system/forum/images/post_icons/icon8.gif
Normal file
|
After Width: | Height: | Size: 677 B |
BIN
system/forum/images/post_icons/icon9.gif
Normal file
|
After Width: | Height: | Size: 888 B |
377
system/forum/language/English/admin.lng
Normal file
@@ -0,0 +1,377 @@
|
||||
<?php
|
||||
|
||||
$f_lg = array(
|
||||
'm_forum' => "Welcome to admincp of DLE Forum",
|
||||
'm_stats' => "Main forum stats",
|
||||
'm_new_cat' => "Category",
|
||||
'm_new_cat2' => "Create new category",
|
||||
'm_new_forum' => "Forum",
|
||||
'm_new_forum2' => "New forum title",
|
||||
'm_content' => "Management",
|
||||
'm_content2' => "Editing, list category and forums",
|
||||
'm_rank' => "Rank",
|
||||
'm_rank2' => "Create and edit users rank",
|
||||
'm_tools' => "Settings",
|
||||
'm_tools2' => "Settings of main forum function",
|
||||
'm_discuss' => "Discuss",
|
||||
'm_discuss2' => "Settings of button - Discuss on forum",
|
||||
'm_email' => "System Messages",
|
||||
'm_email2' => "Manage system messages.",
|
||||
'm_service' => "Service",
|
||||
'm_service2' => "Forum servise tools",
|
||||
'm_usergroup' => "User group settings",
|
||||
'm_usergroup2' => "Manage user group",
|
||||
'm_help' => "Help",
|
||||
'm_help2' => "Forum Help",
|
||||
|
||||
'forum_version' => "Version DLE Forum:",
|
||||
'licence_info' => "Licence type:",
|
||||
'forum_status' => "Forum_status:",
|
||||
'forum_topic' => "Forum topics:",
|
||||
'forum_posts' => "Forum Posts:",
|
||||
'forum_online' => "Online",
|
||||
'forum_offline' => "Offline",
|
||||
'forum_db_size' => "Database size:",
|
||||
'forum_files' => "Files size:",
|
||||
'forum_cache' => "Cache size:",
|
||||
'clear_cache' => "Clear cache",
|
||||
'check_updates' => "Check for updates",
|
||||
'msg_updates' => "check updates",
|
||||
'no_update' => "Cannot connect to the server. Try again later.",
|
||||
|
||||
'cat_new' => "Create Category",
|
||||
'cat_edit' => "Edit Category",
|
||||
'cat_name' => "Category title",
|
||||
'cat_ok_add1' => "Category was created",
|
||||
'cat_ok_add2' => "Category was successfully created!",
|
||||
'cat_ok_edit1' => "Category was edited",
|
||||
'cat_ok_edit2' => "Category was successfully edited!",
|
||||
'cat_err_name' => "Enter category title!",
|
||||
'cat_button' => "Create category",
|
||||
|
||||
|
||||
'forum_new' => "Create new forum",
|
||||
'forum_mset' => "Main settings",
|
||||
'forum_name' => "Forum title",
|
||||
'forum_descr' => "Forum description",
|
||||
'forum_cat' => "Category",
|
||||
'forum_for' => "Subforum ?",
|
||||
'password' => "Password",
|
||||
'forum_icon' => "Forum Icon",
|
||||
'forum_icon_hint' => "Icon prefix.<br />f_new_X.gif<br />f_nonew_X.gif<br />fc_new_X.gif<br />fc_nonew_X.gif<br />where X prefix.",
|
||||
'forum_rules' => "Rules",
|
||||
'forum_rules1' => "Title",
|
||||
'forum_rules2' => "Text",
|
||||
'forum_access' => "Access settings",
|
||||
'forum_ok_add1' => "Forum was created",
|
||||
'forum_ok_add2' => "Forum was successfully created!",
|
||||
'forum_err_name' => "Enter forum title",
|
||||
'forum_button' => "Create forum",
|
||||
|
||||
'forum_edit' => "Edit forum",
|
||||
'forum_ok_edit1' => "Forum was edited",
|
||||
'forum_ok_edit2' => "Forum was successfully edited!",
|
||||
|
||||
'java_add_forum' => "Add forum",
|
||||
'java_sort' => "Sort",
|
||||
'java_sort_f' => "Sort forums",
|
||||
'java_edit' => "Edit",
|
||||
'java_ssort' => "Subforums",
|
||||
'java_access' => "Access",
|
||||
'java_moderator' => "Add moderator",
|
||||
'java_del' => "Delete",
|
||||
|
||||
'access_for_f' => "New access for all forums of this category",
|
||||
|
||||
'access_forum_group' => "Group",
|
||||
'access_forum_mod' => "Moderation",
|
||||
'access_forum_topic' => "Topic creation",
|
||||
'access_forum_write' => "Topic write",
|
||||
'access_forum_read' => "Topic read",
|
||||
'access_forum_upload' => "Upload files",
|
||||
'access_forum_download' => "Download files",
|
||||
|
||||
'titles_main' => "Users rank",
|
||||
'titles_name' => "User rank",
|
||||
'titles_pots' => "Required messages",
|
||||
'titles_pips' => "Stars",
|
||||
'titles_action' => "Action",
|
||||
'titles_add' => "Add rank",
|
||||
'titles_nname' => "Rank title",
|
||||
'titles_npost' => "Minimum messages",
|
||||
'titles_npips' => "Total stars",
|
||||
'titles_edit' => "Edit rank",
|
||||
'titles_uadd' => "Add rank to user",
|
||||
'titles_uname' => "User name",
|
||||
'titles_urname' => "User Rank",
|
||||
'titles_error_name' => "User with this name not found!",
|
||||
|
||||
'button_add' => "Add",
|
||||
'button_edit' => "Edit",
|
||||
'button_save' => "Save",
|
||||
'button_sort' => "Sort",
|
||||
'error' => "Error",
|
||||
'error_x' => "Full all Fields!",
|
||||
'label_edit' => "edit",
|
||||
'label_del' => "delete",
|
||||
'db_prev' => "go back",
|
||||
|
||||
'tools_menu' => "Forum settings",
|
||||
|
||||
'tools_global' => "Forum global settings",
|
||||
'tools_name' => "Forum Title:",
|
||||
'tools_name_' => "Example: \"Forum DLE Files Group\"",
|
||||
'tools_url' => "URL with folder of forum:",
|
||||
'tools_url_' => "Example: http://forum.dle-files.ru",
|
||||
'tools_mrewrite' => "Enable search engine friendly URLs?",
|
||||
|
||||
'tools_wysiwyg' => "Enable WYSIWYG editor",
|
||||
'tools_offline' => "Disable Forum",
|
||||
'tools_offline_' => "Enable or disable access to your forum.",
|
||||
'tools_timestamp' => "Time zone offset:",
|
||||
'tools_timestamp2' => "<a onClick=\"javascript:Help('date')\" class=main href=\"#\">help on this function</a>",
|
||||
'tools_sessions' => "register sessions?",
|
||||
'tools_sessions_' => "It is necessary for modules «Online», «who view forum», «who read topic»...",
|
||||
'tools_ses_time' => "Time without any action of user",
|
||||
'tools_ses_time_' => "After this time user status will be set as offline? (in minutesõ)",
|
||||
'tools_stats' => "Enable block with statistic of forum?",
|
||||
|
||||
'tools_online' => "Show Online?",
|
||||
'tools_online_' => "shows online users.",
|
||||
|
||||
'tools_forum_bar' => "Enable Forumbar?",
|
||||
'tools_forum_bar_' => "shows user's current location on the forum e.g. category, topic...",
|
||||
|
||||
'tools_show' => "Topics and messages",
|
||||
'tools_topics' => "Topics limit, in list of forum",
|
||||
'tools_topics_' => "Default — 25",
|
||||
'tools_hot' => "Limit of messages in topic",
|
||||
'tools_hot_' => "Default — 30",
|
||||
'tools_posts' => "Limit of messages, per topic page",
|
||||
'tools_posts_' => "Default — 20",
|
||||
|
||||
'tools_mhide' => "Number of messages to view hiden text",
|
||||
'tools_mhide_' => "To view text between tags <b>[HIDE] [/HIDE]</b>.",
|
||||
|
||||
'tools_abc_topic' => "Maximum title simbols",
|
||||
|
||||
'tools_post_update' => "mix messages?",
|
||||
'tools_post_update2' => "If author of last or new message is the same the new message will be mix with old message and shows like one post .",
|
||||
'tools_last_plink' => "Link to last topic page",
|
||||
'tools_last_plink_' => "shows link to last topic page in block last post.",
|
||||
'tools_hide_forum' => "Hide forums?",
|
||||
'tools_hide_forum_' => "Hide forums for for one or another group.",
|
||||
'tools_topic_sort' => "Sort topics by date?",
|
||||
'tools_topic_sort_' => "Topics will be sort by date of last post.",
|
||||
'tools_topic_email' => "E-mail notification of new topic creation",
|
||||
|
||||
'tools_pr_imp' => "Pinned Topics prefix",
|
||||
'tools_pr_vote' => "Topics with vote prefix",
|
||||
'tools_pr_modr' => "Topics without moderation prefix",
|
||||
'tools_pr_sub_f' => "Subforum prefix",
|
||||
|
||||
|
||||
'tools_safety' => "Safety settings",
|
||||
'tools_complaint' => "Disable module «Report»?",
|
||||
'tools_flood' => "Flood control",
|
||||
'tools_flood_' => "Number of seconds user must wait before being able to post another message.
|
||||
leave empty to disable.",
|
||||
'tools_search_captcha' => "Enable security code for search",
|
||||
|
||||
'tools_preventions' => "Warn system",
|
||||
'tools_prevntn_on' => "Warn",
|
||||
'tools_prevntn_on_' => "Enable warn system?",
|
||||
'tools_prevntn_max' => "Maximum warns",
|
||||
'tools_prevntn_max_' => "Maximun number of warn to block user.",
|
||||
'tools_prevntn_group' => "Group with disable warn",
|
||||
|
||||
'tools_prevntn_g_show' => "Moderators",
|
||||
'tools_prevntn_g_show_' => "Usergroup with access to view users warn magazine.",
|
||||
'tools_prevntn_show' => "Access to user to view warn?",
|
||||
'tools_prevntn_show_' => "With module enable user cant view warn status.",
|
||||
'tools_prevntn_show_all' => "Acces to users to view all users warn status?",
|
||||
'tools_prevntn_show_all_' => "With module enable user cant view all users warn status .",
|
||||
'tools_prevntn_show_gr' => "Show warn status in group with disable warn?",
|
||||
|
||||
'tools_warn_day' => "Warn limit to one user",
|
||||
'tools_warn_day2' => "number of warn by moderator in one day.",
|
||||
|
||||
'tools_modules' => "Modules tools",
|
||||
'tools_mod_icq' => "ICQ status",
|
||||
'tools_mod_icq_' => "module shows ICQ icon.",
|
||||
'tools_mod_rank' => "Rank",
|
||||
'tools_mod_rank_' => "module shows user rank by number of messages.",
|
||||
'tools_subscr' => "Subscrition",
|
||||
'tools_subscr_' => "after answer in topic user will receive e-mail.",
|
||||
'tools_reputation' => "Reputation",
|
||||
'tools_reputation_' => "Enable users reputation.",
|
||||
'tools_poll' => "Poll",
|
||||
'tools_poll_' => "usergroup with access to poll in topics.",
|
||||
'tools_ses_forum' => "Show who view forum?",
|
||||
|
||||
'tools_ses_topic' => "Show who read topic?",
|
||||
|
||||
'tools_discuss' => "Button 'Discuss in forum'",
|
||||
'tools_disc_on' => "Enable module",
|
||||
'tools_disc_on_' => "Enable module «Discuss in forum».",
|
||||
'tools_disc_title' => "Topic title",
|
||||
'tools_disc_title_' => "Topic title, what will be created by presing on the button.",
|
||||
'tools_disc_opt_1' => "News title",
|
||||
'tools_disc_opt_2' => "Title by template",
|
||||
'tools_disc_t_tpl' => "Template title",
|
||||
'tools_disc_t_tpl_' => "example: <b>article: {post_title}</b>",
|
||||
'tools_disc_post' => "Topic Description",
|
||||
'tools_disc_post_' => "Topic Description, what will be created by presing on the button.",
|
||||
'tools_disc_opt_3' => "Short news",
|
||||
'tools_disc_opt_4' => "Full news",
|
||||
'tools_disc_opt_5' => "Template",
|
||||
'tools_disc_p_tpl' => "Template of topic description",
|
||||
'tools_disc_p_tpl_' => "example: <b>[url={post_link}]{post_title}[/url]</b><br />If field is fill,when wthat text will be main description.",
|
||||
|
||||
'tools_speed' => "Speed tools",
|
||||
'tools_t_as_p' => "Created topic as user message?",
|
||||
'tools_t_as_p_' => "if yes, when if user create topic it will be count as message post in user status.",
|
||||
'tools_sp_num' => "Count number of messages?",
|
||||
'tools_sp_num_' => "if yes, example, with deleted user topic or message will be recount number of post in user status. if no,when user messages will be count in known time.",
|
||||
'tools_sp_num_date' => "messages count days",
|
||||
'tools_sp_num_date_' => "example: one every day.",
|
||||
'tools_new_t_day' => "Time of active topic",
|
||||
'tools_new_t_day_' => "After this time without any answer in topic the topic will be old. example: 5 days.",
|
||||
'tools_sp_sublast' => "Refresh forum with answer in subforums?",
|
||||
'tools_sp_sublast_' => "shows last post in forum with answer in subforum.",
|
||||
|
||||
'tools_uploads' => "Upload files on server settings",
|
||||
'tools_upload' => "Enable file uploads on server",
|
||||
'tools_upload_' => "Usergroup with access to upload any file.",
|
||||
'tools_upload_type' => "File types to upload",
|
||||
'tools_upload_type_' => "Enter file types separated by comma.",
|
||||
'tools_img_upl' => "allow to users upload images",
|
||||
|
||||
'tools_img_max_size' => "Maximum image size",
|
||||
'tools_img_max_size_' => "Enter maximum image size in kb",
|
||||
'tools_thumb_size' => "Auto resize large images:",
|
||||
'tools_thumb_size_' => "Auto resize large images on upload (in Pixels).",
|
||||
'tools_jpeg_quality' => "JPEG image compression:",
|
||||
'tools_jpeg_quality_' => "Compression is applied to all uploaded JPEG images.",
|
||||
'tools_img_width' => "Auto resize linked images",
|
||||
'tools_img_width_' => "Enter maximum image size for tag [img] [/img], to disable this function enter 0.",
|
||||
|
||||
'tools_licence' => "Licence",
|
||||
'tools_licence_key' => "Licence key",
|
||||
'tools_licence_key_' => "Enter Licence key.",
|
||||
'tools_copyright' => "CopyRight",
|
||||
'tools_copyright2' => "Show CopyRight?",
|
||||
'tools_licence_name' => "Show «Registered to...»",
|
||||
'tools_licence_name_' => "Example: DLE Files Group 2008",
|
||||
|
||||
't_f_save' => "Settings are saved",
|
||||
't_f_save1' => "Settings are successfully saved",
|
||||
|
||||
'mail_subscr' => "E-Mail messages settings, For sibscrition",
|
||||
'mail_subscr_' => "<b>{%username_to%}</b> - Name<br /><b>{%username_from%}</b> - From<br /><b>{%topic_name%}</b> - Topic title<br /><b>{%topic_link%}</b> - Topic link<br /><b>{%topic_link_del%}</b> - Subscrition link",
|
||||
'mail_frend' => "E-Mail messages settings, Send to friend",
|
||||
'mail_frend_' => "<b>{%username_to%}</b> - Name<br /><b>{%username_from%}</b> - From<br /><b>{%text%}</b> - message text",
|
||||
'mail_report' => "E-Mail messages settings, For reports",
|
||||
'mail_report_' => "<b>{%username_from%}</b> - Name<br /><b>{%text%}</b> - message text<br /><b>{%topic_link%}</b> - topic link<br /><b>{%post_id%}</b> - message ID<br />",
|
||||
'mail_new_topic' => "E-Mail messages settings, New topic created",
|
||||
'mail_new_topic_' => "<b>{%username%}</b> - Topic author<br /><b>{%date%}</b> - date of creation<br /><b>{%title%}</b> - tpic title<br /><b>{%link%}</b> - topic link",
|
||||
|
||||
'email_ok' => "Settings are saved",
|
||||
'email_ok2' => "Settings are successfully saved!",
|
||||
|
||||
'trial_info' => "<b>Warring!</b><br>You using not activated version of script with limits you must enter the licence key.<br>Activation of script on <a href='http://dle-files.ru/'>http://dle-files.ru</a>",
|
||||
'trial_login' => "Login:",
|
||||
'trial_key' => "Key:",
|
||||
'trial_act' => "Activate",
|
||||
'licence_trial' => "Free version",
|
||||
'licence_full' => "Licence activated",
|
||||
'trial_limit' => "This trial version of Dle Forum has expired.",
|
||||
|
||||
'group_list' => "Usergroup list",
|
||||
'group_name' => "Group Name",
|
||||
'group_users' => "Users",
|
||||
'group_sel1' => "Edit",
|
||||
'group_sel2' => "Delete",
|
||||
'group_sel3' => "Cannot delete",
|
||||
'group_edit' => "Edit group:",
|
||||
|
||||
'group_colour' => "Group color",
|
||||
'group_colour_' => "Usergroup color. (example: #CC0000)",
|
||||
|
||||
'group_offline' => "Allow to view offline forum",
|
||||
'group_post_edit' => "Can edit own posts?",
|
||||
'group_post_del' => "Can delete own posts?",
|
||||
'group_topic_set' => "Can open/close own topics?",
|
||||
'group_topic_edit' => "Can edit own topics?",
|
||||
'group_topic_del' => "Can delete own topics?",
|
||||
'group_vote' => "Can poll?",
|
||||
'group_flood' => "Enable Flood-control to this group?",
|
||||
'group_html' => "Allow HTML in messages?",
|
||||
'group_filter' => "Enable to this group word filter?",
|
||||
'group_moderation' => "Moderation settings",
|
||||
|
||||
'group_edit_ok' => "Edit group",
|
||||
'group_edit_ok2' => "Group was edited!",
|
||||
|
||||
'mod_edit_topic' => "Can change topics title?",
|
||||
'mod_del_topic' => "Can delete topics/polls?",
|
||||
'mod_edit_post' => "Can edit messages?",
|
||||
'mod_del_post' => "Can delete messages",
|
||||
'mod_open_topic' => "Can open topics?",
|
||||
'mod_close_topic' => "Can close topics?",
|
||||
'mod_move_topic' => "Can move topics?",
|
||||
'mod_fixed_topic' => "Can pin topics?",
|
||||
'mod_defixed_topic' => "Can unpin topics?",
|
||||
'mod_warn_users' => "Can use warn user?",
|
||||
'mod_multi_moderation' => "Can use multi moderation?",
|
||||
|
||||
'mod_search_user' => "User search",
|
||||
'mod_search_name' => "Enter username:",
|
||||
'mod_config_set' => "Moderation settings",
|
||||
|
||||
'mod_add' => "Moderator was added",
|
||||
'mod_add2' => "Moderator was successfully added!",
|
||||
'mod_edit_ok' => "Moderator was changed",
|
||||
'mod_edit_ok2' => "Moderator was successfully changed!",
|
||||
|
||||
'button_search' => "Search",
|
||||
|
||||
'discuss_name' => "Category settings",
|
||||
'discuss_cat_id' => "Category ID",
|
||||
'discuss_category' => "Category",
|
||||
'discuss_forum_id' => "Forum ID",
|
||||
'discuss_forum' => "Forum",
|
||||
'discuss_config' => "Topic description settings",
|
||||
'discuss_t_text' => "Description",
|
||||
|
||||
'svce_full' => "(Leave empty if you want to clean all)",
|
||||
|
||||
'yes' => "Yes",
|
||||
'no' => "No",
|
||||
|
||||
'button_start' => "Start",
|
||||
|
||||
'activation_send' => "Sending ...",
|
||||
'trial_act1' => "Cannot connect to the server. Try again later.",
|
||||
'trial_act2' => "Entered data not correspond to necessary.",
|
||||
'trial_act3' => "Thank you! Your script was activated",
|
||||
'trial_act4' => "Server fault Try again later.",
|
||||
|
||||
// add for 2.3 //
|
||||
|
||||
'tools_abc_last' => "The maximum length of the title of the topic in the block «Last Post»",
|
||||
'tools_abc_last1' => "The maximum permitted length of the title of the topic in the block «Last Post»",
|
||||
'tools_topic_captcha' => "Security code for a new topic",
|
||||
'tools_topic_captcha1' => "User groups to which you want to include security code (CAPTCHA). You can select more than one group.",
|
||||
'tools_post_captcha' => "Security code for new posts",
|
||||
'tools_post_captcha1' => "User groups to which you want to include security code (CAPTCHA). You can select more than one group.",
|
||||
'rep_edit_group' => "Moderators reputation",
|
||||
'rep_edit_group2' => "Groups of users who may log Moderate reputation. You can select more than one group.",
|
||||
'tools_post_maxlen' => "The maximum number of characters in the message",
|
||||
'tools_post_maxlen2' => "Specify the maximum number of characters that can polzvatel to use when writing messages in the forum",
|
||||
'tools_auto_wrap' => "Automatic distribution of long words",
|
||||
'tools_auto_wrap2' => "In case of exceeding a specified number of characters",
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
117
system/forum/language/English/forum.lng
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
// ********************************************************************************
|
||||
// DLE Forum v.2.2
|
||||
// ********************************************************************************
|
||||
|
||||
$f_lang = array(
|
||||
|
||||
'f_msg' => "Forum message",
|
||||
'f_404' => "Reference, is «dead» or deleted. <a href=\"javascript:history.go(-1)\">go back</a>",
|
||||
'page_deny' => "Members, of group <b>{user_group}</b>, cannot view this page.",
|
||||
|
||||
'all_info' => "Information",
|
||||
|
||||
'values_error' => "All fields are required! <a href=\"javascript:history.go(-1)\">go back</a>",
|
||||
|
||||
'subforums' => " - ïîäôîðóìû",
|
||||
|
||||
'forum_read' => "Members, of group <b>{user_group}</b>, cannot view this forum.",
|
||||
'topic_read' => "Members, of group <b>{user_group}</b>, cannot view this topic.",
|
||||
'topic_write' => "Members, of group <b>{user_group}</b>, cannot leave post on this forum.",
|
||||
'forum_down' => "Members, of group <b>{user_group}</b>, cannot download files on this forum.",
|
||||
|
||||
'is_topics' => "<center><b>Not found. it is poseble that in this forum not exist any topic, or the topic are to old and was deleted.</b></center>",
|
||||
|
||||
'search_nresult' => "The search did not return any results. <a href=\"javascript:history.go(-1)\">search again?</a>",
|
||||
'search_error' => " You have entered less than 4 characters!. <a href=\"javascript:history.go(-1)\">search again?</a>",
|
||||
|
||||
'topic_yes' => "With answers",
|
||||
'topic_no' => "Without answers",
|
||||
'topic_closed' => "Topic closed",
|
||||
'last_post' => "<b>Last. post:</b>",
|
||||
|
||||
'mtf_op' => "Option",
|
||||
'mtf_01' => " - Open",
|
||||
'mtf_02' => " - Close",
|
||||
'mtf_03' => " - Delete",
|
||||
'mtf_05' => " - Move",
|
||||
'mtf_06' => " - Hide",
|
||||
'mtf_07' => " - Publish",
|
||||
'mtf_08' => " - Pin",
|
||||
'mtf_09' => " - Unpin",
|
||||
|
||||
'time_heute' => "Today",
|
||||
'time_gestern' => "Yesterday",
|
||||
|
||||
'fs_new' => "There are new messages",
|
||||
'fs_nonew' => "There are not new messages",
|
||||
|
||||
'fl_topic' => "<br /><b>Topic:</b>",
|
||||
'fl_author' => "<br /><b>Author:</b>",
|
||||
'fl_nopost' => "There are not messages",
|
||||
'fl_c_forum' => "<i>Closed forum</i>",
|
||||
|
||||
'err_mail' => "E-mail address is incorrect!.",
|
||||
'err_name' => "You have entered the name of a registered user. If you are this user you must login first.",
|
||||
|
||||
'topic_add_stop' => "Fill out all required fields! {stop} <a href=\"javascript:history.go(-1)\">go back</a>",
|
||||
'topic_add_ndeny' => "Members, of group <b>{user_group}</b>, cannot open topics on this forum.",
|
||||
|
||||
'app_warn' => "Warn",
|
||||
'app_rep' => "Reputation",
|
||||
'app_subscr' => "Subscrition",
|
||||
'app_getnew' => "New Messages",
|
||||
'app_newtopic' => "New Topic",
|
||||
'app_reply' => "Reply",
|
||||
'app_user_topic' => "User topics",
|
||||
'app_post_edit' => "Edit message",
|
||||
'app_search' => "Search",
|
||||
|
||||
'search_result' => "Search result",
|
||||
|
||||
'u_log_empty' => "<hr><center><b>User magazine is empty.</b></center>",
|
||||
|
||||
'f_reply' => "Fast reply",
|
||||
|
||||
'getnew_title' => "Messages sice you last visited",
|
||||
'all_read_link' => "Read all",
|
||||
|
||||
'subscr_not' => "<center><b>you dont have Subscrition on any topic.</b></center>",
|
||||
|
||||
'search_result' => "Search result",
|
||||
'search_topic' => "The search did not return any results. <a href='javascript:history.go(-1)'>go back</a>",
|
||||
|
||||
'report_send' => "report was successfully send. <a href=\"{link}\">go back</a>",
|
||||
|
||||
'mail_send' => "mail was successfully send <a href=\"{link}\">go back</a>",
|
||||
|
||||
'title_forward' => "Send mail to friend",
|
||||
|
||||
'edit_info' => "Message was edited by",
|
||||
|
||||
'err_name' => "<Li>Check spelling entered name!</Li>",
|
||||
'err_mail' => "<Li>Check spelling entered e-mail!</Li>",
|
||||
|
||||
'h_post' => "<b>Message hiden</b>",
|
||||
|
||||
'flood_stop' => "Flood protection is active, write your message in {time} seconds. <a href='javascript:history.go(-1)'>go back</a>",
|
||||
|
||||
'discuss_no_cat' => " choise forum for this category of news. <a href=\"javascript:history.go(-1)\">go back</a>",
|
||||
'discuss_off' => "This function is turned of. to create forum login forum. <a href=\"javascript:history.go(-1)\">go back</a>",
|
||||
|
||||
// add for 2.3 //
|
||||
|
||||
'captcha_stop' => "Security code does not match the display! <a href=\"javascript:history.go(-1)\">Âåðíóòüñÿ íàçàä</a>",
|
||||
'maxlen_stop' => "The length of the message exceeds the limit! <a href=\"javascript:history.go(-1)\">Âåðíóòüñÿ íàçàä</a>",
|
||||
'ajax_stop_1' => "He was activated flood control!",
|
||||
'ajax_stop_2' => "Security code does not match the display!",
|
||||
'ajax_stop_3' => "Çàïîëíèòå âñå íåîáõîäèìûå ïîëÿ!",
|
||||
'ajax_stop_4' => "The length of the message exceeds the limit!",
|
||||
'topic_last_p' => "By the last report:",
|
||||
'last_visit' => "<b>Since returning, the last time you were here</b>",
|
||||
'reg_name' => "<br />Registered to ",
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
413
system/forum/language/Russian/admin.lng
Normal file
@@ -0,0 +1,413 @@
|
||||
<?php
|
||||
|
||||
$f_lg = array(
|
||||
'm_forum' => "Добро пожаловать в админцентр DLE Forum",
|
||||
'm_stats' => "Общая статистика форума",
|
||||
'm_new_cat' => "Категория",
|
||||
'm_new_cat2' => "Создание новой категории",
|
||||
'm_new_forum' => "Форум",
|
||||
'm_new_forum2' => "Создание нового форума",
|
||||
'm_content' => "Управление",
|
||||
'm_content2' => "Редактирование, сортировка категорий и форумов",
|
||||
'm_rank' => "Звания",
|
||||
'm_rank2' => "Создание и редактирование званий пользователей",
|
||||
'm_tools' => "Настройка",
|
||||
'm_tools2' => "Настройка общих параметров форума",
|
||||
'm_discuss' => "Обсудить",
|
||||
'm_discuss2' => "Настройка кнопки - Обсудить на форуме",
|
||||
'm_email' => "Шаблоны E-Mail сообщений",
|
||||
'm_email2' => "Настройка шаблонов E-Mail сообщений, которые отсылает форум.",
|
||||
'm_service' => "Обслуживание",
|
||||
'm_service2' => "Инструменты обслуживания форума",
|
||||
'm_usergroup' => "Настройка групп пользователей",
|
||||
'm_usergroup2' => "Управление группами пользователей на форуме, назначение прав доступа для этих групп",
|
||||
'm_help' => "Справка",
|
||||
'm_help2' => "Помощь и Документация по форуму",
|
||||
|
||||
'forum_version' => "Версия DLE Forum:",
|
||||
'licence_info' => "Тип лицензии скрипта:",
|
||||
'forum_status' => "Режим работы форума:",
|
||||
'forum_topic' => "Общее количество тем:",
|
||||
'forum_posts' => "Общее количество сообщений:",
|
||||
'forum_online' => "Включен",
|
||||
'forum_offline' => "Выключен",
|
||||
'forum_db_size' => "Общий размер базы данных форума:",
|
||||
'forum_files' => "Общий размер прикрепленных файлов:",
|
||||
'forum_cache' => "Общий размер кеша:",
|
||||
'clear_cache' => "Очистить кеш",
|
||||
'check_updates' => "Проверить наличие обновлений",
|
||||
'msg_updates' => "Проверка обновлений",
|
||||
'no_update' => "Не удалось подключится к удаленному серверу.",
|
||||
|
||||
'cat_new' => "Создание новой категории",
|
||||
'cat_edit' => "Редактирование категории",
|
||||
'cat_name' => "Название категории",
|
||||
'cat_ok_add1' => "Категория создана",
|
||||
'cat_ok_add2' => "Категория успешно создана!",
|
||||
'cat_ok_edit1' => "Категория отредактирована",
|
||||
'cat_ok_edit2' => "Категория успешно отредактирована!",
|
||||
'cat_err_name' => "Введите название категории!",
|
||||
'cat_button' => "Создать категорию",
|
||||
|
||||
|
||||
'forum_new' => "Создание нового форума",
|
||||
'forum_mset' => "Основные настройки",
|
||||
'forum_name' => "Название форума",
|
||||
'forum_descr' => "Описание форума",
|
||||
'forum_cat' => "Категория",
|
||||
'forum_for' => "Подфорум ?",
|
||||
'password' => "Пароль",
|
||||
'forum_icon' => "Иконка форума",
|
||||
'forum_icon_hint' => "Префикс для иконки.<br />f_new_X.gif<br />f_nonew_X.gif<br />fc_new_X.gif<br />fc_nonew_X.gif<br />Где X префикс.",
|
||||
'forum_rules' => "Правила",
|
||||
'forum_rules1' => "Заголовок",
|
||||
'forum_rules2' => "Текст",
|
||||
'forum_access' => "Настройки доступа",
|
||||
'forum_ok_add1' => "Форум создан",
|
||||
'forum_ok_add2' => "Форум успешно создан!",
|
||||
'forum_err_name' => "Введите название форума!",
|
||||
'forum_button' => "Создать форум",
|
||||
|
||||
'forum_edit' => "Редактирование форума",
|
||||
'forum_ok_edit1' => "Форум отредактирован",
|
||||
'forum_ok_edit2' => "Форум успешно отредактирован!",
|
||||
|
||||
'java_add_forum' => "Добавить форум",
|
||||
'java_sort' => "Сортировать",
|
||||
'java_sort_f' => "Сортировать форумы",
|
||||
'java_edit' => "Редактировать",
|
||||
'java_ssort' => "Подфорумы",
|
||||
'java_access' => "Задать права доступа",
|
||||
'java_moderator' => "Добавить модератора",
|
||||
'java_del' => "Удалить",
|
||||
|
||||
'access_for_f' => "Новые права доступа для всех форумов данной категории",
|
||||
|
||||
'access_forum_group' => "Группа",
|
||||
'access_forum_mod' => "Модерация",
|
||||
'access_forum_topic' => "Создание тем",
|
||||
'access_forum_write' => "Ответ в темах",
|
||||
'access_forum_read' => "Чтение тем",
|
||||
'access_forum_upload' => "Загрузка файлов",
|
||||
'access_forum_download' => "Скачивание файлов",
|
||||
|
||||
'titles_main' => "Звания пользователей",
|
||||
'titles_name' => "Звание посетителя",
|
||||
'titles_pots' => "Требуется сообщений",
|
||||
'titles_pips' => "Звездочки",
|
||||
'titles_action' => "Действие",
|
||||
'titles_add' => "Добавление звания",
|
||||
'titles_nname' => "Название звания",
|
||||
'titles_npost' => "Минимальное количество сообщений ",
|
||||
'titles_npips' => "Количество звездочек",
|
||||
'titles_edit' => "Редактирование звания",
|
||||
'titles_uadd' => "Добавление звания пользователю",
|
||||
'titles_uname' => "Имя пользователя",
|
||||
'titles_urname' => "Звание пользователя",
|
||||
'titles_error_name' => "Пользователь с таким именем не найден!",
|
||||
|
||||
'button_add' => "Добавить",
|
||||
'button_edit' => "Редактировать",
|
||||
'button_save' => "Сохранить",
|
||||
'button_sort' => "Отсортировать",
|
||||
'error' => "Ошибка",
|
||||
'error_x' => "Заполните все поля!",
|
||||
'label_edit' => "правка",
|
||||
'label_del' => "удалить",
|
||||
'db_prev' => "Вернуться назад",
|
||||
|
||||
'tools_menu' => "Настройка параметров форума",
|
||||
|
||||
'tools_global' => "Глобальные Настройки форума",
|
||||
'tools_name' => "Название форума:",
|
||||
'tools_name_' => "Например: \"Форум DLE Files Group\"",
|
||||
'tools_url' => "URL к папке с форумом:",
|
||||
'tools_url_' => "Например: http://forum.dle-files.ru (без слеша)",
|
||||
'tools_mrewrite' => "Включить ЧПУ?",
|
||||
'tools_mrewrite_' => "Если 'Да', то ссылки будут иметь вид http://yourdomain.com/forum/topic_1",
|
||||
'tools_wysiwyg' => "Включить WYSIWYG редактор",
|
||||
'tools_wysiwyg2' => "Если Да то будет включен WYSIWYG редактор, если нет то будут использоваться BBCODES",
|
||||
'tools_offline' => "Выключить форум",
|
||||
'tools_offline_' => "Перевести форум в состояние offline, для проведения технических работ.",
|
||||
'tools_timestamp' => "Формат времени:",
|
||||
'tools_timestamp2' => "<a onClick=\"javascript:Help('date')\" class=main href=\"#\">помощь по работе функции</a>",
|
||||
'tools_sessions' => "Регистрировать сессии?",
|
||||
'tools_sessions_' => "Добавляет 1-2 запроса. Необходимо для модулей «Online», «кто просматривает форум», «кто читает тему»...",
|
||||
'tools_ses_time' => "Период отсутствия активности пользователя",
|
||||
'tools_ses_time_' => "Через сколько минут считать пользователя в offline? (в минутах)",
|
||||
'tools_stats' => "Показывать блок со статистикой форума?",
|
||||
'tools_stats_' => "Показывает блок со статистикой в нижней части главной страницы форума.",
|
||||
|
||||
'tools_online' => "Показывать Online?",
|
||||
'tools_online_' => "Показывает в блоке со статистикой сколько человек на форуме.",
|
||||
|
||||
'tools_forum_bar' => "Показывать блок с местом положения на форуме?",
|
||||
'tools_forum_bar_' => "Показывает название категории, форума…",
|
||||
|
||||
'tools_show' => "Темы и Сообщения",
|
||||
'tools_topics' => "Количество тем, отображаемых в списке тем форума",
|
||||
'tools_topics_' => "По умолчанию — 25",
|
||||
'tools_hot' => "Количество сообщений в теме, необходимых для присвоения статуса «горячей»?",
|
||||
'tools_hot_' => "По умолчанию — 30",
|
||||
'tools_posts' => "Количество сообщений, размещаемых на одной странице темы",
|
||||
'tools_posts_' => "По умолчанию — 20",
|
||||
|
||||
'tools_mhide' => "Кол-во сообщений для просмотра скрытого текста",
|
||||
'tools_mhide_' => "Просмотр текста между тегами <b>[HIDE] [/HIDE]</b>.",
|
||||
|
||||
'tools_abc_topic' => "Максимальная длина заголовка тем",
|
||||
'tools_abc_topic_' => "Максимальная разрешенная длина заголовка тем.",
|
||||
'tools_post_update' => "Склеивать сообщения?",
|
||||
'tools_post_update2' => "Если автор последнего и нового сообщения один и тот же, то сообщение склеится.",
|
||||
'tools_last_plink' => "Ссылка на последнюю страницу темы",
|
||||
'tools_last_plink_' => "Показывать ссылку на последнюю страницу темы в блоке Последнее сообщение.",
|
||||
'tools_hide_forum' => "Скрывать форумы?",
|
||||
'tools_hide_forum_' => "Скрывать форумы не доступные для просмотра определенной группой.",
|
||||
'tools_topic_sort' => "Сортировать темы по дате?",
|
||||
'tools_topic_sort_' => "Темы будут сортироваться по дате последнего ответа.",
|
||||
'tools_topic_email' => "Отсылать E-Mail уведомление при создании темы",
|
||||
'tools_topic_email_' => "Если 'Да', при создании темы на форуме, на E-Mail модератору будет отправлено соответствующее уведомление.",
|
||||
|
||||
'tools_pr_imp' => "Префикс важных тем",
|
||||
'tools_pr_imp_' => "Текст, отображаемый перед названием темы с таким статусом. Важная тема всегда в верхней части списка всех тем в форуме.",
|
||||
'tools_pr_vote' => "Префикс опросов",
|
||||
'tools_pr_vote_' => "Текст, отображаемый перед названием темы с таким статусом. Все темы, в которых есть опрос, отмечаются так.",
|
||||
'tools_pr_modr' => "Префикс тем без модерации",
|
||||
'tools_pr_modr_' => "Текст, отображаемый перед названием темы с таким статусом. Все темы, которые ожидают модерацию, отмечаются так.",
|
||||
'tools_pr_sub_f' => "Префикс подфорумов",
|
||||
'tools_pr_sub_f_' => "Текст, отображаемый перед выводом подфорумов.",
|
||||
|
||||
'tools_safety' => "Настройки Безопасности",
|
||||
'tools_complaint' => "Отключить кнопку «Жалоба»?",
|
||||
'tools_complaint_' => "Отключить возможность вашим пользователям подавать жалобу о некорректном сообщении.",
|
||||
'tools_flood' => "Флуд-контроль — интервал в секундах между возможностью публиковать сообщения",
|
||||
'tools_flood_' => "Время, которое пользователи буду ждать перед возможность опубликовать еще одно сообщение после опубликованного.
|
||||
Вы можете оставить поле пустым для отключения флуд-контроля.",
|
||||
'tools_search_captcha' => "Код безопасности для поиска",
|
||||
'tools_search_captcha_' => "Группы пользователей для которых нужно включить код безопасности (CAPTCHA). Можно выбрать более одной группы.",
|
||||
|
||||
'tools_preventions' => "Система Предупреждений",
|
||||
'tools_prevntn_on' => "Предупреждения",
|
||||
'tools_prevntn_on_' => "Включить систему предупреждений?",
|
||||
'tools_prevntn_max' => "Максимальный уровень предупреждений",
|
||||
'tools_prevntn_max_' => "Максимальное количество предупреждений для блокировки пользователя.",
|
||||
'tools_prevntn_group' => "Защищенные группы",
|
||||
'tools_prevntn_group_' => "Группы пользователей, к которым невозможно применять предупреждения.
|
||||
Можно выбрать более одной группы.",
|
||||
'tools_prevntn_g_show' => "Модераторы",
|
||||
'tools_prevntn_g_show_' => "Группы пользователей, которые могут просматривать журнал предупреждений. Можно выбрать более одной группы.",
|
||||
'tools_prevntn_show' => "Разрешить пользователям видеть свой уровень предупреждений?",
|
||||
'tools_prevntn_show_' => "Если включено, то пользователи смогут видеть свой текущий уровень предупреждений.",
|
||||
'tools_prevntn_show_all' => "Разрешить пользователям видеть чужой уровень предупреждений?",
|
||||
'tools_prevntn_show_all_' => "Если включено, то пользователи смогут видеть друг у друга уровень предупреждений.",
|
||||
'tools_prevntn_show_gr' => "Показывать у защищенных групп уровень предупреждений?",
|
||||
'tools_prevntn_show_gr_' => "Если включено, то у пользователей защищенных групп можно видеть текущий уровень предупреждений.",
|
||||
'tools_warn_day' => "Предупреждения одному пользователю",
|
||||
'tools_warn_day2' => "Сколько раз за день модератор может ставить предупреждение одному пользователю?",
|
||||
|
||||
'tools_modules' => "Управление Модулями",
|
||||
'tools_mod_icq' => "Статус ICQ",
|
||||
'tools_mod_icq_' => "Модуль показывает статус-картинку пользователя ICQ.",
|
||||
'tools_mod_rank' => "Звание Rank",
|
||||
'tools_mod_rank_' => "Модуль показывает звание посетителя на сайте, в зависимости от кол-ва сообщений.",
|
||||
'tools_subscr' => "Подписка на темы",
|
||||
'tools_subscr_' => "После ответа в подписанную тему, будет отправлено письмо на e-mail.",
|
||||
'tools_reputation' => "Репутация",
|
||||
'tools_reputation_' => "Разрешить посетителям менять друг другу репутацию.",
|
||||
'tools_poll' => "Опросы",
|
||||
'tools_poll_' => "Группы пользователей, к которым разрешено создавать опросы в темах. Можно выбрать более одной группы.",
|
||||
'tools_ses_forum' => "Показывать, кто просматривает форум?",
|
||||
'tools_ses_forum_' => "Увеличивает количество запросов на 1 при каждом просмотре форума.",
|
||||
'tools_ses_topic' => "Показывать, кто читает тему?",
|
||||
'tools_ses_topic_' => "Увеличивает количество запросов на 1 при каждом просмотре темы.",
|
||||
|
||||
'tools_discuss' => "Кнопка 'Обсудить на форуме'",
|
||||
'tools_disc_on' => "Включить модуль",
|
||||
'tools_disc_on_' => "Включить модуль «Обсудить на форуме».",
|
||||
'tools_disc_title' => "Название темы",
|
||||
'tools_disc_title_' => "Название темы, которая будет создана при нажатии на кнопку.",
|
||||
'tools_disc_opt_1' => "Название новости",
|
||||
'tools_disc_opt_2' => "Название по шаблону",
|
||||
'tools_disc_t_tpl' => "Шаблон названия",
|
||||
'tools_disc_t_tpl_' => "Например: <b>Статья: {post_title}</b>",
|
||||
'tools_disc_post' => "Содержание темы",
|
||||
'tools_disc_post_' => "Содержание темы, которая будет создана при нажатии на кнопку.",
|
||||
'tools_disc_opt_3' => "Краткая новость",
|
||||
'tools_disc_opt_4' => "Полная новость",
|
||||
'tools_disc_opt_5' => "Шаблон",
|
||||
'tools_disc_p_tpl' => "Шаблон содержания темы",
|
||||
'tools_disc_p_tpl_' => "Например: <b>[url={post_link}]{post_title}[/url]</b><br />Если поле заполнено, то этот текст будет под основным содержанием.",
|
||||
|
||||
'tools_speed' => "Настройки Быстродействия",
|
||||
'tools_t_as_p' => "Считать созданную тему за сообщение?",
|
||||
'tools_t_as_p_' => "Если да, то при создании темы, посетителю прибавиться одно сообщение на форуме.",
|
||||
'tools_sp_num' => "Вычитать кол-во сообщений сразу?",
|
||||
'tools_sp_num_' => "Если да, то например, при удалении темы или сообщения будет пересчет кол-ва сообщений у посетителя. Если нет, то подсчет кол-ва сообщений у посетителя будет производиться раз в определенный срок.",
|
||||
'tools_sp_num_date' => "Срок пересчета сообщений",
|
||||
'tools_sp_num_date_' => "Через сколько дней пересчитывать кол-во сообщений у посетителя. Например: раз в день.",
|
||||
'tools_new_t_day' => "Срок активности темы",
|
||||
'tools_new_t_day_' => "Через сколько дней тема устареет, если посетитель ее не прочитал. Например: 5 дней.",
|
||||
'tools_sp_sublast' => "Обновлять форум при ответе в подфоруме?",
|
||||
'tools_sp_sublast_' => "Будет обновляться блок последнее сообщение, при ответе в подфоруме.",
|
||||
|
||||
'tools_uploads' => "Настройка загрузки файлов на сервер",
|
||||
'tools_upload' => "Разрешить загрузку файлов на сервер",
|
||||
'tools_upload_' => "Группы пользователей, которым будет разрешена загрузка не только картинок на сервер, но и других файлов.",
|
||||
'tools_upload_type' => "Расширение файлов, допустимых к загрузке",
|
||||
'tools_upload_type_' => "Укажите через запятую расширения файлов, которые разрешено закачивать.",
|
||||
'tools_img_upl' => "Разрешить пользователям загружать картинки",
|
||||
'tools_img_upl_' => "Вы можете разрешить или запретить пользователям загружать изображения на сервер.",
|
||||
'tools_img_max_size' => "Максимально допустимый объём изображения",
|
||||
'tools_img_max_size_' => "Введите максимальный объём загружаемого изображения (в килобайтах)",
|
||||
'tools_thumb_size' => "Размер уменьшенной копии загруженного изображения:",
|
||||
'tools_thumb_size_' => "Максимальный размер в пикселях любой из сторон загружаемой картинки при превышении которого будет создаваться уменьшенная копия.",
|
||||
'tools_jpeg_quality' => "Качество сжатия .jpg изображения:",
|
||||
'tools_jpeg_quality_' => "Качество сжатия JPEG картинки при копировании на сервер.",
|
||||
'tools_img_width' => "Автоматическое изменение размера для удаленных изображений",
|
||||
'tools_img_width_' => "Укажите максимальную ширину картинки для тега [img] [/img], после которой изображение будет пропорционально уменьшено, до указанного размера. Для отключения автоматического уменьшения введите 0.",
|
||||
|
||||
'tools_licence' => "Лицензия",
|
||||
'tools_licence_key' => "Регистрационный ключ",
|
||||
'tools_licence_key_' => "Введите Регистрационный ключ.",
|
||||
'tools_copyright' => "CopyRight",
|
||||
'tools_copyright2' => "Отображать CopyRight?",
|
||||
'tools_licence_name' => "Показывать «Зарегистрировано на...»",
|
||||
'tools_licence_name_' => "Примеры: DLE Files Group 2008",
|
||||
|
||||
't_f_save' => "Настройки сохранены",
|
||||
't_f_save1' => "Настройки системы были успешно сохранены",
|
||||
|
||||
'mail_subscr' => "Настройка E-Mail сообщения, которое отсылается при ответе в подписанную тему",
|
||||
'mail_subscr_' => "<b>{%username_to%}</b> - имя получателя<br /><b>{%username_from%}</b> - имя отправителя<br /><b>{%topic_name%}</b> - название темы<br /><b>{%topic_link%}</b> - ссылка на тему<br /><b>{%topic_link_del%}</b> - ссылка для отписки от темы",
|
||||
'mail_frend' => "Настройка E-Mail сообщения, которое отсылается при отправке письма другу",
|
||||
'mail_frend_' => "<b>{%username_to%}</b> - имя получателя<br /><b>{%username_from%}</b> - имя отправителя<br /><b>{%text%}</b> - текст сообщения",
|
||||
'mail_report' => "Настройка E-Mail сообщения, которое отсылается при отправке жалобы на сообщение",
|
||||
'mail_report_' => "<b>{%username_from%}</b> - имя отправителя<br /><b>{%text%}</b> - текст сообщения<br /><b>{%topic_link%}</b> - ссылка на тему<br /><b>{%post_id%}</b> - ID сообщения<br />",
|
||||
'mail_new_topic' => "Настройка E-Mail сообщения, которое отсылается при создании новой темы",
|
||||
'mail_new_topic_' => "<b>{%username%}</b> - автор темы<br /><b>{%date%}</b> - дата создания<br /><b>{%title%}</b> - название темы<br /><b>{%link%}</b> - ссылка на тему",
|
||||
|
||||
'email_ok' => "Обновление шаблонов завершено",
|
||||
'email_ok2' => "Шаблоны для писем успешно обновлены!",
|
||||
|
||||
'trial_info' => "<b>Внимание!</b><br>Вы используете неактивированную версию скрипта для снятия установленных ограничений, вам необходимо ввести ключ активации.<br>Активация скрипта проходит на сервере <a href='http://dle-files.ru/'>http://dle-files.ru</a>",
|
||||
'trial_login' => "Логин:",
|
||||
'trial_key' => "Ключ:",
|
||||
'trial_act' => "Активировать",
|
||||
'licence_trial' => "Бесплатная версия",
|
||||
'licence_full' => "Лицензия активирована",
|
||||
'trial_limit' => "Были превышены лимиты бесплатной версии скрипта. Дальнейшая работа невозможна.",
|
||||
|
||||
'group_list' => "Список групп пользователей",
|
||||
'group_name' => "Название группы",
|
||||
'group_users' => "Пользователей",
|
||||
'group_sel1' => "Редактировать",
|
||||
'group_sel2' => "Удалить",
|
||||
'group_sel3' => "Удалить невозможно",
|
||||
'group_edit' => "Редактирование группы:",
|
||||
|
||||
'group_colour' => "Цвет группы",
|
||||
'group_colour_' => "Цвет группы при отображение в списке активных пользователей. (Например: #CC0000)",
|
||||
|
||||
'group_offline' => "Разрешить просмотр отключенного форума?",
|
||||
'group_post_edit' => "Могут редактировать свои сообщения?",
|
||||
'group_post_del' => "Могут удалять свои сообщения?",
|
||||
'group_topic_set' => "Могут открывать/закрывать свои темы?",
|
||||
'group_topic_edit' => "Могут изменять названия и описания своих тем?",
|
||||
'group_topic_del' => "Могут удалять свои темы?",
|
||||
'group_vote' => "Могут голосовать (где разрешено)?",
|
||||
'group_flood' => "Применять к пользователям данной группы флуд-контроль?",
|
||||
'group_html' => "Могут использовать HTML в сообщениях?",
|
||||
'group_filter' => "Применять к пользователям данной группы фильтры плохих слов?",
|
||||
'group_moderation' => "Настройки модерации",
|
||||
|
||||
'group_edit_ok' => "Редактирование группы",
|
||||
'group_edit_ok2' => "Изменения в группу успешно внесены!",
|
||||
|
||||
'mod_edit_topic' => "Может изменять название чужих тем?",
|
||||
'mod_del_topic' => "Может удалять чужие темы/голосования?",
|
||||
'mod_edit_post' => "Может редактировать чужие сообщения?",
|
||||
'mod_del_post' => "Может удалять чужие сообщения?",
|
||||
'mod_open_topic' => "Может открывать темы?",
|
||||
'mod_close_topic' => "Может закрывать темы?",
|
||||
'mod_move_topic' => "Может перемещать темы?",
|
||||
'mod_fixed_topic' => "Может закреплять темы?",
|
||||
'mod_defixed_topic' => "Может опускать темы?",
|
||||
'mod_warn_users' => "Может предупреждать других пользователей?",
|
||||
'mod_multi_moderation' => "Может использовать мульти-модерацию?",
|
||||
|
||||
'mod_search_user' => "Поиск пользователя",
|
||||
'mod_search_name' => "Введите имя пользователя:",
|
||||
'mod_config_set' => "Настройки модерации",
|
||||
|
||||
'mod_add' => "Модератор добавлен",
|
||||
'mod_add2' => "Модератор успешно добавлен!",
|
||||
'mod_edit_ok' => "Модератор изменен",
|
||||
'mod_edit_ok2' => "Модератор успешно изменен!",
|
||||
|
||||
'button_search' => "Найти",
|
||||
|
||||
'discuss_name' => "Настройка соответствий категорий",
|
||||
'discuss_cat_id' => "ID Категории",
|
||||
'discuss_category' => "Категория",
|
||||
'discuss_forum_id' => "ID Форума",
|
||||
'discuss_forum' => "Форум",
|
||||
'discuss_config' => "Настройка содержания темы",
|
||||
'discuss_t_text' => "Содержание",
|
||||
|
||||
'svce_full' => "(Оставьте поле пустым, если хотите очистить весь журнал)",
|
||||
|
||||
'yes' => "Да",
|
||||
'no' => "Нет",
|
||||
|
||||
'button_start' => "Запустить",
|
||||
|
||||
'activation_send' => "Отправка ...",
|
||||
'trial_act1' => "Не удалось установить подключение к удаленному серверу.",
|
||||
'trial_act2' => "Введенные данные не соответствуют необходимым.",
|
||||
'trial_act3' => "Благодарим вас за покупку нашего скрипта!",
|
||||
'trial_act4' => "Сбой в работе сервера. Повторите попытку позднее.",
|
||||
|
||||
// add for 2.3 //
|
||||
|
||||
'tools_abc_last' => "Максимальная длина названия темы в блоке «Последнее сообщение»",
|
||||
'tools_abc_last1' => "Максимальная разрешенная длина названия темы в блоке «Последнее сообщение»",
|
||||
'tools_topic_captcha' => "Код безопасности для новых тем",
|
||||
'tools_topic_captcha1' => "Группы пользователей для которых нужно включить код безопасности (CAPTCHA). Можно выбрать более одной группы.",
|
||||
'tools_post_captcha' => "Код безопасности для новых сообщений",
|
||||
'tools_post_captcha1' => "Группы пользователей для которых нужно включить код безопасности (CAPTCHA). Можно выбрать более одной группы.",
|
||||
'rep_edit_group' => "Модераторы репутации",
|
||||
'rep_edit_group2' => "Группы пользователей которые могут модерировать журнал репутации. Можно выбрать более одной группы.",
|
||||
'tools_post_maxlen' => "Максимальное количество символов в сообщениях",
|
||||
'tools_post_maxlen2' => "Укажите максимальное количество символов, которое может использовать пользватель при написании сообщений на форуме",
|
||||
'tools_auto_wrap' => "Автоматическая разбивка длинных слов",
|
||||
'tools_auto_wrap2' => "В случае превышения заданного числа символов",
|
||||
|
||||
// add for 2.4 //
|
||||
'forum_posts_conf' => "Настройки сообщений",
|
||||
'forum_postcount' => "Включить счетчик сообщений?",
|
||||
'forum_fixpost' => "Закреплять первое сообщение?",
|
||||
'meta_description' => "Описание (Description) форума:",
|
||||
'meta_description2' => "Краткое описание, не более 200 символов",
|
||||
'meta_keywords' => "Ключевые слова (Keywords) для форума:",
|
||||
'meta_keywords2' => "Введите через запятую основные ключевые слова для вашего форума",
|
||||
'meta_topic' => "Создавать мета теги для тем:",
|
||||
'meta_topic2' => "Будут создаваться мета описание и ключевые слова для тем",
|
||||
'check_updates' => "Проверка обновлений",
|
||||
'check_updates_start' => "Подождите идет подключение к удаленному серверу ...",
|
||||
|
||||
// add for 2.5 //
|
||||
'group_youtube' => "Могут использовать тег youtubе?",
|
||||
'group_youtube2' => "Данный тег предназначен для публикации видео на форуме с таких видеохранилищ как youtube.com и rutube.ru.",
|
||||
'group_flash' => "Могут использовать тег flash?",
|
||||
'group_flash2' => "Данный тег предназначен для вставки флеш роликов в формате swf.",
|
||||
'mod_combining_post' => "Разрешить склеивать сообщения?",
|
||||
'mod_move_post' => "Разрешить переносить сообщения из одной темы в другую?",
|
||||
'forum_banner' => "Управление рекламными материалами",
|
||||
'forum_banner2' => "Код баннера",
|
||||
'tools_bot_agent' => "Показывать ботов?",
|
||||
'tools_bot_agent2' => "Регистрировать сессии поисковых ботов.",
|
||||
'forum_q_reply' => "Отображать форму быстрого ответа?",
|
||||
'forum_i_edit' => "Отображать информацию о редактирование сообщения?",
|
||||
);
|
||||
|
||||
?>
|
||||
123
system/forum/language/Russian/forum.lng
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
// ********************************************************************************
|
||||
// DLE Forum v.2.2
|
||||
// ********************************************************************************
|
||||
|
||||
$f_lang = array(
|
||||
|
||||
'f_msg' => "Сообщение форума",
|
||||
'f_404' => "Ссылка, по которой вы попали на эту страницу является «мертвой» или удаленной. <a href=\"javascript:history.go(-1)\">Вернуться назад</a>",
|
||||
'page_deny' => "Посетители, находящиеся в группе <b>{user_group}</b>, не могут просматривать данную страницу.",
|
||||
|
||||
'all_info' => "Информация",
|
||||
|
||||
'values_error' => "Заполните все необходимые поля! <a href=\"javascript:history.go(-1)\">Вернуться назад</a>",
|
||||
|
||||
'subforums' => " - подфорумы",
|
||||
|
||||
'forum_read' => "Посетители, находящиеся в группе <b>{user_group}</b>, не могут просматривать данный форум.",
|
||||
'topic_read' => "Посетители, находящиеся в группе <b>{user_group}</b>, не могут просматривать данную тему.",
|
||||
'topic_write' => "Посетители, находящиеся в группе <b>{user_group}</b>, не могут оставлять ответы в данном форуме.",
|
||||
'forum_down' => "Посетители, находящиеся в группе <b>{user_group}</b>, не могут скачивать файлы из данного форума.",
|
||||
|
||||
'is_topics' => "<center><b>Не найдено ни одной темы. Возможно в этом форуме нет тем, либо они более стары и не соответствуют текущей сортировке.</b></center>",
|
||||
|
||||
'search_nresult' => "К сожалению, Ваш поиск не дал никаких результатов.<br />Попробуйте расширить параметры поиска, используя другое ключевое слово. <a href=\"javascript:history.go(-1)\">Повторить поиск?</a>",
|
||||
'search_error' => " Введено пустое поле для поиска или строка поиска содержит менее 4 символов, в связи с чем поиск был приостановлен. <a href=\"javascript:history.go(-1)\">Повторить поиск?</a>",
|
||||
|
||||
'topic_yes' => "Есть ответы",
|
||||
'topic_no' => "Нет ответов",
|
||||
'topic_closed' => "Тема закрыта",
|
||||
'last_post' => "<b>Посл. сообщение:</b>",
|
||||
|
||||
'mtf_op' => "Опции",
|
||||
'mtf_01' => " - Открыть",
|
||||
'mtf_02' => " - Закрыть",
|
||||
'mtf_03' => " - Удалить",
|
||||
'mtf_05' => " - Переместить",
|
||||
'mtf_06' => " - Скрыть",
|
||||
'mtf_07' => " - Опубликовать",
|
||||
'mtf_08' => " - Закрепить",
|
||||
'mtf_09' => " - Открепить",
|
||||
|
||||
'time_heute' => "Сегодня",
|
||||
'time_gestern' => "Вчера",
|
||||
|
||||
'fs_new' => "Есть новые сообщения",
|
||||
'fs_nonew' => "Нет новых сообщений",
|
||||
|
||||
'fl_topic' => "<br /><b>Тема:</b>",
|
||||
'fl_author' => "<br /><b>Автор:</b>",
|
||||
'fl_nopost' => "Нет сообщений",
|
||||
'fl_c_forum' => "<i>Закрытый форум</i>",
|
||||
|
||||
'err_mail' => "Вы ввели неверный E-Mail адрес.",
|
||||
'err_name' => "Вы ввели имя зарегистрированного пользователя. Если Вы есть этот пользователь, то Вам необходимо авторизироваться на сайте.",
|
||||
|
||||
'topic_add_stop' => "Заполните все необходимые поля! {stop} <a href=\"javascript:history.go(-1)\">Вернуться назад</a>",
|
||||
'topic_add_ndeny' => "Посетители, находящиеся в группе <b>{user_group}</b>, не могут открывать темы в данном форуме.",
|
||||
|
||||
'app_warn' => "Предупреждения",
|
||||
'app_rep' => "Репутация",
|
||||
'app_subscr' => "Текущие подписки",
|
||||
'app_getnew' => "Новые сообщения",
|
||||
'app_newtopic' => "Новая тема",
|
||||
'app_reply' => "Ответ",
|
||||
'app_user_topic' => "Темы пользователя",
|
||||
'app_post_edit' => "Редактирование сообщения",
|
||||
'app_search' => "Поиск",
|
||||
|
||||
'search_result' => "Результат поиска",
|
||||
|
||||
'u_log_empty' => "<hr><center><b>Журнал пользователя пуст.</b></center>",
|
||||
|
||||
'f_reply' => "Быстрый ответ",
|
||||
|
||||
'getnew_title' => "Сообщения с Вашего последнего посещения",
|
||||
'all_read_link' => "Прочитано",
|
||||
|
||||
'subscr_not' => "<center><b>Вы не подписаны ни на одну тему.</b></center>",
|
||||
|
||||
'search_result' => "Результаты поиска",
|
||||
'search_topic' => "К сожалению, Ваш поиск не дал никаких результатов. <a href='javascript:history.go(-1)'>Назад</a>",
|
||||
|
||||
'report_send' => "Жалоба успешно отправлена. <a href=\"{link}\">Вернуться назад</a>",
|
||||
|
||||
'mail_send' => "Письмо успешно отправлено <a href=\"{link}\">Вернуться назад</a>",
|
||||
|
||||
'title_forward' => "Отправка письма другу",
|
||||
|
||||
'edit_info' => "Сообщение отредактировал",
|
||||
|
||||
'err_name' => "<Li>Проврете правильность ввода имени!</Li>",
|
||||
'err_mail' => "<Li>Проврете правильность ввода e-mail!</Li>",
|
||||
|
||||
'h_post' => "<b>Сообщение скрыто</b>",
|
||||
|
||||
'flood_stop' => "Был активирован флуд-контроль, напишите ваше сообщение через {time} секунд. <a href='javascript:history.go(-1)'>Назад</a>",
|
||||
|
||||
'discuss_no_cat' => "Для данной категории новостей не задан форум. <a href=\"javascript:history.go(-1)\">Вернуться назад</a>",
|
||||
'discuss_off' => "Данная функция отключена. Для создания темы зайдите на форум. <a href=\"javascript:history.go(-1)\">Вернуться назад</a>",
|
||||
|
||||
// add for 2.3 //
|
||||
|
||||
'captcha_stop' => "Код безопасности не соответствует отображённому! <a href=\"javascript:history.go(-1)\">Вернуться назад</a>",
|
||||
'maxlen_stop' => "Длинна сообщения превышает допустимый предел! <a href=\"javascript:history.go(-1)\">Вернуться назад</a>",
|
||||
'ajax_stop_1' => "Был активирован флуд-контроль!",
|
||||
'ajax_stop_2' => "Код безопасности не соответствует отображённому!",
|
||||
'ajax_stop_3' => "Заполните все необходимые поля!",
|
||||
'ajax_stop_4' => "Длинна сообщения превышает допустимый предел!",
|
||||
'topic_last_p' => "К последнему сообщению:",
|
||||
'last_visit' => "<b>С возвращением, последний раз вы были здесь:</b>",
|
||||
'reg_name' => "<br />Зарегистрировано на ",
|
||||
|
||||
// add for 2.4 //
|
||||
|
||||
'moderators' => "Модераторы:",
|
||||
'spoiler_title' => "Показать / Скрыть текст",
|
||||
'i_quote' => "Цитата:",
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
197
system/forum/main.php
Normal file
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
$act = $_REQUEST['act'];
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/init.php';
|
||||
|
||||
switch ($act)
|
||||
{
|
||||
|
||||
// ********************************************************************************
|
||||
// SHOW INDEX
|
||||
// ********************************************************************************
|
||||
case "":
|
||||
|
||||
if ($forum_config['hide_forum']){
|
||||
$access_hide = "and access_read regexp '[[:<:]](".$member_id['user_group'].")[[:>:]]'";
|
||||
}else{
|
||||
$access_hide = "";
|
||||
}
|
||||
|
||||
$result_content = $db->query("SELECT * FROM " . PREFIX . "_forum_category LEFT JOIN ". PREFIX ."_forum_forums ON ". PREFIX ."_forum_category.sid= ". PREFIX ."_forum_forums.main_id WHERE parentid = '0' {$access_hide} ORDER BY posi, position");
|
||||
|
||||
for ($i = 0; $row = $db->get_row($result_content); $i = $row['sid'])
|
||||
{
|
||||
if ($row['name'])
|
||||
{
|
||||
if (!$fcache->open('sub-'.$row['id']))
|
||||
{
|
||||
if ($sub_forums_array != 'empty')
|
||||
{
|
||||
foreach ($sub_forums_array as $value)
|
||||
{
|
||||
if ($row['id'] == $value['parentid'])
|
||||
{
|
||||
$symbol_count++;
|
||||
|
||||
if ($symbol_count > 1) $symbol = ", ";
|
||||
|
||||
$sub_forums .= link_forum($value['id'], $value['name'], $symbol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$fcache->save('sub-'.$row['id'], $sub_forums);
|
||||
}
|
||||
else { $sub_forums = $fcache->open('sub-'.$row['id']); }
|
||||
|
||||
if (!$fcache->open('moder-'.$row['id']))
|
||||
{
|
||||
foreach ($forum_moderators as $moderators)
|
||||
{
|
||||
if ($moderators['forum_id'] == $row['id'] and $moderators['member_name'])
|
||||
{
|
||||
$mod_count++;
|
||||
|
||||
if ($mod_count > 1) $mod_symbol = ", ";
|
||||
|
||||
$moderators_list .= $mod_symbol . link_user($moderators['member_name']);
|
||||
}
|
||||
}
|
||||
|
||||
$fcache->save('moder-'.$row['id'], $moderators_list);
|
||||
}
|
||||
else { $moderators_list = $fcache->open('moder-'.$row['id']); }
|
||||
|
||||
$forum_link = link_forum($row['id'], $row['name']);
|
||||
|
||||
$tpl->load_template($tpl_dir.'forums.tpl');
|
||||
|
||||
$tpl->set('{forum_id_rss}', $forum_url."/rss/forum_".$row['id'].".xml");
|
||||
$tpl->set('{status}', forum_status ($row['f_last_date'], $row['password'], $row['icon']));
|
||||
$tpl->set('{name}', $forum_link);
|
||||
$tpl->set('{description}', stripslashes($row['description']));
|
||||
|
||||
if ($sub_forums){$tpl->set('{forums}', '<br />' . $forum_config['forum_pr_sub'].' '.$sub_forums);
|
||||
} else {$tpl->set('{forums}', '');}
|
||||
if ($moderators_list){$tpl->set('{moderators}', '<br />' . $f_lang['moderators'] . ' ' . $moderators_list);
|
||||
} else {$tpl->set('{moderators}', '');}
|
||||
|
||||
$tpl->set('{topics}', $row['topics']);
|
||||
$tpl->set('{post}', $row['posts']);
|
||||
$tpl->set('{last}', forum_last ($row['f_last_tid'], $row['f_last_title'], $row['f_last_poster_name'], $row['f_last_date'], $row['password'], $row['id'], $row['access_read'], $row['last_post_id']));
|
||||
|
||||
$tpl->compile("forums_{$row['main_id']}");
|
||||
$tpl->clear();
|
||||
|
||||
unset ($sub_forums);
|
||||
unset ($symbol_count);
|
||||
unset ($symbol);
|
||||
unset ($moderators_list);
|
||||
unset ($mod_count);
|
||||
unset ($mod_symbol);
|
||||
}
|
||||
|
||||
if ($row['sid'] != $start_id){
|
||||
$category_link = link_category($start_id, $start_name);
|
||||
$tpl->load_template($tpl_dir.'category.tpl');
|
||||
$tpl->set('{category}', $category_link);
|
||||
$tpl->set('{forums}', $tpl->result["forums_{$start_id}"]);
|
||||
$tpl->compile('dle_forum');
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
$start_id = $row['sid'];
|
||||
$start_name = stripslashes($row['cat_name']);
|
||||
}
|
||||
|
||||
$category_link = link_category($start_id, $start_name);
|
||||
|
||||
$tpl->load_template($tpl_dir.'category.tpl');
|
||||
|
||||
$tpl->set('{category}', $category_link);
|
||||
$tpl->set('{forums}', $tpl->result["forums_{$start_id}"]);
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
$tpl->clear();
|
||||
|
||||
if ($forum_config['stats']){require_once SYSTEM_DIR.'/forum/sources/modules/stats.php';}
|
||||
|
||||
break;
|
||||
|
||||
case "category": require_once SYSTEM_DIR.'/forum/sources/category.php'; break;
|
||||
case "forum": require_once SYSTEM_DIR.'/forum/sources/showforum.php'; break;
|
||||
case "topic": require_once SYSTEM_DIR.'/forum/sources/showtopic.php'; break;
|
||||
case "add_topic": require_once SYSTEM_DIR.'/forum/action/addtopic.php'; break;
|
||||
case "getforum": require_once SYSTEM_DIR.'/forum/action/forum.php'; break;
|
||||
case "getnew": require_once SYSTEM_DIR.'/forum/sources/modules/getnew.php'; break;
|
||||
case "search": require_once SYSTEM_DIR.'/forum/sources/modules/search.php'; break;
|
||||
case "subscription": require_once SYSTEM_DIR.'/forum/sources/modules/subscription.php'; break;
|
||||
case "moderation": require_once SYSTEM_DIR.'/forum/action/moderation.php'; break;
|
||||
case "post": require_once SYSTEM_DIR.'/forum/action/post.php'; break;
|
||||
case "_topic": require_once SYSTEM_DIR.'/forum/action/topic.php'; break;
|
||||
case "user_posts": require_once SYSTEM_DIR.'/forum/sources/shapeshifter/forum_posts.php'; break;
|
||||
|
||||
// ********************************************************************************
|
||||
// ATTACHMENT
|
||||
// ********************************************************************************
|
||||
case "attachment":
|
||||
$file_id = intval($_REQUEST['id']);
|
||||
if ($file_id)
|
||||
{
|
||||
$row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_files WHERE file_id = '$file_id'");
|
||||
|
||||
if ($row['file_id'])
|
||||
{
|
||||
if (count($forums_array))
|
||||
{
|
||||
$access_download = $forums_array[$row['forum_id']]['access_download'];
|
||||
|
||||
if (check_access($access_download))
|
||||
{
|
||||
if ($row['file_type'] == "file"){
|
||||
$FILE_DIR = "files";
|
||||
} else {
|
||||
$FILE_DIR = "images";
|
||||
}
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_files SET dcount = dcount+1 WHERE file_id = '$file_id'");
|
||||
@header("Location: {$config['http_home_url']}uploads/forum/{$FILE_DIR}/{$row['onserver']}");
|
||||
}
|
||||
else
|
||||
{
|
||||
$group_name = $user_group[$member_id['user_group']]['group_name'];
|
||||
forum_msg($f_lang['f_msg'], $f_lang['forum_down'], 'user_group', $group_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@header("HTTP/1.0 404 Not Found");
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
@header("HTTP/1.0 404 Not Found");
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ($forum_config['forum_bar'])
|
||||
{
|
||||
$forum_bar = "<a href=\"{$forum_url}/\">".$forum_config['forum_title']."</a>";
|
||||
if ($bbr_cid and $bbr_name){$forum_bar .= " » ".link_category($bbr_cid, $bbr_name);}
|
||||
if ($bbr_fname and $bbr_fid){$forum_bar .= " » ".link_forum($bbr_fid, $bbr_fname);}
|
||||
if ($bbr_tname and $bbr_tid){$forum_bar .= " » ".link_topic($bbr_tid, $bbr_tname);}
|
||||
if ($bbr_app){$forum_bar .= " » ".$bbr_app."</a>";}
|
||||
$forum_bar = stripslashes($forum_bar);
|
||||
}
|
||||
|
||||
if (!defined('FORUM_SUB_DOMAIN')){require_once SYSTEM_DIR . $compile_php;}
|
||||
|
||||
if ($forum_config['meta_descr'] and !$meta_topic){$metatags['description'] = $forum_config['meta_descr'];}
|
||||
if ($forum_config['meta_keywords'] and !$meta_topic){$metatags['keywords'] = $forum_config['meta_keywords'];}
|
||||
?>
|
||||
142
system/forum/sources/category.php
Normal file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
if (intval($cid))
|
||||
{
|
||||
if ($forum_config['hide_forum'])
|
||||
{
|
||||
$access_hide = "and access_read regexp '[[:<:]](".$member_id['user_group'].")[[:>:]]'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$access_hide = "";
|
||||
}
|
||||
|
||||
$category_name = stripslashes($cats_array[$cid]['cat_name']);
|
||||
|
||||
if ($category_name)
|
||||
{
|
||||
$result = $db->query("SELECT * FROM ". PREFIX ."_forum_forums WHERE main_id = $cid and parentid = 0 {$access_hide} ORDER by position");
|
||||
|
||||
while ($row = $db->get_row($result))
|
||||
{
|
||||
if (!$fcache->open('sub-'.$row['id']))
|
||||
{
|
||||
if ($sub_forums_array != 'empty')
|
||||
{
|
||||
foreach ($sub_forums_array as $value)
|
||||
{
|
||||
if ($row['id'] == $value['parentid'])
|
||||
{
|
||||
$symbol_count++;
|
||||
|
||||
if ($symbol_count > 1) $symbol = ", ";
|
||||
|
||||
$sub_forums .= link_forum($value['id'], $value['name'], $symbol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$fcache->save('sub-'.$row['id'], $sub_forums);
|
||||
}
|
||||
else { $sub_forums = $fcache->open('sub-'.$row['id']); }
|
||||
|
||||
if (!$fcache->open('moder-'.$row['id']))
|
||||
{
|
||||
foreach ($forum_moderators as $moderators)
|
||||
{
|
||||
if ($moderators['forum_id'] == $row['id'] and $moderators['member_name'])
|
||||
{
|
||||
$mod_count++;
|
||||
|
||||
if ($mod_count > 1) $mod_symbol = ", ";
|
||||
|
||||
$moderators_list .= $mod_symbol . link_user($moderators['member_name']);
|
||||
}
|
||||
}
|
||||
|
||||
$fcache->save('moder-'.$row['id'], $moderators_list);
|
||||
}
|
||||
else { $moderators_list = $fcache->open('moder-'.$row['id']); }
|
||||
|
||||
$tpl->load_template($tpl_dir.'forums.tpl');
|
||||
|
||||
$tpl->set('{status}', forum_status ($row['f_last_date'], $row['password'], $row['icon']));
|
||||
|
||||
$tpl->set('{name}', link_forum($row['id'], $row['name']));
|
||||
|
||||
$tpl->set('{description}', stripslashes($row['description']));
|
||||
|
||||
if ($sub_forums)
|
||||
{
|
||||
$tpl->set('{forums}', '<br />'.$forum_config['forum_pr_sub'].' '.$sub_forums);
|
||||
}
|
||||
else { $tpl->set('{forums}', ''); }
|
||||
|
||||
if ($moderators_list)
|
||||
{
|
||||
$tpl->set('{moderators}', '<br />' . $f_lang['moderators'] . ' ' . $moderators_list);
|
||||
}
|
||||
else { $tpl->set('{moderators}', ''); }
|
||||
|
||||
$tpl->set('{topics}', $row['topics']);
|
||||
|
||||
$tpl->set('{post}', $row['posts']);
|
||||
|
||||
$tpl->set('{forum_id_rss}', $forum_url."/rss/forum_".$row['id'].".xml");
|
||||
|
||||
$tpl->set('{last}', forum_last ($row['f_last_tid'], $row['f_last_title'], $row['f_last_poster_name'], $row['f_last_date'], $row['password'], $row['id'], $row['access_read'], $row['last_post_id']));
|
||||
|
||||
$tpl->compile('forums');
|
||||
|
||||
$tpl->clear();
|
||||
|
||||
unset ($sub_forums);
|
||||
|
||||
unset ($symbol_count);
|
||||
|
||||
unset ($symbol);
|
||||
|
||||
unset ($moderators_list);
|
||||
|
||||
unset ($mod_count);
|
||||
|
||||
unset ($mod_symbol);
|
||||
}
|
||||
|
||||
$tpl->load_template($tpl_dir.'category.tpl');
|
||||
|
||||
$tpl->set('{category}', $category_name);
|
||||
|
||||
$tpl->set('{forums}', $tpl->result['forums']);
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
|
||||
$tpl->clear();
|
||||
|
||||
$metatags['title'] = $forum_config['forum_title'].' » '.$category_name;
|
||||
|
||||
if ($forum_config['forum_bar'])
|
||||
{
|
||||
$bbr_cid = $cid;
|
||||
$bbr_name = $category_name;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
@header("HTTP/1.0 404 Not Found");
|
||||
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
@header("HTTP/1.0 404 Not Found");
|
||||
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
?>
|
||||
48
system/forum/sources/components/attachment.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
$get_attachment = $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE topic_id = '$tid' and file_attach = '1'");
|
||||
|
||||
while ($row = $db->get_row($get_attachment))
|
||||
{
|
||||
if ($row['file_type'] == "image")
|
||||
{
|
||||
$img_full = $config['http_home_url'].'uploads/forum/images/'.$row['onserver'];
|
||||
|
||||
$attachment = "<img src=\"{$img_full}\" border=\"0\">";
|
||||
}
|
||||
|
||||
elseif ($row['file_type'] == "thumb")
|
||||
{
|
||||
$img_full = $config['http_home_url'].'uploads/forum/images/'.$row['onserver'];
|
||||
|
||||
$img_thumb = $config['http_home_url'].'uploads/forum/thumbs/'.$row['onserver'];
|
||||
|
||||
$hs_expand = "onClick=\"return hs.expand(this)\"";
|
||||
|
||||
$attachment = "<a href=\"{$img_full}\" {$hs_expand}><img src=\"{$img_thumb}\" border=\"0\"></a>";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$attachment_down = $a_forum_url."act=attachment&id=".$row['file_id'];
|
||||
|
||||
$attachment = "<a href=\"$attachment_down\">{$row['file_name']}</a> ({$row['dcount']} | ".mksize($row['file_size']).")";
|
||||
|
||||
//$onserver_url = "{$config['http_home_url']}uploads/forum/files/{$row['onserver']}";
|
||||
}
|
||||
|
||||
if (!$ajax_edit_attach){
|
||||
$tpl->result['posts'] = str_replace('[attachment='.$row['file_id'].']', $attachment, $tpl->result['posts']);
|
||||
//$tpl->result['posts'] = preg_replace("#\[attachment={$row['file_id']}:(.*)\]#i", $onserver_url, $tpl->result['posts']);
|
||||
}
|
||||
else{
|
||||
$post_text = str_replace('[attachment='.$row['file_id'].']', $attachment, $post_text);
|
||||
//$post_text = preg_replace("#\[attachment={$row['file_id']}:(.*)\]#i", $onserver_url, $post_text);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
179
system/forum/sources/components/bbcode.php
Normal file
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
if (!defined('FORUM_SUB_DOMAIN'))
|
||||
{
|
||||
$color_html_dir = "{THEME}/bbcodes";
|
||||
|
||||
} else
|
||||
{
|
||||
$color_html_dir = $forum_config['forum_url']."/ajax";
|
||||
}
|
||||
|
||||
$uploads_script_dir = $config['http_home_url']."system/forum/sources/modules";
|
||||
|
||||
if (!$upload_var['bb_width']) $bb_width = "460px";
|
||||
|
||||
else $bb_width = $upload_var['bb_width'];
|
||||
|
||||
$i = 0;
|
||||
$output = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"120\"><tr>";
|
||||
|
||||
$smilies = explode(",", $config['smilies']);
|
||||
foreach($smilies as $smile)
|
||||
{
|
||||
$i++; $smile = trim($smile);
|
||||
|
||||
$output .= "<td style=\"padding:2px;\" align=\"center\"><a href=\"#\" onClick=\"ins_smile(':$smile:'); return false;\"><img style=\"border: none;\" alt=\"$smile\" src=\"".$config['http_home_url']."system/data/emoticons/$smile.gif\" /></a></td>";
|
||||
|
||||
if ($i%3 == 0) $output .= "</tr><tr>";
|
||||
|
||||
}
|
||||
|
||||
$output .= "</tr></table>";
|
||||
|
||||
if ($ajax_post_id)
|
||||
{
|
||||
$ajax_post_id = '_'.$ajax_post_id;
|
||||
|
||||
$addform = "document.forum_post_form".$ajax_post_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$addform = "document.getElementById( 'forum-post-form' )";
|
||||
}
|
||||
|
||||
$startform = "post_text".$ajax_post_id;
|
||||
|
||||
$add_id = false;
|
||||
|
||||
if ($access_upload AND $forum_config['tools_upload'] OR $access_upload AND $forum_config['img_upload'])
|
||||
{
|
||||
$tag_upload = "<div id=\"b_code\" class=\"editor_button\" onclick=\"window_upload()\"><img title=\"Çàãðóçêà ôàéëîâ è èçîáðàæåíèé íà ñåðâåð\" src=\"{THEME}/bbcodes/upload.gif\" width=\"23\" height=\"25\" border=\"0\"></div>";
|
||||
}
|
||||
|
||||
if (!$upload_var['reply']){
|
||||
|
||||
$code = <<<HTML
|
||||
<div style="width:{$bb_width}; height:50px; border:1px solid #BBB; background-image:url('{THEME}/bbcodes/bg.gif');">
|
||||
<div id="b_b" class="editor_button" onclick="simpletag('b')"><img title="$lang[bb_t_b]" src="{THEME}/bbcodes/b.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_i" class="editor_button" onclick="simpletag('i')"><img title="$lang[bb_t_i]" src="{THEME}/bbcodes/i.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_u" class="editor_button" onclick="simpletag('u')"><img title="$lang[bb_t_u]" src="{THEME}/bbcodes/u.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_s" class="editor_button" onclick="simpletag('s')"><img title="$lang[bb_t_s]" src="{THEME}/bbcodes/s.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div id="b_emo" class="editor_button" onclick="ins_emo();"><img title="$lang[bb_t_emo]" src="{THEME}/bbcodes/emo.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_color" class="editor_button" onclick="ins_color();"><img src="{THEME}/bbcodes/color.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick="tag_url()"><img title="$lang[bb_t_url]" src="{THEME}/bbcodes/link.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick="tag_email()"><img title="$lang[bb_t_m]" src="{THEME}/bbcodes/email.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick=tag_image()><img title="$lang[bb_b_img]" src="{THEME}/bbcodes/image.gif" width="23" height="25" border="0"></div>
|
||||
{$tag_upload}
|
||||
<div class="editor_button" onclick="tag_video()"><img title="$lang[bb_t_video]" src="{THEME}/bbcodes/mp.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick="tag_audio()"><img src="{THEME}/bbcodes/mp3.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick="tag_flash()"><img src="{THEME}/bbcodes/flash.gif" width="23" height="25" border="0" alt="" /></div>
|
||||
<div class="editor_button" onclick="tag_media()"><img src="{THEME}/bbcodes/youtube.gif" width="23" height="25" border="0" alt="" /></div>
|
||||
<div class="editor_button" style="padding-top:4px;width:120px;"><select name="bbfont" class="editor_button" onchange="insert_font(this.options[this.selectedIndex].value, 'font')"><option value='0'>{$lang['bb_t_font']}</option><option value='Arial'>Arial</option><option value='Arial Black'>Arial Black</option><option value='Century Gothic'>Century Gothic</option><option value='Courier New'>Courier New</option><option value='Georgia'>Georgia</option><option value='Impact'>Impact</option><option value='System'>System</option><option value='Tahoma'>Tahoma</option><option value='Times New Roman'>Times New Roman</option><option value='Verdana'>Verdana</option></select></div>
|
||||
<div class="editor_button" style="padding-top:4px;width:65px;"><select name="bbsize" class="editor_button" onchange="insert_font(this.options[this.selectedIndex].value, 'size')"><option value='0'>{$lang['bb_t_size']}</option><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option></select></div>
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div id="b_left" class="editor_button" onclick="simpletag('left')"><img title="$lang[bb_t_l]" src="{THEME}/bbcodes/l.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_center" class="editor_button" onclick="simpletag('center')"><img title="$lang[bb_t_c]" src="{THEME}/bbcodes/c.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_right" class="editor_button" onclick="simpletag('right')"><img title="$lang[bb_t_r]" src="{THEME}/bbcodes/r.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div id="b_quote" class="editor_button" onclick="simpletag('quote')"><img title="$lang[bb_t_quote]" src="{THEME}/bbcodes/quote.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_code" class="editor_button" onclick="simpletag('code')"><img title="$lang[bb_t_code]" src="{THEME}/bbcodes/code.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_hide" class="editor_button" onclick="simpletag('hide')"><img title="$lang[bb_t_hide]" src="{THEME}/bbcodes/hide.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div id="b_spoiler" class="editor_button" onclick="spoiler()"><img src="{THEME}/bbcodes/spoiler.gif" width="23" height="25" border="0"></div>
|
||||
<iframe width="154" height="104" id="cp" src="{$color_html_dir}/color.html" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; display: none; position: absolute;"></iframe>
|
||||
<div id="dle_emo" style="visibility:hidden; display: none; position: absolute; width:140px; height: 124px; overflow: auto; border: 1px solid #BBB; background:#E9E8F2;filter: alpha(opacity=95, enabled=1) progid:DXImageTransform.Microsoft.Shadow(color=#CACACA,direction=135,strength=3);">{$output}</div>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
$code = <<<HTML
|
||||
<div style="width:{$bb_width}; height:25px; border:1px solid #BBB; background-image:url('{THEME}/bbcodes/bg.gif');">
|
||||
<div id="b_b" class="editor_button" onclick="simpletag('b')"><img title="$lang[bb_t_b]" src="{THEME}/bbcodes/b.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_i" class="editor_button" onclick="simpletag('i')"><img title="$lang[bb_t_i]" src="{THEME}/bbcodes/i.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_u" class="editor_button" onclick="simpletag('u')"><img title="$lang[bb_t_u]" src="{THEME}/bbcodes/u.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div id="b_emo" class="editor_button" onclick="ins_emo();"><img title="$lang[bb_t_emo]" src="{THEME}/bbcodes/emo.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_color" class="editor_button" onclick="ins_color();"><img src="{THEME}/bbcodes/color.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick="tag_url()"><img title="$lang[bb_t_url]" src="{THEME}/bbcodes/link.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick="tag_email()"><img title="$lang[bb_t_m]" src="{THEME}/bbcodes/email.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div class="editor_button" onclick=tag_image()><img title="$lang[bb_b_img]" src="{THEME}/bbcodes/image.gif" width="23" height="25" border="0"></div>
|
||||
{$tag_upload}
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div id="b_quote" class="editor_button" onclick="simpletag('quote')"><img title="$lang[bb_t_quote]" src="{THEME}/bbcodes/quote.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_code" class="editor_button" onclick="simpletag('code')"><img title="$lang[bb_t_code]" src="{THEME}/bbcodes/code.gif" width="23" height="25" border="0"></div>
|
||||
<div id="b_hide" class="editor_button" onclick="simpletag('hide')"><img title="$lang[bb_t_hide]" src="{THEME}/bbcodes/hide.gif" width="23" height="25" border="0"></div>
|
||||
<div class="editor_button"><img src="{THEME}/bbcodes/brkspace.gif" width="5" height="25" border="0"></div>
|
||||
<div id="b_spoiler" class="editor_button" onclick="spoiler()"><img src="{THEME}/bbcodes/spoiler.gif" width="23" height="25" border="0"></div>
|
||||
<iframe width="154" height="104" id="cp" src="{$color_html_dir}/color.html" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" style="visibility:hidden; display: none; position: absolute;"></iframe>
|
||||
<div id="dle_emo" style="visibility:hidden; display: none; position: absolute; width:140px; height: 124px; overflow: auto; border: 1px solid #BBB; background:#E9E8F2;filter: alpha(opacity=95, enabled=1) progid:DXImageTransform.Microsoft.Shadow(color=#CACACA,direction=135,strength=3);">{$output}</div>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
if ( stristr( $_SERVER['REQUEST_URI'], "pages.php" ) ) {
|
||||
|
||||
$script_code = @file_get_contents(SYSTEM_DIR."/ajax/bbcodes.js");
|
||||
$script_code .= <<<HTML
|
||||
|
||||
-->
|
||||
</SCRIPT>
|
||||
HTML;
|
||||
|
||||
} else {
|
||||
|
||||
$script_code = <<<HTML
|
||||
-->
|
||||
</SCRIPT>
|
||||
<script type="text/javascript" src="{$config['http_home_url']}system/ajax/bbcodes.js"></script>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
$bb_code = <<<HTML
|
||||
<SCRIPT type=text/javascript>
|
||||
<!--
|
||||
var text_enter_url = "$lang[bb_url]";
|
||||
var text_enter_page = "$lang[bb_page]";
|
||||
var text_enter_url_name = "$lang[bb_url_name]";
|
||||
var text_enter_page_name = "$lang[bb_page_name]";
|
||||
var text_enter_image = "$lang[bb_image]";
|
||||
var text_enter_email = "$lang[bb_email]";
|
||||
var text_code = "$lang[bb_code]";
|
||||
var text_quote = "$lang[bb_quote]";
|
||||
var error_no_url = "$lang[bb_no_url]";
|
||||
var error_no_title = "$lang[bb_no_title]";
|
||||
var error_no_email = "$lang[bb_no_email]";
|
||||
var prompt_start = "$lang[bb_prompt_start]";
|
||||
var img_title = "$lang[bb_img_title]";
|
||||
var email_title = "$lang[bb_email_title]";
|
||||
var text_pages = "$lang[bb_bb_page]";
|
||||
var image_align = "{$config['image_align']}";
|
||||
|
||||
var selField = "{$startform}";
|
||||
var fombj = {$addform};
|
||||
|
||||
function window_upload()
|
||||
{
|
||||
|
||||
uploadsform('{$uploads_script_dir}/uploads.php?area={$upload_var['area']}&fid={$upload_var['forum_id']}&tid={$upload_var['topic_id']}&pid={$upload_var['post_id']}');
|
||||
|
||||
}
|
||||
|
||||
{$script_code}
|
||||
{$code}
|
||||
HTML;
|
||||
|
||||
?>
|
||||
104
system/forum/sources/components/edit_options.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
if ($check_moderator)
|
||||
{
|
||||
if (moderator_value('edit_topic', $forum_id, $m_member))
|
||||
{
|
||||
$topic_option .= "<option value=\"04\"> - Ðåäàêòèðîâàòü çàãîëîâîê</option>";
|
||||
}
|
||||
|
||||
if (moderator_value('move_topic', $forum_id, $m_member))
|
||||
{
|
||||
$topic_option .= "<option value=\"05\"> - Ïåðåìåñòèòü òåìó</option>";
|
||||
}
|
||||
|
||||
if (moderator_value('close_topic', $forum_id, $m_member) and !$row_topic['topic_status'])
|
||||
{
|
||||
$topic_option .= "<option value=\"02\"> - Çàêðûòü òåìó</option>";
|
||||
}
|
||||
|
||||
if (moderator_value('open_topic', $forum_id, $m_member) and $row_topic['topic_status'])
|
||||
{
|
||||
$topic_option .= "<option value=\"01\"> - Îòêðûòü òåìó</option>";
|
||||
}
|
||||
|
||||
if (moderator_value('pin_topic', $forum_id, $m_member) and $row_topic['fixed'])
|
||||
{
|
||||
$topic_option .= "<option value=\"08\"> - Çàêðåïèòü òåìó</option>";
|
||||
}
|
||||
|
||||
if (moderator_value('unpin_topic', $forum_id, $m_member) and !$row_topic['fixed'])
|
||||
{
|
||||
$topic_option .= "<option value=\"09\"> - Îòêðåïèòü òåìó</option>";
|
||||
}
|
||||
|
||||
if (!$row_topic['hidden'])
|
||||
{
|
||||
$topic_option .= "<option value=\"06\"> - Ñêðûòü òåìó</option>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$topic_option .= "<option value=\"07\"> - Îïóáëèêîâàòü òåìó</option>";
|
||||
}
|
||||
|
||||
if (moderator_value('delete_topic', $forum_id, $m_member))
|
||||
{
|
||||
$topic_option .= "<option value=\"03\"> - Óäàëèòü òåìó</option>";
|
||||
}
|
||||
|
||||
if($topic_option)
|
||||
{
|
||||
$topic_option = "<option value=\"-1\">Îïöèè ìîäåðàòîðà</option>".$topic_option;
|
||||
}
|
||||
|
||||
$posts_option = "<option value=\"00\">Ñîîáùåíèÿ</option>";
|
||||
|
||||
if (moderator_value('combining_post', $forum_id, $m_member))
|
||||
{
|
||||
$posts_option .= "<option value=\"07\"> - Îáúåäèíèòü ñîîáùåíèÿ</option>";
|
||||
}
|
||||
|
||||
if (moderator_value('move_post', $forum_id, $m_member))
|
||||
{
|
||||
$posts_option .= "<option value=\"08\"> - Ïåðåìåñòèòü ñîîáùåíèÿ</option>";
|
||||
}
|
||||
|
||||
$posts_option .= "<option value=\"05\"> - Îïóáëèêîâàòü ñîîáùåíèÿ</option>";
|
||||
$posts_option .= "<option value=\"06\"> - Ñêðûòü ñîîáùåíèÿ</option>";
|
||||
|
||||
if (moderator_value('mass_prune', $forum_id, $m_member))
|
||||
{
|
||||
$posts_option .= "<option value=\"04\"> - Óäàëèòü ñîîáùåíèÿ</option>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($user_group[$member_id['user_group']]['forum_topic_edit'] AND $member_id['name'] == $row_topic['author_topic'])
|
||||
{
|
||||
$topic_option .= "<option value=\"04\"> - Ðåäàêòèðîâàòü çàãîëîâîê</option>";
|
||||
}
|
||||
|
||||
if ($user_group[$member_id['user_group']]['forum_topic_set'] AND $member_id['name'] == $row_topic['author_topic']){
|
||||
if ($row_topic['topic_status']){
|
||||
$topic_option .= "<option value=\"01\"> - Îòêðûòü òåìó</option>";
|
||||
}else{
|
||||
$topic_option .= "<option value=\"02\"> - Çàêðûòü òåìó</option>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($user_group[$member_id['user_group']]['forum_topic_del'] AND $member_id['name'] == $row_topic['author_topic'])
|
||||
{
|
||||
$topic_option .= "<option value=\"03\"> - Óäàëèòü òåìó</option>";
|
||||
}
|
||||
|
||||
if ($topic_option)
|
||||
{
|
||||
$topic_option = "<option value=\"-1\">Îïöèè ìîäåðàòîðà</option>".$topic_option;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
777
system/forum/sources/components/functions.php
Normal file
@@ -0,0 +1,777 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// FORUM sessions
|
||||
// ********************************************************************************
|
||||
function forum_sessions ($act_forum = 0, $act_topic = 0)
|
||||
{
|
||||
global $db, $act, $forum_config, $member_id;
|
||||
|
||||
$id = $db->safesql($_COOKIE['dle_forum_sessions']);
|
||||
|
||||
$ip = $db->safesql($_SERVER['REMOTE_ADDR']);
|
||||
|
||||
if (!$id) { $id = session_id(); }
|
||||
|
||||
$browser = $db->safesql($_SERVER['HTTP_USER_AGENT']);
|
||||
|
||||
$member_name = $member_id['name'];
|
||||
|
||||
$BOT_AGENT = array(
|
||||
'Googlebot' => "Google Bot",
|
||||
'Mediapartners' => "Google MP",
|
||||
'msnbot' => "MSN Bot",
|
||||
'yahoo' => "Yahoo Bot",
|
||||
'yandex' => "Yandex Bot",
|
||||
'rambler' => "Rambler Bot",
|
||||
'aport' => "Aport Bot",
|
||||
'webalta' => "WebAlta Bot",
|
||||
);
|
||||
|
||||
if (intval($member_id['user_group']) == "0"){ $member_id['user_group'] = "5"; }
|
||||
|
||||
if ($member_id['user_group'] == "5" and $forum_config['bot_agent'])
|
||||
{
|
||||
foreach ($BOT_AGENT as $bot => $bot_name)
|
||||
{
|
||||
if ( stristr ($browser, $bot) )
|
||||
{
|
||||
$member_name = $bot_name;
|
||||
|
||||
$id = md5 ($bot);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$time = time();
|
||||
|
||||
$stime = time() - ($forum_config['session_time'] * 60);
|
||||
|
||||
if ($id)
|
||||
{
|
||||
$row = $db->super_query("SELECT id FROM " . PREFIX . "_forum_sessions WHERE id = '$id' AND ip = '$ip'");
|
||||
}
|
||||
|
||||
if (!$row['id'])
|
||||
{
|
||||
set_cookie ('dle_forum_sessions', session_id(), 365);
|
||||
|
||||
$where_mn = $member_name ? " OR member_name = '$member_name'" : "";
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_sessions WHERE running_time < '$stime' OR id = '$id'".$where_mn);
|
||||
|
||||
$db->query("INSERT INTO " . PREFIX . "_forum_sessions (id, member_name, member_id, user_group, ip, browser, running_time, location, act_forum, act_topic) VALUES ('$id', '$member_name', '$member_id[user_id]', '$member_id[user_group]', '$ip', '$browser', '$time', '$act', '$act_forum', '$act_topic')");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$db->query("UPDATE " . PREFIX . "_forum_sessions SET member_name = '$member_name', member_id = '$member_id[user_id]', user_group = '$member_id[user_group]', running_time = '$time', location = '$act', act_forum = '$act_forum', act_topic = '$act_topic' WHERE id = '$id'");
|
||||
}
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// FORUM Online
|
||||
// ********************************************************************************
|
||||
function get_forum_online ($type = false, $value = false)
|
||||
{
|
||||
global $db, $forum_config, $user_group, $forum_online;
|
||||
|
||||
$stime = time() - ($forum_config['session_time'] * 60);
|
||||
|
||||
if ($type and $value)
|
||||
{
|
||||
$WHERE = "".$type." = '$value' and";
|
||||
}
|
||||
|
||||
$sessions = $db->query("SELECT member_name, user_group FROM " . PREFIX . "_forum_sessions WHERE {$WHERE} running_time > '$stime'");
|
||||
|
||||
$forum_online['member_count'] = 0;
|
||||
|
||||
$forum_online['guest_count'] = 0;
|
||||
|
||||
while ($row = $db->get_row($sessions))
|
||||
{
|
||||
$forum_online['all_count']++;
|
||||
|
||||
if ($row['member_name'] AND $row['user_group'] !== "5")
|
||||
{
|
||||
$forum_online['member_count']++;
|
||||
|
||||
$symbol_count++;
|
||||
|
||||
if ($symbol_count > 1) $symbol = ", ";
|
||||
|
||||
$group_span = $user_group[$row['user_group']]['colour'];
|
||||
$forum_online['member_list'] .= $symbol.link_user($row['member_name'], "<span style=\"color:{$group_span}\">".$row['member_name']."</span>");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$forum_online['guest_count']++;
|
||||
|
||||
if ($row['member_name'])
|
||||
{
|
||||
$symbol_count++;
|
||||
|
||||
if ($symbol_count > 1) $symbol = ", ";
|
||||
|
||||
$forum_online['member_list'] .= $symbol . $row['member_name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($forum_online['all_count'] > $forum_config['_max_online_'])
|
||||
{
|
||||
global $fcache;
|
||||
|
||||
$max_online = array ('count' => $forum_online['all_count'], 'time' => $GLOBALS['_TIME']);
|
||||
|
||||
$fcache->set('online', $max_online);
|
||||
|
||||
$fcache->delete('stats');
|
||||
}
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// SHOW DATE
|
||||
// ********************************************************************************
|
||||
function show_date ($date)
|
||||
{
|
||||
global $f_lang, $forum_config, $_TIME;
|
||||
|
||||
if (date(Ymd, $date) == date(Ymd, $_TIME))
|
||||
{
|
||||
$show_date = $f_lang['time_heute'].langdate(", H:i", $date);
|
||||
}
|
||||
elseif (date(Ymd, $date) == date(Ymd, ($_TIME - 86400)))
|
||||
{
|
||||
$show_date = $f_lang['time_gestern'].langdate(", H:i", $date);
|
||||
}
|
||||
else
|
||||
{
|
||||
$show_date = langdate($forum_config['timestamp'], $date);
|
||||
}
|
||||
|
||||
return ($show_date);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// FORUM STATUS
|
||||
// ********************************************************************************
|
||||
function forum_status ($last_date, $close = false, $icon = false)
|
||||
{
|
||||
global $member_id, $lasttime, $f_lang;
|
||||
|
||||
$last_date = strtotime($last_date);
|
||||
|
||||
if ($icon)
|
||||
{
|
||||
$icon = "_".$icon;
|
||||
}
|
||||
|
||||
if ($last_date > $lasttime)
|
||||
{
|
||||
if (!$close)
|
||||
{
|
||||
$image = "f_new{$icon}.gif"; $alt = $f_lang['fs_new'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$image = "fc_new{$icon}.gif"; $alt = $f_lang['fs_new'];
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (!$close)
|
||||
{
|
||||
$image = "f_nonew{$icon}.gif"; $alt = $f_lang['fs_nonew'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$image = "fc_nonew{$icon}.gif"; $alt = $f_lang['fs_nonew'];
|
||||
}
|
||||
}
|
||||
|
||||
$topic_info = "<img src='{THEME}/forum/images/".$image."' border='0' alt='$alt'>";
|
||||
|
||||
return($topic_info);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// FORUM LAST
|
||||
// ********************************************************************************
|
||||
function forum_last ($topic_id, $title, $last_user, $last_date, $password = false, $fid = false, $access_read = false, $last_pid = 0)
|
||||
{
|
||||
global $forum_config, $f_lang, $_TIME, $member_id;
|
||||
|
||||
$title = stripslashes($title);
|
||||
|
||||
$last_date = strtotime($last_date);
|
||||
|
||||
$last_date_info = show_date($last_date);
|
||||
|
||||
$h_title = $f_lang['topic_last_p'].' '.$title;
|
||||
|
||||
if ($forum_config['last_abc'])
|
||||
{
|
||||
if (strlen($title) > $forum_config['last_abc'])
|
||||
{
|
||||
$title = substr($title, 0, $forum_config['last_abc']).'...';
|
||||
}
|
||||
}
|
||||
|
||||
if ($password AND md5($password) !== $_COOKIE["dle_forum_{$fid}"])
|
||||
{
|
||||
$link_topic = $f_lang['fl_c_forum'];
|
||||
}
|
||||
elseif (!check_access($access_read))
|
||||
{
|
||||
$link_topic = $f_lang['fl_c_forum'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($forum_config['mod_rewrite']) { $p_sn = "/last#post-{$last_pid}"; } else { $p_sn = "&lastpost=1#post-{$last_pid}"; }
|
||||
|
||||
$link_topic = link_topic($topic_id . $p_sn, $title, $h_title);
|
||||
}
|
||||
|
||||
$last_date_info .= $f_lang['fl_topic'].' '.$link_topic;
|
||||
|
||||
$last_date_info .= $f_lang['fl_author'].' '.link_user($last_user);
|
||||
|
||||
if (!$last_user or !$last_date){ $last_date_info = $f_lang['fl_nopost']; }
|
||||
|
||||
return($last_date_info);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// TOPIC STATUS
|
||||
// ********************************************************************************
|
||||
function topic_status ($topic_id, $last_date, $post, $topic_status, $frage)
|
||||
{
|
||||
global $topic_views, $forum_config, $member_id, $f_lang, $topic_a_time;
|
||||
|
||||
$last_date = strtotime($last_date);
|
||||
|
||||
if ($last_date > $topic_a_time AND $last_date > $member_id['forum_time']) $topic_views_time = 1;
|
||||
|
||||
if ($post >= $forum_config['topic_hot']) $topic_hot = 1;
|
||||
|
||||
if (!$topic_views[$topic_id] AND $topic_views_time)
|
||||
{
|
||||
$image = 'topic.gif'; $alt = $f_lang['topic_yes'];
|
||||
|
||||
if ($topic_hot) $image = 'hot_topic.gif'; $alt = $f_lang['topic_yes'];
|
||||
|
||||
if ($frage) $image = 'dlet_poll.gif'; $alt = $f_lang['topic_yes'];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$image = 'new_topic.gif'; $alt = $f_lang['topic_no'];
|
||||
|
||||
if ($topic_hot) $image = 'hot_topic_no.gif'; $alt = $f_lang['topic_no'];
|
||||
|
||||
if ($frage) $image = 'dlet_poll_no.gif'; $alt = $f_lang['topic_no'];
|
||||
}
|
||||
|
||||
if ($topic_status == 1){$image = 'dlet_closed.gif'; $alt = $f_lang['topic_closed'];}
|
||||
|
||||
return ("<img src='{THEME}/forum/images/".$image."' border='0' alt='$alt'>");
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// TOPIC LAST
|
||||
// ********************************************************************************
|
||||
function topic_last ($topic_id, $last_user, $last_date, $posts, $last_pid = 0)
|
||||
{
|
||||
global $forum_config, $f_lang, $_TIME;
|
||||
|
||||
$last_date = strtotime($last_date);
|
||||
|
||||
$last_date_info = show_date($last_date);
|
||||
|
||||
if ($forum_config['last_plink'])
|
||||
{
|
||||
$last_page = @ceil(($posts + 1) / $forum_config['post_inpage']);
|
||||
|
||||
if (!$last_page) $last_page = 1;
|
||||
|
||||
if ($forum_config['mod_rewrite']) { $p_sn = '/'; } else { $p_sn = '&cstart='; }
|
||||
|
||||
$last_date_info .= "<br />".link_topic($topic_id . $p_sn . $last_page . "#post-{$last_pid}", $f_lang['last_post'])." ".link_user($last_user)."<br />";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$last_date_info .= "<br />{$f_lang['last_post']} ".link_user($last_user)."<br />";
|
||||
}
|
||||
|
||||
if (!$last_user or !$last_date){$last_date_info = $f_lang['fl_nopost'];}
|
||||
|
||||
return($last_date_info);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// CHECK ACCESS
|
||||
// ********************************************************************************
|
||||
function check_access ($value = false)
|
||||
{
|
||||
global $member_id;
|
||||
|
||||
$value = explode(":", $value);
|
||||
|
||||
$check = in_array($member_id['user_group'], $value);
|
||||
|
||||
if ($check) return true;
|
||||
|
||||
else return false;
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// CHECK MODERATOR
|
||||
// ********************************************************************************
|
||||
function check_moderator($value, $moderators)
|
||||
{
|
||||
global $member_id, $m_member;
|
||||
|
||||
$value = explode(":", $value);
|
||||
|
||||
$check = in_array($member_id['user_group'], $value);
|
||||
|
||||
if (!$check and $moderators)
|
||||
{
|
||||
$moderators = explode(":", $moderators);
|
||||
|
||||
$check = in_array($member_id['user_id'], $moderators);
|
||||
|
||||
$m_member = true;
|
||||
}
|
||||
|
||||
if ($check) return true;
|
||||
|
||||
else return false;
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// MODERATOR VALUE
|
||||
// ********************************************************************************
|
||||
function moderator_value($value, $forum_id, $m_member = false)
|
||||
{
|
||||
global $member_id, $forum_moderators;
|
||||
|
||||
if ($forum_moderators == "a:0:{}") return false;
|
||||
|
||||
if ($forum_moderators)
|
||||
{
|
||||
if ($m_member)
|
||||
{
|
||||
$search = 'member_id';
|
||||
|
||||
$search_value = $member_id['user_id'];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$search = 'group_id';
|
||||
|
||||
$forum_id = '0';
|
||||
|
||||
$search_value = $member_id['user_group'];
|
||||
}
|
||||
|
||||
foreach ($forum_moderators as $key => $val)
|
||||
{
|
||||
if ($forum_moderators[$key]['forum_id'] == $forum_id)
|
||||
{
|
||||
if ($forum_moderators[$key][$search] == $search_value)
|
||||
{
|
||||
if ($forum_moderators[$key][$value])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// IS MODERATION
|
||||
// ********************************************************************************
|
||||
function is_moderation($forum_id = 0, $topic_id = 0, $post_id = 0, $value = '')
|
||||
{
|
||||
global $db, $member_id, $user_group, $m_member, $is_mod; //$forum_id
|
||||
|
||||
$forum_id = intval($forum_id);
|
||||
|
||||
$topic_id = intval($topic_id);
|
||||
|
||||
$post_id = intval($post_id);
|
||||
|
||||
if ($post_id)
|
||||
{
|
||||
$get_post = $db->super_query("SELECT * FROM " . PREFIX . "_forum_posts WHERE pid = '$post_id'");
|
||||
|
||||
$topic_id = $get_post['topic_id'];
|
||||
|
||||
$is_mod['topic_id'] = $get_post['topic_id'];
|
||||
|
||||
$is_mod['author'] = $get_post['post_author'];
|
||||
|
||||
if ($member_id['name'] == $get_post['post_author'] AND $user_group[$member_id['user_group']][$value] AND !$get_post['hidden'])
|
||||
{
|
||||
return true;
|
||||
|
||||
$topic_id = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($topic_id)
|
||||
{
|
||||
if (!$forum_id)
|
||||
{
|
||||
$get_topic = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '$topic_id'");
|
||||
|
||||
if ($get_topic['tid'] != $topic_id) return false;
|
||||
|
||||
$forum_id = $get_topic['forum_id'];
|
||||
}
|
||||
|
||||
$is_mod['forum_id'] = $get_topic['forum_id'];
|
||||
|
||||
$get_forum = $db->super_query("SELECT * FROM " . PREFIX . "_forum_forums WHERE id = '$forum_id'");
|
||||
|
||||
if (check_moderator($get_forum['access_mod'], $get_forum['moderators']))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$post_id and !$topic_id)
|
||||
{
|
||||
$get_forum = $db->super_query("SELECT * FROM " . PREFIX . "_forum_forums WHERE id = '$forum_id'");
|
||||
|
||||
if (check_moderator($get_forum['access_mod'], $get_forum['moderators']))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// GROUP MODERATION
|
||||
// ********************************************************************************
|
||||
function group_moderation ($topic_id = 0, $value = false)
|
||||
{
|
||||
global $db, $member_id, $user_group;
|
||||
|
||||
if (intval($topic_id))
|
||||
{
|
||||
$row = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '$topic_id'");
|
||||
|
||||
if ($member_id['name'] == $row['author_topic'])
|
||||
{
|
||||
foreach ($user_group as $key => $val)
|
||||
{
|
||||
if ($user_group[$key]['id'] == $member_id['user_group'])
|
||||
{
|
||||
if ($user_group[$key][$value])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// FORUM MSG
|
||||
// ********************************************************************************
|
||||
function forum_msg($title, $msg_text, $tpl_found = false, $tpl_set = false)
|
||||
{
|
||||
global $tpl, $tpl_dir;
|
||||
|
||||
$tpl->load_template($tpl_dir.'msg.tpl');
|
||||
|
||||
$tpl->set('{title}', $title);
|
||||
|
||||
$tpl->set('{msg}', $msg_text);
|
||||
|
||||
if ($tpl_found)
|
||||
{
|
||||
$tpl->set("{".$tpl_found."}", $tpl_set);
|
||||
}
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Get Salt
|
||||
// ********************************************************************************
|
||||
function get_salt()
|
||||
{
|
||||
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
|
||||
|
||||
srand((double)microtime()*1000000);
|
||||
|
||||
for($i=0;$i < 9; $i++)
|
||||
{
|
||||
$key_salt .= $salt{rand(0,33)};
|
||||
}
|
||||
|
||||
return ($key_salt);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Strip Data
|
||||
// ********************************************************************************
|
||||
function strip_data ($text)
|
||||
{
|
||||
$quotes = array( "\x27", "\x22", "\x60", "\t","\n","\r","'",",","/","\\","¬",";",":","@","~","[","]","{","}","=",")","(","*","&","^","%","$","<",">","?","!", '"' );
|
||||
$text = trim(strip_tags ($text));
|
||||
$text = str_replace($quotes, '', $text);
|
||||
return $text;
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// hilites
|
||||
// ********************************************************************************
|
||||
function hilites ($search, $txt)
|
||||
{
|
||||
$r = preg_split('((>)|(<))', $txt, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
|
||||
for ($i = 0; $i < count($r); $i++)
|
||||
{
|
||||
if ($r[$i] == "<")
|
||||
{
|
||||
$i++; continue;
|
||||
}
|
||||
|
||||
$r[$i] = preg_replace("#($search)#i", "<span style='background-color:yellow;'><font color='red'>\\1</font></span>", $r[$i]);
|
||||
}
|
||||
|
||||
return join("", $r);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// FORUM LIST
|
||||
// ********************************************************************************
|
||||
function forum_list(){
|
||||
global $db;
|
||||
|
||||
$select_list = "<select name=\"move_fid\">";
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_category LEFT JOIN ". PREFIX ."_forum_forums ON ". PREFIX ."_forum_category.sid=". PREFIX ."_forum_forums.main_id ORDER BY posi, position");
|
||||
|
||||
for ($i = 0, $totalcount = 0; $row = $db->get_row($result); $i = $row['sid'], $chcount++)
|
||||
{
|
||||
if ($row['sid'] != $i)
|
||||
{
|
||||
$row['cat_name'] = stripslashes($row['cat_name']);
|
||||
|
||||
$select_list .= "<option value=\"0\">{$row['cat_name']}</option>";
|
||||
}
|
||||
|
||||
if ($row['name'])
|
||||
{
|
||||
$row['name'] = stripslashes($row['name']);
|
||||
|
||||
$select_list .= "<option value=\"{$row['id']}\"> -- {$row['name']}</option>";
|
||||
}
|
||||
}
|
||||
|
||||
$select_list .= "</select>";
|
||||
|
||||
return ($select_list);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// CHECK ATTACHMENT
|
||||
// ********************************************************************************
|
||||
function check_attachment($post_id, $sources)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$post_id = intval($post_id);
|
||||
|
||||
if (!$post_id OR !$sources) return false;
|
||||
|
||||
$query = $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE post_id = '$post_id'");
|
||||
|
||||
while ($row = $db->get_row($query))
|
||||
{
|
||||
if (stristr($sources, "[attachment={$row['file_id']}]") OR stristr($sources, "/forum/files/{$row['onserver']}"))
|
||||
{
|
||||
$file_attach_y[] = $row['file_id'];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$file_attach_n[] = $row['file_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($file_attach_y)
|
||||
{
|
||||
$update_list_y = implode(',', $file_attach_y);
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_files SET file_attach = '1' WHERE file_id IN ({$update_list_y})");
|
||||
}
|
||||
|
||||
if ($file_attach_n)
|
||||
{
|
||||
$update_list_n = implode(',', $file_attach_n);
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_files SET file_attach = '0' WHERE file_id IN ({$update_list_n})");
|
||||
}
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// File Type
|
||||
// ********************************************************************************
|
||||
function file_type($name)
|
||||
{
|
||||
$type = explode ('.', $name);
|
||||
|
||||
$type = end ($type);
|
||||
|
||||
return ($type);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Auto Wrap
|
||||
// ********************************************************************************
|
||||
function auto_wrap($post)
|
||||
{
|
||||
global $forum_config;
|
||||
|
||||
if (!$forum_config['auto_wrap']) return $post;
|
||||
|
||||
$post = preg_split('((>)|(<))', $post, -1, PREG_SPLIT_DELIM_CAPTURE);
|
||||
|
||||
$n = count($post);
|
||||
|
||||
for ($i = 0; $i < $n; $i++)
|
||||
{
|
||||
if ($post[$i] == "<")
|
||||
{
|
||||
$i++; continue;
|
||||
}
|
||||
|
||||
$post[$i] = preg_replace("#([^\s\n\r]{".intval($forum_config['auto_wrap'])."})#i", "\\1<br />", $post[$i]);
|
||||
}
|
||||
|
||||
$post = join("", $post);
|
||||
|
||||
return $post;
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Forum Metatags
|
||||
// ********************************************************************************
|
||||
function forum_metatags($story)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$keyword_count = 20;
|
||||
$newarr = array ();
|
||||
$headers = array ();
|
||||
$quotes = array ("\x27", "\x22", "\x60", "\t", '\n', '\r', "\n", "\r", '\\', "'", ",", ".", "/", "¬", "#", ";", ":", "@", "~", "[", "]", "{", "}", "=", "-", "+", ")", "(", "*", "&", "^", "%", "$", "<", ">", "?", "!", '"' );
|
||||
$fastquotes = array ("\x27", "\x22", "\x60", "\t", "\n", "\r", '"', "'", '\r', '\n', "/", "\\", "{", "}", "[", "]" );
|
||||
|
||||
$story = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "", $story );
|
||||
$story = preg_replace( "'\[attachment=(.*?)\]'si", "", $story );
|
||||
|
||||
$story = str_replace( '<br />', ' ', $story );
|
||||
$story = trim( strip_tags( $story ) );
|
||||
|
||||
$story = str_replace( $fastquotes, '', $story );
|
||||
$headers['description'] = $db->safesql( substr( $story, 0, 190 ) );
|
||||
|
||||
$story = str_replace( $quotes, '', $story );
|
||||
|
||||
$arr = explode( " ", $story );
|
||||
|
||||
foreach ( $arr as $word )
|
||||
{
|
||||
if( strlen( $word ) > 4 ) $newarr[] = $word;
|
||||
}
|
||||
|
||||
$arr = array_count_values( $newarr );
|
||||
arsort( $arr );
|
||||
|
||||
$arr = array_keys( $arr );
|
||||
|
||||
$total = count( $arr );
|
||||
|
||||
$offset = 0;
|
||||
|
||||
$arr = array_slice( $arr, $offset, $keyword_count );
|
||||
|
||||
$headers['keywords'] = $db->safesql( implode( ", ", $arr ) );
|
||||
|
||||
return $headers;
|
||||
}
|
||||
|
||||
function set_first_post_id ($tid, $pid = 0)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$tid = intval($tid);
|
||||
|
||||
if (!$pid)
|
||||
{
|
||||
$row = $db->super_query("SELECT pid FROM " . PREFIX . "_forum_posts WHERE topic_id = $tid");
|
||||
|
||||
$pid = $row['pid'];
|
||||
}
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET first_post = '$pid', last_post_id = '$pid' WHERE tid = '$tid'");
|
||||
|
||||
return $pid;
|
||||
}
|
||||
|
||||
function calk_topic_del ($topic_id, $del_count = 0, $act = '-')
|
||||
{
|
||||
global $db, $forum_config;
|
||||
|
||||
if (!$topic_id) return false;
|
||||
|
||||
$row = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_posts WHERE topic_id = $topic_id");
|
||||
|
||||
if (!$forum_config['set_topic_post']) $row['count'] = ($row['count'] - 1);
|
||||
|
||||
$new_result = $db->super_query("SELECT * FROM ". PREFIX ."_forum_posts WHERE topic_id = $topic_id ORDER by post_date DESC");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET post = '{$row['count']}', last_date = '$new_result[post_date]', last_poster_name = '$new_result[post_author]' WHERE tid = $topic_id");
|
||||
|
||||
$row2 = $db->super_query("SELECT forum_id FROM " . PREFIX . "_forum_topics WHERE tid = $topic_id");
|
||||
|
||||
$new_f_r = $db->super_query("SELECT * FROM ". PREFIX ."_forum_topics WHERE forum_id = {$row2['forum_id']} ORDER by last_date DESC");
|
||||
|
||||
if ($del_count)
|
||||
{
|
||||
$db->query("UPDATE " . PREFIX . "_forum_forums SET posts = posts{$act}{$del_count}, f_last_date = '$new_f_r[last_date]', f_last_poster_name = '$new_f_r[last_poster_name]' WHERE id = {$row2['forum_id']}");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
||||
471
system/forum/sources/components/init.php
Normal file
@@ -0,0 +1,471 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
@include SYSTEM_DIR.'/data/forum_config.php';
|
||||
include_once SYSTEM_DIR.'/forum/language/'.$config['langs'].'/forum.lng';
|
||||
require_once SYSTEM_DIR.'/classes/cache.class.php';
|
||||
$fcache = new cache($dir = ROOT_DIR . '/cache/forum');
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/functions.php';
|
||||
|
||||
define('UPLOAD_DIR', ROOT_DIR."/uploads/forum/");
|
||||
|
||||
// ********************************************************************************
|
||||
// USER UPDATE
|
||||
// ********************************************************************************
|
||||
|
||||
if ($is_logged and $forum_config['set_post_num_day'] and !$_SESSION['forum_update'])
|
||||
{
|
||||
if (!$member_id['forum_update'])
|
||||
{
|
||||
$db->query("UPDATE " . PREFIX . "_users SET forum_update = '".time()."' WHERE user_id = {$member_id['user_id']}");
|
||||
}
|
||||
|
||||
$up_days = ($forum_config['set_post_num_day'] * 8640);
|
||||
|
||||
if ((time() + $up_days) > $member_id['forum_update'])
|
||||
{
|
||||
if ($forum_config['set_topic_post'])
|
||||
{
|
||||
$topic = $db->super_query("SELECT COUNT(tid) as count FROM " . PREFIX . "_forum_topics WHERE author_topic = '$member_id[name]'");
|
||||
|
||||
$topic_num = $topic['count'];
|
||||
}
|
||||
|
||||
$post = $db->super_query("SELECT COUNT(pid) as count FROM " . PREFIX . "_forum_posts
|
||||
WHERE post_author = '$member_id[name]' and is_count");
|
||||
|
||||
$post_num = $post['count'];
|
||||
|
||||
$update = $forum_config['set_topic_post'] ? ($topic_num + $post_num) : $post_num;
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_users SET forum_post = '$update' WHERE name = '$member_id[name]'");
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_users SET forum_update = '".time()."' WHERE user_id = {$member_id['user_id']}");
|
||||
|
||||
$_SESSION['forum_update'] = "1";
|
||||
}
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// SET MOD REWRITE
|
||||
// ********************************************************************************
|
||||
if (!defined('FORUM_SUB_DOMAIN'))
|
||||
{
|
||||
if ($forum_config['mod_rewrite'])
|
||||
{
|
||||
$forum_url = $config['http_home_url']."forum";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$forum_url = $config['http_home_url']."index.php?do=forum&";
|
||||
}
|
||||
|
||||
$a_forum_url = $config['http_home_url']."index.php?do=forum&";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ($forum_config['mod_rewrite'])
|
||||
{
|
||||
$forum_url = $forum_config['forum_url'];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$forum_url = $forum_config['forum_url']."/index.php?";
|
||||
}
|
||||
|
||||
$a_forum_url = $forum_config['forum_url']."/index.php?";
|
||||
}
|
||||
|
||||
$forum_link_array = array();
|
||||
|
||||
if ($forum_config['mod_rewrite'])
|
||||
{
|
||||
$forum_link_array['search'] = $forum_url."/search/";
|
||||
|
||||
$forum_link_array['getnew'] = $forum_url."/getnew/";
|
||||
|
||||
$forum_link_array['subscription'] = $forum_url."/subscription/";
|
||||
|
||||
$forum_link_array['textversion'] = $forum_url."/textversion.html";
|
||||
|
||||
function link_category($id, $name)
|
||||
{
|
||||
global $forum_url;
|
||||
|
||||
return ("<a href='{$forum_url}/category_{$id}'>{$name}</a>");
|
||||
}
|
||||
|
||||
function link_forum($id, $name, $symbol=false)
|
||||
{
|
||||
global $forum_url;
|
||||
|
||||
$name = stripslashes($name);
|
||||
|
||||
return ($symbol."<a href='{$forum_url}/forum_{$id}'>{$name}</a>");
|
||||
}
|
||||
|
||||
function link_topic($id, $name, $title = false)
|
||||
{
|
||||
global $forum_url;
|
||||
|
||||
if ($title) $title = " title='$title'";
|
||||
|
||||
return ("<a href='{$forum_url}/topic_{$id}'{$title}>{$name}</a>");
|
||||
}
|
||||
|
||||
function link_user($user, $title = false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (!$title) $title = $user;
|
||||
|
||||
return("<a href='{$config['http_home_url']}user/".urlencode($user)."/'>{$title}</a>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$forum_link_array['search'] = $forum_url."act=search";
|
||||
|
||||
$forum_link_array['getnew'] = $forum_url."act=getnew";
|
||||
|
||||
$forum_link_array['subscription'] = $forum_url."act=subscription";
|
||||
|
||||
$forum_link_array['textversion'] = $config['http_home_url']."system/forum/textversion.php";
|
||||
|
||||
function link_category($id, $name)
|
||||
{
|
||||
global $forum_url;
|
||||
|
||||
return ("<a href='{$forum_url}category={$id}'>{$name}</a>");
|
||||
}
|
||||
|
||||
function link_forum($id, $name, $symbol=false)
|
||||
{
|
||||
global $forum_url;
|
||||
|
||||
$name = stripslashes($name);
|
||||
|
||||
return ($symbol."<a href='{$forum_url}showforum={$id}'>{$name}</a>");
|
||||
}
|
||||
|
||||
function link_topic($id, $name, $title = false)
|
||||
{
|
||||
global $forum_url;
|
||||
|
||||
if ($title) $title = " title='$title'";
|
||||
|
||||
return ("<a href='{$forum_url}showtopic={$id}'{$title}>{$name}</a>");
|
||||
}
|
||||
|
||||
function link_user($user, $title = false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (!$title) $title = $user;
|
||||
|
||||
return("<a href='{$config['http_home_url']}?subaction=userinfo&user=".urlencode($user)."'>{$title}</a>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$tpl_dir = 'forum/';
|
||||
|
||||
$metatags['title'] = $forum_config['forum_title'];
|
||||
|
||||
$start_id = $fcache->get('start_id');
|
||||
|
||||
if (!$start_id)
|
||||
{
|
||||
$row_start = $db->super_query("SELECT sid FROM " . PREFIX . "_forum_category ORDER BY posi LIMIT 1");
|
||||
|
||||
$start_id = $row_start['sid'];
|
||||
|
||||
$fcache->set('start_id', $start_id);
|
||||
}
|
||||
|
||||
$cats_array = $fcache->get('cats_array');
|
||||
|
||||
if (!$cats_array)
|
||||
{
|
||||
$cats_array = array();
|
||||
|
||||
$result = $db->query("SELECT sid, cat_name FROM ". PREFIX ."_forum_category ORDER by posi");
|
||||
|
||||
while ($row = $db->get_row($result))
|
||||
{
|
||||
$cats_array[$row['sid']] = array ();
|
||||
|
||||
foreach ($row as $key => $value)
|
||||
{
|
||||
$cats_array[$row['sid']][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$cats_array) $cats_array = 'empty';
|
||||
|
||||
$fcache->set('cats_array', $cats_array);
|
||||
}
|
||||
|
||||
$forums_array = $fcache->get('forums_array');
|
||||
|
||||
if (!$forums_array)
|
||||
{
|
||||
$forums_array = array();
|
||||
|
||||
$result = $db->query("SELECT id, parentid, main_id, name, access_read, access_write, access_topic, access_mod, access_upload, access_download, password, moderators, postcount, fixpost, banner, q_reply, i_edit FROM ". PREFIX ."_forum_forums ORDER by position");
|
||||
|
||||
while ($row = $db->get_row($result))
|
||||
{
|
||||
$forums_array[$row['id']] = array ();
|
||||
|
||||
foreach ($row as $key => $value)
|
||||
{
|
||||
$forums_array[$row['id']][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$fcache->set('forums_array', $forums_array);
|
||||
}
|
||||
|
||||
$sub_forums_array = $fcache->get('sub_forums_array');
|
||||
|
||||
if (!$sub_forums_array)
|
||||
{
|
||||
$sub_forums_array = array();
|
||||
|
||||
$result = $db->query("SELECT id, parentid, name FROM ". PREFIX ."_forum_forums WHERE parentid ORDER by position");
|
||||
|
||||
while ($row = $db->get_row($result))
|
||||
{
|
||||
$sub_forums_array[$row['id']] = array ();
|
||||
|
||||
foreach ($row as $key => $value)
|
||||
{
|
||||
$sub_forums_array[$row['id']][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$sub_forums_array) $sub_forums_array = 'empty';
|
||||
|
||||
$fcache->set('sub_forums_array', $sub_forums_array);
|
||||
}
|
||||
|
||||
$sub_parentid = $fcache->get('sub_parentid');
|
||||
|
||||
if (!$sub_parentid)
|
||||
{
|
||||
$sub_parentid = array();
|
||||
|
||||
$result = $db->query("SELECT parentid FROM ". PREFIX ."_forum_forums WHERE parentid ORDER by position");
|
||||
|
||||
while ($row = $db->get_row($result))
|
||||
{
|
||||
$sub_parentid[$row['parentid']] = array ();
|
||||
|
||||
foreach ($row as $key => $value)
|
||||
{
|
||||
$sub_parentid[$row['parentid']][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$sub_parentid) $sub_parentid = 'empty';
|
||||
|
||||
$fcache->set('sub_parentid', $sub_parentid);
|
||||
}
|
||||
|
||||
$forum_moderators = $fcache->get('forum_moderators');
|
||||
|
||||
if (!$forum_moderators)
|
||||
{
|
||||
$get_moderators = $db->query("SELECT * FROM " . PREFIX . "_forum_moderators ORDER BY mid ASC");
|
||||
|
||||
$forum_moderators = array();
|
||||
|
||||
while ($row = $db->get_row($get_moderators))
|
||||
{
|
||||
$forum_moderators[$row['mid']] = array();
|
||||
|
||||
foreach ($row as $key => $value)
|
||||
{
|
||||
$forum_moderators[$row['mid']][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$fcache->set('forum_moderators', $forum_moderators);
|
||||
}
|
||||
|
||||
$rank_array = $fcache->get('rank_array');
|
||||
|
||||
if (!$rank_array)
|
||||
{
|
||||
$rank_array = array();
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_titles");
|
||||
|
||||
while ($row = $db->get_row($result))
|
||||
{
|
||||
$rank_array[$row['id']] = array ();
|
||||
|
||||
foreach ($row as $key => $value)
|
||||
{
|
||||
$rank_array[$row['id']][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$rank_array) $rank_array = 'empty';
|
||||
|
||||
$fcache->set('rank_array', $rank_array);
|
||||
}
|
||||
|
||||
$date_cron = $fcache->get('date_cron');
|
||||
|
||||
//@TODO Êîñÿê â èçîáðàæåíèè
|
||||
$compile_php = "/inc/forum/ico/dle_forum.png";
|
||||
|
||||
if (!$date_cron OR $date_cron != date('d'))
|
||||
{
|
||||
$lim_time = (time() - 86400);
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE file_date < '$lim_time' AND file_attach = 0");
|
||||
|
||||
while ($row = $db->get_row($result))
|
||||
{
|
||||
if ($row['file_type'] == "file")
|
||||
{
|
||||
unlink(UPLOAD_DIR."files/".$row['onserver']);
|
||||
}
|
||||
|
||||
elseif ($row['file_type'] == "thumb")
|
||||
{
|
||||
unlink(UPLOAD_DIR."thumbs/".$row['onserver']);
|
||||
|
||||
unlink(UPLOAD_DIR."images/".$row['onserver']);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
unlink(UPLOAD_DIR."images/".$row['onserver']);
|
||||
}
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_files WHERE file_id = {$row['file_id']}");
|
||||
}
|
||||
|
||||
$fcache->set('date_cron', date('d'));
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// MAX ONLINE STATS
|
||||
// ********************************************************************************
|
||||
$max_online = $fcache->get('online');
|
||||
|
||||
$forum_config['_max_online_'] = $max_online['count'];
|
||||
|
||||
// ********************************************************************************
|
||||
// IF OFFLINE
|
||||
// ********************************************************************************
|
||||
if ($forum_config['offline'] AND !$user_group[$member_id['user_group']]['allow_offline'] AND !$ajax_start)
|
||||
{
|
||||
die ("<center><hr><h2>Forum - offline</h2><hr></center>");
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// REQUREST
|
||||
// ********************************************************************************
|
||||
if ($_REQUEST['category'])
|
||||
{
|
||||
$act = 'category';
|
||||
|
||||
$cid = intval($_REQUEST['category']);
|
||||
|
||||
$t_act = '?c' . $cid;
|
||||
}
|
||||
|
||||
if ($_REQUEST['showforum'])
|
||||
{
|
||||
$act = 'forum';
|
||||
|
||||
$fid = intval($_REQUEST['showforum']);
|
||||
|
||||
$t_act = '?f' . $fid;
|
||||
}
|
||||
|
||||
if ($_REQUEST['showtopic'])
|
||||
{
|
||||
$act = 'topic';
|
||||
|
||||
$tid = intval($_REQUEST['showtopic']);
|
||||
|
||||
$t_act = '?t' . $tid;
|
||||
}
|
||||
|
||||
if ($forum_config['sessions_log'] AND $act != 'forum' AND $act != 'topic' AND !$not_forum_sessions AND !$ajax_start)
|
||||
{
|
||||
forum_sessions();
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// TIME
|
||||
// ********************************************************************************
|
||||
$topic_a_time = time() - ($forum_config['topic_new_day'] * 86400);
|
||||
|
||||
if ($is_logged)
|
||||
{
|
||||
if (!$_SESSION['forum_last'])
|
||||
{
|
||||
@session_register('forum_last');
|
||||
|
||||
$_SESSION['forum_last'] = $member_id['forum_last'];
|
||||
|
||||
if (($member_id['forum_last'] + (3600*4)) < $_TIME)
|
||||
{
|
||||
$db->query("UPDATE LOW_PRIORITY " . USERPREFIX . "_users SET forum_last='{$_TIME}' where user_id={$member_id['user_id']}");
|
||||
}
|
||||
}
|
||||
|
||||
$lasttime = $_SESSION['forum_last'];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (!$_COOKIE['forum_last'])
|
||||
{
|
||||
set_cookie ('forum_last', $_TIME, 365);
|
||||
|
||||
$_COOKIE['forum_last'] = $_TIME;
|
||||
}
|
||||
|
||||
if (!$_SESSION['guest_forum_last'])
|
||||
{
|
||||
@session_register('guest_forum_last');
|
||||
|
||||
$_SESSION['guest_forum_last'] = $_COOKIE['forum_last'];
|
||||
|
||||
if (($_COOKIE['forum_last'] + (3600*4)) < $_TIME)
|
||||
{
|
||||
set_cookie ('forum_last', $_TIME, 365);
|
||||
}
|
||||
}
|
||||
|
||||
$lasttime = $_SESSION['guest_forum_last'];
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// Last Visit
|
||||
// ********************************************************************************
|
||||
if (!$act and $lasttime)
|
||||
{
|
||||
$dle_forum_last_visit = $f_lang['last_visit'] .' '. show_date ($lasttime);
|
||||
}
|
||||
else
|
||||
{
|
||||
$dle_forum_last_visit = "";
|
||||
}
|
||||
?>
|
||||
1
system/forum/sources/components/licence.odf
Normal file
159
system/forum/sources/components/navigation.php
Normal file
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/*
|
||||
=====================================================
|
||||
DLE Forum - by DLE Files Group
|
||||
-----------------------------------------------------
|
||||
http://dle-files.ru/
|
||||
-----------------------------------------------------
|
||||
File: navigation.php
|
||||
=====================================================
|
||||
Copyright (c) 2008,2010 DLE Files Group
|
||||
=====================================================
|
||||
*/
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
$tpl->load_template($tpl_dir.'navigation.tpl');
|
||||
|
||||
//----------------------------------
|
||||
// Previous
|
||||
//----------------------------------
|
||||
$no_prev = false;
|
||||
$no_next = false;
|
||||
|
||||
if(isset($cstart) and $cstart != "" and $cstart > 0)
|
||||
{
|
||||
$prev = $cstart / $config_inpage;
|
||||
|
||||
$tpl->set_block("'\[prev-link\](.*?)\[/prev-link\]'si", "<a href=\"".$icat."".$prev."/\">\\1</a>");
|
||||
}
|
||||
|
||||
else $tpl->set_block("'\[prev-link\](.*?)\[/prev-link\]'si", "\\1"); $no_prev = TRUE;
|
||||
|
||||
//----------------------------------
|
||||
// Pages
|
||||
//----------------------------------
|
||||
if($config_inpage)
|
||||
{
|
||||
if ($count_all > $config_inpage){$tpl_nav = true;} // tpl compile //
|
||||
|
||||
$pages_count = @ceil($count_all / $config_inpage);
|
||||
$pages_start_from = 0;
|
||||
$pages = "";
|
||||
$pages_per_section = 3;
|
||||
|
||||
if($pages_count > 10)
|
||||
{
|
||||
for($j = 1; $j <= $pages_per_section; $j++)
|
||||
{
|
||||
if($pages_start_from != $cstart)
|
||||
{
|
||||
$pages .= "<a href=\"".$icat."".$j."\">$j</a> ";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$pages .= " <span>$j</span> ";
|
||||
}
|
||||
|
||||
$pages_start_from += $config_inpage;
|
||||
}
|
||||
|
||||
if(((($cstart / $config_inpage) + 1) > 1) && ((($cstart / $config_inpage) + 1) < $pages_count))
|
||||
{
|
||||
$pages .= ((($cstart / $config_inpage) + 1) > ($pages_per_section + 2)) ? '... ' : ' ';
|
||||
$page_min = ((($cstart / $config_inpage) + 1) > ($pages_per_section + 1)) ? ($cstart / $config_inpage) : ($pages_per_section + 1);
|
||||
|
||||
$page_max = ((($cstart / $config_inpage) + 1) < ($pages_count - ($pages_per_section + 1))) ? (($cstart / $config_inpage) + 1) : $pages_count - ($pages_per_section + 1);
|
||||
|
||||
$pages_start_from = ($page_min - 1) * $config_inpage;
|
||||
|
||||
for($j = $page_min; $j < $page_max + ($pages_per_section - 1); $j++)
|
||||
{
|
||||
if($pages_start_from != $cstart)
|
||||
{
|
||||
$pages .= "<a href=\"".$icat."".$j."\">$j</a> ";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$pages .= " <span>$j</span> ";
|
||||
}
|
||||
|
||||
$pages_start_from += $config_inpage;
|
||||
}
|
||||
|
||||
$pages .= ((($cstart / $config_inpage) + 1) < $pages_count - ($pages_per_section + 1)) ? '... ' : ' ';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$pages .= '... ';
|
||||
}
|
||||
|
||||
$pages_start_from = ($pages_count - $pages_per_section) * $config_inpage;
|
||||
|
||||
for($j=($pages_count - ($pages_per_section - 1)); $j <= $pages_count; $j++)
|
||||
{
|
||||
if($pages_start_from != $cstart)
|
||||
{
|
||||
$pages .= "<a href=\"".$icat."".$j."\">$j</a> ";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$pages .= " <span>$j</span> ";
|
||||
}
|
||||
|
||||
$pages_start_from += $config_inpage;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
for($j=1;$j<=$pages_count;$j++)
|
||||
{
|
||||
if($pages_start_from != $cstart)
|
||||
{
|
||||
$pages .= "<a href=\"".$icat."".$j."\">$j</a> ";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$pages .= " <span>$j</span> ";
|
||||
}
|
||||
|
||||
$pages_start_from += $config_inpage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tpl->set('{pages}', $pages);
|
||||
|
||||
$tpl->set('{pages_count}', $pages_count);
|
||||
|
||||
$tpl->set_block("'\[page-link\](.*?)\[/page-link\]'si", "<a href=\"JavaScript:navigation('{$pages_count}', '{$icat}');\">\\1</a>");
|
||||
|
||||
//----------------------------------
|
||||
// Next
|
||||
//----------------------------------
|
||||
$i = (($cstart / $config_inpage));
|
||||
|
||||
if($i < $pages_count-1)
|
||||
{
|
||||
$next_page = $cstart / $config_inpage + 2;
|
||||
|
||||
$tpl->set_block("'\[next-link\](.*?)\[/next-link\]'si", "<a href=\"".$icat."".$next_page."/\">\\1</a>");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\[next-link\](.*?)\[/next-link\]'si", "\\1"); $no_next = TRUE;
|
||||
}
|
||||
|
||||
if ($tpl_nav){$tpl->compile('navigation');}
|
||||
|
||||
$tpl->clear();
|
||||
?>
|
||||
159
system/forum/sources/components/poll.php
Normal file
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
|
||||
$topic_id = $tid;
|
||||
|
||||
function get_votes ($all) {
|
||||
|
||||
$data = array();
|
||||
|
||||
if ($all != "") {
|
||||
$all = explode("|", $all);
|
||||
|
||||
foreach ($all as $vote) {
|
||||
list($answerid, $answervalue) = explode(":", $vote);
|
||||
$data[$answerid] = intval($answervalue);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
$_IP = $db->safesql($_SERVER['REMOTE_ADDR']);
|
||||
|
||||
if ($is_logged)
|
||||
$log_id = intval($member_id['user_id']);
|
||||
else
|
||||
$log_id = $_IP;
|
||||
|
||||
$log = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_poll_log WHERE topic_id = '$topic_id' AND member ='{$log_id}'");
|
||||
|
||||
$row_topic['poll_title'] = stripslashes($row_topic['poll_title']);
|
||||
$row_topic['frage'] = stripslashes($row_topic['frage']);
|
||||
$body = explode("<br />", stripslashes($row_topic['poll_body']));
|
||||
|
||||
$tpl->load_template($tpl_dir.'poll.tpl');
|
||||
|
||||
$tpl->set('{vote_title}', $row_topic['poll_title']);
|
||||
$tpl->set('{question}', $row_topic['frage']);
|
||||
$tpl->set('{vote_count}', $row_topic['poll_count']);
|
||||
|
||||
$list = "<div id=\"dle-poll-list\">";
|
||||
|
||||
if (!$log['count'] AND $check_write) {
|
||||
if (!$row_topic['multiple']){
|
||||
|
||||
for ($v = 0; $v < sizeof($body); $v++) {
|
||||
if (!$v) $sel = "checked"; else $sel = "";
|
||||
|
||||
$list .= <<<HTML
|
||||
<div><input name="dle_poll_votes" id="dle_poll_votes" type="radio" $sel value="{$v}"><label for="dle_poll_votes">{$body[$v]}</label></div>
|
||||
HTML;
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
for ($v = 0; $v < sizeof($body); $v++) {
|
||||
|
||||
$list .= <<<HTML
|
||||
<div><input name="dle_poll_votes[]" id="dle_poll_votes" type="checkbox" value="{$v}"><label for="dle_poll_votes">{$body[$v]}</label></div>
|
||||
HTML;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$allcount = 0;
|
||||
|
||||
} else {
|
||||
|
||||
$answer = get_votes ($row_topic['answer']);
|
||||
$allcount = $row_topic['poll_count'];
|
||||
$pn = 0;
|
||||
|
||||
for ($v = 0; $v < sizeof($body); $v++) {
|
||||
|
||||
$num = $answer[$v];
|
||||
++$pn; if ($pn > 5) $pn = 1;
|
||||
|
||||
if (!$num) $num = 0;
|
||||
|
||||
if ($allcount != 0) $proc = (100 * $num) / $allcount;
|
||||
else $proc = 0;
|
||||
|
||||
$proc = round($proc, 0);
|
||||
|
||||
$list .= <<<HTML
|
||||
{$body[$v]} - {$num} ({$proc}%)<br />
|
||||
<img src="{$config['http_home_url']}templates/{$config['skin']}/images/poll{$pn}.gif" height="10" width="{$proc}%" style="border:1px solid black"><br />
|
||||
HTML;
|
||||
|
||||
|
||||
}
|
||||
|
||||
$allcount = 1;
|
||||
|
||||
}
|
||||
|
||||
$list .= "</div>";
|
||||
|
||||
$tpl->set('{vote_body}',$list);
|
||||
|
||||
if (!defined('FORUM_SUB_DOMAIN'))
|
||||
{
|
||||
$ajax_poll_php = "system/forum/";
|
||||
}
|
||||
|
||||
$ajax_script = <<<HTML
|
||||
<script type="text/javascript">
|
||||
var dle_poll_result = 0;
|
||||
var dle_poll_voted = {$allcount};
|
||||
function doPoll( event ){
|
||||
|
||||
var frm = document.dlepollform;
|
||||
var vote_check = '';
|
||||
var topic_id = frm.topic_id.value;
|
||||
|
||||
if (dle_poll_voted == 1) { return; }
|
||||
|
||||
if (event != 'results' && dle_poll_result != 1) {
|
||||
for (var i=0;i < frm.elements.length;i++) {
|
||||
var elmnt = frm.elements[i];
|
||||
if (elmnt.type=='radio') {
|
||||
if(elmnt.checked == true){ vote_check = elmnt.value; break;}
|
||||
}
|
||||
if (elmnt.type=='checkbox') {
|
||||
if(elmnt.checked == true){ vote_check = vote_check + elmnt.value + ' ';}
|
||||
}
|
||||
}
|
||||
|
||||
if (event == 'vote' && vote_check == '') { alert ('{$lang['poll_failed']}'); return; }
|
||||
|
||||
dle_poll_voted = 1;
|
||||
|
||||
} else { dle_poll_result = 1; }
|
||||
|
||||
if (dle_poll_result == 1 && event == 'vote') { dle_poll_result = 0; event = 'list'; }
|
||||
|
||||
ShowLoading('');
|
||||
$.post(dle_root + "{$ajax_poll_php}ajax/poll.php", { vote_skin: "{$config['skin']}", topic_id: topic_id, action: event, answer: vote_check }, function(data){
|
||||
|
||||
HideLoading('');
|
||||
|
||||
$("#dle-poll-list").fadeOut(500, function() {
|
||||
$(this).html(data);
|
||||
$(this).fadeIn(500);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
$tpl->copy_template = $ajax_script."<form method=\"post\" name=\"dlepollform\" id=\"dlepollform\" action=\"\">".$tpl->copy_template."<input type=\"hidden\" name=\"topic_id\" id=\"topic_id\" value=\"".$topic_id."\" /></form>";
|
||||
|
||||
$tpl->compile('topic_poll');
|
||||
$tpl->clear();
|
||||
|
||||
?>
|
||||
124
system/forum/sources/components/text_skin.php
Normal file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
function tpl_main ($tpl){
|
||||
|
||||
global $config, $forum_config;
|
||||
|
||||
$textversion = <<<HTML
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset={$tpl['charset']}" />
|
||||
<link rel="stylesheet" rev="stylesheet" href="{$config['http_home_url']}/system/forum/textscreen.css" media="screen" />
|
||||
<title>{$tpl['title']}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id='wrapper'>
|
||||
<div id='largetext'>Ïîëíàÿ âåðñèÿ ýòîé ñòðàíèöû: <a href='{$tpl['full_version_link']}'>{$tpl['full_version']}</a></div>
|
||||
<div class='nav'>{$tpl['nav']}</div>
|
||||
{$tpl['pages']}
|
||||
<div id='content'>
|
||||
{$tpl['content']}
|
||||
</div>
|
||||
{$tpl['pages']}
|
||||
<div class='smalltext'>Äëÿ ïðîñìîòðà ïîëíîé âåðñèè ýòîé ñòðàíèöû, ïîæàëóéñòà, <a href='{$tpl['full_version_link']}'>ïðîéäèòå ïî ññûëêå</a>.</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
HTML;
|
||||
|
||||
echo $textversion;
|
||||
|
||||
}
|
||||
|
||||
function tpl_forums_page ($forums)
|
||||
{
|
||||
return <<<HTML
|
||||
<div class='forumwrap'>
|
||||
<ul>
|
||||
$forums
|
||||
</ul>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
function tpl_forum_page ($topics)
|
||||
{
|
||||
return <<<HTML
|
||||
<div class='topicwrap'>
|
||||
<ol>
|
||||
$topics
|
||||
</ol>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
function tpl_pages ($cstart, $count_all, $inpage, $url)
|
||||
{
|
||||
$pages_count = @ceil($count_all / $inpage);
|
||||
|
||||
$pages_start_from = 0;
|
||||
$pages = "";
|
||||
|
||||
for ($j=1; $j <= $pages_count; $j++)
|
||||
{
|
||||
if ($pages_start_from != $cstart)
|
||||
{
|
||||
$pages .= "<a href=\"{$url}-{$j}\">{$j}</a> ";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$pages .= " <b>{$j}</b> ";
|
||||
}
|
||||
|
||||
$pages_start_from += $inpage;
|
||||
}
|
||||
|
||||
return ("<div class='pagespan'><b>Ñòðàíèöû:</b> {$pages}</div>");
|
||||
}
|
||||
|
||||
function tpl_category ($id, $name)
|
||||
{
|
||||
return ("\n<li><strong><a href='?c{$id}'>{$name}</a></strong></li>\n<ul>");
|
||||
}
|
||||
|
||||
function tpl_category_end ()
|
||||
{
|
||||
return ("\n</ul></li>");
|
||||
}
|
||||
|
||||
function tpl_forum ($id, $name, $post, $sub = false)
|
||||
{
|
||||
if ($sub)
|
||||
{
|
||||
$sub_tpl = "\n<li><ul>{$sub}</ul></li>\n";
|
||||
}
|
||||
|
||||
return ("\n<li><a href='?f{$id}'>{$name}</a> <span class='desc'>({$post} ñîîáùåíèé)</span></li>".$sub_tpl);
|
||||
}
|
||||
|
||||
function tpl_forum_sub ($id, $name)
|
||||
{
|
||||
return ("\n<li><a href='?f{$id}'>{$name}</a></li>");
|
||||
}
|
||||
|
||||
function tpl_post ($post, $author, $date)
|
||||
{
|
||||
return <<<HTML
|
||||
<div class='postwrapper'>
|
||||
<div class='posttopbar'>
|
||||
<div class='postname'>{$author}</div>
|
||||
<div class='postdate'>{$date}</div>
|
||||
</div>
|
||||
<div class='postcontent'>{$post}</div>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
function tpl_topic_list ($id, $n_pre, $name, $post)
|
||||
{
|
||||
return ("\n<li>{$n_pre}<a href='?t{$id}'>{$name}</a> <span class='desc'>({$post} îòâåòîâ)</span></li>");
|
||||
}
|
||||
|
||||
?>
|
||||
96
system/forum/sources/modules/getnew.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
|
||||
if ($is_logged)
|
||||
{
|
||||
if ($_REQUEST['code'] == "01")
|
||||
{
|
||||
$db->query("UPDATE " . PREFIX . "_users SET forum_last = '$_TIME', forum_time = '$_TIME' WHERE name = '$member_id[name]'");
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_views WHERE user_id = '$member_id[user_id]'");
|
||||
|
||||
$_SESSION['forum_last'] = $_TIME;
|
||||
|
||||
@header("Location: {$forum_url}");
|
||||
}
|
||||
|
||||
if ($cstart)
|
||||
{
|
||||
$cstart = $cstart - 1;
|
||||
$cstart = $cstart * $forum_config['topic_inpage'];
|
||||
}
|
||||
|
||||
$row_views = $db->query("SELECT topic_id FROM " . PREFIX . "_forum_views WHERE user_id = '$member_id[user_id]'");
|
||||
|
||||
$topic_views = array();
|
||||
|
||||
while ($row = $db->get_row($row_views))
|
||||
{
|
||||
$topic_views[$row['topic_id']] = '1';
|
||||
}
|
||||
|
||||
$config_inpage = $forum_config['topic_inpage'];
|
||||
|
||||
$result_topics = $db->query("SELECT * FROM " . PREFIX . "_forum_topics WHERE UNIX_TIMESTAMP(last_date) > '$lasttime' and hidden = 0 LIMIT ".$cstart.",".$forum_config['topic_inpage']."");
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/showtopics.php';
|
||||
|
||||
if (!$is_topics)
|
||||
{
|
||||
$msg_info = $f_lang['is_topics'];
|
||||
}
|
||||
|
||||
$get_count = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_topics WHERE UNIX_TIMESTAMP(last_date) > '$lasttime' and hidden = 0");
|
||||
|
||||
$count_all = $get_count['count'];
|
||||
|
||||
$icat = $forum_url."/getnew/";
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/navigation.php';
|
||||
|
||||
$tpl->load_template($tpl_dir.'forum.tpl');
|
||||
|
||||
$tpl->set('{banner}', '');
|
||||
|
||||
$tpl->set('{forum}', $f_lang['getnew_title']);
|
||||
|
||||
$tpl->set('{subforums}','');
|
||||
|
||||
$tpl->set('{topics}', $tpl->result['topics']);
|
||||
|
||||
$tpl->set('{info}', $msg_info);
|
||||
|
||||
$tpl->set('{navigation}', $tpl->result['navigation']);
|
||||
|
||||
$all_read_link = "<a href=\"{$a_forum_url}act=getnew&code=01\">{$f_lang['all_read_link']}</a>";
|
||||
|
||||
$tpl->set_block("'\\[options\\](.*?)\\[/options\\]'si", $all_read_link);
|
||||
|
||||
$tpl->set_block("'\\[rules\\](.*?)\\[/rules\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[new_topic\\](.*?)\\[/new_topic\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[selected\\](.*?)\\[/selected\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[fast-search\\](.*?)\\[/fast-search\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[moderation\\](.*?)\\[/moderation\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si","");
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
|
||||
$tpl->clear();
|
||||
|
||||
}
|
||||
|
||||
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['app_getnew'];
|
||||
|
||||
?>
|
||||
250
system/forum/sources/modules/search.php
Normal file
@@ -0,0 +1,250 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
if (isset($_REQUEST['search_text']))
|
||||
{
|
||||
$search_text = substr ( strip_data( $_REQUEST['search_text'] ), 0, 90 );
|
||||
|
||||
$search_text_explode = explode (' ', $search_text);
|
||||
|
||||
if (count($search_text_explode))
|
||||
{
|
||||
foreach ($search_text_explode as $key => $value)
|
||||
{
|
||||
$value = trim ($value);
|
||||
|
||||
if ($value !== "" and strlen($value) > 3)
|
||||
{
|
||||
$search_text_array[] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($search_text_array))
|
||||
{
|
||||
$search_list = implode('|', $search_text_array);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$search_fid = $_REQUEST['search_fid'];
|
||||
|
||||
$count_all = intval($_REQUEST['count_all']);
|
||||
|
||||
if ($forum_config['search_captcha'])
|
||||
{
|
||||
$search_captcha = check_access($forum_config['search_captcha']);
|
||||
}
|
||||
|
||||
if ($search_captcha)
|
||||
{
|
||||
if ($_REQUEST['sec_code'])
|
||||
{
|
||||
$_SESSION['captcha_search'] = $_REQUEST['sec_code'];
|
||||
}
|
||||
|
||||
if ($_SESSION['captcha_search'] == $_SESSION['sec_code_session'])
|
||||
{
|
||||
$search_captcha_true = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$search_captcha_true = TRUE;
|
||||
}
|
||||
|
||||
if ($search_list AND $search_captcha_true)
|
||||
{
|
||||
if ($search_fid)
|
||||
{
|
||||
$_SESSION['search_fid'] = $search_fid;
|
||||
}
|
||||
|
||||
if ($is_logged)
|
||||
{
|
||||
$row_views = $db->query("SELECT topic_id FROM " . PREFIX . "_forum_views WHERE user_id = '$member_id[user_id]'");
|
||||
|
||||
$topic_views = array();
|
||||
|
||||
while ($row = $db->get_row($row_views))
|
||||
{
|
||||
$topic_views[$row['topic_id']] = '1';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$row_views = explode(",", $_COOKIE['dle_forum_views']);
|
||||
|
||||
foreach ($row_views as $value)
|
||||
{
|
||||
$topic_views[$value] = '1';
|
||||
}
|
||||
}
|
||||
|
||||
if ($cstart){
|
||||
$cstart = $cstart - 1;
|
||||
$cstart = $cstart * $forum_config['topic_inpage'];
|
||||
}
|
||||
|
||||
$config_inpage = $forum_config['topic_inpage'];
|
||||
|
||||
if ($search_fid)
|
||||
{
|
||||
if (is_array($search_fid))
|
||||
{
|
||||
$hole_arr = array();
|
||||
foreach ($search_fid as $hole)
|
||||
{
|
||||
$hole_arr[] = intval($hole);
|
||||
}
|
||||
$fid_list = implode(',', $hole_arr);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$fid_list = intval($search_fid);
|
||||
}
|
||||
}
|
||||
|
||||
$fid_q = $fid_list ? "and forum_id IN ({$fid_list}) " : "";
|
||||
|
||||
if ($_REQUEST['search_in'] == "titles")
|
||||
{
|
||||
$mysql_query = "SELECT * FROM " . PREFIX . "_forum_topics
|
||||
WHERE title REGEXP ('$search_list') ".$fid_q."and hidden = 0
|
||||
OR topic_descr REGEXP ('$search_list') ".$fid_q."and hidden = 0";
|
||||
|
||||
$count_query = "SELECT COUNT(tid) as count FROM " . PREFIX . "_forum_topics
|
||||
WHERE title REGEXP ('$search_list') ".$fid_q."and hidden = 0
|
||||
OR topic_descr REGEXP ('$search_list') ".$fid_q."and hidden = 0";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$mysql_query = "SELECT p.*, t.* FROM " . PREFIX . "_forum_posts AS p LEFT JOIN " . PREFIX . "_forum_topics AS t ON t.tid = p.topic_id
|
||||
WHERE p.post_text REGEXP ('$search_list') ".$fid_q."and p.hidden = 0 GROUP BY t.tid";
|
||||
|
||||
$count_query = "SELECT SQL_CALC_FOUND_ROWS * FROM " . PREFIX . "_forum_posts AS p LEFT JOIN " . PREFIX . "_forum_topics AS t
|
||||
ON t.tid = p.topic_id
|
||||
WHERE p.post_text REGEXP ('$search_list') ".$fid_q."and p.hidden = 0 GROUP BY t.tid";
|
||||
}
|
||||
|
||||
$result_topics = $db->query("" . $mysql_query . " LIMIT ".$cstart.",".$forum_config['topic_inpage']."");
|
||||
|
||||
if (!$count_all)
|
||||
{
|
||||
if ($_REQUEST['search_in'] == "titles")
|
||||
{
|
||||
$count_get = $db->super_query ($count_query);
|
||||
|
||||
$count_all = $count_get['count'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$count_all = $db->num_rows($db->query($count_query));
|
||||
}
|
||||
}
|
||||
|
||||
if ($count_all){
|
||||
|
||||
if ($forum_config['mod_rewrite'])
|
||||
{
|
||||
$icat = $forum_url . "/search/" . $count_all . "-" . urlencode($search_text) ."/";
|
||||
}
|
||||
else
|
||||
{
|
||||
$icat = $forum_url."act=search&count_all=".$count_all."&search_text=".urlencode($search_text)."&cstart=";
|
||||
}
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/showtopics.php';
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/navigation.php';
|
||||
|
||||
$tpl->load_template($tpl_dir.'forum.tpl');
|
||||
|
||||
$tpl->set('{forum}', $f_lang['search_result']);
|
||||
|
||||
$tpl->set('{subforums}','');
|
||||
|
||||
$tpl->set('{topics}', $tpl->result['topics']);
|
||||
|
||||
$tpl->set('{info}', $msg_info);
|
||||
|
||||
$tpl->set('{navigation}', $tpl->result['navigation']);
|
||||
|
||||
$tpl->set_block("'\\[options\\](.*?)\\[/options\\]'si", '');
|
||||
|
||||
$tpl->set_block("'\\[rules\\](.*?)\\[/rules\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[new_topic\\](.*?)\\[/new_topic\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[selected\\](.*?)\\[/selected\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[fast-search\\](.*?)\\[/fast-search\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[moderation\\](.*?)\\[/moderation\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si","");
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
|
||||
$tpl->clear();
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['search_nresult']);
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($_REQUEST['search_text'] and $search_maxlen)
|
||||
{
|
||||
forum_msg($f_lang['f_msg'], $f_lang['search_error']);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$_SESSION['search_fid'] = "";
|
||||
|
||||
$tpl->load_template($tpl_dir.'search.tpl');
|
||||
|
||||
$tpl->copy_template = "<form method=\"post\" action=\"\">".$tpl->copy_template."</form>";
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_category LEFT JOIN ". PREFIX ."_forum_forums ON ". PREFIX ."_forum_category.sid=". PREFIX ."_forum_forums.main_id ORDER BY posi, position");
|
||||
|
||||
$select_list = "<select name='search_fid[]' size='10' multiple='multiple'>";
|
||||
|
||||
$select_list .= "<option value='0' selected='selected'>» Âñå ôîðóìû</option>";
|
||||
|
||||
for ($i = 0, $totalcount = 0; $row = $db->get_row($result); $i = $row['sid'], $chcount++)
|
||||
{
|
||||
if ($row['sid'] != $i)
|
||||
{
|
||||
$row['cat_name'] = stripslashes($row['cat_name']);
|
||||
|
||||
$select_list .= "<optgroup label=\"{$row['cat_name']}\">";
|
||||
}
|
||||
|
||||
if ($row['name'])
|
||||
{
|
||||
$row['name'] = stripslashes($row['name']);
|
||||
|
||||
$select_list .= "<option value=\"{$row['id']}\"> -- {$row['name']}</option>";
|
||||
}
|
||||
}
|
||||
|
||||
$select_list .= "</select>";
|
||||
|
||||
$tpl->set('{forum_select}',$select_list);
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
$bbr_app = $f_lang['app_search'];
|
||||
|
||||
?>
|
||||
113
system/forum/sources/modules/stats.php
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
$act = $_REQUEST['act'];
|
||||
|
||||
if ($forum_config['stats'] AND !$act)
|
||||
{
|
||||
$stats_array = array();
|
||||
|
||||
$today_date = date('d');;
|
||||
|
||||
$stats_array = $fcache->get('stats');
|
||||
|
||||
if (!$stats_array OR $stats_array['date'] != $today_date)
|
||||
{
|
||||
$stats_array = FALSE;
|
||||
|
||||
$stats_array = array();
|
||||
|
||||
$row_post = $db->super_query("SELECT COUNT(pid) as count FROM " . PREFIX . "_forum_posts");
|
||||
|
||||
$stats_array['posts'] = $row_post['count'];
|
||||
|
||||
$row_topic = $db->super_query("SELECT COUNT(tid) as count FROM " . PREFIX . "_forum_topics");
|
||||
|
||||
$stats_array['topics'] = $row_topic['count'];
|
||||
|
||||
$row_users_reg = $db->super_query("SELECT COUNT(user_id) as count FROM " . PREFIX . "_users");
|
||||
|
||||
$stats_array['users_reg'] = $row_users_reg['count'];
|
||||
|
||||
$row_users = $db->super_query("SELECT COUNT(user_id) as count FROM " . PREFIX . "_users WHERE forum_post");
|
||||
|
||||
$stats_array['users'] = $row_users['count'];
|
||||
|
||||
$result_users = $db->query("SELECT * FROM " . PREFIX . "_users WHERE forum_post ORDER BY forum_post DESC LIMIT 10");
|
||||
|
||||
while ($row = $db->get_row($result_users))
|
||||
{
|
||||
$top_count++;
|
||||
|
||||
if ($top_count > 1)
|
||||
{
|
||||
$symbol = ", ";
|
||||
}
|
||||
|
||||
$group_span = $user_group[$row['user_group']]['colour'];
|
||||
|
||||
$a_top_users = "{$config['http_home_url']}user/".urlencode($row['name'])."/";
|
||||
|
||||
$stats_array['top_users'] .= $symbol."<a href=\"{$a_top_users}\"><span style=\"color:{$group_span}\">$row[name]</span></a>";
|
||||
}
|
||||
|
||||
if (!$stats_array['top_users'])
|
||||
{
|
||||
$stats_array['top_users'] = "--";
|
||||
}
|
||||
|
||||
$stats_array['date'] = $today_date;
|
||||
|
||||
$last_user_row = $db->super_query("SELECT * FROM " . PREFIX . "_users ORDER BY user_id DESC LIMIT 1");
|
||||
|
||||
$stats_array['last_user'] = link_user($last_user_row['name']);
|
||||
|
||||
$stats_array['max_online'] = $max_online['count'];
|
||||
$stats_array['max_online_time'] = langdate('j F Y, H:i', $max_online['time']);
|
||||
|
||||
$fcache->set('stats', $stats_array);
|
||||
}
|
||||
|
||||
// tpl compile //
|
||||
$tpl->load_template($tpl_dir.'stats.tpl');
|
||||
|
||||
if ($forum_config['online'] and $forum_config['sessions_log'])
|
||||
{
|
||||
get_forum_online();
|
||||
|
||||
$tpl->set('[online-stats]','');
|
||||
$tpl->set('[/online-stats]','');
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\\[online-stats\\](.*?)\\[/online-stats\\]'si","");
|
||||
}
|
||||
|
||||
$tpl->set('{post-num}', $stats_array['posts']);
|
||||
$tpl->set('{topic-num}', $stats_array['topics']);
|
||||
$tpl->set('{all-users}', $stats_array['users_reg']);
|
||||
$tpl->set('{forum-users}', $stats_array['users']);
|
||||
$tpl->set('{top-users}', $stats_array['top_users']);
|
||||
|
||||
$tpl->set('{online-num}', $forum_online['all_count']);
|
||||
$tpl->set('{member_count}', $forum_online['member_count']);
|
||||
$tpl->set('{guest_count}', $forum_online['guest_count']);
|
||||
$tpl->set('{online_time}', $forum_config['session_time']);
|
||||
|
||||
if (!$forum_online['member_list'])
|
||||
{
|
||||
$forum_online['member_list'] = ""; // default value: --
|
||||
}
|
||||
|
||||
$tpl->set('{member_online}', $forum_online['member_list']);
|
||||
|
||||
$tpl->set('{last_user}', $stats_array['last_user']);
|
||||
$tpl->set('{max_online}', $stats_array['max_online']);
|
||||
$tpl->set('{max_online_time}', $stats_array['max_online_time']);
|
||||
|
||||
$tpl->compile('forum_stats');
|
||||
$tpl->clear();
|
||||
}
|
||||
?>
|
||||
154
system/forum/sources/modules/subscription.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
$code = $_REQUEST['code'];
|
||||
|
||||
$tid = intval($_REQUEST['tid']);
|
||||
|
||||
$selected_id = $_REQUEST['selected_id'];
|
||||
|
||||
if ($is_logged)
|
||||
{
|
||||
switch ($code)
|
||||
{
|
||||
// ********************************************************************************
|
||||
// ADD
|
||||
// ********************************************************************************
|
||||
case "add":
|
||||
|
||||
$db->query("SELECT * FROM " . PREFIX . "_forum_subscription WHERE topic_id = '$tid' and user_id = '{$member_id['user_id']}'");
|
||||
|
||||
if (!$db->num_rows() and $tid)
|
||||
{
|
||||
$db->query("INSERT INTO " . PREFIX . "_forum_subscription (user_id, topic_id) values ('{$member_id['user_id']}', '$tid')");
|
||||
}
|
||||
|
||||
header("Location: $_SERVER[HTTP_REFERER]");
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// DEL
|
||||
// ********************************************************************************
|
||||
case "del":
|
||||
|
||||
if ($selected_id)
|
||||
{
|
||||
$selected_id = explode(",", $selected_id);
|
||||
|
||||
foreach ($selected_id as $topic_id)
|
||||
{
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_subscription WHERE topic_id = '$topic_id' and user_id = '{$member_id['user_id']}'");
|
||||
}
|
||||
}
|
||||
|
||||
header("Location: $_SERVER[HTTP_REFERER]");
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// SUBSCRIPTION
|
||||
// ********************************************************************************
|
||||
default:
|
||||
|
||||
if ($cstart)
|
||||
{
|
||||
$cstart = $cstart - 1;
|
||||
$cstart = $cstart * $forum_config['topic_inpage'];
|
||||
}
|
||||
|
||||
if ($forum_config['topic_sort'])
|
||||
{
|
||||
$sort_type = "last_date";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$sort_type = "tid";
|
||||
}
|
||||
|
||||
$row_views = $db->query("SELECT topic_id FROM " . PREFIX . "_forum_views WHERE user_id = '$member_id[user_id]'");
|
||||
|
||||
$topic_views = array();
|
||||
|
||||
while ($row = $db->get_row($row_views))
|
||||
{
|
||||
$topic_views[$row['topic_id']] = '1';
|
||||
}
|
||||
|
||||
$config_inpage = $forum_config['topic_inpage'];
|
||||
|
||||
$result_count = $db->super_query("SELECT count(*) as count FROM " . PREFIX . "_forum_subscription LEFT JOIN " . PREFIX . "_forum_topics ON " . PREFIX . "_forum_subscription.topic_id = " . PREFIX . "_forum_topics.tid WHERE " . PREFIX . "_forum_subscription.user_id = '{$member_id['user_id']}'");
|
||||
|
||||
$result_topics = $db->query("SELECT * FROM " . PREFIX . "_forum_subscription LEFT JOIN " . PREFIX . "_forum_topics ON " . PREFIX . "_forum_subscription.topic_id = " . PREFIX . "_forum_topics.tid WHERE " . PREFIX . "_forum_subscription.user_id = '{$member_id['user_id']}'");
|
||||
|
||||
$mass_prune = true;
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/showtopics.php';
|
||||
|
||||
if (!$is_topics)
|
||||
{
|
||||
$msg_info = $f_lang['subscr_not'];
|
||||
}
|
||||
|
||||
$tpl->load_template($tpl_dir.'forum.tpl');
|
||||
|
||||
$tpl->set('{banner}', '');
|
||||
|
||||
$tpl->set('{forum}', $f_lang['app_subscr']);
|
||||
|
||||
$tpl->set('{subforums}','');
|
||||
|
||||
$tpl->set('{topics}', $tpl->result['topics']);
|
||||
|
||||
$tpl->set('{info}', $msg_info);
|
||||
|
||||
$tpl->set('{navigation}', $tpl->result['navigation']);
|
||||
|
||||
$tpl->set_block("'\\[options\\](.*?)\\[/options\\]'si","");
|
||||
|
||||
$tpl->set('[selected]',"");
|
||||
$tpl->set('[/selected]',"");
|
||||
|
||||
$tpl->set_block("'\\[rules\\](.*?)\\[/rules\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[new_topic\\](.*?)\\[/new_topic\\]'si","");
|
||||
|
||||
$tpl->set_block("'\\[fast-search\\](.*?)\\[/fast-search\\]'si","");
|
||||
|
||||
$tpl->set('[moderation]',"<form name=\"modform\" method=\"post\" action=\"\">"); //{$a_forum_url}act=subscription
|
||||
$moderation = "<select name=\"code\">";
|
||||
|
||||
$moderation .= "<option value=\"del\">Îòïèñàòüñÿ</option>";
|
||||
|
||||
$moderation .= "</select>";
|
||||
|
||||
$tpl->set('{moderation}', $moderation);
|
||||
|
||||
$tpl->set('[/moderation]',"<input type=\"hidden\" value=\"\" name=\"selected_id\" /></form>");
|
||||
|
||||
$tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si","");
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
|
||||
$tpl->clear();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if ($forum_config['forum_bar'])
|
||||
{
|
||||
$bbr_app = $f_lang['app_subscr'];
|
||||
}
|
||||
?>
|
||||
375
system/forum/sources/modules/uploads.php
Normal file
@@ -0,0 +1,375 @@
|
||||
<?php
|
||||
@session_start();
|
||||
|
||||
error_reporting(7);
|
||||
|
||||
ini_set('display_errors', true);
|
||||
ini_set('html_errors', false);
|
||||
|
||||
define('DATALIFEENGINE', true);
|
||||
define('ROOT_DIR', '../../../..');
|
||||
define('SYSTEM_DIR', ROOT_DIR.'/system');
|
||||
|
||||
define('UPLOAD_DIR', ROOT_DIR."/uploads/forum/");
|
||||
|
||||
require SYSTEM_DIR."/data/config.php";
|
||||
require_once SYSTEM_DIR.'/classes/mysql.php';
|
||||
require_once SYSTEM_DIR."/data/dbconfig.php";
|
||||
require_once SYSTEM_DIR."/modules/functions.php";
|
||||
|
||||
require_once SYSTEM_DIR.'/data/forum_config.php';
|
||||
|
||||
$allowed_video = array("avi", "mp4", "wmv", "mpg", "flv");
|
||||
|
||||
// ********************************************************************************
|
||||
// File Type
|
||||
// ********************************************************************************
|
||||
function file_type($name){
|
||||
$type = explode ('.', $name);
|
||||
$type = end ($type);
|
||||
return ($type);
|
||||
}
|
||||
|
||||
check_xss ();
|
||||
|
||||
$area = $_REQUEST['area'];
|
||||
|
||||
$do = $_REQUEST['do'];
|
||||
|
||||
$fid = intval($_REQUEST['fid']);
|
||||
|
||||
$tid = intval($_REQUEST['tid']);
|
||||
|
||||
$pid = intval($_REQUEST['pid']);
|
||||
|
||||
$del = $_REQUEST['del'];
|
||||
|
||||
$user_group = $cache->get ("usergroup");
|
||||
|
||||
if (!$user_group) {
|
||||
$user_group = array ();
|
||||
|
||||
$db->query("SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC");
|
||||
|
||||
while($row = $db->get_row()){
|
||||
|
||||
$user_group[$row['id']] = array ();
|
||||
|
||||
foreach ($row as $key => $value)
|
||||
{
|
||||
$user_group[$row['id']][$key] = $value;
|
||||
}
|
||||
|
||||
}
|
||||
$cache->set ("usergroup", $user_group);
|
||||
$db->free();
|
||||
}
|
||||
|
||||
include_once SYSTEM_DIR.'/modules/sitelogin.php';
|
||||
$result = $db->super_query("SELECT * FROM " . PREFIX . "_forum_forums WHERE id = '$fid'");
|
||||
$access_upload = $result['access_upload'];
|
||||
$access_upload = explode(":", $access_upload);
|
||||
if (!in_array($member_id['user_group'], $access_upload)){die("Hacking attempt!");}
|
||||
$access_mod = $result['access_mod'];
|
||||
$access_mod = explode(":", $access_mod);
|
||||
|
||||
if (!in_array($member_id['user_group'], $access_mod))
|
||||
{
|
||||
$db_file_author = " AND file_author = '{$member_id['name']}'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$db_file_author = "";
|
||||
}
|
||||
|
||||
$forum_config['tools_upload'] = explode (':', $forum_config['tools_upload']);
|
||||
|
||||
if ($forum_config['tools_upload'])
|
||||
{
|
||||
if (in_array($member_id['user_group'], $forum_config['tools_upload']))
|
||||
{
|
||||
$upload_file_access = TRUE;
|
||||
} else
|
||||
{
|
||||
$upload_file_access = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// TPL //
|
||||
echo <<<HTML
|
||||
<html>
|
||||
<head>
|
||||
<title>Uploads</title>
|
||||
</head>
|
||||
<style type="text/css" media="all">
|
||||
.dle_forum {
|
||||
background-color: #FFF;
|
||||
font-family: verdana;
|
||||
font-size: 11px;
|
||||
color: #222;
|
||||
}
|
||||
.dle_forum a:link, .dle_forum a:active, .dle_forum a:visited {
|
||||
color: #222;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.dle_forum a:hover {
|
||||
color: #34498B;
|
||||
}
|
||||
.button {
|
||||
background-color: #fff;
|
||||
border: 1px solid #B4B4B4;
|
||||
color: #000;
|
||||
font-family: verdana;
|
||||
font-size: 11px;
|
||||
padding: 1px;
|
||||
}
|
||||
.forum_input {
|
||||
background-color: #fff;
|
||||
border: 1px solid #B4B4B4;
|
||||
color: #000;
|
||||
font-family: verdana;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
<body class="dle_forum">
|
||||
HTML;
|
||||
|
||||
echo <<<HTML
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
function insertfile(selected_id)
|
||||
{
|
||||
attachment = "[attachment=" + selected_id + "]";
|
||||
parent.doInsert(attachment, '', false); window.focus();
|
||||
};
|
||||
|
||||
function insertaudio(onserver)
|
||||
{
|
||||
audio = "[audio=" + onserver + "]";
|
||||
parent.doInsert(audio, '', false); window.focus();
|
||||
};
|
||||
|
||||
function insertvideo(onserver)
|
||||
{
|
||||
video = "[video=" + onserver + "]";
|
||||
parent.doInsert(video, '', false); window.focus();
|
||||
};
|
||||
|
||||
</script>
|
||||
HTML;
|
||||
|
||||
$DIR = 0;
|
||||
$is_file = 0;
|
||||
$is_image = 0;
|
||||
|
||||
$send_link = "?area=$area&fid=$fid&tid=$tid&pid=$pid";
|
||||
$maxupload = mksize($forum_config['img_size']*1024);
|
||||
|
||||
if ($do == "add")
|
||||
{
|
||||
$allowed_images = array("gif", "jpg", "png", "jpe", "jpeg");
|
||||
$allowed_files = explode(',', $forum_config['upload_type']);
|
||||
|
||||
$file_name = totranslit($_FILES['attachment']['name']);
|
||||
|
||||
$file_explode = explode(".",$file_name);
|
||||
$file_type = strtolower(end($file_explode));
|
||||
$attachment_size = $_FILES['attachment']['size'];
|
||||
|
||||
if (in_array($file_type, $allowed_images) AND $forum_config['img_upload']){
|
||||
if ($attachment_size < ($forum_config['img_size']*1024)){
|
||||
$is_image = TRUE;
|
||||
$DIR = "images/";
|
||||
}else{
|
||||
$image_size_error = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($file_type, $allowed_files) AND $upload_file_access){
|
||||
$is_file = TRUE;
|
||||
$DIR = "files/";
|
||||
}
|
||||
|
||||
if ($is_file OR $is_image){
|
||||
$uploadfile = UPLOAD_DIR.$DIR.basename($file_name);
|
||||
|
||||
if (move_uploaded_file($_FILES['attachment']['tmp_name'], $uploadfile)){
|
||||
$file_name = totranslit($_FILES['attachment']['name']);
|
||||
$file_size = $_FILES['attachment']['size'];
|
||||
}
|
||||
|
||||
if (file_exists(UPLOAD_DIR . $DIR . $file_name)){
|
||||
|
||||
if ($is_file){
|
||||
$ftype = 'file';
|
||||
$file_rename = time()."_".totranslit($file_name);
|
||||
}else{
|
||||
$ftype = 'image';
|
||||
$file_rename = time().".".$file_type;
|
||||
}
|
||||
|
||||
rename(UPLOAD_DIR . $DIR . $file_name, UPLOAD_DIR . $DIR . $file_rename);
|
||||
|
||||
if ($is_image)
|
||||
{
|
||||
include_once SYSTEM_DIR.'/classes/thumb.class.php';
|
||||
|
||||
$thumb = new thumbnail(UPLOAD_DIR.$DIR.$file_rename);
|
||||
|
||||
if ($thumb->size_auto($forum_config['thumb_size']))
|
||||
{
|
||||
$thumb->jpeg_quality($forum_config['jpeg_quality']);
|
||||
|
||||
$thumb->save(UPLOAD_DIR."thumbs/".$file_rename);
|
||||
|
||||
$ftype = 'thumb';
|
||||
|
||||
@chmod (UPLOAD_DIR."thumbs/".$file_rename, 0666);
|
||||
}
|
||||
}
|
||||
|
||||
$db->query("INSERT INTO " . PREFIX . "_forum_files (file_type, forum_id, topic_id, post_id, file_name, onserver, file_author, file_date, file_size) values ('$ftype', '$fid', '$tid', '$pid', '$file_name', '$file_rename', '$member_id[name]' , '".time()."', '$file_size')");
|
||||
|
||||
@chmod (UPLOAD_DIR.$DIR.$file_rename, 0666);
|
||||
|
||||
$upload_info = "<font color=\"green\">Ôàéë <b>$file_name</b> çàãðóæåí.</font>";
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$upload_info = "<font color=\"red\">Íåâîçìîæíî çàãðóçèòü ôàéë íà ñåðâåð!</font>";
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ($image_size_error)
|
||||
{
|
||||
$upload_info = "<font color=\"red\">Ñëèøêîì áîëüøîå èçîáðàæåíèå!</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$upload_info = "<font color=\"red\">Íå äîïóñòèìûé ôîðìàò ôàéëà!</font>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($do == "del" and $del)
|
||||
{
|
||||
foreach ($del as $file_id)
|
||||
{
|
||||
$file_id = intval($file_id);
|
||||
if ($file_id) $del_id[$file_id] = $file_id;
|
||||
}
|
||||
|
||||
$del_list = implode(',', $del_id);
|
||||
|
||||
$result = $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE file_id IN ({$del_list})".$db_file_author);
|
||||
|
||||
while ($row = $db->get_row($result))
|
||||
{
|
||||
if ($row['file_type'] == "file")
|
||||
{
|
||||
unlink(UPLOAD_DIR."files/".$row['onserver']);
|
||||
}
|
||||
|
||||
elseif ($row['file_type'] == "thumb")
|
||||
{
|
||||
unlink(UPLOAD_DIR."thumbs/".$row['onserver']);
|
||||
|
||||
unlink(UPLOAD_DIR."images/".$row['onserver']);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
unlink(UPLOAD_DIR."images/".$row['onserver']);
|
||||
}
|
||||
|
||||
$db->query("DELETE FROM " . PREFIX . "_forum_files WHERE file_id = '$row[file_id]' LIMIT 1");
|
||||
}
|
||||
}
|
||||
|
||||
echo "<fieldset>";
|
||||
|
||||
echo "<form method=\"post\" enctype=\"multipart/form-data\" action=\"$send_link&do=add\"><br />";
|
||||
|
||||
echo "<input class=\"forum_input\" name=\"attachment\" type=\"file\" style=\"width:200px\" />";
|
||||
|
||||
echo " ";
|
||||
|
||||
echo "<input class=\"button\" value=\"Çàãðóçèòü\" type=\"submit\" style=\"background-color:#53E490;\" />";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
if (!$upload_info) $upload_info = "Ìàêñèìàëüíûé ðàçìåð äëÿ îäíîãî ôàéëà: <b>$maxupload</b>";
|
||||
|
||||
echo "<p>$upload_info</p>";
|
||||
|
||||
echo "</fieldset><br />";
|
||||
|
||||
echo "<fieldset><legend><strong>Çàãðóæåííûå ôàéëû</strong></legend>";
|
||||
|
||||
echo "<form method=\"post\" enctype=\"multipart/form-data\" action=\"$send_link&do=del\">";
|
||||
|
||||
echo "<table class=\"dle_forum\" width=\"100%\">";
|
||||
|
||||
$db->query("SELECT * FROM " . PREFIX . "_forum_files
|
||||
WHERE topic_id = '$tid' AND file_attach = '0'".$db_file_author." OR post_id = '$pid'".$db_file_author);
|
||||
|
||||
while ($row = $db->get_row())
|
||||
{
|
||||
$file_title = mksize($row['file_size'])." (Çàãðóçèë: {$row['file_author']})";
|
||||
|
||||
$on_server = $config['http_home_url'].'uploads/forum/files/'.$row['onserver'];
|
||||
|
||||
$type = file_type($row['onserver']);
|
||||
|
||||
if ($type == 'mp3')
|
||||
{
|
||||
$insert_ob = " <a OnClick=\"insertaudio('".$on_server."')\" href=\"#\">[audio]</a>";
|
||||
}
|
||||
elseif(in_array($type, $allowed_video))
|
||||
{
|
||||
$insert_ob = " <a OnClick=\"insertvideo('".$on_server."')\" href=\"#\">[video]</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$insert_ob = "";
|
||||
}
|
||||
|
||||
echo "<tr>
|
||||
<td width=\"85%\"><a title=\"$file_title\" OnClick=\"insertfile('".$row['file_id']."')\" href=\"#\">$row[file_name]</a>{$insert_ob}</td>
|
||||
<td width=\"10%\"> </td>
|
||||
<td width=\"5%\"><input type=checkbox name=\"del[".$row['file_id']."]\" value=\"".$row['file_id']."\"></td>
|
||||
</tr>";
|
||||
|
||||
$row_count++;
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
|
||||
if ($row_count){
|
||||
|
||||
echo "<hr /><div align=\"right\"><input class=\"button\" value=\"Óäàëèòü\" type=\"submit\" style=\"background-color:#FF9999;\" /></div>";
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
echo "<br />Íè îäíîãî ôàéëà íå çàãðóæåíî.";
|
||||
}
|
||||
|
||||
echo "</form>";
|
||||
|
||||
echo "</fieldset>";
|
||||
|
||||
echo <<<HTML
|
||||
</body>
|
||||
|
||||
</html>
|
||||
HTML;
|
||||
|
||||
?>
|
||||
154
system/forum/sources/shapeshifter/forum_posts.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
$username = $db->safesql( htmlspecialchars( urldecode( $_REQUEST['name'] ) ) );
|
||||
if ($username)
|
||||
{
|
||||
$cstart = intval($_REQUEST['cstart']);
|
||||
if ($cstart < 0)
|
||||
$cstart = 0;
|
||||
|
||||
if ($cstart){
|
||||
$cstart = $cstart - 1;
|
||||
$cstart = $cstart * $forum_config['post_inpage'];
|
||||
}
|
||||
|
||||
$i = $cstart;
|
||||
|
||||
$config_inpage = $forum_config['post_inpage'];
|
||||
|
||||
switch ($_REQUEST['code'])
|
||||
{
|
||||
case "search":
|
||||
$search_text = strip_data($_REQUEST['search_text']);
|
||||
if ($search_text)
|
||||
{
|
||||
$_SESSION['search_text_'.$tid] = $search_text;
|
||||
}
|
||||
$search_text = $_SESSION['search_text_'.$tid];
|
||||
if ($search_text)
|
||||
{
|
||||
$search_page = 0;
|
||||
if (intval($_REQUEST['search_page']) == "1")
|
||||
$cstart = 0;
|
||||
|
||||
$search_text_topic = true;
|
||||
$access_forum = "(ff.access_read LIKE '%:".$member_id['user_group']."' OR ff.access_read LIKE '%:".$member_id['user_group'].":%' OR ff.access_read LIKE '".$member_id['user_group'].":%' OR ff.access_read LIKE '".$member_id['user_group']."')";
|
||||
$result_posts = $db->query("SELECT SQL_CALC_FOUND_ROWS forum_posts.*, ff.*, ff.id AS ffid, ff.name AS f_name, ".PREFIX."_forum_topics.*, users.* FROM `".PREFIX."_forum_posts` AS `forum_posts`, `".USERPREFIX."_users` AS `users`, `".PREFIX."_forum_forums` AS `ff`, `".PREFIX."_forum_topics` WHERE users.name = forum_posts.post_author AND forum_posts.post_author = '".$username."' AND tid = topic_id AND forum_posts.hidden = '0' AND (".$access_forum." AND ff.id = forum_id) ".$where." {$where_sort} ORDER BY post_date DESC LIMIT ".$cstart.",".$forum_config['post_inpage']."");
|
||||
$sql_count = "SELECT FOUND_ROWS() as count";
|
||||
$row = $db->super_query($sql_count);
|
||||
$count_all = $row['count'] + 1;
|
||||
|
||||
$a_href_reply = $config['http_home_url']."user/".$username."/posts/";
|
||||
|
||||
$icat = $config['http_home_url']."?do=forum&act=user_posts&name=".$username."&code=search&cstart=";
|
||||
$icat_prov = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
$access_forum = "(ff.access_read LIKE '%:".$member_id['user_group']."' OR ff.access_read LIKE '%:".$member_id['user_group'].":%' OR ff.access_read LIKE '".$member_id['user_group'].":%' OR ff.access_read LIKE '".$member_id['user_group']."')";
|
||||
$result_posts = $db->query("SELECT SQL_CALC_FOUND_ROWS forum_posts.*, ff.*, ff.id AS ffid, ff.name AS f_name, ".PREFIX."_forum_topics.*, users.* FROM `".PREFIX."_forum_posts` AS `forum_posts`, `".USERPREFIX."_users` AS `users`, `".PREFIX."_forum_forums` AS `ff`, `".PREFIX."_forum_topics` WHERE users.name = forum_posts.post_author AND forum_posts.post_author = '".$username."' AND tid = topic_id AND forum_posts.hidden = '0' AND (".$access_forum." AND ff.id = forum_id) ".$where." ORDER BY post_date DESC LIMIT ".$cstart.",".$forum_config['post_inpage']."");
|
||||
$sql_count = "SELECT FOUND_ROWS() as count";
|
||||
$row = $db->super_query($sql_count);
|
||||
$count_all = $row['count'] + 1;
|
||||
$search_page = 1;
|
||||
$search_text_topic = false;
|
||||
|
||||
$icat = $config['http_home_url']."user/".$username."/posts/page";
|
||||
$a_href_reply = $config['http_home_url']."user".$username."/";
|
||||
|
||||
$icat_prov = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($count_all)
|
||||
{
|
||||
require_once SYSTEM_DIR.'/forum/sources/shapeshifter/showallposts.php';
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/navigation.php';
|
||||
}
|
||||
|
||||
if ($post_num_id)
|
||||
{
|
||||
$tpl->load_template($tpl_dir.'topic.tpl');
|
||||
|
||||
$tpl->set('{banner}', stripslashes($forums_array[$forum_id]['banner']));
|
||||
|
||||
$tpl->set('{addpost}', "");
|
||||
$tpl->set('{title}', "Ïîñëåäíèå ïîñòû ïîëüçîâàòåëÿ: ".$username."");
|
||||
$tpl->set('{title_descr}', "Âñåãî íàéäåíî ".$count_all." ïîñòîâ");
|
||||
|
||||
$tpl->set('{navigation}', $tpl->result['navigation']);
|
||||
$tpl->set_block("'\\[options\\](.*?)\\[/options\\]'si","");
|
||||
|
||||
$tpl->set('{topic_subscription}', "");
|
||||
$tpl->set('{say_friend}', "");
|
||||
$tpl->set('{topic_pechat}', "");
|
||||
|
||||
$tpl->set_block("'\\[new_topic\\](.*?)\\[/new_topic\\]'si","");
|
||||
$tpl->set_block("'\\[poll\\](.*?)\\[/poll\\]'si","");
|
||||
$tpl->set_block("'\\[reply\\](.*?)\\[/reply\\]'si","");
|
||||
$tpl->set('{s_reply}', "");
|
||||
|
||||
if ($search_text_topic)
|
||||
{
|
||||
$tpl->set('{search_link}', $config['http_home_url']."user/".$username."/posts/");
|
||||
$tpl->set('{search_num}', $count_all);
|
||||
$tpl->set('[search_link]','');
|
||||
$tpl->set('[/search_link]','');
|
||||
}
|
||||
else
|
||||
$tpl->set_block("'\\[search_link\\](.*?)\\[/search_link\\]'si","");
|
||||
|
||||
if ($forum_config['ses_topic'] and $forum_config['sessions_log'])
|
||||
{
|
||||
forum_sessions($forum_id, $tid);
|
||||
get_forum_online('act_topic', $tid);
|
||||
$tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si","\\1");
|
||||
$tpl->set('{all_count}', $forum_online['all_count']);
|
||||
$tpl->set('{guest_count}', $forum_online['guest_count']);
|
||||
$tpl->set('{member_count}', $forum_online['member_count']);
|
||||
$tpl->set('{member_list}', $forum_online['member_list']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si","");
|
||||
}
|
||||
|
||||
$tpl->set('{forum_name}', link_forum($forum_id, $forum_name));
|
||||
$tpl->set_block("'\\[old-topic\\](.*?)\\[/old-topic\\]'si","");
|
||||
$tpl->set_block("'\\[new-topic\\](.*?)\\[/new-topic\\]'si","");
|
||||
|
||||
$tpl->set('[fast-search]',"<form action=\"\" method=\"post\">");
|
||||
$tpl->set('[/fast-search]',"<input type=\"hidden\" name=\"code\" value=\"search\" /><input type=\"hidden\" name=\"search_page\" value=\"".$search_page."\" /></form>");
|
||||
|
||||
$tpl->set_block("'\\[moderation\\](.*?)\\[/moderation\\]'si","");
|
||||
|
||||
$tpl->set('{posts}', $tpl->result['posts']);
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
$tpl->clear();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['search_result'], $f_lang['search_topic']);
|
||||
}
|
||||
}
|
||||
else
|
||||
forum_msg($f_lang['search_result'], "Âû íå âûáðàëè ïîëüçîâàòåëÿ.");
|
||||
|
||||
$metatags['title'] = 'Âñå ïîñòû ïîëüçîâàòåëÿ » '.$forum_config['forum_title'];
|
||||
|
||||
if ($forum_config['forum_bar'])
|
||||
{
|
||||
$bbr_cid = $c_id;
|
||||
$bbr_top = " » Âñå ïîñòû ïîëüçîâàòåëÿ";
|
||||
}
|
||||
|
||||
?>
|
||||
112
system/forum/sources/shapeshifter/forum_rss.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?PHP
|
||||
|
||||
define( 'DATALIFEENGINE', true );
|
||||
define( 'ROOT_DIR', '../../../..' );
|
||||
define( 'SYSTEM_DIR', '../../..' );
|
||||
@error_reporting( E_ALL ^ E_NOTICE );
|
||||
@ini_set( 'display_errors', true );
|
||||
@ini_set( 'html_errors', false );
|
||||
@ini_set( 'error_reporting', E_ALL ^ E_NOTICE );
|
||||
|
||||
if (! defined ( 'DATALIFEENGINE' ))
|
||||
die ( "Hacking attempt!" );
|
||||
|
||||
$forum_id = intval ( $_REQUEST ['fid']);
|
||||
|
||||
if ($forum_id != "" AND $forum_id != 0) {
|
||||
|
||||
include SYSTEM_DIR . '/data/config.php';
|
||||
require_once SYSTEM_DIR . '/classes/mysql.php';
|
||||
include_once SYSTEM_DIR . '/data/dbconfig.php';
|
||||
include_once SYSTEM_DIR . '/modules/functions.php';
|
||||
//require_once ENGINE_DIR . '/classes/templates.class.php';
|
||||
include_once ROOT_DIR . '/language/' . $config['langs'] . '/website.lng';
|
||||
|
||||
require_once SYSTEM_DIR . '/modules/sitelogin.php';
|
||||
if( ! $is_logged )
|
||||
{
|
||||
$member_id['user_group'] = 5;
|
||||
}
|
||||
|
||||
$opisanie = "Ôîðóì Files-Sib.NET"; // êîðîòêîå îïèñàíèå ñàéòà
|
||||
$adres_1 = "Files-Sib.NET"; // èìÿ äîìåíà
|
||||
$adres_2 = "http://files-sib.net/"; // àäðåñ âàøåãî ñàéòà
|
||||
$nazvanir_f = "Ôîðóì Files-Sib.NET"; // íàçâàíèå âàøåãî ôîðóìà
|
||||
$url_logo = "http://files-sib.net/templates/default/images/logo.png"; // ññûëêà íà ëîãî âàøåãî ñàéòà
|
||||
$f_info = $db->super_query("SELECT * FROM " . PREFIX . "_forum_forums where id = '$forum_id'");
|
||||
if ($f_info['id'] == $forum_id AND $f_info['id'] != "") // ïðîâåðêà íà ID íàéäåííîãî ôîðóìà
|
||||
{
|
||||
check_xss();
|
||||
$title = htmlspecialchars ( strip_tags ( stripslashes ( $f_info['name'] ) ) );
|
||||
$site = $config['http_home_url'];//3
|
||||
$rss_content = <<<XML
|
||||
<?xml version="1.0" encoding="{$config['charset']}"?>
|
||||
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<channel>
|
||||
<title>{$nazvanir_f} » {$title}</title>
|
||||
<link>{$site}</link>
|
||||
<language>ru</language>
|
||||
<description>{$config['description']}</description>
|
||||
<copyright>{$opisanie}</copyright>
|
||||
<generator>{$adres_1}</generator>
|
||||
<image>
|
||||
<title>{$opisanie}</title>
|
||||
<url>{$url_logo}</url>
|
||||
<link>{$adres_2}</link>
|
||||
</image>
|
||||
|
||||
XML;
|
||||
|
||||
$access_forum = "(ff.access_read LIKE '%:".$member_id['user_group']."' OR ff.access_read LIKE '%:".$member_id['user_group'].":%' OR ff.access_read LIKE '".$member_id['user_group'].":%' OR ff.access_read LIKE '".$member_id['user_group']."')";
|
||||
$sql_result = $db->query("SELECT * FROM `".PREFIX."_forum_posts` AS `forum_posts`, `".PREFIX."_forum_forums` AS `ff`, `".PREFIX."_forum_topics` WHERE tid = forum_posts.topic_id AND ff.id = '$f_info[id]' AND forum_posts.hidden = '0' AND (".$access_forum." AND ff.id = ".PREFIX."_forum_topics.forum_id) AND ".PREFIX."_forum_topics.hidden = '0' ORDER BY forum_posts.post_date DESC LIMIT 0,30");
|
||||
while($row = $db->get_row($sql_result))
|
||||
{
|
||||
$t_title = htmlspecialchars ( strip_tags ( stripslashes ( $row['title'] ) ) );
|
||||
|
||||
$rss_content .= <<<XML
|
||||
<item>
|
||||
<title>{$t_title}</title>
|
||||
|
||||
XML;
|
||||
$url = $config['http_home_url']."forum/topic_".$row['tid'];
|
||||
$rss_content .= "<link>{$url}</link>\n";
|
||||
$row['post_text'] = preg_replace ( "'\\[hide\\](.*?)\\[/hide\\]'ies", "", $row['post_text'] );
|
||||
$author = "<a {$go_page} href=\"".$config['http_home_url']."user/".urlencode($row['post_author'])."/\">".$row['post_author']."</a>";
|
||||
|
||||
$rss_content2 = <<<HTML
|
||||
{$row['post_text']}<br>
|
||||
<b>Îïóáëèêîâàë:</b> {$author}<hr>
|
||||
HTML;
|
||||
|
||||
$rss_content3 = stripslashes(str_replace("<br />", "<br>", $rss_content2));
|
||||
|
||||
$rss_content .= <<<XML
|
||||
<description>
|
||||
<![CDATA[ {$rss_content3} ]]>
|
||||
</description>
|
||||
<category>undefined</category>
|
||||
<dc:creator>{$row['post_author']}</dc:creator>
|
||||
<pubDate>{$row['post_date']}</pubDate>
|
||||
</item>
|
||||
|
||||
XML;
|
||||
|
||||
}
|
||||
|
||||
$rss_content .= <<<XML
|
||||
|
||||
</channel>
|
||||
</rss>
|
||||
XML;
|
||||
header ( 'Content-type: application/xml' );
|
||||
echo $rss_content;
|
||||
|
||||
}
|
||||
else
|
||||
header( "Location: {$config['http_home_url']}" );
|
||||
}
|
||||
else
|
||||
header( "Location: {$config['http_home_url']}" );
|
||||
|
||||
exit ();
|
||||
?>
|
||||
259
system/forum/sources/shapeshifter/showallposts.php
Normal file
@@ -0,0 +1,259 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
|
||||
if ($cstart) $post_num_id = $cstart;
|
||||
|
||||
while ($row = $db->get_row($result_posts))
|
||||
{
|
||||
|
||||
$forum_id = $row['forum_id'];
|
||||
$tid = $row['tid'];
|
||||
|
||||
$check_read = check_access($forums_array[$forum_id]['access_read']);
|
||||
$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']);
|
||||
|
||||
if ($check_moderator){
|
||||
$deny_edit_post = moderator_value('edit_post', $forum_id, $m_member);
|
||||
$deny_del_post = moderator_value('delete_post', $forum_id, $m_member);
|
||||
}
|
||||
|
||||
if ($user_group[$member_id['user_group']]['forum_post_edit']){
|
||||
$group_post_edit = true;
|
||||
}else{
|
||||
$group_post_edit = false;
|
||||
}
|
||||
|
||||
if ($user_group[$member_id['user_group']]['forum_post_del']){
|
||||
$group_post_del = true;
|
||||
}else{
|
||||
$group_post_del = false;
|
||||
}
|
||||
|
||||
$post_num_id++;
|
||||
$i++;
|
||||
|
||||
if($is_logged) {
|
||||
$tpl->set( '[not-logged]', "" );
|
||||
$tpl->set( '[/not-logged]', "" );
|
||||
} else $tpl->set_block( "'\\[not-logged\\](.*?)\\[/not-logged\\]'si", "" );
|
||||
|
||||
if (!$row['user_group']) $row['user_group'] = 5;
|
||||
|
||||
if ($ajax_adds) $post_num_id = "--";
|
||||
|
||||
$row['post_text'] = stripslashes( $row['post_text'] );
|
||||
|
||||
if ($row['hidden']){
|
||||
if ($check_moderator){
|
||||
$row['post_text'] = "<div class=\"hidden_post\">{$f_lang['h_post']}:<br />".$row['post_text']."</div>";
|
||||
}else{
|
||||
$row['post_text'] = "<div class=\"hidden_post\">{$f_lang['h_post']}</div>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($search_text){$row['post_text'] = hilites($search_text, $row['post_text']);}
|
||||
|
||||
// ********************************************************************************
|
||||
// LOAD TEMPLATE
|
||||
// ********************************************************************************
|
||||
|
||||
$tpl->load_template($tpl_dir.'post.tpl');
|
||||
|
||||
if( strlen( $row['title'] ) > 15 ) $title = substr( $row['title'], 0, 15 ) . " ...";
|
||||
else $title = $row['title'];
|
||||
|
||||
$tpl->set( '{topic_url}', " Òåìà: <a href=\"".$config['http_home_url']."forum/topic_".$row['tid']."/last#reply\">".$row['title']."</a>, ");
|
||||
|
||||
$tpl->set('{post_id}', "<a href=\"javascript:PostLink($post_num_id);\" name=\"post-{$post_num_id}\">{$post_num_id}</a>");
|
||||
|
||||
if ($row['edit_time']) $tpl->set('{edit-info}', "<br /><span class='edit-info'>{$f_lang['edit_info']} <b>{$row['edit_user']}</b> - ".show_date($row['edit_time'])."</span>");
|
||||
else $tpl->set('{edit-info}', "");
|
||||
|
||||
$go_page = "onClick=\"return dropdownmenu(this, event, FUserMenu('".urlencode($row['name'])."', '".$row['user_id']."', '".$member_id['user_group']."', '$a_forum_url'), '170px')\" onMouseout=\"delayhidemenu()\"";
|
||||
|
||||
$group_span = $user_group[$row['user_group']]['colour'];
|
||||
|
||||
if ($row['is_register'])
|
||||
{
|
||||
if ($config['skin'] == "Lite" OR $config['skin'] == "Wap")
|
||||
$tpl->set('{author}', "<a href=\"".$config['http_home_url']."user/".urlencode($row['name'])."/\"><span style=\"color:{$group_span}\">{$row['post_author']}</span></a>");
|
||||
else
|
||||
$tpl->set('{author}', "<a {$go_page} href=\"#\"><span style=\"color:{$group_span}\">{$row['post_author']}</span></a>");
|
||||
}
|
||||
else $tpl->set('{author}', "<a href=\"mailto:".$row['e_mail']."\">{$row['post_author']}</a>");
|
||||
|
||||
$grav_url = 'http://gravatar.com/avatar/' . md5( stripslashes( $row['email'] ) ) . "?s=100&r=g&d=" . $config['http_home_url'] . 'templates/' . $config['skin'] . '/images/noavatar.png';
|
||||
if ($row['foto'])
|
||||
$tpl->set('{foto}', $config['http_home_url']."uploads/fotos/".$row['foto']);
|
||||
else
|
||||
$tpl->set('{foto}', $grav_url);
|
||||
|
||||
if ($row['icq']) $tpl->set('{icq}', stripslashes($row['icq']));
|
||||
else $tpl->set('{icq}', '--');
|
||||
|
||||
if ($row['land']) $tpl->set('{land}', stripslashes($row['land']));
|
||||
else $tpl->set('{land}', '--');
|
||||
|
||||
if ($row['fullname']) $tpl->set('{fullname}', stripslashes($row['fullname']));
|
||||
else $tpl->set('{fullname}', '--');
|
||||
|
||||
if ($row['is_register']) $tpl->set('{registration}', langdate("j.m.Y", $row['reg_date']));
|
||||
else $tpl->set('{registration}', '--');
|
||||
|
||||
if ($row['is_register'] AND $row['signature'])
|
||||
{
|
||||
$tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","\\1");
|
||||
$tpl->set('{signature}', stripslashes($row['signature']));
|
||||
}
|
||||
else $tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","");
|
||||
|
||||
if ($user_group[$row['user_group']]['colour']){
|
||||
$group_span = $user_group[$row['user_group']]['colour'];
|
||||
$group_name = "<span style=\"color:{$group_span}\">".$user_group[$row['user_group']]['group_name']."</span>";
|
||||
}else{
|
||||
$group_name = $user_group[$row['user_group']]['group_name'];
|
||||
}
|
||||
|
||||
if ($row['banned'])
|
||||
{
|
||||
$group_name = "BANNED";
|
||||
}
|
||||
|
||||
$tpl->set('{group-name}', $group_name);
|
||||
|
||||
$tpl->set('{post-num}', intval($row['forum_post']));
|
||||
$tpl->set('{news-num}', intval($row['news_num']));
|
||||
$tpl->set('{comm-num}', intval($row['comm_num']));
|
||||
|
||||
|
||||
// ********************************************************************************
|
||||
// POST SELECTED
|
||||
// ********************************************************************************
|
||||
$tpl->set('{selected}', "");
|
||||
|
||||
// ********************************************************************************
|
||||
// POST DATE
|
||||
// ********************************************************************************
|
||||
$row['post_date'] = strtotime($row['post_date']);
|
||||
|
||||
$tpl->set('{post-date}', show_date($row['post_date']));
|
||||
|
||||
if (!$forum_config['mod_report'] and $is_logged)
|
||||
{
|
||||
$tpl->set('[report]',"<a href=\"{$a_forum_url}act=_topic&code=report&tid={$tid}&pid={$post_num_id}\">");
|
||||
$tpl->set('[/report]',"</a>");
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\\[report\\](.*?)\\[/report\\]'si","");
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// FAST
|
||||
// ********************************************************************************
|
||||
|
||||
$tpl->set_block("'\\[fast\\](.*?)\\[/fast\\]'si","");
|
||||
|
||||
// ********************************************************************************
|
||||
// RANK
|
||||
// ********************************************************************************
|
||||
if ($forum_config['mod_rank'] and $rank_array != 'empty')
|
||||
{
|
||||
if (!$row['forum_post']) $row['forum_post'] = 0;
|
||||
|
||||
foreach ($rank_array as $value)
|
||||
{
|
||||
if ($row['forum_post'] >= $value['posts'])
|
||||
{
|
||||
$rank_title = $value['title'];
|
||||
|
||||
$rank_num = $value['pips'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($row['forum_rank']) $rank_title = $row['forum_rank'];
|
||||
|
||||
if ($row['forum_pips']) $rank_num = $row['forum_pips'];
|
||||
|
||||
$rating = $rank_num * 17;
|
||||
|
||||
$rank_image = "<div class=\"rank\" style=\"display:inline;\">
|
||||
<ul class=\"unit-rank\">
|
||||
<li class=\"current-rank\" style=\"width:{$rating}px;\">{$rating}</li>
|
||||
</ul>
|
||||
</div>";
|
||||
}
|
||||
|
||||
$tpl->set('{rank-title}', $rank_title);
|
||||
|
||||
$tpl->set('{rank-image}', $rank_image);
|
||||
|
||||
// ********************************************************************************
|
||||
// REPUTATION
|
||||
// ********************************************************************************
|
||||
|
||||
@include (SYSTEM_DIR.'/modules/reputation.php');
|
||||
|
||||
if ($check_moderator)
|
||||
$tpl->set('{ip}', "IP: <a onClick=\"return dropdownmenu(this, event, IPMenu('".$row['post_ip']."', '".$lang['ip_info']."', '".$lang['ip_tools']."', '".$lang['ip_ban']."'), '190px')\" onMouseout=\"delayhidemenu()\" href=\"http://www.nic.ru/whois/?ip={$row['post_ip']}\" target=\"_blank\">{$row['post_ip']}</a>");
|
||||
else $tpl->set('{ip}', '');
|
||||
|
||||
if ($num_post_tid > 0)
|
||||
$del_post = true;
|
||||
else
|
||||
$del_post = false;
|
||||
|
||||
// ********************************************************************************
|
||||
// POST EDIT
|
||||
// ********************************************************************************
|
||||
if (($member_id['name'] == $row['post_author']) AND $group_post_edit OR $deny_edit_post)
|
||||
{
|
||||
$tpl->set('[post-edit]',"<a onClick=\"return dropdownmenu(this, event, PostEditMenu('$row[pid]', '$a_forum_url', '$post_num_id'), '170px')\" onMouseout=\"delayhidemenu()\" href=\"#\">");
|
||||
$tpl->set('[/post-edit]',"</a>");
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\\[post-edit\\](.*?)\\[/post-edit\\]'si","");
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// POST DEL
|
||||
// ********************************************************************************
|
||||
|
||||
$tpl->set_block("'\\[post-del\\](.*?)\\[/post-del\\]'si","");
|
||||
|
||||
// ********************************************************************************
|
||||
// POST TEXT
|
||||
// ********************************************************************************
|
||||
$tpl->set('{text}', "<div id='post-id-".$row['pid']."'>".stripslashes($row['post_text'])."</div>");
|
||||
|
||||
// ********************************************************************************
|
||||
// HIDE
|
||||
// ********************************************************************************
|
||||
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","<div class=\"quote\">".$hide_info."</div>");
|
||||
}
|
||||
|
||||
$tpl->compile('posts');
|
||||
|
||||
if (stristr ($tpl->result['posts'], "[attachment="))
|
||||
{
|
||||
$tid = $row['tid'];
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/attachment.php';
|
||||
}
|
||||
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
$ban_short = array ();
|
||||
unset( $ban_short );
|
||||
|
||||
?>
|
||||
328
system/forum/sources/showforum.php
Normal file
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
|
||||
if (intval($fid))
|
||||
{
|
||||
$row_forum = $db->super_query("SELECT * FROM " . PREFIX . "_forum_forums WHERE id = $fid");
|
||||
|
||||
$check_moderator = check_moderator($row_forum['access_mod'], $row_forum['moderators']);
|
||||
$check_read = check_access($row_forum['access_read']);
|
||||
|
||||
if ($check_moderator){$mass_prune = moderator_value('mass_prune', $fid, $m_member);}
|
||||
|
||||
// ********************************************************************************
|
||||
// PASSWORD
|
||||
// ********************************************************************************
|
||||
$password = $row_forum['password'];
|
||||
|
||||
if ($password)
|
||||
{
|
||||
$forum_cookie = $_COOKIE["dle_forum_{$fid}"];
|
||||
|
||||
unset ($check_read); // âõîä ïî ïàðîëþ äëÿ âñåõ
|
||||
|
||||
if ($_REQUEST['password']){
|
||||
if ($password == $_REQUEST['password']){
|
||||
set_cookie ("dle_forum_{$fid}", md5($_REQUEST['password']), 365);
|
||||
$check_read = true;
|
||||
}
|
||||
} else {
|
||||
if (md5($password) == $forum_cookie)
|
||||
{
|
||||
$check_read = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// SHOW FORUM
|
||||
// ********************************************************************************
|
||||
$c_id = $row_forum['main_id'];
|
||||
|
||||
if ($row_forum['id'] and $check_read)
|
||||
{
|
||||
$forum_name = stripslashes($row_forum['name']);
|
||||
|
||||
if ($sub_parentid[$fid] and $sub_parentid != 'empty')
|
||||
{
|
||||
if ($forum_config['hide_forum'])
|
||||
{
|
||||
$access_hide = "and access_read regexp '[[:<:]](".$member_id['user_group'].")[[:>:]]'";
|
||||
} else
|
||||
{
|
||||
$access_hide = "";
|
||||
}
|
||||
|
||||
$result = $db->query("SELECT * FROM ". PREFIX ."_forum_forums WHERE parentid = $fid {$access_hide} ORDER by position");
|
||||
|
||||
while ($row = $db->get_row($result))
|
||||
{
|
||||
if (!$fcache->open('moder-'.$row['id']))
|
||||
{
|
||||
foreach ($forum_moderators as $moderators)
|
||||
{
|
||||
if ($moderators['forum_id'] == $row['id'] and $moderators['member_name'])
|
||||
{
|
||||
$mod_count++;
|
||||
|
||||
if ($mod_count > 1) $mod_symbol = ", ";
|
||||
|
||||
$moderators_list .= $mod_symbol . link_user($moderators['member_name']);
|
||||
}
|
||||
}
|
||||
|
||||
$fcache->save('moder-'.$row['id'], $moderators_list);
|
||||
}
|
||||
else { $moderators_list = $fcache->open('moder-'.$row['id']); }
|
||||
|
||||
$tpl->load_template($tpl_dir.'forums.tpl');
|
||||
|
||||
$tpl->set('{status}', forum_status ($row['f_last_date'], $row['password'], $row['icon']));
|
||||
$tpl->set('{name}', link_forum($row['id'], $row['name']));
|
||||
$tpl->set('{description}', stripslashes($row['description']));
|
||||
$tpl->set('{forum_id_rss}', $forum_url."/rss/forum_".$row['id'].".xml");
|
||||
$tpl->set('{forums}', '');
|
||||
|
||||
if ($moderators_list)
|
||||
{
|
||||
$tpl->set('{moderators}', '<br />' . $f_lang['moderators'] . ' ' . $moderators_list);
|
||||
}
|
||||
else { $tpl->set('{moderators}', ''); }
|
||||
|
||||
$tpl->set('{topics}', $row['topics']);
|
||||
$tpl->set('{post}', $row['posts']);
|
||||
$tpl->set('{last}', forum_last($row['f_last_tid'], $row['f_last_title'], $row['f_last_poster_name'], $row['f_last_date'], $row['password'], $row['id'], $row['access_read']));
|
||||
|
||||
$tpl->compile('forums');
|
||||
$tpl->clear();
|
||||
|
||||
unset ($moderators_list);
|
||||
unset ($mod_count);
|
||||
unset ($mod_symbol);
|
||||
}
|
||||
|
||||
$tpl->load_template($tpl_dir.'category.tpl');
|
||||
|
||||
$tpl->set('{category}', $forum_name.$f_lang['subforums']);
|
||||
$tpl->set('{forums}', $tpl->result['forums']);
|
||||
|
||||
$tpl->compile('subforums');
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// TOPIC VIEWS
|
||||
// ********************************************************************************
|
||||
if ($is_logged){
|
||||
$row_views = $db->query("SELECT topic_id FROM " . PREFIX . "_forum_views WHERE user_id = $member_id[user_id] and forum_id = $fid");
|
||||
|
||||
$topic_views = array();
|
||||
|
||||
while ($row = $db->get_row($row_views))
|
||||
{
|
||||
$topic_views[$row['topic_id']] = '1';
|
||||
}
|
||||
} else {
|
||||
$row_views = explode(",", $_COOKIE['dle_forum_views']);
|
||||
|
||||
foreach ($row_views as $value)
|
||||
{
|
||||
$topic_views[$value] = '1';
|
||||
}
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// CSTART
|
||||
// ********************************************************************************
|
||||
if ($cstart){
|
||||
$cstart = $cstart - 1;
|
||||
$cstart = $cstart * $forum_config['topic_inpage'];
|
||||
}
|
||||
|
||||
if ($forum_config['topic_sort']){
|
||||
$sort_type = "last_date";
|
||||
} else {
|
||||
$sort_type = "tid";
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// SWITCH
|
||||
// ********************************************************************************
|
||||
if (!$check_moderator) $q_hidden = " and hidden = 0"; else $q_hidden = "";
|
||||
|
||||
switch ($_REQUEST['code'])
|
||||
{
|
||||
// ********************************************************************************
|
||||
// HIDDEN
|
||||
// ********************************************************************************
|
||||
case "hidden":
|
||||
|
||||
if ($check_moderator){
|
||||
$WHERE = "and hidden = 1";
|
||||
$get_count = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_topics WHERE forum_id = $fid and hidden = 1");
|
||||
$count_all = $get_count['count'];
|
||||
$icat = $a_forum_url."showforum={$fid}&code=hidden&cstart=";
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// TODAY
|
||||
// ********************************************************************************
|
||||
case "today":
|
||||
$today_date = date('Y-m-d');;
|
||||
$WHERE = "{$q_hidden} and last_date >= DATE_ADD(NOW(), INTERVAL -1 DAY)";
|
||||
$get_count = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_topics WHERE forum_id = $fid {$WHERE}");
|
||||
$count_all = $get_count['count'];
|
||||
$icat = $a_forum_url."showforum={$fid}&code=today&cstart=";
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// NOREPLY
|
||||
// ********************************************************************************
|
||||
case "noreply":
|
||||
$WHERE = "{$q_hidden} and post = '0'";
|
||||
$get_count = $db->super_query("SELECT COUNT(*) as count FROM " . PREFIX . "_forum_topics WHERE forum_id = $fid {$WHERE}");
|
||||
$count_all = $get_count['count'];
|
||||
$icat = $a_forum_url."showforum={$fid}&code=noreply&cstart=";
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// SEARCH
|
||||
// ********************************************************************************
|
||||
case "search":
|
||||
if ($_POST['search_text']){}
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// DEFAULT
|
||||
// ********************************************************************************
|
||||
default:
|
||||
$count_all = $row_forum['topics'];
|
||||
$icat = $forum_url."/forum_{$fid}/";
|
||||
if (!$check_moderator) $WHERE = "and hidden = 0"; else $WHERE = "";
|
||||
break;
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// DLE Forum
|
||||
// ********************************************************************************
|
||||
$config_inpage = $forum_config['topic_inpage'];
|
||||
|
||||
$result_topics = $db->query("SELECT * FROM " . PREFIX . "_forum_topics WHERE forum_id = $fid ".$WHERE." ORDER BY fixed, ".$sort_type." DESC LIMIT ".$cstart.",".$forum_config['topic_inpage']."");
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/showtopics.php';
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/navigation.php';
|
||||
|
||||
if (!$is_topics){$msg_info = $f_lang['is_topics'];}
|
||||
|
||||
$tpl->load_template($tpl_dir.'forum.tpl');
|
||||
|
||||
$tpl->set('{banner}', stripslashes($row_forum['banner']));
|
||||
$tpl->set('{forum}', $forum_name);
|
||||
$tpl->set('{subforums}', $tpl->result["subforums"]);
|
||||
$tpl->set('{info}', $msg_info);
|
||||
|
||||
if ($row_forum['rules_title']){
|
||||
$tpl->set('[rules]',"");
|
||||
$tpl->set('{rules-name}', $row_forum['rules_title']);
|
||||
$tpl->set('{rules-text}', $row_forum['rules']);
|
||||
$tpl->set('[/rules]',"");
|
||||
} else {
|
||||
$tpl->set_block("'\\[rules\\](.*?)\\[/rules\\]'si","");
|
||||
}
|
||||
|
||||
if($is_logged){
|
||||
$a_new_topic = $forum_url."/forum_{$fid}/add/";
|
||||
$tpl->set('[new_topic]',"<a href=\"{$a_new_topic}\">");
|
||||
$tpl->set('[/new_topic]',"</a>");
|
||||
} else {
|
||||
$tpl->set('[new_topic]',"");
|
||||
$tpl->set('[/new_topic]',"");
|
||||
}
|
||||
|
||||
$tpl->set('[options]',"<a onClick=\"return dropdownmenu(this, event, ForumMenu('$fid', '$check_moderator', '$a_forum_url'), '180px')\" onMouseout=\"delayhidemenu()\" href='#'\">");
|
||||
$tpl->set('[/options]',"</a>");
|
||||
|
||||
$tpl->set('[fast-search]',"<form method=\"post\" action=\"{$a_forum_url}act=search&search_fid={$fid}\">");
|
||||
$tpl->set('[/fast-search]',"</form>");
|
||||
|
||||
if ($mass_prune){
|
||||
$tpl->set('[selected]',"");
|
||||
$tpl->set('[/selected]',"");
|
||||
|
||||
$tpl->set('[moderation]',"<form name=\"modform\" method=\"post\" action=\"{$a_forum_url}act=moderation\">");
|
||||
|
||||
$moderation = "<select name=\"code\">";
|
||||
$moderation .= "<option value=\"-1\">{$f_lang['mtf_op']}</option>";
|
||||
$moderation .= "<option value=\"02\">{$f_lang['mtf_02']}</option>";
|
||||
$moderation .= "<option value=\"01\">{$f_lang['mtf_01']}</option>";
|
||||
$moderation .= "<option value=\"08\">{$f_lang['mtf_08']}</option>";
|
||||
$moderation .= "<option value=\"09\">{$f_lang['mtf_09']}</option>";
|
||||
$moderation .= "<option value=\"05\">{$f_lang['mtf_05']}</option>";
|
||||
$moderation .= "<option value=\"07\">{$f_lang['mtf_07']}</option>";
|
||||
$moderation .= "<option value=\"06\">{$f_lang['mtf_06']}</option>";
|
||||
$moderation .= "<option value=\"03\">{$f_lang['mtf_03']}</option>";
|
||||
$moderation .= "</select>";
|
||||
|
||||
$tpl->set('{moderation}', $moderation);
|
||||
|
||||
$tpl->set('[/moderation]',"<input type=\"hidden\" value=\"\" name=\"selected_id\" /></form>");
|
||||
} else {
|
||||
$tpl->set_block("'\\[selected\\](.*?)\\[/selected\\]'si","");
|
||||
$tpl->set_block("'\\[moderation\\](.*?)\\[/moderation\\]'si","");
|
||||
}
|
||||
|
||||
if ($forum_config['ses_forum'] and $forum_config['sessions_log']){
|
||||
forum_sessions($fid);
|
||||
|
||||
get_forum_online("act_forum", $fid);
|
||||
|
||||
$tpl->set('[online]',"");
|
||||
|
||||
$tpl->set('{all_count}', $forum_online['all_count']);
|
||||
$tpl->set('{guest_count}', $forum_online['guest_count']);
|
||||
$tpl->set('{member_count}', $forum_online['member_count']);
|
||||
$tpl->set('{member_list}', $forum_online['member_list']);
|
||||
|
||||
$tpl->set('[/online]',"");
|
||||
} else {
|
||||
$tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si","");
|
||||
}
|
||||
|
||||
$tpl->set('{topics}', $tpl->result['topics']);
|
||||
$tpl->set('{navigation}', $tpl->result['navigation']);
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
$tpl->clear();
|
||||
|
||||
} else {
|
||||
if (!$check_read){
|
||||
if (!$password){
|
||||
$group_name = $user_group[$member_id['user_group']]['group_name'];
|
||||
forum_msg($f_lang['f_msg'], $f_lang['forum_read'], 'user_group', $group_name);
|
||||
} else {
|
||||
$password_form = "<form method=\"post\" action=\"\">Ïàðîëü: <input class=\"bbcodes\" type=\"text\" name=\"password\"><input class=\"bbcodes\" type=\"submit\" value=\"Ok\"></form>";
|
||||
forum_msg($f_lang['f_msg'], $password_form);
|
||||
}
|
||||
} else {
|
||||
@header("HTTP/1.0 404 Not Found");
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
}
|
||||
|
||||
$metatags['title'] = $forum_config['forum_title'].' » ' . stripslashes($row_forum['name']);
|
||||
|
||||
if ($forum_config['forum_bar']){
|
||||
$bbr_cid = $c_id;
|
||||
$bbr_name = $cats_array[$c_id]['cat_name'];
|
||||
$bbr_fid = $fid;
|
||||
$bbr_fname = $row_forum['name'];
|
||||
}
|
||||
} else {
|
||||
@header("HTTP/1.0 404 Not Found");
|
||||
forum_msg($f_lang['f_msg'], $f_lang['f_404']);
|
||||
}
|
||||
?>
|
||||
223
system/forum/sources/showposts.php
Normal file
@@ -0,0 +1,223 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
if ($cstart) { $post_num_id = $cstart; }
|
||||
|
||||
if ($fixpost and $cstart)
|
||||
{
|
||||
$post_num_id = $post_num_id - 1;
|
||||
}
|
||||
|
||||
if ($check_moderator)
|
||||
{
|
||||
$deny_edit_post = moderator_value('edit_post', $forum_id, $m_member);
|
||||
|
||||
$deny_del_post = moderator_value('delete_post', $forum_id, $m_member);;
|
||||
}
|
||||
|
||||
if ($user_group[$member_id['user_group']]['forum_post_edit']){
|
||||
$group_post_edit = true;
|
||||
}else{
|
||||
$group_post_edit = false;
|
||||
}
|
||||
|
||||
if ($user_group[$member_id['user_group']]['forum_post_del']){
|
||||
$group_post_del = true;
|
||||
}else{
|
||||
$group_post_del = false;
|
||||
}
|
||||
|
||||
$posts_found = false;
|
||||
|
||||
while ($row = $db->get_row($result_posts))
|
||||
{
|
||||
$post_num_id++;
|
||||
|
||||
if (!$row['user_group']) $row['user_group'] = 5;
|
||||
|
||||
if ($ajax_adds) $post_num_id = "--";
|
||||
|
||||
if ($row['hidden'] == "1")
|
||||
{
|
||||
if ($check_moderator)
|
||||
{
|
||||
$row['post_text'] = "<div class=\"hidden_post\">{$f_lang['h_post']}:<br />".$row['post_text']."</div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['post_text'] = "<div class=\"hidden_post\">{$f_lang['h_post']}</div>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($search_text)
|
||||
{
|
||||
$row['post_text'] = hilites($search_text, $row['post_text']);
|
||||
}
|
||||
|
||||
//start Õàê ÒÑ by SaNcHeS
|
||||
|
||||
if($row['post_author'] == $row_topic['author_topic'])
|
||||
{
|
||||
$ts = "<b>Àâòîð òåìû</b><br><br>";
|
||||
}
|
||||
//end Õàê ÒÑ by SaNcHeS
|
||||
|
||||
// ********************************************************************************
|
||||
// LOAD TEMPLATE
|
||||
// ********************************************************************************
|
||||
$tpl->load_template($tpl_dir.'post.tpl');
|
||||
|
||||
if ($row['pid'] == $first_post){
|
||||
$tpl->set('{post_id}', "<a href=\"javascript:PostLink({$row['pid']});\" name=\"post-{$row['pid']}\">1</a>");
|
||||
} else {
|
||||
$tpl->set('{post_id}', "<a href=\"javascript:PostLink({$row['pid']});\" name=\"post-{$row['pid']}\">{$post_num_id}</a>");
|
||||
}
|
||||
|
||||
if ($row['edit_time'] and $show_edit_info)
|
||||
$tpl->set('{edit-info}', "<br /><span class='edit-info'>{$f_lang['edit_info']} <b>{$row['edit_user']}</b> - ".show_date($row['edit_time'])."</span>");
|
||||
else $tpl->set('{edit-info}', "");
|
||||
|
||||
$go_page = "onClick=\"return dropdownmenu(this, event, FUserMenu('".urlencode($row['name'])."', '".$row['user_id']."', '".$member_id['user_group']."', '$a_forum_url'), '170px')\" onMouseout=\"delayhidemenu()\"";
|
||||
|
||||
if ($row['is_register'])
|
||||
$tpl->set('{author}', "<a {$go_page} href=\"#\">{$row['post_author']}</a>");
|
||||
else $tpl->set('{author}', "<a href=\"mailto:".$row['e_mail']."\">{$row['post_author']}</a>");
|
||||
|
||||
$tpl->set( '{topic_url}', "");
|
||||
|
||||
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}/images/noavatar.png" );
|
||||
|
||||
if ($row['icq']) $tpl->set('{icq}', stripslashes($row['icq']));
|
||||
else $tpl->set('{icq}', '--');
|
||||
|
||||
//start Õàê ÒÑ by SaNcHeS
|
||||
if ($ts) $tpl->set('{ts}', '');
|
||||
if($row['post_author'] == $row_topic['author_topic']){
|
||||
if ($ts) $tpl->set('{ts}', $ts);
|
||||
else $tpl->set('{ts}');
|
||||
}
|
||||
//end Õàê ÒÑ by SaNcHeS
|
||||
|
||||
if ($row['land']) $tpl->set('{land}', stripslashes($row['land']));
|
||||
else $tpl->set('{land}', '--');
|
||||
|
||||
if ($row['fullname']) $tpl->set('{fullname}', stripslashes($row['fullname']));
|
||||
else $tpl->set('{fullname}', '--');
|
||||
|
||||
if ($row['reg_date']) $tpl->set('{registration}', langdate("j.m.Y", $row['reg_date']));
|
||||
else $tpl->set('{registration}', '--');
|
||||
|
||||
if ($row['is_register'] AND $row['signature'])
|
||||
{
|
||||
$tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","\\1");
|
||||
$tpl->set('{signature}', stripslashes($row['signature']));
|
||||
}
|
||||
else $tpl->set_block("'\\[signature\\](.*?)\\[/signature\\]'si","");
|
||||
|
||||
if ($user_group[$row['user_group']]['colour']){
|
||||
$group_span = $user_group[$row['user_group']]['colour'];
|
||||
$group_name = "<span style=\"color:{$group_span}\">".$user_group[$row['user_group']]['group_name']."</span>";
|
||||
}else{
|
||||
$group_name = $user_group[$row['user_group']]['group_name'];
|
||||
}
|
||||
|
||||
if ($row['banned']){$group_name = "BANNED";}
|
||||
$tpl->set('{group-name}', $group_name);
|
||||
$tpl->set('{post-num}', intval($row['forum_post']));
|
||||
$tpl->set('{news-num}', intval($row['news_num']));
|
||||
$tpl->set('{comm-num}', intval($row['comm_num']));
|
||||
|
||||
// ********************************************************************************
|
||||
// POST SELECTED
|
||||
// ********************************************************************************
|
||||
if ($check_moderator AND $post_num_id != 1) $tpl->set('{selected}', "<input OnClick=\"select_id('{$row['pid']}');\" type='checkbox' name=\"sid[{$row['pid']}]\" value=\"{$row['pid']}\">");
|
||||
else $tpl->set('{selected}', "");
|
||||
|
||||
// ********************************************************************************
|
||||
// POST DATE
|
||||
// ********************************************************************************
|
||||
$row['post_date'] = strtotime($row['post_date']);
|
||||
|
||||
$tpl->set('{post-date}', show_date($row['post_date']));
|
||||
|
||||
if (!$forum_config['mod_report'] and $is_logged){
|
||||
$tpl->set('[report]',"<a href=\"{$a_forum_url}act=_topic&code=report&tid={$tid}&pid={$post_num_id}\">");
|
||||
$tpl->set('[/report]',"</a>");
|
||||
} else {
|
||||
$tpl->set_block("'\\[report\\](.*?)\\[/report\\]'si","");
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// FAST
|
||||
// ********************************************************************************
|
||||
if ($check_write AND !$row['hidden'])
|
||||
{
|
||||
$tpl->set('[fast]',"<a onmouseover=\"dle_copy_quote('".str_replace( array(" ", "'"), array(" ", "&#039;"), $row['post_author'] )."');\" href=\"#\" onClick=\"forum_ins('".str_replace( array(" ", "'"), array(" ", "&#039;"), $row['post_author'] )."'); ShowHide('sreply', 'open'); return false;\"\">");
|
||||
$tpl->set('[/fast]',"</a>");
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\\[fast\\](.*?)\\[/fast\\]'si","");
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// REPUTATION
|
||||
// ********************************************************************************
|
||||
@include (SYSTEM_DIR.'/modules/reputation.php');
|
||||
|
||||
if ($check_moderator)
|
||||
$tpl->set('{ip}', "IP: <a onClick=\"return dropdownmenu(this, event, IPMenu('".$row['post_ip']."', '".$lang['ip_info']."', '".$lang['ip_tools']."', '".$lang['ip_ban']."'), '190px')\" onMouseout=\"delayhidemenu()\" href=\"http://www.nic.ru/whois/?ip={$row['post_ip']}\" target=\"_blank\">{$row['post_ip']}</a>");
|
||||
else $tpl->set('{ip}', '');
|
||||
|
||||
// ********************************************************************************
|
||||
// POST EDIT
|
||||
// ********************************************************************************
|
||||
if (($member_id['name'] == $row['post_author']) AND $group_post_edit AND !$row['hidden'] OR $deny_edit_post){
|
||||
$tpl->set('[post-edit]',"<a onClick=\"return dropdownmenu(this, event, PostEditMenu('$row[pid]', '$a_forum_url', '$page', '$post_num_id'), '170px')\" onMouseout=\"delayhidemenu()\" href=\"#\">");
|
||||
$tpl->set('[/post-edit]',"</a>");
|
||||
}else{
|
||||
$tpl->set_block("'\\[post-edit\\](.*?)\\[/post-edit\\]'si","");
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// POST DEL
|
||||
// ********************************************************************************
|
||||
if (($member_id['name'] == $row['post_author']) AND $group_post_del AND !$row['hidden'] OR $deny_del_post)
|
||||
{
|
||||
if ($post_num_id != 1)
|
||||
{
|
||||
$tpl->set('[post-del]',"<a href=\"javascript:postDelete('".$a_forum_url."act=post&code=04&selected_id=".$row['pid']."')\">");
|
||||
$tpl->set('[/post-del]',"</a>");
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\\[post-del\\](.*?)\\[/post-del\\]'si","");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\\[post-del\\](.*?)\\[/post-del\\]'si","");
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// POST TEXT
|
||||
// ********************************************************************************
|
||||
$tpl->set('{text}', "<div id='post-id-".$row['pid']."'>".stripslashes($row['post_text'])."</div>");
|
||||
|
||||
$tpl->compile('posts');
|
||||
|
||||
$tpl->clear();
|
||||
|
||||
$posts_found = true;
|
||||
}
|
||||
|
||||
if (stristr ($tpl->result['posts'], "[attachment="))
|
||||
{
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/attachment.php';
|
||||
}
|
||||
|
||||
$tpl->result['posts'] .= "\n<span id='ajax-post'></span>\n";
|
||||
?>
|
||||
397
system/forum/sources/showtopic.php
Normal file
@@ -0,0 +1,397 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE')){die("Hacking attempt!");}
|
||||
|
||||
if (intval($tid)){
|
||||
$row_topic = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = $tid");
|
||||
$forum_id = $row_topic['forum_id'];
|
||||
$last_date = $row_topic['last_date'];
|
||||
|
||||
if ($forum_config['meta_topic'] and $row_topic['meta_descr']){
|
||||
$metatags['description'] = $row_topic['meta_descr'];
|
||||
$metatags['keywords'] = $row_topic['meta_keywords'];
|
||||
|
||||
$meta_topic = true;
|
||||
}
|
||||
|
||||
else { $meta_topic = false; }
|
||||
|
||||
$page = $cstart;
|
||||
|
||||
// ********************************************************************************
|
||||
// GET LAST POST
|
||||
// ********************************************************************************
|
||||
if ($_REQUEST['lastpost']){
|
||||
$last_page = @ceil(($row_topic['post'] + 1) / $forum_config['post_inpage']);
|
||||
|
||||
if ($last_page > 1){
|
||||
$last_page = $forum_url."/topic_$tid/$last_page#post-{$row_topic['last_post_id']}";
|
||||
header("Location: $last_page");
|
||||
}
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// CHECK ACCESS
|
||||
// ********************************************************************************
|
||||
$check_read = check_access($forums_array[$forum_id]['access_read']);
|
||||
$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']);
|
||||
$fixpost = $forums_array[$forum_id]['fixpost'];
|
||||
|
||||
if ($row_topic['hidden'] and !$check_moderator)
|
||||
{
|
||||
$check_read = false;
|
||||
}
|
||||
|
||||
if ($forums_array[$forum_id]['password'] and md5($forums_array[$forum_id]['password']) !== $_COOKIE["dle_forum_{$forum_id}"])
|
||||
{
|
||||
$check_read = false;
|
||||
}
|
||||
|
||||
$forum_name = $forums_array[$forum_id]['name'];
|
||||
|
||||
if ($_REQUEST['view'] and $check_read)
|
||||
{
|
||||
if ($_REQUEST['view'] == "new")
|
||||
{
|
||||
$q_view = '>';
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$q_view = '<';
|
||||
}
|
||||
|
||||
$view_tid = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE forum_id = $forum_id and last_date {$q_view} '$last_date'");
|
||||
|
||||
$open_topic = $forum_url."/topic_{$view_tid['tid']}/";
|
||||
|
||||
if ($view_tid['tid'])
|
||||
{
|
||||
header("Location: {$open_topic}");
|
||||
}
|
||||
}
|
||||
|
||||
if ($row_topic['tid'] and $check_read)
|
||||
{
|
||||
// ********************************************************************************
|
||||
// TOPIC VIEWS
|
||||
// ********************************************************************************
|
||||
if (!$_SESSION["topic_views_{$tid}"]){
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET views = views+1 WHERE tid = $tid");
|
||||
$_SESSION["topic_views_{$tid}"] = "1";
|
||||
}
|
||||
|
||||
if ($is_logged)
|
||||
{
|
||||
$rowt = $db->super_query("SELECT topic_id FROM " . PREFIX . "_forum_views WHERE topic_id = $tid and user_id = {$member_id[user_id]}");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$topic_views = $_COOKIE['dle_forum_views'];
|
||||
}
|
||||
|
||||
if (!$rowt['topic_id'] AND $is_logged){
|
||||
$_TIME = time()+($config['date_adjust']*60);
|
||||
$db->query("INSERT INTO " . PREFIX . "_forum_views (topic_id, forum_id, user_id, time) values ('$tid', '$forum_id', '$member_id[user_id]', '$_TIME')");
|
||||
} else {
|
||||
$topic_views = $topic_views.",".$tid;
|
||||
set_cookie ("dle_forum_views", $topic_views, 365);
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// TOPIC READ
|
||||
// ********************************************************************************
|
||||
if ($cstart){
|
||||
$cstart = $cstart - 1;
|
||||
$cstart = $cstart * $forum_config['post_inpage'];
|
||||
}
|
||||
|
||||
switch ($_REQUEST['code'])
|
||||
{
|
||||
case "search":
|
||||
|
||||
$search_text = strip_data($_REQUEST['search_text']);
|
||||
|
||||
if ($search_text)
|
||||
{
|
||||
$_SESSION['search_text_'.$tid] = $search_text;
|
||||
}
|
||||
|
||||
$search_text = $_SESSION['search_text_'.$tid];
|
||||
|
||||
if ($search_text)
|
||||
{
|
||||
$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 post_text LIKE '%{$search_text}%' ORDER by pid LIMIT ".$cstart.",".$forum_config['post_inpage']."");
|
||||
|
||||
$result_count = $db->super_query("SELECT count(*) as count FROM " . PREFIX . "_forum_posts WHERE topic_id = $tid AND post_text LIKE '%{$search_text}%'");
|
||||
|
||||
$count_all = $result_count['count'];
|
||||
|
||||
$a_href_reply = $forum_url."/topic_{$tid}/reply/";
|
||||
$a_new_topic = $forum_url."/forum_{$forum_id}/add/";
|
||||
|
||||
$icat = $a_forum_url . "showtopic={$tid}&code=search&cstart=";
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
$fp_query = "";
|
||||
|
||||
if ($fixpost and $cstart)
|
||||
{
|
||||
$first_post = $row_topic['first_post'] ? $row_topic['first_post'] : set_first_post_id ($tid);
|
||||
$fp_query = "(SELECT p.*, u.* FROM " . PREFIX . "_forum_posts AS p LEFT JOIN " . USERPREFIX . "_users AS u ON p.post_author = u.name WHERE p.pid = $first_post) UNION ";
|
||||
}
|
||||
|
||||
$posts_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 ORDER by pid LIMIT ".$cstart.",".$forum_config['post_inpage']."";
|
||||
|
||||
if ($fp_query) { $posts_query = "({$posts_query})"; }
|
||||
|
||||
$result_posts = $db->query($fp_query . $posts_query);
|
||||
|
||||
$count_all = ($row_topic['post'] + 1);
|
||||
|
||||
$icat = $forum_url."/topic_{$tid}/";
|
||||
|
||||
$a_href_reply = $forum_url."/topic_{$tid}/reply/";
|
||||
|
||||
$a_new_topic = $forum_url."/forum_{$forum_id}/add/";
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if ($count_all)
|
||||
{
|
||||
$show_edit_info = $forums_array[$forum_id]['i_edit'];
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/showposts.php';
|
||||
|
||||
if (!$posts_found and $_SESSION['post_num_update_'.$tid] < 5)
|
||||
{
|
||||
$post_row = $db->super_query("SELECT COUNT(pid) as count FROM " . PREFIX . "_forum_posts WHERE topic_id = $tid");
|
||||
|
||||
$post_row['count'] = ($post_row['count'] - 1);
|
||||
|
||||
$db->query("UPDATE " . PREFIX . "_forum_topics SET post = '{$post_row['count']}' WHERE tid = $tid");
|
||||
|
||||
$_SESSION['post_num_update_'.$tid]++;
|
||||
|
||||
header("Location: {$icat}");
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
$config_inpage = $forum_config['post_inpage'];
|
||||
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/navigation.php';
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// POLL
|
||||
// ********************************************************************************
|
||||
if ($row_topic['poll_title'] AND $row_topic['frage'] AND $row_topic['poll_body']){
|
||||
$dle_forum_poll = TRUE;
|
||||
include_once SYSTEM_DIR.'/forum/sources/components/poll.php';
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// REPLY
|
||||
// ********************************************************************************
|
||||
if ($check_write and !$row_topic['topic_status'] and $forums_array[$forum_id]['q_reply']){
|
||||
$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());
|
||||
$upload_var['reply'] = "reply";
|
||||
$tpl->load_template($tpl_dir.'ajax_addpost.tpl');
|
||||
$tpl->set('{title}', $f_lang['f_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","");
|
||||
}
|
||||
$tpl->set('{bbcode}',$bb_code);
|
||||
$tpl->set('{text}',"");
|
||||
|
||||
if ($is_logged) $hidden = "<input type=\"hidden\" name=\"name\" id=\"name\" value=\"{$member_id['name']}\" /><input type=\"hidden\" name=\"mail\" id=\"mail\" value=\"\" />"; else $hidden = "";
|
||||
|
||||
$topic_title_last = urlencode(stripslashes($row_topic['title']));
|
||||
|
||||
$tpl->copy_template = "<form method=\"post\" name=\"forum-post-form\" id=\"forum-post-form\" action=\"{$_SESSION['referrer']}\" onkeypress=\"CtrlEnter(event, this);\">".$tpl->copy_template."{$hidden}
|
||||
<input type=\"hidden\" name=\"topic_title\" id=\"topic_title\" value=\"{$topic_title_last}\" />
|
||||
<input type=\"hidden\" name=\"topic_id\" id=\"topic_id\" value=\"{$tid}\" />
|
||||
<input type=\"hidden\" name=\"forum_id\" id=\"forum_id\" value=\"{$forum_id}\" />
|
||||
<input type=\"hidden\" name=\"post_id\" id=\"post_id\" value=\"{$upload_var[post_id]}\" /></form>
|
||||
<div id=\"uploads-form\"></div>";
|
||||
|
||||
$tpl->compile('addpost');
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$tpl->load_template($tpl_dir.'msg.tpl');
|
||||
$tpl->set('{title}', $f_lang['all_info']);
|
||||
$tpl->set('{msg}', $f_lang['topic_write']);
|
||||
$tpl->set('{user_group}', $user_group[$member_id['user_group']]['group_name']);
|
||||
$tpl->compile('addpost');
|
||||
$tpl->clear();
|
||||
}
|
||||
|
||||
// ********************************************************************************
|
||||
// TOPIC TEMPLATE
|
||||
// ********************************************************************************
|
||||
if ($post_num_id){
|
||||
|
||||
$tpl->load_template($tpl_dir.'topic.tpl');
|
||||
|
||||
$tpl->set('{banner}', stripslashes($forums_array[$forum_id]['banner']));
|
||||
|
||||
if ($row_topic['topic_descr']){
|
||||
$row_topic['title'] = $row_topic['title'].', '.$row_topic['topic_descr'];
|
||||
}
|
||||
|
||||
$tpl->set('{title}', stripslashes($row_topic['title']));
|
||||
$tpl->set('{navigation}', $tpl->result['navigation']);
|
||||
|
||||
$tpl->set('[options]',"<a onClick=\"return dropdownmenu(this, event, TopicMenu('$tid', '$a_forum_url', '$check_moderator'), '170px')\" onMouseout=\"delayhidemenu()\" href='#'\">");
|
||||
$tpl->set('[/options]',"</a>");
|
||||
|
||||
$tpl->set('[new_topic]',"<a href=\"{$a_new_topic}\">");
|
||||
$tpl->set('[/new_topic]',"</a>");
|
||||
|
||||
if ($dle_forum_poll){
|
||||
$tpl->set_block("'\\[poll\\](.*?)\\[/poll\\]'si","\\1");
|
||||
$tpl->set('{topic_poll}', $tpl->result["topic_poll"]);
|
||||
}else{
|
||||
$tpl->set_block("'\\[poll\\](.*?)\\[/poll\\]'si","");
|
||||
}
|
||||
|
||||
if(!$row_topic['topic_status']){
|
||||
$tpl->set('[reply]',"<a href='{$a_href_reply}'\">");
|
||||
$tpl->set('[/reply]',"</a>");
|
||||
|
||||
if ($forums_array[$forum_id]['q_reply']){
|
||||
$tpl->set('{s_reply}', "<a href=\"javascript:ShowHide('sreply');\"><img src=\"{THEME}/forum/images/s_reply.gif\" border=\"0\" alt=\"Áûñòðûé îòâåò\"></a>");
|
||||
}else{
|
||||
$tpl->set('{s_reply}', "");
|
||||
$tpl->result['addpost'] = "";
|
||||
}
|
||||
|
||||
}else{
|
||||
$tpl->set_block("'\\[reply\\](.*?)\\[/reply\\]'si","");
|
||||
$tpl->set('{s_reply}', "<a href=\"{$a_href_reply}\"><img src=\"{THEME}/forum/images/closed.gif\" border=\"0\" alt=\"Òåìà çàêðûòà\"></a>");
|
||||
}
|
||||
|
||||
$tpl->set('{addpost}', $tpl->result['addpost']);
|
||||
|
||||
if ($forum_config['ses_topic'] and $forum_config['sessions_log']){
|
||||
forum_sessions($forum_id, $tid);
|
||||
|
||||
get_forum_online('act_topic', $tid);
|
||||
|
||||
$tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si","\\1");
|
||||
|
||||
$tpl->set('{all_count}', $forum_online['all_count']);
|
||||
$tpl->set('{guest_count}', $forum_online['guest_count']);
|
||||
$tpl->set('{member_count}', $forum_online['member_count']);
|
||||
$tpl->set('{member_list}', $forum_online['member_list']);
|
||||
}else{
|
||||
$tpl->set_block("'\\[online\\](.*?)\\[/online\\]'si","");
|
||||
}
|
||||
|
||||
$tpl->set('[new-topic]',"<a href='{$a_forum_url}showtopic={$tid}&view=new'>");
|
||||
$tpl->set('[/new-topic]',"</a>");
|
||||
|
||||
$tpl->set('{forum_name}', link_forum($forum_id, $forum_name));
|
||||
|
||||
$tpl->set('[old-topic]',"<a href='{$a_forum_url}showtopic={$tid}&view=old'>");
|
||||
$tpl->set('[/old-topic]',"</a>");
|
||||
|
||||
$tpl->set('[fast-search]',"<form action=\"\" method=\"post\">");
|
||||
$tpl->set('[/fast-search]',"<input type=\"hidden\" name=\"code\" value=\"search\" /></form>");
|
||||
|
||||
include_once SYSTEM_DIR.'/forum/sources/components/edit_options.php';
|
||||
|
||||
if ($topic_option or $posts_option)
|
||||
{
|
||||
if ($topic_option)
|
||||
{
|
||||
$topic_moderation = "<form method=\"POST\" action=\"{$a_forum_url}act=moderation\">";
|
||||
$topic_moderation .= "<select name=\"code\">{$topic_option}</select>";
|
||||
$topic_moderation .= "<input type=\"hidden\" value=\"{$tid}\" name=\"selected_id\" /><input type=\"submit\" class=\"button\" value=\">\"/></form>";
|
||||
|
||||
$tpl->set('{moderation}', $topic_moderation);
|
||||
}else{
|
||||
$tpl->set('{moderation}', '');
|
||||
}
|
||||
|
||||
if ($posts_option){
|
||||
$posts_moderation = "<form method=\"POST\" name=\"modform\" action=\"{$a_forum_url}act=post\">";
|
||||
$posts_moderation .= "<select name=\"code\">{$posts_option}</select>";
|
||||
$posts_moderation .= "<input type=\"hidden\" value=\"\" name=\"selected_id\" /><input type=\"submit\" class=\"button\" value=\"Ok\"/></form>";
|
||||
|
||||
$tpl->set('{post_moderation}', $posts_moderation);
|
||||
}else{
|
||||
$tpl->set('{post_moderation}', '');
|
||||
}
|
||||
|
||||
$tpl->set_block("'\\[moderation\\](.*?)\\[/moderation\\]'si","\\1");
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\\[moderation\\](.*?)\\[/moderation\\]'si","");
|
||||
}
|
||||
|
||||
$tpl->set('{posts}', $tpl->result['posts']);
|
||||
|
||||
$tpl->compile('dle_forum');
|
||||
$tpl->clear();
|
||||
|
||||
// ********************************************************************************
|
||||
// HIDE
|
||||
// ********************************************************************************
|
||||
if ($member_id['forum_post'] >= $forum_config['post_hide']) { $tpl->result['dle_forum'] = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "\\1", $tpl->result['dle_forum']); }
|
||||
else { $tpl->result['dle_forum'] = preg_replace ( "'\[hide\](.*?)\[/hide\]'si", "<div class=\"quote\">" . $lang['news_regus'] . "</div>", $tpl->result['dle_forum'] ); }
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
forum_msg($f_lang['search_result'], $f_lang['search_topic']);
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$group_name = $user_group[$member_id['user_group']]['group_name'];
|
||||
|
||||
forum_msg($f_lang['f_msg'], $f_lang['topic_read'], 'user_group', $group_name);
|
||||
}
|
||||
|
||||
$metatags['title'] = $forum_config['forum_title'].' » '.stripslashes($row_topic['title']);
|
||||
|
||||
// ********************************************************************************
|
||||
// FORUM BAR
|
||||
// ********************************************************************************
|
||||
if ($forum_config['forum_bar'])
|
||||
{
|
||||
$bbr_fid = $forum_id;
|
||||
$bbr_fname = $forum_name;
|
||||
|
||||
$c_id = $forums_array[$forum_id]['main_id'];
|
||||
|
||||
$bbr_cid = $c_id;
|
||||
$bbr_name = $cats_array[$c_id]['cat_name'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
82
system/forum/sources/showtopics.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
if(!defined('DATALIFEENGINE'))
|
||||
{
|
||||
die("Hacking attempt!");
|
||||
}
|
||||
|
||||
while ($row = $db->get_row($result_topics))
|
||||
{
|
||||
if ($forum_config['topic_abc'])
|
||||
{
|
||||
if (strlen($row['title']) > $forum_config['topic_abc'])
|
||||
{
|
||||
$row['title'] = substr ($row['title'], 0, $forum_config['topic_abc']).'...';
|
||||
}
|
||||
|
||||
if (strlen($row['topic_descr']) > $forum_config['topic_abc'])
|
||||
{
|
||||
$row['topic_descr'] = substr ($row['topic_descr'], 0, $forum_config['topic_abc']).'...';
|
||||
}
|
||||
}
|
||||
|
||||
$topic_link = link_topic($row['tid'], $row['title']);
|
||||
|
||||
if ($row['hidden']){$topic_link = $forum_config['forum_pr_modr'].' '.$topic_link;}
|
||||
if (!$row['fixed']){$topic_link = $forum_config['forum_pr_imp'].' '.$topic_link;}
|
||||
if ($row['frage']){$topic_link = $forum_config['forum_pr_vote'].' '.$topic_link;}
|
||||
|
||||
$tpl->load_template($tpl_dir.'topics.tpl');
|
||||
|
||||
$tpl->set('{status}', topic_status($row['tid'], $row['last_date'], $row['post'], $row['topic_status'], $row['frage']));
|
||||
$tpl->set('{title}', stripslashes($topic_link));
|
||||
$tpl->set('{description}', stripslashes($row['topic_descr']));
|
||||
$tpl->set('{show}', $row['views']);
|
||||
$tpl->set('{post}', $row['post']);
|
||||
|
||||
$str='';
|
||||
$nom='';
|
||||
$str=ceil($row['post']/$forum_config['post_inpage']);
|
||||
if ($str>1) {
|
||||
if ($str<=5) {
|
||||
for ($i = 1; $i <= $str; $i++) {
|
||||
$topic_linker="/forum/topic_".$row['tid']."/".$i."/";
|
||||
$nom.="<a id=\"pagen\" href='$topic_linker'>$i</a> ";}
|
||||
$tpl->set('{str}', $nom);
|
||||
}
|
||||
if ($str>5){
|
||||
for ($i = 1; $i <= 5; $i++) {
|
||||
$topic_linker="/forum/topic_".$row['tid']."/".$i."/";
|
||||
$nom.="<a id=\"pagen\" href='$topic_linker'>$i</a> ";
|
||||
}
|
||||
$nom.="...";
|
||||
$topic_linker="/forum/topic_".$row['tid']."/".$str."/";
|
||||
$nom.="<a id=\"pagen\" href='$topic_linker'>$str</a>";
|
||||
$tpl->set('{str}', $nom);
|
||||
}
|
||||
} else $tpl->set('{str}', '');
|
||||
|
||||
$tpl->set('{author}', link_user($row['author_topic']));
|
||||
|
||||
$tpl->set('{last}', topic_last ($row['tid'], $row['last_poster_name'], $row['last_date'], $row['post'], $row['last_post_id']));
|
||||
|
||||
if ($mass_prune)
|
||||
{
|
||||
$tpl->set('[selected]',"");
|
||||
|
||||
$tpl->set('{selected}', "<input OnClick=\"select_id('{$row['tid']}');\" type='checkbox' name=\"sid[{$row['tid']}]\" value=\"{$row['tid']}\">");
|
||||
|
||||
$tpl->set('[/selected]',"");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$tpl->set_block("'\\[selected\\](.*?)\\[/selected\\]'si","");
|
||||
}
|
||||
|
||||
$tpl->compile('topics');
|
||||
|
||||
$tpl->clear();
|
||||
|
||||
$is_topics = 1;
|
||||
}
|
||||
?>
|
||||
178
system/forum/textscreen.css
Normal file
@@ -0,0 +1,178 @@
|
||||
BODY
|
||||
{
|
||||
background-color: #FFF;
|
||||
color: #000;
|
||||
font-family: Verdana, Tahoma, Arial, "Trebuchet MS", Sans-Serif, Georgia, Courier, "Times New Roman", Serif;
|
||||
font-size: 1em;
|
||||
margin: 20px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.nav
|
||||
{
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
border:1px solid gray;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
.pagespan
|
||||
{
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
border:1px solid gray;
|
||||
padding:10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.navsmall
|
||||
{
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
border:1px dotted lightgray;
|
||||
padding:8px 8px 8px 8px;
|
||||
text-align:center;
|
||||
width:350px;
|
||||
float:right;
|
||||
}
|
||||
|
||||
#largetext
|
||||
{
|
||||
font-size: 1.0em;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
padding-top: 3px;
|
||||
width:auto;
|
||||
}
|
||||
|
||||
#wrapper
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#copyright
|
||||
{
|
||||
margin-top: 10px;
|
||||
font-size: 10px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
#content
|
||||
{
|
||||
padding: 10px;
|
||||
margin-top:10px;
|
||||
border:1px solid gray;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.topicwrap,
|
||||
.forumwrap
|
||||
{
|
||||
line-height:130%;
|
||||
}
|
||||
|
||||
.topicwrap ul,
|
||||
.forumwrap ul
|
||||
{
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.topicwrap li,
|
||||
.forumwrap li
|
||||
{
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
.forumwrap strong
|
||||
{
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.desc
|
||||
{
|
||||
color: gray;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.smalltext
|
||||
{
|
||||
color: gray;
|
||||
font-size: 10px;
|
||||
text-align:center;
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
/*---------------------------------------*/
|
||||
/* Post view */
|
||||
/*---------------------------------------*/
|
||||
|
||||
|
||||
.postwrapper
|
||||
{
|
||||
border:1px solid #E6E3E4;
|
||||
padding:1px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.posttopbar
|
||||
{
|
||||
background-color: #E6E3E4;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.postname
|
||||
{
|
||||
font-weight: bold;
|
||||
font-size: 0.8em;
|
||||
width: auto;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.postdate
|
||||
{
|
||||
width:auto;
|
||||
font-size: 0.8em;
|
||||
color: gray;
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
.postcontent
|
||||
{
|
||||
padding: 6px;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.title_quote
|
||||
{
|
||||
color: #000;
|
||||
margin: 8px auto 0px auto;
|
||||
font-weight:bold;
|
||||
font-size:10px;
|
||||
padding: 8px;
|
||||
background-color:#E4EAF2;
|
||||
border-left: 4px solid #8394B2;
|
||||
border-top: 1px dotted #000;
|
||||
border-right: 1px dotted #000;
|
||||
}
|
||||
.quote
|
||||
{
|
||||
color: #465584;
|
||||
background-color: #FAFCFE;
|
||||
border-left: 4px solid #8394B2;
|
||||
border-right: 1px dotted #000;
|
||||
border-bottom: 1px dotted #000;
|
||||
padding: 4px;
|
||||
margin: 0px auto 8px auto;
|
||||
}
|
||||
.scriptcode
|
||||
{
|
||||
font-family: Courier, "Courier New", Verdana, Arial;
|
||||
color: #465584;
|
||||
background-color: #FAFCFE;
|
||||
border: 1px dotted #000;
|
||||
padding: 2px;
|
||||
width:98%;
|
||||
margin: 0px auto 0px auto;
|
||||
}
|
||||
428
system/forum/textversion.php
Normal file
@@ -0,0 +1,428 @@
|
||||
<?php
|
||||
@session_start();
|
||||
@error_reporting(E_ALL ^ E_NOTICE);
|
||||
@ini_set('display_errors', true);
|
||||
@ini_set('html_errors', false);
|
||||
|
||||
define('DATALIFEENGINE', true);
|
||||
|
||||
if(!defined('FORUM_SUB_DOMAIN')){define('ROOT_DIR', '../..');}
|
||||
|
||||
define('SYSTEM_DIR', ROOT_DIR.'/system');
|
||||
|
||||
include SYSTEM_DIR.'/data/config.php';
|
||||
include SYSTEM_DIR.'/data/forum_config.php';
|
||||
|
||||
$_TIME = time()+($config['date_adjust']*60);
|
||||
|
||||
$tpl = array();
|
||||
|
||||
$tpl['charset'] = $config['charset'];
|
||||
|
||||
include_once ROOT_DIR.'/language/'.$config['langs'].'/website.lng';
|
||||
require_once SYSTEM_DIR.'/modules/functions.php';
|
||||
require_once SYSTEM_DIR.'/classes/mysql.php';
|
||||
require_once SYSTEM_DIR.'/data/dbconfig.php';
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/init.php';
|
||||
require_once SYSTEM_DIR.'/forum/sources/components/text_skin.php';
|
||||
|
||||
// ********************************************************************************
|
||||
// FORUM URL
|
||||
// ********************************************************************************
|
||||
if (!$forum_config['forum_url'])
|
||||
{
|
||||
$forum_url = $config['http_home_url']."forum";
|
||||
|
||||
$txt_url = $config['http_home_url']."forum/textversion.html";
|
||||
|
||||
$a_forum_url = $config['http_home_url']."index.php?do=forum&";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$forum_url = $forum_config['forum_url'];
|
||||
|
||||
$txt_url = $forum_config['forum_url']."/textversion.html";
|
||||
|
||||
$a_forum_url = $forum_config['forum_url']."/index.php?";
|
||||
}
|
||||
|
||||
$c_url = $forum_url.'/category_';
|
||||
|
||||
$f_url = $forum_url.'/forum_';
|
||||
|
||||
$t_url = $forum_url.'/topic_';
|
||||
|
||||
// ********************************************************************************
|
||||
// USER GROUP
|
||||
// ********************************************************************************
|
||||
$user_group = $cache->get ("usergroup");
|
||||
if (!$user_group){
|
||||
$user_group = array ();
|
||||
$db->query("SELECT * FROM " . USERPREFIX . "_usergroups ORDER BY id ASC");
|
||||
while($row = $db->get_row())
|
||||
{
|
||||
$user_group[$row['id']] = array ();
|
||||
foreach ($row as $key => $value){$user_group[$row['id']][$key] = $value;}
|
||||
}
|
||||
$cache->set ("usergroup", $user_group);
|
||||
$db->free();
|
||||
}
|
||||
|
||||
require_once SYSTEM_DIR.'/modules/sitelogin.php';
|
||||
|
||||
if (!$is_logged){$member_id['user_group'] = 5;}
|
||||
|
||||
function get_attachment ($tid, $sourse){
|
||||
global $db, $a_forum_url;
|
||||
|
||||
$get_attachment = $db->query("SELECT * FROM " . PREFIX . "_forum_files WHERE topic_id = '$tid' and file_attach = '1'");
|
||||
|
||||
while ($row = $db->get_row($get_attachment))
|
||||
{
|
||||
if ($row['file_type'] == "image")
|
||||
{
|
||||
$img_full = $config['http_home_url'].'uploads/forum/images/'.$row['onserver'];
|
||||
$attachment = "<img src=\"{$img_full}\" border=\"0\">";
|
||||
}
|
||||
|
||||
elseif ($row['file_type'] == "thumb")
|
||||
{
|
||||
$img_full = $config['http_home_url'].'uploads/forum/images/'.$row['onserver'];
|
||||
$img_thumb = $config['http_home_url'].'uploads/forum/thumbs/'.$row['onserver'];
|
||||
$attachment = "<a href=\"{$img_full}\"><img src=\"{$img_thumb}\" border=\"0\"></a>";
|
||||
}else{
|
||||
$attachment_down = $a_forum_url."act=attachment&id=".$row['file_id'];
|
||||
$attachment = "<a href=\"$attachment_down\">{$row['file_name']}</a> ({$row['dcount']} | ".mksize($row['file_size']).")";
|
||||
}
|
||||
$sourse = str_replace('[attachment='.$row['file_id'].']', $attachment, $sourse);
|
||||
}
|
||||
return $sourse;
|
||||
}
|
||||
|
||||
function not_access(){
|
||||
global $txt_url;
|
||||
@header ("Location: $txt_url");
|
||||
}
|
||||
|
||||
$forum_config['topic_inpage'] = 150;
|
||||
$forum_config['post_inpage'] = 50;
|
||||
|
||||
// ********************************************************************************
|
||||
// TEXT VERSION
|
||||
// ********************************************************************************
|
||||
$main_string = parse_url($_SERVER['REQUEST_URI']);
|
||||
|
||||
$main_string = $main_string['query'];
|
||||
|
||||
$act = '';
|
||||
$id = 0;
|
||||
$cstart = 0;
|
||||
|
||||
$category_name = 0;
|
||||
$category_id = 0;
|
||||
$forum_name = 0;
|
||||
|
||||
if (strstr($main_string, "-")){
|
||||
list($main, $start) = explode("-", $main_string);
|
||||
|
||||
$main_string = $main;
|
||||
$cstart = $start;
|
||||
}
|
||||
|
||||
if (preg_match( "#c\d#", $main_string)){
|
||||
$act = "category";
|
||||
|
||||
$id = intval( preg_replace( "#c(\d+)#", "\\1", $main_string ) );
|
||||
}
|
||||
|
||||
if (preg_match( "#f\d#", $main_string)){
|
||||
$act = "forum";
|
||||
|
||||
$id = intval( preg_replace( "#f(\d+)#", "\\1", $main_string ) );
|
||||
}
|
||||
|
||||
if (preg_match( "#t\d#", $main_string)){
|
||||
$act = "topic";
|
||||
|
||||
$id = intval( preg_replace( "#t(\d+)#", "\\1", $main_string ) );
|
||||
}
|
||||
|
||||
switch ($act)
|
||||
{
|
||||
// ********************************************************************************
|
||||
// SHOW CATEGORY
|
||||
// ********************************************************************************
|
||||
case "category":
|
||||
|
||||
$category_id = $id;
|
||||
|
||||
if ($forum_config['hide_forum']) $access_hide = "and access_read regexp '[[:<:]](".$member_id['user_group'].")[[:>:]]'";
|
||||
|
||||
else $access_hide = "";
|
||||
|
||||
$category_name = $cats_array[$id]['cat_name'];
|
||||
|
||||
if ($id and $category_name)
|
||||
{
|
||||
$result = $db->query("SELECT * FROM ". PREFIX ."_forum_forums WHERE main_id = '$id' and parentid = '0' {$access_hide} ORDER by position");
|
||||
|
||||
$tpl['content'] .= tpl_category ($id, $category_name);
|
||||
|
||||
while ($row = $db->get_row($result))
|
||||
{
|
||||
$sub_forums = "";
|
||||
|
||||
if ($sub_forums_array != 'empty')
|
||||
{
|
||||
foreach ($sub_forums_array as $value)
|
||||
{
|
||||
if ($row['id'] == $value['parentid'])
|
||||
{
|
||||
$sub_forums .= tpl_forum_sub ($value['id'], $value['name']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tpl['content'] .= tpl_forum ($row['id'], $row['name'], $row['posts'], $sub_forums);
|
||||
}
|
||||
}
|
||||
|
||||
$tpl['content'] = tpl_forums_page ($tpl['content']);
|
||||
|
||||
$tpl['content'] .= tpl_category_end ();
|
||||
|
||||
$tpl['title'] = $forum_config['forum_title'] .' > '. $category_name;
|
||||
|
||||
$tpl['full_version'] = $category_name;
|
||||
|
||||
$tpl['full_version_link'] = $c_url . $id;
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// SHOW FORUM
|
||||
// ********************************************************************************
|
||||
case "forum":
|
||||
|
||||
if ($cstart){
|
||||
$cstart = $cstart - 1;
|
||||
$cstart = $cstart * $forum_config['topic_inpage'];
|
||||
}
|
||||
|
||||
if ($forum_config['topic_sort'])
|
||||
{
|
||||
$sort_type = "last_date";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sort_type = "tid";
|
||||
}
|
||||
|
||||
if ($id)
|
||||
{
|
||||
$row_forum = $db->super_query("SELECT * FROM " . PREFIX . "_forum_forums WHERE id = '$id'");
|
||||
|
||||
$check_read = check_access($row_forum['access_read']);
|
||||
|
||||
$forum_name = $row_forum['name'];
|
||||
|
||||
$password = $row_forum['password'];
|
||||
|
||||
$category_id = $row_forum['main_id'];
|
||||
|
||||
$count_all = $row_forum['topics'];
|
||||
|
||||
if ($password)
|
||||
{
|
||||
$forum_cookie = $_COOKIE["dle_forum_{$fid}"];
|
||||
|
||||
unset ($check_read);
|
||||
|
||||
if (md5($password) == $forum_cookie)
|
||||
{
|
||||
$check_read = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_read and $count_all)
|
||||
{
|
||||
$db->query("SELECT * FROM " . PREFIX . "_forum_topics WHERE forum_id = '$id' ".$WHERE." ORDER BY fixed, ".$sort_type." DESC LIMIT ".$cstart.",".$forum_config['topic_inpage']."");
|
||||
|
||||
while ($row = $db->get_row())
|
||||
{
|
||||
if ($row['hidden']) $n_pre = $forum_config['forum_pr_modr'].' ';
|
||||
|
||||
elseif (!$row['fixed']) $n_pre = $forum_config['forum_pr_imp'].' ';
|
||||
|
||||
elseif ($row['frage']) $n_pre = $forum_config['forum_pr_vote'].' ';
|
||||
|
||||
else $n_pre = '';
|
||||
|
||||
$tpl['content'] .= tpl_topic_list ($row['tid'], $n_pre, $row['title'], $row['post']);
|
||||
}
|
||||
|
||||
if ($count_all > $forum_config['topic_inpage'])
|
||||
{
|
||||
$tpl['pages'] = tpl_pages ($cstart, $count_all, $forum_config['topic_inpage'], "?f{$id}");
|
||||
}
|
||||
|
||||
$tpl['content'] = tpl_forum_page ($tpl['content']);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
not_access();
|
||||
}
|
||||
|
||||
$tpl['title'] = $forum_config['forum_title'] .' > '. $forum_name;
|
||||
|
||||
$tpl['full_version'] = $forum_name;
|
||||
|
||||
$tpl['full_version_link'] = $f_url . $id;
|
||||
|
||||
$category_name = $cats_array[$category_id]['cat_name'];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
not_access();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// SHOW TOPIC
|
||||
// ********************************************************************************
|
||||
case "topic":
|
||||
|
||||
if ($cstart){
|
||||
$cstart = $cstart - 1;
|
||||
$cstart = $cstart * $forum_config['post_inpage'];
|
||||
}
|
||||
|
||||
if ($id){
|
||||
$row_topic = $db->super_query("SELECT * FROM " . PREFIX . "_forum_topics WHERE tid = '$id'");
|
||||
$forum_id = $row_topic['forum_id'];
|
||||
$forum_name = $forums_array[$forum_id]['name'];
|
||||
$check_read = check_access($forums_array[$forum_id]['access_read']);
|
||||
}
|
||||
|
||||
if ($row_topic['tid'] and $check_read and !$row_topic['hidden']){
|
||||
$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 = '$id' ORDER by pid LIMIT ".$cstart.",".$forum_config['post_inpage']."");
|
||||
|
||||
$count_all = ($row_topic['post'] + 1);
|
||||
|
||||
if ($count_all)
|
||||
{
|
||||
while ($row = $db->get_row ($result_posts))
|
||||
{
|
||||
if ($row['hidden'])
|
||||
{
|
||||
$row['post_text'] = " ";
|
||||
}
|
||||
|
||||
if( $user_group[$member_id['user_group']]['allow_hide'] ) $row['post_text'] = preg_replace( "'\[hide\](.*?)\[/hide\]'si", "\\1", $row['post_text']);
|
||||
else $row['post_text'] = preg_replace ( "'\[hide\](.*?)\[/hide\]'si", "<div class=\"quote\">" . $lang['news_regus'] . "</div>", $row['post_text'] );
|
||||
$row['post_text'] = preg_replace ( "'\[group=(.*?)\](.*?)\[/group\]'sie",'group_hide($1,"\\2")', $row['post_text']);
|
||||
|
||||
$row['post_date'] = strtotime($row['post_date']);
|
||||
|
||||
$tpl['content'] .= tpl_post ($row['post_text'], $row['post_author'], show_date($row['post_date']));
|
||||
}
|
||||
|
||||
if (stristr ($tpl['content'], "[attachment="))
|
||||
{
|
||||
$tpl['content'] = get_attachment ($id, $tpl['content']);
|
||||
}
|
||||
|
||||
if ($count_all > $forum_config['post_inpage'])
|
||||
{
|
||||
$tpl['pages'] = tpl_pages ($cstart, $count_all, $forum_config['post_inpage'], "?t{$id}");
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
not_access();
|
||||
}
|
||||
|
||||
$tpl['title'] = $forum_config['forum_title'] .' > '. $row_topic['title'];
|
||||
|
||||
$tpl['full_version'] = $row_topic['title'];
|
||||
|
||||
$tpl['full_version_link'] = $t_url . $id;
|
||||
|
||||
$category_id = $forums_array[$forum_id]['main_id'];
|
||||
|
||||
$category_name = $cats_array[$category_id]['cat_name'];
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
not_access();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ********************************************************************************
|
||||
// SHOW INDEX
|
||||
// ********************************************************************************
|
||||
default:
|
||||
|
||||
if ($forum_config['hide_forum']) $access_hide = "and access_read regexp '[[:<:]](".$member_id['user_group'].")[[:>:]]'";
|
||||
|
||||
else $access_hide = "";
|
||||
|
||||
$db->query("SELECT * FROM " . PREFIX . "_forum_category LEFT JOIN ". PREFIX ."_forum_forums ON ". PREFIX ."_forum_category.sid= ". PREFIX ."_forum_forums.main_id WHERE parentid = '0' {$access_hide} ORDER BY posi, position");
|
||||
|
||||
for ($i = 0; $row = $db->get_row(); $i = $row['sid'])
|
||||
{
|
||||
$count++;
|
||||
|
||||
if ($row['sid'] != $i)
|
||||
{
|
||||
if ($count > 1)
|
||||
{
|
||||
$tpl['content'] .= tpl_category_end ();
|
||||
}
|
||||
|
||||
$tpl['content'] .= tpl_category ($row['main_id'], $row['cat_name']);
|
||||
}
|
||||
|
||||
if ($row['name'])
|
||||
{
|
||||
$sub_forums = "";
|
||||
|
||||
if ($sub_forums_array != 'empty')
|
||||
{
|
||||
foreach ($sub_forums_array as $value)
|
||||
{
|
||||
if ($row['id'] == $value['parentid'])
|
||||
{
|
||||
$sub_forums .= tpl_forum_sub ($value['id'], $value['name']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tpl['content'] .= tpl_forum ($row['id'], $row['name'], $row['posts'], $sub_forums);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$tpl['content'] = tpl_forums_page ($tpl['content']);
|
||||
$tpl['title'] = $forum_config['forum_title'];
|
||||
$tpl['full_version'] = $forum_config['forum_title'];
|
||||
$tpl['full_version_link'] = $forum_url;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$tpl['nav'] = "<a href='{$txt_url}'>{$forum_config['forum_title']}</a>";
|
||||
|
||||
if ($category_name){$tpl['nav'] = $tpl['nav'] . " > <a href='{$txt_url}?c{$category_id}'>{$category_name}</a>";}
|
||||
if ($forum_name){$tpl['nav'] = $tpl['nav'] . " > <a href='{$txt_url}?f{$id}'>{$forum_name}</a>";}
|
||||
|
||||
tpl_main ($tpl);
|
||||
|
||||
?>
|
||||