Фикс http://torrentpier.me/threads/23439/ + удаление некоторых неиспользуемых переменных раскиданных по коду. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@557 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
glix08@gmail.com 2014-01-14 21:10:04 +00:00
commit fdf8d769ab
9 changed files with 34 additions and 48 deletions

View file

@ -55,8 +55,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
// Increase number of revision after update
$bb_cfg['tp_version'] = '2.5 (unstable)';
$bb_cfg['tp_release_date'] = '13-01-2014';
$bb_cfg['tp_release_state'] = 'R556';
$bb_cfg['tp_release_date'] = '15-01-2014';
$bb_cfg['tp_release_state'] = 'R557';
// Database
$charset = 'utf8';

View file

@ -182,7 +182,7 @@ function sync ($type, $id)
function topic_delete ($mode_or_topic_id, $forum_id = null, $prune_time = 0, $prune_all = false)
{
global $lang, $bb_cfg, $log_action;
global $lang, $log_action;
$prune = ($mode_or_topic_id === 'prune');
@ -519,7 +519,7 @@ function topic_move ($topic_id, $to_forum_id, $from_forum_id = null, $leave_shad
function post_delete ($mode_or_post_id, $user_id = null, $exclude_first = true)
{
global $bb_cfg, $log_action;
global $log_action;
$del_user_posts = ($mode_or_post_id === 'user'); // Delete all user posts

View file

@ -1,8 +1,7 @@
<?php
function run_jobs($jobs) {
global $bb_cfg, $datastore;
function run_jobs($jobs)
{
define('IN_CRON', true);
$sql = "SELECT cron_script

View file

@ -67,7 +67,6 @@ function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, &
$temp_option_text[$option_id] = clean_title($option_text);
}
}
$option_text = $temp_option_text;
if (count($poll_options) < 2)
{
@ -85,10 +84,10 @@ function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, &
}
// Check smilies limit
if($bb_cfg['max_smilies'])
if ($bb_cfg['max_smilies'])
{
$count_smilies = substr_count(bbcode2html($message), '<img class="smile" src="'. $bb_cfg['smilies_path']);
if($count_smilies > $bb_cfg['max_smilies'])
if ($count_smilies > $bb_cfg['max_smilies'])
{
$to_many_smilies = sprintf($lang['MAX_SMILIES_PER_POST'], $bb_cfg['max_smilies']);
$error_msg .= (!empty($error_msg)) ? '<br />'. $to_many_smilies : $to_many_smilies;
@ -215,12 +214,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
{
$edited_sql .= ", post_time = $current_time ";
//lpt
$result = DB()->sql_query("
UPDATE ". BB_TOPICS ." SET
topic_last_post_time = $current_time
WHERE topic_id = $topic_id
LIMIT 1
");
DB()->sql_query("UPDATE ". BB_TOPICS ." SET topic_last_post_time = $current_time WHERE topic_id = $topic_id LIMIT 1");
}
$sql = ($mode != "editpost") ? "INSERT INTO " . BB_POSTS . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '". USER_IP ."')" : "UPDATE " . BB_POSTS . " SET post_username = '$post_username'" . $edited_sql . " WHERE post_id = $post_id";

View file

@ -75,7 +75,7 @@ function report_modules_inactive($mode = 'all', $module = null)
$dir = @opendir(INC_DIR .'report_hack');
$modules = array();
$i = 0;
while ($file = @readdir($dir))
{
if (!preg_match('#(.*)\.' . phpbb_preg_quote('php', '#') . '$#', $file, $matches))

View file

@ -152,7 +152,6 @@ function delete_torrent ($attach_id, $mode = '')
message_die(GENERAL_ERROR, $lang['TOR_NOT_FOUND']);
}
$post_id = $torrent['post_id'];
$topic_id = $torrent['topic_id'];
$forum_id = $torrent['forum_id'];
$poster_id = $torrent['poster_id'];
@ -162,7 +161,7 @@ function delete_torrent ($attach_id, $mode = '')
message_die(GENERAL_ERROR, $lang['NOT_TORRENT']);
}
torrent_auth_check($forum_id, $torrent['poster_id']);
torrent_auth_check($forum_id, $poster_id);
tracker_unregister($attach_id);
delete_attachment(0, $attach_id);
@ -198,7 +197,7 @@ function change_tor_status ($attach_id, $new_tor_status)
// Set gold/silver type for torrent
function change_tor_type ($attach_id, $tor_status_gold)
{
global $topic_id, $lang, $bb_cfg;
global $topic_id, $lang;
if (!$torrent = get_torrent_info($attach_id))
{

View file

@ -585,10 +585,7 @@ class user_common
$this->data['user_lang'] = $bb_cfg['default_lang'];
$this->data['user_timezone'] = $bb_cfg['board_timezone'];
if (!defined('LANG_DIR'))
{
define('LANG_DIR', DEFAULT_LANG_DIR);
}
if (!defined('LANG_DIR')) define('LANG_DIR', DEFAULT_LANG_DIR);
require(LANG_DIR .'lang_main.php');

View file

@ -120,9 +120,6 @@ function smtpmail($mail_to, $subject, $message, $headers = '')
fputs($socket, "MAIL FROM: <" . $bb_cfg['board_email'] . ">\r\n");
server_parse($socket, "250", __LINE__);
// Specify each user to send to and build to header.
$to_header = '';
// Add an additional bit of error checking to the To field.
$mail_to = (trim($mail_to) == '') ? 'Undisclosed-recipients:;' : trim($mail_to);
if (preg_match('#[^ ]+\@[^ ]+#', $mail_to))

View file

@ -838,7 +838,7 @@ if ($submit && !$errors)
if ($bb_cfg['require_activation'] == USER_ACTIVATION_ADMIN)
{
$sql = "SELECT user_email, user_lang, usr_opt FROM ". BB_USERS ." WHERE user_level = " . ADMIN;
$sql = "SELECT user_email, user_lang, user_opt FROM ". BB_USERS ." WHERE user_level = " . ADMIN;
if (!($result = DB()->sql_query($sql)))
{