mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 21:33:54 -07:00
r486
Черновики. ALTER TABLE `bb_topics` ADD COLUMN `is_draft` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `topic_show_first_post`; git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@486 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
0f8ae52264
commit
7ffc9c882d
13 changed files with 229 additions and 211 deletions
|
@ -1331,6 +1331,7 @@ CREATE TABLE IF NOT EXISTS `bb_topics` (
|
||||||
`topic_dl_type` tinyint(1) NOT NULL DEFAULT '0',
|
`topic_dl_type` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`topic_last_post_time` int(11) NOT NULL DEFAULT '0',
|
`topic_last_post_time` int(11) NOT NULL DEFAULT '0',
|
||||||
`topic_show_first_post` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
`topic_show_first_post` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`is_draft` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`topic_id`),
|
PRIMARY KEY (`topic_id`),
|
||||||
KEY `forum_id` (`forum_id`),
|
KEY `forum_id` (`forum_id`),
|
||||||
KEY `topic_last_post_id` (`topic_last_post_id`),
|
KEY `topic_last_post_id` (`topic_last_post_id`),
|
||||||
|
|
399
upload/ajax.php
399
upload/ajax.php
|
@ -8,53 +8,51 @@ require('./common.php');
|
||||||
$ajax->init();
|
$ajax->init();
|
||||||
|
|
||||||
// Handle "board disabled via ON/OFF trigger"
|
// Handle "board disabled via ON/OFF trigger"
|
||||||
if (file_exists(BB_DISABLED))
|
if (file_exists(BB_DISABLED)) {
|
||||||
{
|
|
||||||
$ajax->ajax_die($bb_cfg['board_disabled_msg']);
|
$ajax->ajax_die($bb_cfg['board_disabled_msg']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load actions required modules
|
// Load actions required modules
|
||||||
switch ($ajax->action)
|
switch ($ajax->action) {
|
||||||
{
|
|
||||||
case 'view_post':
|
case 'view_post':
|
||||||
require(INC_DIR .'bbcode.php');
|
require(INC_DIR . 'bbcode.php');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'posts':
|
case 'posts':
|
||||||
case 'post_mod_comment':
|
case 'post_mod_comment':
|
||||||
require(INC_DIR .'bbcode.php');
|
require(INC_DIR . 'bbcode.php');
|
||||||
require(INC_DIR .'functions_post.php');
|
require(INC_DIR . 'functions_post.php');
|
||||||
require(INC_DIR .'functions_admin.php');
|
require(INC_DIR . 'functions_admin.php');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'view_torrent':
|
case 'view_torrent':
|
||||||
case 'mod_action':
|
case 'mod_action':
|
||||||
case 'change_tor_status':
|
case 'change_tor_status':
|
||||||
case 'gen_passkey';
|
case 'gen_passkey';
|
||||||
require(BB_ROOT .'attach_mod/attachment_mod.php');
|
require(BB_ROOT . 'attach_mod/attachment_mod.php');
|
||||||
require(INC_DIR .'functions_torrent.php');
|
require(INC_DIR . 'functions_torrent.php');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'change_torrent':
|
case 'change_torrent':
|
||||||
require(BB_ROOT .'attach_mod/attachment_mod.php');
|
require(BB_ROOT . 'attach_mod/attachment_mod.php');
|
||||||
require(INC_DIR .'functions_torrent.php');
|
require(INC_DIR . 'functions_torrent.php');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'user_register':
|
case 'user_register':
|
||||||
require(INC_DIR .'functions_validate.php');
|
require(INC_DIR . 'functions_validate.php');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'manage_user':
|
case 'manage_user':
|
||||||
require(INC_DIR .'functions_admin.php');
|
require(INC_DIR . 'functions_admin.php');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'group_membership':
|
case 'group_membership':
|
||||||
require(INC_DIR .'functions_group.php');
|
require(INC_DIR . 'functions_group.php');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// position in $ajax->valid_actions['xxx']
|
// position in $ajax->valid_actions['xxx']
|
||||||
define('AJAX_AUTH', 0); // 'guest', 'user', 'mod', 'admin'
|
define('AJAX_AUTH', 0); // 'guest', 'user', 'mod', 'admin'
|
||||||
|
|
||||||
$user->session_start();
|
$user->session_start();
|
||||||
$ajax->exec();
|
$ajax->exec();
|
||||||
|
@ -64,88 +62,82 @@ $ajax->exec();
|
||||||
//
|
//
|
||||||
class ajax_common
|
class ajax_common
|
||||||
{
|
{
|
||||||
var $request = array();
|
var $request = array();
|
||||||
var $response = array();
|
var $response = array();
|
||||||
|
|
||||||
var $valid_actions = array(
|
var $valid_actions = array(
|
||||||
// ACTION NAME AJAX_AUTH
|
// ACTION NAME AJAX_AUTH
|
||||||
'edit_user_profile' => array('admin'),
|
'edit_user_profile' => array('admin'),
|
||||||
'change_user_rank' => array('admin'),
|
'change_user_rank' => array('admin'),
|
||||||
'change_user_opt' => array('admin'),
|
'change_user_opt' => array('admin'),
|
||||||
'manage_user' => array('admin'),
|
'manage_user' => array('admin'),
|
||||||
|
|
||||||
'mod_action' => array('mod'),
|
'mod_action' => array('mod'),
|
||||||
'topic_tpl' => array('mod'),
|
'topic_tpl' => array('mod'),
|
||||||
'group_membership' => array('mod'),
|
'group_membership' => array('mod'),
|
||||||
|
|
||||||
'gen_passkey' => array('user'),
|
'gen_passkey' => array('user'),
|
||||||
'change_torrent' => array('user'),
|
'change_torrent' => array('user'),
|
||||||
'change_tor_status' => array('user'),
|
'change_tor_status' => array('user'),
|
||||||
|
'modify_draft' => array('user'),
|
||||||
|
|
||||||
'view_post' => array('guest'),
|
'view_post' => array('guest'),
|
||||||
'view_torrent' => array('guest'),
|
'view_torrent' => array('guest'),
|
||||||
'user_register' => array('guest'),
|
'user_register' => array('guest'),
|
||||||
'posts' => array('guest'),
|
'posts' => array('guest'),
|
||||||
'index_data' => array('guest'),
|
'index_data' => array('guest'),
|
||||||
|
|
||||||
'post_mod_comment' => array('mod'),
|
'post_mod_comment' => array('mod'),
|
||||||
);
|
);
|
||||||
|
|
||||||
var $action = null;
|
var $action = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
function ajax_common ()
|
function ajax_common()
|
||||||
{
|
{
|
||||||
ob_start(array(&$this, 'ob_handler'));
|
ob_start(array(&$this, 'ob_handler'));
|
||||||
header('Content-Type: text/plain');
|
header('Content-Type: text/plain');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform action
|
* Perform action
|
||||||
*/
|
*/
|
||||||
function exec ()
|
function exec()
|
||||||
{
|
{
|
||||||
global $lang;
|
global $lang;
|
||||||
|
|
||||||
// Exit if we already have errors
|
// Exit if we already have errors
|
||||||
if (!empty($this->response['error_code']))
|
if (!empty($this->response['error_code'])) {
|
||||||
{
|
|
||||||
$this->send();
|
$this->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that requested action is valid
|
// Check that requested action is valid
|
||||||
$action = $this->action;
|
$action = $this->action;
|
||||||
|
|
||||||
if (!$action || !is_string($action))
|
if (!$action || !is_string($action)) {
|
||||||
{
|
|
||||||
$this->ajax_die('no action specified');
|
$this->ajax_die('no action specified');
|
||||||
}
|
} else if (!$action_params =& $this->valid_actions[$action]) {
|
||||||
else if (!$action_params =& $this->valid_actions[$action])
|
$this->ajax_die('invalid action: ' . $action);
|
||||||
{
|
|
||||||
$this->ajax_die('invalid action: '. $action);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auth check
|
// Auth check
|
||||||
switch ($action_params[AJAX_AUTH])
|
switch ($action_params[AJAX_AUTH]) {
|
||||||
{
|
|
||||||
// GUEST
|
// GUEST
|
||||||
case 'guest':
|
case 'guest':
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// USER
|
// USER
|
||||||
case 'user':
|
case 'user':
|
||||||
if (IS_GUEST)
|
if (IS_GUEST) {
|
||||||
{
|
|
||||||
$this->ajax_die($lang['NEED_TO_LOGIN_FIRST']);
|
$this->ajax_die($lang['NEED_TO_LOGIN_FIRST']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// MOD
|
// MOD
|
||||||
case 'mod':
|
case 'mod':
|
||||||
if (!IS_AM)
|
if (!IS_AM) {
|
||||||
{
|
|
||||||
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
||||||
}
|
}
|
||||||
$this->check_admin_session();
|
$this->check_admin_session();
|
||||||
|
@ -153,8 +145,7 @@ class ajax_common
|
||||||
|
|
||||||
// ADMIN
|
// ADMIN
|
||||||
case 'admin':
|
case 'admin':
|
||||||
if (!IS_ADMIN)
|
if (!IS_ADMIN) {
|
||||||
{
|
|
||||||
$this->ajax_die($lang['ONLY_FOR_ADMIN']);
|
$this->ajax_die($lang['ONLY_FOR_ADMIN']);
|
||||||
}
|
}
|
||||||
$this->check_admin_session();
|
$this->check_admin_session();
|
||||||
|
@ -172,9 +163,9 @@ class ajax_common
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exit on error
|
* Exit on error
|
||||||
*/
|
*/
|
||||||
function ajax_die ($error_msg, $error_code = E_AJAX_GENERAL_ERROR)
|
function ajax_die($error_msg, $error_code = E_AJAX_GENERAL_ERROR)
|
||||||
{
|
{
|
||||||
$this->response['error_code'] = $error_code;
|
$this->response['error_code'] = $error_code;
|
||||||
$this->response['error_msg'] = $error_msg;
|
$this->response['error_msg'] = $error_msg;
|
||||||
|
@ -183,23 +174,22 @@ class ajax_common
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialization
|
* Initialization
|
||||||
*/
|
*/
|
||||||
function init ()
|
function init()
|
||||||
{
|
{
|
||||||
$this->request = $_POST;
|
$this->request = $_POST;
|
||||||
$this->action =& $this->request['action'];
|
$this->action =& $this->request['action'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send data
|
* Send data
|
||||||
*/
|
*/
|
||||||
function send ()
|
function send()
|
||||||
{
|
{
|
||||||
$this->response['action'] = $this->action;
|
$this->response['action'] = $this->action;
|
||||||
|
|
||||||
if (DBG_USER && SQL_DEBUG && !empty($_COOKIE['sql_log']))
|
if (DBG_USER && SQL_DEBUG && !empty($_COOKIE['sql_log'])) {
|
||||||
{
|
|
||||||
$this->response['sql_log'] = get_sql_log();
|
$this->response['sql_log'] = get_sql_log();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,24 +198,20 @@ class ajax_common
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OB Handler
|
* OB Handler
|
||||||
*/
|
*/
|
||||||
function ob_handler ($contents)
|
function ob_handler($contents)
|
||||||
{
|
{
|
||||||
if (DBG_USER)
|
if (DBG_USER) {
|
||||||
{
|
if ($contents) {
|
||||||
if ($contents)
|
|
||||||
{
|
|
||||||
$this->response['raw_output'] = $contents;
|
$this->response['raw_output'] = $contents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$response_js = bb_json_encode($this->response);
|
$response_js = bb_json_encode($this->response);
|
||||||
|
|
||||||
if (GZIP_OUTPUT_ALLOWED && !defined('NO_GZIP'))
|
if (GZIP_OUTPUT_ALLOWED && !defined('NO_GZIP')) {
|
||||||
{
|
if (UA_GZIP_SUPPORTED && strlen($response_js) > 2000) {
|
||||||
if (UA_GZIP_SUPPORTED && strlen($response_js) > 2000)
|
|
||||||
{
|
|
||||||
header('Content-Encoding: gzip');
|
header('Content-Encoding: gzip');
|
||||||
$response_js = gzencode($response_js, 1);
|
$response_js = gzencode($response_js, 1);
|
||||||
}
|
}
|
||||||
|
@ -235,26 +221,21 @@ class ajax_common
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin session
|
* Admin session
|
||||||
*/
|
*/
|
||||||
function check_admin_session ()
|
function check_admin_session()
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
if (!$user->data['session_admin'])
|
if (!$user->data['session_admin']) {
|
||||||
{
|
if (empty($this->request['user_password'])) {
|
||||||
if (empty($this->request['user_password']))
|
|
||||||
{
|
|
||||||
$this->prompt_for_password();
|
$this->prompt_for_password();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$login_args = array(
|
$login_args = array(
|
||||||
'login_username' => $user->data['username'],
|
'login_username' => $user->data['username'],
|
||||||
'login_password' => $_POST['user_password'],
|
'login_password' => $_POST['user_password'],
|
||||||
);
|
);
|
||||||
if (!$user->login($login_args, true))
|
if (!$user->login($login_args, true)) {
|
||||||
{
|
|
||||||
$this->ajax_die('Wrong password');
|
$this->ajax_die('Wrong password');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,184 +243,161 @@ class ajax_common
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prompt for password
|
* Prompt for password
|
||||||
*/
|
*/
|
||||||
function prompt_for_password ()
|
function prompt_for_password()
|
||||||
{
|
{
|
||||||
$this->response['prompt_password'] = 1;
|
$this->response['prompt_password'] = 1;
|
||||||
$this->send();
|
$this->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prompt for confirmation
|
* Prompt for confirmation
|
||||||
*/
|
*/
|
||||||
function prompt_for_confirm ($confirm_msg)
|
function prompt_for_confirm($confirm_msg)
|
||||||
{
|
{
|
||||||
if(empty($confirm_msg)) $this->ajax_die('false');
|
if (empty($confirm_msg)) $this->ajax_die('false');
|
||||||
|
|
||||||
$this->response['prompt_confirm'] = 1;
|
$this->response['prompt_confirm'] = 1;
|
||||||
$this->response['confirm_msg'] = $confirm_msg;
|
$this->response['confirm_msg'] = $confirm_msg;
|
||||||
$this->send();
|
$this->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify mod rights
|
* Verify mod rights
|
||||||
*/
|
*/
|
||||||
function verify_mod_rights ($forum_id)
|
function verify_mod_rights($forum_id)
|
||||||
{
|
{
|
||||||
global $userdata, $lang;
|
global $userdata, $lang;
|
||||||
|
|
||||||
$is_auth = auth(AUTH_MOD, $forum_id, $userdata);
|
$is_auth = auth(AUTH_MOD, $forum_id, $userdata);
|
||||||
|
|
||||||
if (!$is_auth['auth_mod'])
|
if (!$is_auth['auth_mod']) {
|
||||||
{
|
|
||||||
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
$this->ajax_die($lang['ONLY_FOR_MOD']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function edit_user_profile ()
|
function edit_user_profile()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'edit_user_profile.php');
|
require(AJAX_DIR . 'edit_user_profile.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function change_user_rank ()
|
function change_user_rank()
|
||||||
{
|
{
|
||||||
global $datastore, $lang;
|
global $datastore, $lang;
|
||||||
|
|
||||||
$ranks = $datastore->get('ranks');
|
$ranks = $datastore->get('ranks');
|
||||||
$rank_id = intval($this->request['rank_id']);
|
$rank_id = intval($this->request['rank_id']);
|
||||||
|
|
||||||
if (!$user_id = intval($this->request['user_id']) OR !$profiledata = get_userdata($user_id))
|
if (!$user_id = intval($this->request['user_id']) OR !$profiledata = get_userdata($user_id)) {
|
||||||
{
|
|
||||||
$this->ajax_die("invalid user_id: $user_id");
|
$this->ajax_die("invalid user_id: $user_id");
|
||||||
}
|
}
|
||||||
if ($rank_id != 0 && !isset($ranks[$rank_id]))
|
if ($rank_id != 0 && !isset($ranks[$rank_id])) {
|
||||||
{
|
|
||||||
$this->ajax_die("invalid rank_id: $rank_id");
|
$this->ajax_die("invalid rank_id: $rank_id");
|
||||||
}
|
}
|
||||||
|
|
||||||
DB()->query("UPDATE ". BB_USERS ." SET user_rank = $rank_id WHERE user_id = $user_id LIMIT 1");
|
DB()->query("UPDATE " . BB_USERS . " SET user_rank = $rank_id WHERE user_id = $user_id LIMIT 1");
|
||||||
|
|
||||||
cache_rm_user_sessions($user_id);
|
cache_rm_user_sessions($user_id);
|
||||||
|
|
||||||
$this->response['html'] = ($rank_id != 0) ? $lang['AWARDED_RANK'] . ' <b> '. $ranks[$rank_id]['rank_title'] .'</b>' : $lang['SHOT_RANK'];
|
$this->response['html'] = ($rank_id != 0) ? $lang['AWARDED_RANK'] . ' <b> ' . $ranks[$rank_id]['rank_title'] . '</b>' : $lang['SHOT_RANK'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function change_user_opt ()
|
function change_user_opt()
|
||||||
{
|
{
|
||||||
global $bf, $lang;
|
global $bf, $lang;
|
||||||
|
|
||||||
$user_id = (int) $this->request['user_id'];
|
$user_id = (int)$this->request['user_id'];
|
||||||
$new_opt = bb_json_decode($this->request['user_opt']);
|
$new_opt = bb_json_decode($this->request['user_opt']);
|
||||||
|
|
||||||
if (!$user_id OR !$u_data = get_userdata($user_id))
|
if (!$user_id OR !$u_data = get_userdata($user_id)) {
|
||||||
{
|
|
||||||
$this->ajax_die('invalid user_id');
|
$this->ajax_die('invalid user_id');
|
||||||
}
|
}
|
||||||
if (!is_array($new_opt))
|
if (!is_array($new_opt)) {
|
||||||
{
|
|
||||||
$this->ajax_die('invalid new_opt');
|
$this->ajax_die('invalid new_opt');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($bf['user_opt'] as $opt_name => $opt_bit)
|
foreach ($bf['user_opt'] as $opt_name => $opt_bit) {
|
||||||
{
|
if (isset($new_opt[$opt_name])) {
|
||||||
if (isset($new_opt[$opt_name]))
|
|
||||||
{
|
|
||||||
setbit($u_data['user_opt'], $opt_bit, !empty($new_opt[$opt_name]));
|
setbit($u_data['user_opt'], $opt_bit, !empty($new_opt[$opt_name]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DB()->query("UPDATE ". BB_USERS ." SET user_opt = {$u_data['user_opt']} WHERE user_id = $user_id LIMIT 1");
|
DB()->query("UPDATE " . BB_USERS . " SET user_opt = {$u_data['user_opt']} WHERE user_id = $user_id LIMIT 1");
|
||||||
|
|
||||||
// Удаляем данные из кеша
|
// Удаляем данные из кеша
|
||||||
cache_rm_user_sessions ($user_id);
|
cache_rm_user_sessions($user_id);
|
||||||
|
|
||||||
$this->response['resp_html'] = $lang['SAVED'];
|
$this->response['resp_html'] = $lang['SAVED'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function gen_passkey ()
|
function gen_passkey()
|
||||||
{
|
{
|
||||||
global $userdata, $lang;
|
global $userdata, $lang;
|
||||||
|
|
||||||
$req_uid = (int) $this->request['user_id'];
|
$req_uid = (int)$this->request['user_id'];
|
||||||
|
|
||||||
if ($req_uid == $userdata['user_id'] || IS_ADMIN)
|
if ($req_uid == $userdata['user_id'] || IS_ADMIN) {
|
||||||
{
|
if (empty($this->request['confirmed'])) {
|
||||||
if (empty($this->request['confirmed']))
|
|
||||||
{
|
|
||||||
$this->prompt_for_confirm($lang['BT_GEN_PASSKEY_NEW']);
|
$this->prompt_for_confirm($lang['BT_GEN_PASSKEY_NEW']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$passkey = generate_passkey($req_uid, IS_ADMIN))
|
if (!$passkey = generate_passkey($req_uid, IS_ADMIN)) {
|
||||||
{
|
|
||||||
$this->ajax_die('Could not insert passkey');
|
$this->ajax_die('Could not insert passkey');
|
||||||
}
|
}
|
||||||
tracker_rm_user($req_uid);
|
tracker_rm_user($req_uid);
|
||||||
$this->response['passkey'] = $passkey;
|
$this->response['passkey'] = $passkey;
|
||||||
}
|
} else $this->ajax_die($lang['NOT_AUTHORISED']);
|
||||||
else $this->ajax_die($lang['NOT_AUTHORISED']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// User groups membership
|
// User groups membership
|
||||||
function group_membership ()
|
function group_membership()
|
||||||
{
|
{
|
||||||
global $lang, $user;
|
global $lang, $user;
|
||||||
|
|
||||||
if (!$user_id = intval($this->request['user_id']) OR !$profiledata = get_userdata($user_id))
|
if (!$user_id = intval($this->request['user_id']) OR !$profiledata = get_userdata($user_id)) {
|
||||||
{
|
|
||||||
$this->ajax_die("invalid user_id: $user_id");
|
$this->ajax_die("invalid user_id: $user_id");
|
||||||
}
|
}
|
||||||
if (!$mode = (string) $this->request['mode'])
|
if (!$mode = (string)$this->request['mode']) {
|
||||||
{
|
|
||||||
$this->ajax_die('invalid mode (empty)');
|
$this->ajax_die('invalid mode (empty)');
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($mode)
|
switch ($mode) {
|
||||||
{
|
|
||||||
case 'get_group_list':
|
case 'get_group_list':
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT ug.user_pending, g.group_id, g.group_type, g.group_name, g.group_moderator, self.user_id AS can_view
|
SELECT ug.user_pending, g.group_id, g.group_type, g.group_name, g.group_moderator, self.user_id AS can_view
|
||||||
FROM ". BB_USER_GROUP ." ug
|
FROM " . BB_USER_GROUP . " ug
|
||||||
INNER JOIN ". BB_GROUPS ." g ON(g.group_id = ug.group_id AND g.group_single_user = 0)
|
INNER JOIN " . BB_GROUPS . " g ON(g.group_id = ug.group_id AND g.group_single_user = 0)
|
||||||
LEFT JOIN ". BB_USER_GROUP ." self ON(self.group_id = g.group_id AND self.user_id = {$user->id} AND self.user_pending = 0)
|
LEFT JOIN " . BB_USER_GROUP . " self ON(self.group_id = g.group_id AND self.user_id = {$user->id} AND self.user_pending = 0)
|
||||||
WHERE ug.user_id = $user_id
|
WHERE ug.user_id = $user_id
|
||||||
ORDER BY g.group_name
|
ORDER BY g.group_name
|
||||||
";
|
";
|
||||||
$html = array();
|
$html = array();
|
||||||
foreach (DB()->fetch_rowset($sql) as $row)
|
foreach (DB()->fetch_rowset($sql) as $row) {
|
||||||
{
|
$class = ($row['user_pending']) ? 'med' : 'med bold';
|
||||||
$class = ($row['user_pending']) ? 'med' : 'med bold';
|
|
||||||
$class .= ($row['group_moderator'] == $user_id) ? ' colorMod' : '';
|
$class .= ($row['group_moderator'] == $user_id) ? ' colorMod' : '';
|
||||||
$href = "groupcp.php?g={$row['group_id']}";
|
$href = "groupcp.php?g={$row['group_id']}";
|
||||||
|
|
||||||
if (IS_ADMIN)
|
if (IS_ADMIN) {
|
||||||
{
|
|
||||||
$href .= "&u=$user_id";
|
$href .= "&u=$user_id";
|
||||||
$link = '<a href="'. $href .'" class="'. $class .'" target="_blank">'. htmlCHR($row['group_name']) .'</a>';
|
$link = '<a href="' . $href . '" class="' . $class . '" target="_blank">' . htmlCHR($row['group_name']) . '</a>';
|
||||||
$html[] = $link;
|
$html[] = $link;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// скрытая группа и сам юзер не является её членом
|
// скрытая группа и сам юзер не является её членом
|
||||||
if ($row['group_type'] == GROUP_HIDDEN && !$row['can_view'])
|
if ($row['group_type'] == GROUP_HIDDEN && !$row['can_view']) {
|
||||||
{
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($row['group_moderator'] == $user->id)
|
if ($row['group_moderator'] == $user->id) {
|
||||||
{
|
|
||||||
$class .= ' selfMod';
|
$class .= ' selfMod';
|
||||||
$href .= "&u=$user_id"; // сам юзер модератор этой группы
|
$href .= "&u=$user_id"; // сам юзер модератор этой группы
|
||||||
}
|
}
|
||||||
$link = '<a href="'. $href .'" class="'. $class .'" target="_blank">'. htmlCHR($row['group_name']) .'</a>';
|
$link = '<a href="' . $href . '" class="' . $class . '" target="_blank">' . htmlCHR($row['group_name']) . '</a>';
|
||||||
$html[] = $link;
|
$html[] = $link;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($html)
|
if ($html) {
|
||||||
{
|
$this->response['group_list_html'] = '<ul><li>' . join('</li><li>', $html) . '</li></ul>';
|
||||||
$this->response['group_list_html'] = '<ul><li>'. join('</li><li>', $html) .'</li></ul>';
|
} else {
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->response['group_list_html'] = $lang['GROUP_LIST_HIDDEN'];
|
$this->response['group_list_html'] = $lang['GROUP_LIST_HIDDEN'];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -449,78 +407,103 @@ class ajax_common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function post_mod_comment ()
|
function post_mod_comment()
|
||||||
{
|
{
|
||||||
global $lang, $userdata;
|
global $lang, $userdata;
|
||||||
|
|
||||||
$post_id = (int) $this->request['post_id'];
|
$post_id = (int)$this->request['post_id'];
|
||||||
$post = DB()->fetch_row("SELECT t.*, f.*, p.*, pt.post_text
|
$post = DB()->fetch_row("SELECT t.*, f.*, p.*, pt.post_text
|
||||||
FROM ". BB_TOPICS ." t, ". BB_FORUMS ." f, ". BB_POSTS ." p, ". BB_POSTS_TEXT ." pt
|
FROM " . BB_TOPICS . " t, " . BB_FORUMS . " f, " . BB_POSTS . " p, " . BB_POSTS_TEXT . " pt
|
||||||
WHERE p.post_id = $post_id
|
WHERE p.post_id = $post_id
|
||||||
AND t.topic_id = p.topic_id
|
AND t.topic_id = p.topic_id
|
||||||
AND f.forum_id = t.forum_id
|
AND f.forum_id = t.forum_id
|
||||||
AND p.post_id = pt.post_id
|
AND p.post_id = pt.post_id
|
||||||
LIMIT 1");
|
LIMIT 1");
|
||||||
if(!$post) $this->ajax_die('not post');
|
if (!$post) $this->ajax_die('not post');
|
||||||
$type = (int) $this->request['mc_type'];
|
$type = (int)$this->request['mc_type'];
|
||||||
$text = (string) $this->request['mc_text'];
|
$text = (string)$this->request['mc_text'];
|
||||||
$text = prepare_message($text);
|
$text = prepare_message($text);
|
||||||
if (!$text) $this->ajax_die('no text');
|
if (!$text) $this->ajax_die('no text');
|
||||||
DB()->query("UPDATE ". BB_POSTS ." SET post_mod_comment = '". DB()->escape($text) ."', post_mod_comment_type = $type, post_mc_mod_id = ". $userdata['user_id'] .", post_mc_mod_name = '". $userdata['username'] ."' WHERE post_id = $post_id LIMIT 1");
|
DB()->query("UPDATE " . BB_POSTS . " SET post_mod_comment = '" . DB()->escape($text) . "', post_mod_comment_type = $type, post_mc_mod_id = " . $userdata['user_id'] . ", post_mc_mod_name = '" . $userdata['username'] . "' WHERE post_id = $post_id LIMIT 1");
|
||||||
$this->response['type'] = $type;
|
$this->response['type'] = $type;
|
||||||
$this->response['post_id'] = $post_id;
|
$this->response['post_id'] = $post_id;
|
||||||
if ($type == 0) $this->response['html'] = '';
|
if ($type == 0) $this->response['html'] = '';
|
||||||
else if ($type == 1) $this->response['html'] = '<div class="mcBlock"><table cellspacing="0" cellpadding="0" border="0"><tr><td class="mcTd1C">K</td><td class="mcTd2C">'. profile_url($userdata) .' '. $lang['WROTE'] .':<br /><br />'. bbcode2html($text) .'</td></tr></table></div>';
|
else if ($type == 1) $this->response['html'] = '<div class="mcBlock"><table cellspacing="0" cellpadding="0" border="0"><tr><td class="mcTd1C">K</td><td class="mcTd2C">' . profile_url($userdata) . ' ' . $lang['WROTE'] . ':<br /><br />' . bbcode2html($text) . '</td></tr></table></div>';
|
||||||
else if ($type == 2) $this->response['html'] = '<div class="mcBlock"><table cellspacing="0" cellpadding="0" border="0"><tr><td class="mcTd1W">!</td><td class="mcTd2W">'. profile_url($userdata) .' '. $lang['WROTE'] .':<br /><br />'. bbcode2html($text) .'</td></tr></table></div>';
|
else if ($type == 2) $this->response['html'] = '<div class="mcBlock"><table cellspacing="0" cellpadding="0" border="0"><tr><td class="mcTd1W">!</td><td class="mcTd2W">' . profile_url($userdata) . ' ' . $lang['WROTE'] . ':<br /><br />' . bbcode2html($text) . '</td></tr></table></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function view_post ()
|
function view_post()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'view_post.php');
|
require(AJAX_DIR . 'view_post.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function change_tor_status ()
|
function change_tor_status()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'change_tor_status.php');
|
require(AJAX_DIR . 'change_tor_status.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function change_torrent ()
|
function change_torrent()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'change_torrent.php');
|
require(AJAX_DIR . 'change_torrent.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function view_torrent ()
|
function view_torrent()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'view_torrent.php');
|
require(AJAX_DIR . 'view_torrent.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function user_register()
|
function user_register()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'user_register.php');
|
require(AJAX_DIR . 'user_register.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function mod_action()
|
function mod_action()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'mod_action.php');
|
require(AJAX_DIR . 'mod_action.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function posts()
|
function posts()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'posts.php');
|
require(AJAX_DIR . 'posts.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function manage_user()
|
function manage_user()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'manage_user.php');
|
require(AJAX_DIR . 'manage_user.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function topic_tpl()
|
function topic_tpl()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'topic_tpl.php');
|
require(AJAX_DIR . 'topic_tpl.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function index_data()
|
function index_data()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'index_data.php');
|
require(AJAX_DIR . 'index_data.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
function modify_draft()
|
||||||
|
{
|
||||||
|
global $userdata;
|
||||||
|
$tid = (int)$this->request["id_draft"];
|
||||||
|
$mode = (int)$this->request["mode"];
|
||||||
|
$sql = "SELECT * FROM " . BB_TOPICS . " WHERE topic_id = {$tid}";
|
||||||
|
|
||||||
|
if (!$row = DB()->fetch_row($sql)) {
|
||||||
|
$this->ajax_die("Нет такого черновика");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($row["topic_poster"] != $userdata["user_id"] && !IS_ADMIN) {
|
||||||
|
$this->ajax_die("Нельзя удалять чужие черновики");
|
||||||
|
}
|
||||||
|
|
||||||
|
print_r($mode);
|
||||||
|
if (!$mode) {
|
||||||
|
DB()->query("DELETE FROM `bb_topics` WHERE `topic_id`={$tid} LIMIT 1;");
|
||||||
|
}else {
|
||||||
|
DB()->query("UPDATE `bb_topics` SET `is_draft`=0 WHERE `topic_id`={$tid}");
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->response["tid"] = $tid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
|
||||||
// Increase number of revision after update
|
// Increase number of revision after update
|
||||||
$bb_cfg['tp_version'] = '2.5 pre-stable';
|
$bb_cfg['tp_version'] = '2.5 pre-stable';
|
||||||
$bb_cfg['tp_release_date'] = '08-01-2013';
|
$bb_cfg['tp_release_date'] = '08-01-2013';
|
||||||
$bb_cfg['tp_release_state'] = 'R485';
|
$bb_cfg['tp_release_state'] = 'R486';
|
||||||
|
|
||||||
// Database
|
// Database
|
||||||
$charset = 'utf8';
|
$charset = 'utf8';
|
||||||
|
@ -528,4 +528,7 @@ $bb_cfg['captcha'] = array(
|
||||||
);
|
);
|
||||||
|
|
||||||
// SEO
|
// SEO
|
||||||
$bb_cfg['seo_link_home_page'] = false;
|
$bb_cfg['seo_link_home_page'] = false;
|
||||||
|
|
||||||
|
// Status of draft
|
||||||
|
$bb_cfg['status_of_draft'] = true;
|
|
@ -137,6 +137,7 @@ if ($bb_cfg['show_latest_news'] AND $news_forum_ids = $bb_cfg['latest_news_forum
|
||||||
FROM ". BB_TOPICS ."
|
FROM ". BB_TOPICS ."
|
||||||
WHERE forum_id IN ($news_forum_ids)
|
WHERE forum_id IN ($news_forum_ids)
|
||||||
AND topic_moved_id = 0
|
AND topic_moved_id = 0
|
||||||
|
AND is_draft = 0
|
||||||
ORDER BY topic_time DESC
|
ORDER BY topic_time DESC
|
||||||
LIMIT $news_count
|
LIMIT $news_count
|
||||||
");
|
");
|
||||||
|
|
|
@ -160,7 +160,9 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
|
||||||
|
|
||||||
$topic_dl_type = (isset($_POST['topic_dl_type']) && ($post_info['allow_reg_tracker'] || $is_auth['auth_mod'])) ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL;
|
$topic_dl_type = (isset($_POST['topic_dl_type']) && ($post_info['allow_reg_tracker'] || $is_auth['auth_mod'])) ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL;
|
||||||
|
|
||||||
$sql = ($mode != "editpost") ? "INSERT INTO " . BB_TOPICS . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_dl_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_dl_type, $topic_vote)" : "UPDATE " . BB_TOPICS . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_dl_type = $topic_dl_type " . ((@$post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";
|
$is_draft = (empty($_POST['to_draft'])) ? 0 : 1;
|
||||||
|
|
||||||
|
$sql = ($mode != "editpost") ? "INSERT INTO " . BB_TOPICS . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_dl_type, topic_vote, is_draft) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_dl_type, $topic_vote, $is_draft)" : "UPDATE " . BB_TOPICS . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_dl_type = $topic_dl_type " . ((@$post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . ", is_draft={$is_draft}" . " WHERE topic_id = $topic_id";
|
||||||
|
|
||||||
if (!DB()->sql_query($sql))
|
if (!DB()->sql_query($sql))
|
||||||
{
|
{
|
||||||
|
|
|
@ -96,6 +96,9 @@ else if ($signature)
|
||||||
$signature = bbcode2html($signature);
|
$signature = bbcode2html($signature);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$count_draft = DB()->fetch_row("SELECT COUNT(topic_id) as count FROM ". BB_TOPICS . " WHERE topic_poster = {$profiledata['user_id']} AND is_draft=1");
|
||||||
|
$count_draft = $count_draft["count"];
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'PAGE_TITLE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']),
|
'PAGE_TITLE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']),
|
||||||
'USERNAME' => $profiledata['username'],
|
'USERNAME' => $profiledata['username'],
|
||||||
|
@ -116,6 +119,8 @@ $template->assign_vars(array(
|
||||||
'LOCATION' => $profiledata['user_from'],
|
'LOCATION' => $profiledata['user_from'],
|
||||||
|
|
||||||
'USER_ACTIVE' => $profiledata['user_active'],
|
'USER_ACTIVE' => $profiledata['user_active'],
|
||||||
|
'COUNT_DRAFT' => $count_draft,
|
||||||
|
'SEE_I' => ($profiledata['user_id'] == $userdata['user_id'] || IS_ADMIN) ? true : false,
|
||||||
|
|
||||||
'OCCUPATION' => $profiledata['user_occ'],
|
'OCCUPATION' => $profiledata['user_occ'],
|
||||||
'INTERESTS' => $profiledata['user_interests'],
|
'INTERESTS' => $profiledata['user_interests'],
|
||||||
|
|
|
@ -379,6 +379,7 @@ $lang['MAX_SMILIES_PER_POST'] = 'Лимит в %s смайликов в сооб
|
||||||
|
|
||||||
$lang['ATTACH_SIGNATURE'] = 'Присоединить подпись (можно изменять в профиле)';
|
$lang['ATTACH_SIGNATURE'] = 'Присоединить подпись (можно изменять в профиле)';
|
||||||
$lang['NOTIFY'] = 'Сообщать мне о получении ответа';
|
$lang['NOTIFY'] = 'Сообщать мне о получении ответа';
|
||||||
|
$lang['TO_DRAFT'] = 'Сохранить как черновик';
|
||||||
|
|
||||||
$lang['STORED'] = 'Ваше сообщение было успешно добавлено';
|
$lang['STORED'] = 'Ваше сообщение было успешно добавлено';
|
||||||
$lang['DELETED'] = 'Ваше сообщение было успешно удалено';
|
$lang['DELETED'] = 'Ваше сообщение было успешно удалено';
|
||||||
|
|
|
@ -321,9 +321,11 @@ if ($mode == 'newtopic' && $topic_tpl && $post_info['topic_tpl_id'])
|
||||||
if ($submit || $refresh)
|
if ($submit || $refresh)
|
||||||
{
|
{
|
||||||
$notify_user = (int) !empty($_POST['notify']);
|
$notify_user = (int) !empty($_POST['notify']);
|
||||||
|
$to_draft = (int) !empty($_POST['to_draft']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$to_draft = ($bb_cfg['status_of_draft']) ? $post_info['is_draft'] : false ;
|
||||||
$notify_user = bf($userdata['user_opt'], 'user_opt', 'notify');
|
$notify_user = bf($userdata['user_opt'], 'user_opt', 'notify');
|
||||||
if (!IS_GUEST && $mode != 'newtopic' && !$notify_user)
|
if (!IS_GUEST && $mode != 'newtopic' && !$notify_user)
|
||||||
{
|
{
|
||||||
|
@ -851,6 +853,7 @@ $template->assign_vars(array(
|
||||||
'U_VIEWTOPIC' => ( $mode == 'reply' ) ? "viewtopic.php?" . POST_TOPIC_URL . "=$topic_id&postorder=desc" : '',
|
'U_VIEWTOPIC' => ( $mode == 'reply' ) ? "viewtopic.php?" . POST_TOPIC_URL . "=$topic_id&postorder=desc" : '',
|
||||||
|
|
||||||
'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '',
|
'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '',
|
||||||
|
'S_DRAFT_CHECKED' => ( $to_draft ) ? 'checked="checked"' : '',
|
||||||
'S_TYPE_TOGGLE' => $topic_type_toggle,
|
'S_TYPE_TOGGLE' => $topic_type_toggle,
|
||||||
'S_TOPIC_ID' => $topic_id,
|
'S_TOPIC_ID' => $topic_id,
|
||||||
'S_POST_ACTION' => "posting.php",
|
'S_POST_ACTION' => "posting.php",
|
||||||
|
|
|
@ -20,6 +20,10 @@ switch ($mode)
|
||||||
require(INC_DIR . 'ucp/usercp_viewprofile.php');
|
require(INC_DIR . 'ucp/usercp_viewprofile.php');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'viewdraft':
|
||||||
|
require(INC_DIR . 'ucp/usercp_viewdraft.php');
|
||||||
|
break;
|
||||||
|
|
||||||
case 'register':
|
case 'register':
|
||||||
case 'editprofile':
|
case 'editprofile':
|
||||||
if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
|
if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
|
||||||
|
|
|
@ -135,6 +135,12 @@
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</table>
|
</table>
|
||||||
|
<table class="borderless inline">
|
||||||
|
<tr>
|
||||||
|
<td><input type="checkbox" id="to_draft" name="to_draft" {S_DRAFT_CHECKED} /></td>
|
||||||
|
<td><label for="to_draft">{L_TO_DRAFT}</label></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -403,6 +403,12 @@ ajax.callback.gen_passkey = function(data){
|
||||||
<td id="ignore_srv_load">{L_ACCESS_SRV_LOAD}: <b class="editable">{IGNORE_SRV_LOAD}</b></td>
|
<td id="ignore_srv_load">{L_ACCESS_SRV_LOAD}: <b class="editable">{IGNORE_SRV_LOAD}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
<!-- IF SEE_I -->
|
||||||
|
<tr>
|
||||||
|
<th>Черновиков:</th>
|
||||||
|
<td><a href="./profile.php?mode=viewdraft&u={PROFILE_USER_ID}"><b>{COUNT_DRAFT}</b></a></td>
|
||||||
|
</tr>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="pad_4">
|
<td colspan="2" class="pad_4">
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
xZ6v0bcwckAqvp506NFR
|
|
@ -49,6 +49,7 @@ if (!$forum_id OR !$forum_data = @$forums['forum'][$forum_id])
|
||||||
// Only new
|
// Only new
|
||||||
$only_new = $user->opt_js['only_new'];
|
$only_new = $user->opt_js['only_new'];
|
||||||
$only_new_sql = '';
|
$only_new_sql = '';
|
||||||
|
$no_draft = "AND `t`.`is_draft` = 0";
|
||||||
if ($only_new == ONLY_NEW_POSTS)
|
if ($only_new == ONLY_NEW_POSTS)
|
||||||
{
|
{
|
||||||
$only_new_sql = "AND t.topic_last_post_time > $lastvisit";
|
$only_new_sql = "AND t.topic_last_post_time > $lastvisit";
|
||||||
|
@ -362,6 +363,7 @@ $sql = "
|
||||||
$only_new_sql
|
$only_new_sql
|
||||||
$title_match_sql
|
$title_match_sql
|
||||||
$limit_topics_time_sql
|
$limit_topics_time_sql
|
||||||
|
$no_draft
|
||||||
$order_sql
|
$order_sql
|
||||||
LIMIT $start, $topics_per_page
|
LIMIT $start, $topics_per_page
|
||||||
";
|
";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue