mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 00:07:44 +02:00
ok, bugfixing phase #1 finished. There will be more bugfixes coming and those knowing CVS/php/mysql are encouraged to implement the fixes. ;)
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5204 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -32,7 +32,7 @@ function make_forum_select($box_name, $ignore_forum = false, $select_forum = '')
|
||||
|
||||
$sql = "SELECT forum_id, forum_name
|
||||
FROM " . FORUMS_TABLE . "
|
||||
ORDER BY cat_id, forum_order";
|
||||
ORDER BY cat_order, forum_order";
|
||||
if ( !($result = $db->sql_query($sql)) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, 'Couldn not obtain forums information', '', __LINE__, __FILE__, $sql);
|
||||
@@ -140,10 +140,45 @@ function sync($type, $id = false)
|
||||
|
||||
if ( $row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
$sql = ( $row['total_posts'] ) ? "UPDATE " . TOPICS_TABLE . " SET topic_replies = " . ( $row['total_posts'] - 1 ) . ", topic_first_post_id = " . $row['first_post'] . ", topic_last_post_id = " . $row['last_post'] . " WHERE topic_id = $id" : "DELETE FROM " . TOPICS_TABLE . " WHERE topic_id = $id";
|
||||
if ( !$db->sql_query($sql) )
|
||||
if ($row['total_posts'])
|
||||
{
|
||||
message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql);
|
||||
// Correct the details of this topic
|
||||
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
||||
SET topic_replies = ' . ($row['total_posts'] - 1) . ', topic_first_post_id = ' . $row['first_post'] . ', topic_last_post_id = ' . $row['last_post'] . "
|
||||
WHERE topic_id = $id";
|
||||
|
||||
if (!$db->sql_query($sql))
|
||||
{
|
||||
message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// There are no replies to this topic
|
||||
// Check if it is a move stub
|
||||
$sql = 'SELECT topic_moved_id
|
||||
FROM ' . TOPICS_TABLE . "
|
||||
WHERE topic_id = $id";
|
||||
|
||||
if (!($result = $db->sql_query($sql)))
|
||||
{
|
||||
message_die(GENERAL_ERROR, 'Could not get topic ID', '', __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (!$row['topic_moved_id'])
|
||||
{
|
||||
$sql = 'DELETE FROM ' . TOPICS_TABLE . " WHERE topic_id = $id";
|
||||
|
||||
if (!$db->sql_query($sql))
|
||||
{
|
||||
message_die(GENERAL_ERROR, 'Could not remove topic', '', __LINE__, __FILE__, $sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -213,7 +213,7 @@ function prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on,
|
||||
//
|
||||
// Post a new topic/reply/poll or edit existing post/poll
|
||||
//
|
||||
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length)
|
||||
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)
|
||||
{
|
||||
global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
|
||||
global $userdata, $user_ip;
|
||||
@@ -769,7 +769,7 @@ function generate_smilies($mode, $page_id)
|
||||
|
||||
$gen_simple_header = TRUE;
|
||||
|
||||
$page_title = $lang['Emoticons'] . " - $topic_title";
|
||||
$page_title = $lang['Emoticons'];
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
|
@@ -89,7 +89,7 @@ function clean_words($mode, &$entry, &$stopword_list, &$synonym_list)
|
||||
return $entry;
|
||||
}
|
||||
|
||||
function split_words(&$entry, $mode = 'post')
|
||||
function split_words($entry, $mode = 'post')
|
||||
{
|
||||
// If you experience problems with the new method, uncomment this block.
|
||||
/*
|
||||
|
@@ -25,6 +25,8 @@ if ( !defined('IN_PHPBB') )
|
||||
die('Hacking attempt');
|
||||
}
|
||||
|
||||
global $do_gzip_compress;
|
||||
|
||||
//
|
||||
// Show the overall footer.
|
||||
//
|
||||
@@ -35,7 +37,7 @@ $template->set_filenames(array(
|
||||
);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '',
|
||||
'TRANSLATION_INFO' => (isset($lang['TRANSLATION_INFO'])) ? $lang['TRANSLATION_INFO'] : ((isset($lang['TRANSLATION'])) ? $lang['TRANSLATION'] : ''),
|
||||
'ADMIN_LINK' => $admin_link)
|
||||
);
|
||||
|
||||
|
@@ -415,7 +415,7 @@ function append_sid($url, $non_html_amp = false)
|
||||
|
||||
if ( !empty($SID) && !preg_match('#sid=#', $url) )
|
||||
{
|
||||
$url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
|
||||
$url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
|
||||
}
|
||||
|
||||
return $url;
|
||||
|
@@ -47,9 +47,16 @@ if ( $row = $db->sql_fetchrow($result) )
|
||||
}
|
||||
else if ((trim($row['user_actkey']) == trim($HTTP_GET_VARS['act_key'])) && (trim($row['user_actkey']) != ''))
|
||||
{
|
||||
if (intval($board_config['require_activation']) == USER_ACTIVATION_ADMIN && $userdata['user_level'] != ADMIN)
|
||||
if (intval($board_config['require_activation']) == USER_ACTIVATION_ADMIN && $row['user_newpasswd'] == '')
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
|
||||
if (!$userdata['session_logged_in'])
|
||||
{
|
||||
redirect(append_sid('login.' . $phpEx . '?redirect=profile.' . $phpEx . '&mode=activate&' . POST_USERS_URL . '=' . $row['user_id'] . '&act_key=' . trim($HTTP_GET_VARS['act_key'])));
|
||||
}
|
||||
else if ($userdata['user_level'] != ADMIN)
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
|
||||
}
|
||||
}
|
||||
|
||||
$sql_update_pass = ( $row['user_newpasswd'] != '' ) ? ", user_password = '" . str_replace("\'", "''", $row['user_newpasswd']) . "', user_newpasswd = ''" : '';
|
||||
|
@@ -818,7 +818,7 @@ if( isset($HTTP_POST_VARS['avatargallery']) && !$error )
|
||||
|
||||
$allowviewonline = !$allowviewonline;
|
||||
|
||||
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, &$new_password, &$cur_password, $password_confirm, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id']);
|
||||
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $new_password, $cur_password, $password_confirm, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -50,7 +50,7 @@ if ( isset($HTTP_POST_VARS['submit']) )
|
||||
|
||||
$user_actkey = gen_rand_string(true);
|
||||
$key_len = 54 - strlen($server_url);
|
||||
$key_len = ( $str_len > 6 ) ? $key_len : 6;
|
||||
$key_len = ($key_len > 6) ? $key_len : 6;
|
||||
$user_actkey = substr($user_actkey, 0, $key_len);
|
||||
$user_password = gen_rand_string(false);
|
||||
|
||||
|
@@ -165,7 +165,7 @@ $yim_img = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config
|
||||
$yim = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&.src=pg">' . $lang['YIM'] . '</a>' : '';
|
||||
|
||||
$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($profiledata['username']) . "&showresults=posts");
|
||||
$search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . $lang['Search_user_posts'] . '" title="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" border="0" /></a>';
|
||||
$search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" title="' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '" border="0" /></a>';
|
||||
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $profiledata['username']) . '</a>';
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user