phpBBHacks.com, the place for phpBB users

Bookmark and Share

phpBB 2.0.1 to 2.0.2 Code Changes

phpBB 2.0.1 to 2.0.2 Code Changes

Postby Acyd Burn » December 7th 2002, 7:36 am

These are the code changes from phpBB 2.0.1 to phpBB 2.0.2. This might be very helpful if you want to update your forum and have installed a bunch of hacks. In cases like this, it is normally easier to apply the code changes directly to the scripts rather than installing all of the hacks again.

Here are some tips relating to statements to help you through this tutorial:

When you find an 'AFTER, ADD' statement, the code has to be added after the last line quoted in the 'FIND' statement.
When you find a 'REPLACE WITH' statement, the code quoted in the 'FIND' statement has to be replaced completely with the quoted code in the 'REPLACE WITH' statement.
When you find a 'DELETE' statement, the code has to be deleted.

Ok, lets start:


  • install.php
These changes are only relevant to you if you don't want to delete this file, which you should after installation. However, we will list it here for the sake of completeness.

  1. The security fix we have waited for... change phpbb_root_dir to phpbb_root_path.

    FIND
    Code: Select all
    include($phpbb_root_dir . 'includes/functions_selects.'.$phpEx);
    


    REPLACE WITH
    Code: Select all
    include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
    

  2. This change is for the Sessions Table generated:

    FIND - Line 879
    Code: Select all
    	TYPE=HEAP";
    


    REPLACE WITH
    Code: Select all
    	TYPE=HEAP MAX_ROWS=500";
    

  3. A change to have the config data in single quotes.

    FIND - Line 909-914
    Code: Select all
    			$config_data .= '$dbms = "' . $dbms . '";' . "\n\n";
    			$config_data .= '$dbhost = "' . $dbhost . '";' . "\n";
    			$config_data .= '$dbname = "' . $dbname . '";' . "\n";
    			$config_data .= '$dbuser = "' . $dbuser . '";' . "\n";
    			$config_data .= '$dbpasswd = "' . $dbpasswd . '";' . "\n\n";
    			$config_data .= '$table_prefix = "' . $table_prefix . '";' . "\n\n";
    


    REPLACE WITH
    Code: Select all
    			$config_data .= '$dbms = \'' . $dbms . '\';' . "\n\n";
    			$config_data .= '$dbhost = \'' . $dbhost . '\';' . "\n";
    			$config_data .= '$dbname = \'' . $dbname . '\';' . "\n";
    			$config_data .= '$dbuser = \'' . $dbuser . '\';' . "\n";
    			$config_data .= '$dbpasswd = \'' . $dbpasswd . '\';' . "\n\n";
    			$config_data .= '$table_prefix = \'' . $table_prefix . '\';' . "\n\n";
    

  • login.php
The changes made to login.php are mainly intended for fixing some redirection errors.

  1. First redirect fix

    FIND - Line 100
    Code: Select all
    						message_die(CRITICAL_ERROR, "Couldn't start session : login", "", __LINE__, __FILE__);
    					}
    				}
    				else
    				{
    					$redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : '';
    


    AFTER, ADD
    Code: Select all
    					$redirect = str_replace("?", "&", $redirect);
    

  2. Second redirect fix

    FIND - Line 114
    Code: Select all
    					message_die(GENERAL_MESSAGE, $message);
    				}
    			}
    		}
    		else
    		{
    			$redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : "";
    


    AFTER, ADD
    Code: Select all
    			$redirect = str_replace("?", "&", $redirect);
    

  • memberlist.php
The change made to the memberlist is a fix for a little typo.

  1. This is a bugfix where the Memberlist could not sorted by Joined Date.

    FIND - Line 113
    Code: Select all
    		case 'joined':
    


    REPLACE WITH
    Code: Select all
    		case 'joindate':
    

  • modcp.php
Changes to this file are bugfixes.

  1. This is for reducing the users post count when deleting topics.

    FIND - Line 211
    Code: Select all
    				$topic_id_sql .= ( ( $topic_id_sql != '' ) ? ', ' : '' ) . $topics[$i];
    			}
    


    AFTER, ADD
    Code: Select all
    			$sql = "SELECT poster_id, COUNT(post_id) AS posts 
    				FROM " . POSTS_TABLE . " 
    				WHERE topic_id IN ($topic_id_sql) 
    				GROUP BY poster_id";
    			if ( !($result = $db->sql_query($sql)) )
    			{
    				message_die(GENERAL_ERROR, 'Could not get poster id information', '', __LINE__, __FILE__, $sql);
    			}
    
    			$count_sql = array();
    			while ( $row = $db->sql_fetchrow($result) )
    			{
    				$count_sql[] = "UPDATE " . USERS_TABLE . " 
    					SET user_posts = user_posts - " . $row['posts'] . " 
    					WHERE user_id = " . $row['poster_id'];
    			}
    			$db->sql_freeresult($result);
    
    			if ( sizeof($count_sql) )
    			{
    				for($i = 0; $i < sizeof($count_sql); $i++)
    				{
    					if ( !$db->sql_query($count_sql[$i]) )
    					{
    						message_die(GENERAL_ERROR, 'Could not update user post count information', '', __LINE__, __FILE__, $sql);
    					}
    				}
    			}
    			
    

  2. Generate a default value for the Forum Select Box.

    FIND - Line 769
    Code: Select all
    					'S_FORUM_SELECT' => make_forum_select("new_forum_id"))
    


    REPLACE WITH
    Code: Select all
    					'S_FORUM_SELECT' => make_forum_select("new_forum_id", false, $forum_id))
    

  • privmsg.php
Changes to this file are bugfixes.

  1. Missing variable definition was added.

    FIND - Line 51
    Code: Select all
    $delete_all = ( isset($HTTP_POST_VARS['deleteall']) ) ? TRUE : 0;
    


    AFTER, ADD
    Code: Select all
    $save = ( isset($HTTP_POST_VARS['save']) ) ? TRUE : 0;
    

  2. Here missing word replacements were added.

    FIND - Line 572
    Code: Select all
    		$private_message .= '<br /><br />_________________<br />' . make_clickable($user_sig);
    	}
    


    AFTER, ADD
    Code: Select all
    	$orig_word = array();
    	$replacement_word = array();
    	obtain_word_list($orig_word, $replacement_word);
    
    

  3. More missing word replacements.

    FIND - Line 1689
    Code: Select all
    make_jumpbox('viewforum.'.$phpEx);
    


    AFTER, ADD
    Code: Select all
    
    $orig_word = array();
    $replacement_word = array();
    obtain_word_list($orig_word, $replacement_word);
    

  • update_to_202.php
This file was added after phpBB 2.0.1, so no changes here, just a new file. And you have to run it after (or before) changing all phpBB 2 Files. Again, this is listed just for completeness.

    • upgrade.php
    This file was changed, but since no hacks change this file it is safe to overwrite it with the new version.

      • viewforum.php
      Only one little change in this file, a language variable issue.

      1. No new posts instead of new posts.

        FIND - Line 569
        Code: Select all
        						$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
        


        REPLACE WITH
        Code: Select all
        						$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['New_posts'];
        

      • viewtopic.php
      Also only one change, topic_mod has been made empty by default.

      1. Set the variable topic_mod. This is a little security fix.

        FIND - Line 556
        Code: Select all
        $s_auth_can .= ( ( $is_auth['auth_vote'] ) ? $lang['Rules_vote_can'] : $lang['Rules_vote_cannot'] ) . '<br />';
        


        AFTER, ADD
        Code: Select all
        $topic_mod = '';
        
        

      2. Instead of assigning the variable new, append the string. Changed '=' into '.='.

        FIND - Line 564
        Code: Select all
        	$topic_mod = '<a href="' . append_sid("modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=delete") . '"><img src="' . $images['topic_mod_delete'] . '" alt="' . $lang['Delete_topic'] . '" title="' . $lang['Delete_topic'] . '" border="0" /></a> ';
        


        REPLACE WITH
        Code: Select all
        	$topic_mod .= '<a href="' . append_sid("modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=delete") . '"><img src="' . $images['topic_mod_delete'] . '" alt="' . $lang['Delete_topic'] . '" title="' . $lang['Delete_topic'] . '" border="0" /></a> ';
        

      • includes/bbcode.php
      This file is very important, fixes for BBcodes URL, IMG and of course the new smilies_pass function which results in a dramatic speed increase on long topics.

      1. This is the fix for the url-bbcode tag.

        FIND - Line 200
        Code: Select all
        	// [url]xxxx://www.phpbb.com[/url] code..
        	$patterns[1] = "#\[url\]([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)\[/url\]#si";
        	$replacements[1] = $bbcode_tpl['url1'];
        
        	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
        	$patterns[2] = "#\[url\]([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)\[/url\]#si";
        	$replacements[2] = $bbcode_tpl['url2'];
        
        	// [url=xxxx://www.phpbb.com]phpBB[/url] code..
        	$patterns[3] = "#\[url=([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)\](.*?)\[/url\]#si";
        	$replacements[3] = $bbcode_tpl['url3'];
        
        	// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
        	$patterns[4] = "#\[url=([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)\](.*?)\[/url\]#si";
        	$replacements[4] = $bbcode_tpl['url4'];
        


        REPLACE WITH
        Code: Select all
        
        	// [url]xxxx://www.phpbb.com[/url] code..
        	$patterns[1] = "#\[url\]([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\[/url\]#si";
        	$replacements[1] = $bbcode_tpl['url1'];
        
        	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
        	$patterns[2] = "#\[url\]([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\[/url\]#si";
        	$replacements[2] = $bbcode_tpl['url2'];
        
        	// [url=xxxx://www.phpbb.com]phpBB[/url] code..
        	$patterns[3] = "#\[url=([a-z]+?://){1}([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\](.*?)\[/url\]#si";
        	$replacements[3] = $bbcode_tpl['url3'];
        
        	// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
        	$patterns[4] = "#\[url=([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+\(\)]+)\](.*?)\[/url\]#si";
        	$replacements[4] = $bbcode_tpl['url4'];
        

      2. This is a fix for the img-bbcode tag.

        FIND - Line 285
        Code: Select all
        	$text = preg_replace("#\[img\](([a-z]+?)://([^ \"\n\r]+?))\[/img\]#si", "[img:$uid]\\1[/img:$uid]", $text);
        


        REPLACE WITH
        Code: Select all
        	$text = preg_replace("#\[img\](http(s)?://)([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)\[/img\]#si", "[img:$uid]\\1\\3[/img:$uid]", $text);
        

      3. This is a fix for the make_clickable function that makes posted URLs clickable.

        FIND - Line 623
        Code: Select all
        	$ret = preg_replace("#([\n ])([a-z]+?)://([^\t <\n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $ret);
        


        REPLACE WITH
        Code: Select all
        	$ret = preg_replace("#([\n ])([a-z]+?)://([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $ret);
        

      4. This is a fix for the make_clickable function for macking posted URLs clickable.

        FIND - Line 631
        Code: Select all
        	$ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^\t <\n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>", $ret);
        


        REPLACE WITH
        Code: Select all
        	$ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>", $ret);
        

      5. This is a replacement for the smilies_pass function, resulting in a great speed improvement on viewing topics.

        FIND - Line 739
        Code: Select all
        function smilies_pass($message)
        {
        	global $db, $board_config;
        	static $smilies;
        
        	if( empty($smilies) )
        	{
        		$sql = "SELECT code, smile_url
        			FROM " . SMILIES_TABLE;
        		if( !$result = $db->sql_query($sql) )
        		{
        			message_die(GENERAL_ERROR, "Couldn't obtain smilies data", "", __LINE__, __FILE__, $sql);
        		}
        
        		if( !$db->sql_numrows($result) )
        		{
        			return $message;
        		}
        
        		$smilies = $db->sql_fetchrowset($result);
        	}
        
        	usort($smilies, 'smiley_sort');
        	for($i = 0; $i < count($smilies); $i++)
        	{
        		$orig[] = "/(?<=.\\W|\\W.|^\\W)" . phpbb_preg_quote($smilies[$i]['code'], "/") . "(?=.\\W|\\W.|\\W$)/";
        		$repl[] = '<img src="'. $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'] . '" alt="' . $smilies[$i]['smile_url'] . '" border="0" />';
        	}
        
        	if( $i > 0 )
        	{
        		$message = preg_replace($orig, $repl, ' ' . $message . ' ');
        		$message = substr($message, 1, -1);
        	}
        
        	return $message;
        }
        


        REPLACE WITH
        Code: Select all
        function smilies_pass($message) 
        { 
           static $orig, $repl; 
        
           if (!isset($orig)) 
           { 
              global $db, $board_config; 
              $orig = $repl = array(); 
        
              $sql = 'SELECT code, smile_url FROM ' . SMILIES_TABLE; 
              if( !$result = $db->sql_query($sql) ) 
              { 
                 message_die(GENERAL_ERROR, "Couldn't obtain smilies data", "", __LINE__, __FILE__, $sql); 
              } 
              $smilies = $db->sql_fetchrowset($result); 
        
              usort($smilies, 'smiley_sort'); 
              for($i = 0; $i < count($smilies); $i++) 
              { 
                 $orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/"; 
                 $repl[] = '<img src="'. $board_config['smilies_path'] . '/' . $smilies[$i]['smile_url'] . '" alt="' . $smilies[$i]['smile_url'] . '" border="0" />'; 
              } 
           } 
        
           if (count($orig)) 
           { 
              $message = preg_replace($orig, $repl, ' ' . $message . ' '); 
              $message = substr($message, 1, -1); 
           } 
           return $message; 
        }
        

      • includes/emailer.php
      These are all fixes to replace the iso-line with the correct one from the language files. Therefore, no explanation for every change is given.

      1. FIND - Line 131
        Code: Select all
        	function parse_email()
        	{
        


        AFTER, ADD
        Code: Select all
        		global $lang;
        

      2. FIND - Line 155
        Code: Select all
        		$this->encoding = ( trim($match[4]) != '' ) ? trim($match[4]) : 'iso-8859-1';
        


        REPLACE WITH
        Code: Select all
        		$this->encoding = ( trim($match[4]) != '' ) ? trim($match[4]) : $lang['ENCODING'];
        

      3. FIND - Line 209
        Code: Select all
        	function attachFile($filename, $mimetype = "application/octet-stream", $szFromAddress, $szFilenameToDisplay)
        	{
        


        AFTER, ADD
        Code: Select all
        		global $lang;
        

      4. FIND - Line 214
        Code: Select all
        		$this->mailMsg = '--' . $mime_boundary . "\nContent-Type: text/plain;\n\tcharset=\"iso-8859-1\"\n\n" . $this->mailMsg;
        


        REPLACE WITH
        Code: Select all
        		$this->mailMsg = '--' . $mime_boundary . "\nContent-Type: text/plain;\n\tcharset=\"" . $lang['ENCODING'] . "\"\n\n" . $this->mailMsg;
        

      • includes/functions.php
      There was a change in functions.php through development, but was reverted, because it produces one more query.

        • includes/functions_admin.php
        The changes to this file allow the forum select field to have a default value.

        1. Rewrite the function call to allow an extra parameter (the default selected value).

          FIND - Line 27
          Code: Select all
          function make_forum_select($box_name, $ignore_forum = false)
          


          REPLACE WITH
          Code: Select all
          function make_forum_select($box_name, $ignore_forum = false, $select_forum = '')
          

        2. The code for default selecting a value.

          FIND - Line 46
          Code: Select all
          			$forum_list .= '<option value="' . $row['forum_id'] . '">' . $row['forum_name'] . '</option>';
          


          REPLACE WITH
          Code: Select all
          			$selected = ( $select_forum == $row['forum_id'] ) ? ' selected="selected"' : '';
          			$forum_list .= '<option value="' . $row['forum_id'] . '"' . $selected .'>' . $row['forum_name'] . '</option>';
          

        • includes/functions_post.php
        One security fix (I think) and an attempt to increase the time limit on sending notifications.

        1. The security fix, rewrite of html-tags.

          FIND - Line 78
          Code: Select all
          					if ( preg_match('/^<\/?' . $match_tag . '\b/i', $hold_string) )
          


          REPLACE WITH
          Code: Select all
          					if ( preg_match('/^<\/?' . $match_tag . '(?!(\s*)style(\s*)\\=)/i', $hold_string) )
          

        2. Try to increase time limit, will not work on some php-installations.

          FIND - Line 635
          Code: Select all
          			$update_watched_sql = '';
          			if ( $row = $db->sql_fetchrow($result) )
          			{
          


          AFTER, ADD
          Code: Select all
          				@set_time_limit(120);
          
          

        • includes/functions_validate.php
        These two changes are quote number corrections (in the regular expression) for validating usernames, use phpbb_preg_quote
        instead of preg_quote.

        1. First one: forbidden usernames.

          FIND - Line 66
          Code: Select all
          			if ( preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['disallow_username'])) . ")\b#i", $username) )
          


          REPLACE WITH
          Code: Select all
          			if ( preg_match("#\b(" . str_replace("\*", ".*?", phpbb_preg_quote($row['disallow_username'], '#')) . ")\b#i", $username) )
          

        2. Second one: forbidden words.

          FIND - Line 79
          Code: Select all
          			if ( preg_match("#\b(" . str_replace("\*", ".*?", preg_quote($row['word'])) . ")\b#i", $username) )
          


          REPLACE WITH
          Code: Select all
          			if ( preg_match("#\b(" . str_replace("\*", ".*?", phpbb_preg_quote($row['word'], '#')) . ")\b#i", $username) )
          

        • includes/page_header.php
        Not really a change to this file, but please check if you have no newlines after ?>
        sitting around, this can cause header problems. The best is to press the delete
        key after ?> so that no lines are displayed after the ?> anymore.
          • includes/sessions.php
          In this file there are many changes, changes you should not miss, because of a security fix and some adjustments to the sessions code.

          1. Bugfix for banned email addresses.

            FIND - Line 120
            Code: Select all
            		$sql .= " OR ban_email LIKE '" . str_replace("\'", "''", $row['user_email']) . "' 
            			OR ban_email LIKE '" . substr(str_replace("\'", "''", $row['user_email']), strpos(str_replace("\'", "''", $row['user_email']), "@")) . "'";
            


            REPLACE WITH
            Code: Select all
            		$sql .= " OR ban_email LIKE '" . str_replace("\'", "''", $userdata['user_email']) . "' 
            			OR ban_email LIKE '" . substr(str_replace("\'", "''", $userdata['user_email']), strpos(str_replace("\'", "''", $userdata['user_email']), "@")) . "'";
            

          2. Fix for wrong spelled sessiondata variable.

            FIND - Line 215
            Code: Select all
            		$session_data = '';
            


            REPLACE WITH
            Code: Select all
            		$sessiondata = '';
            

          3. A workaround for rotating IP's.

            FIND - Line 232
            Code: Select all
            				AND u.user_id = s.session_user_id 
            				AND s.session_ip = '$user_ip'";
            


            REPLACE WITH
            Code: Select all
            				AND u.user_id = s.session_user_id";
            

          4. A workaround for rotating IP's.

            FIND - Line 245-289
            Code: Select all
            			$SID = ( $sessionmethod == SESSION_METHOD_GET ) ? 'sid=' . $session_id : '';
            
            			//
            			// Only update session DB a minute or so after last update
            			//
            			if ( $current_time - $userdata['session_time'] > 60 )
            			{
            				// || $userdata['user_session_page'] != $thispage_id
            				$sql = "UPDATE " . SESSIONS_TABLE . " 
            					SET session_time = $current_time, session_page = $thispage_id 
            					WHERE session_id = '" . $userdata['session_id'] . "' 
            						AND session_ip = '$user_ip'";
            				if ( !$db->sql_query($sql) )
            				{
            					message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
            				}
            
            				if ( $userdata['user_id'] != ANONYMOUS )
            				{
            					$sql = "UPDATE " . USERS_TABLE . " 
            						SET user_session_time = $current_time, user_session_page = $thispage_id 
            						WHERE user_id = " . $userdata['user_id'];
            					if ( !$db->sql_query($sql) )
            					{
            						message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
            					}
            				}
            
            				//
            				// Delete expired sessions
            				//
            				$expiry_time = $current_time - $board_config['session_length'];
            				$sql = "DELETE FROM " . SESSIONS_TABLE . " 
            					WHERE session_time < $expiry_time 
            						AND session_id <> '$session_id'";
            				if ( !$db->sql_query($sql) )
            				{
            					message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql);
            				}
            
            				setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
            				setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
            			}
            
            			return $userdata;
            


            REPLACE WITH
            Code: Select all
            			//
            			// Do not check IP assuming equivalence, if IPv4 we'll check only first 24
            			// bits ... I've been told (by vHiker) this should alleviate problems with 
            			// load balanced et al proxies while retaining some reliance on IP security.
            			//
            			$ip_check_s = substr($userdata['session_ip'], 0, 6);
            			$ip_check_u = substr($user_ip, 0, 6);
            
            			if ( $ip_check_s == $ip_check_u )
            			{
            				$SID = ( $sessionmethod == SESSION_METHOD_GET ) ? 'sid=' . $session_id : '';
            
            				//
            				// Only update session DB a minute or so after last update
            				//
            				if ( $current_time - $userdata['session_time'] > 60 )
            				{
            					$sql = "UPDATE " . SESSIONS_TABLE . " 
            						SET session_time = $current_time, session_page = $thispage_id 
            						WHERE session_id = '" . $userdata['session_id'] . "'";
            					if ( !$db->sql_query($sql) )
            					{
            						message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
            					}
            
            					if ( $userdata['user_id'] != ANONYMOUS )
            					{
            						$sql = "UPDATE " . USERS_TABLE . " 
            							SET user_session_time = $current_time, user_session_page = $thispage_id 
            							WHERE user_id = " . $userdata['user_id'];
            						if ( !$db->sql_query($sql) )
            						{
            							message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
            						}
            					}
            
            					//
            					// Delete expired sessions
            					//
            					$expiry_time = $current_time - $board_config['session_length'];
            					$sql = "DELETE FROM " . SESSIONS_TABLE . " 
            						WHERE session_time < $expiry_time 
            							AND session_id <> '$session_id'";
            					if ( !$db->sql_query($sql) )
            					{
            						message_die(CRITICAL_ERROR, 'Error clearing sessions table', '', __LINE__, __FILE__, $sql);
            					}
            
            					setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
            					setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
            				}
            
            				return $userdata;
            			}
            

          5. intval the user id (security fix).

            FIND - Line 306
            Code: Select all
            	$user_id = ( isset($sessiondata['userid']) ) ? $sessiondata['userid'] : ANONYMOUS;
            


            REPLACE WITH
            Code: Select all
            	$user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : ANONYMOUS;
            

          • includes/smtp.php
          Only a fix for trailing, on email addresses.

          1. FIND - Line 173
            Code: Select all
            		$to_header .= "<$mail_to_address>, ";
            


            REPLACE WITH
            Code: Select all
            		$to_header .= ( ( $mail_to_address != '' ) ? ', ' : '' ) . "<$mail_to_address>";
            

          • includes/usercp_avatar.php
          rawurlencode removed (have broken things before) and bugfix for avatar gallery.

          1. FIND - Line 65
            Code: Select all
            function user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename)
            {
            	return ( $mode == 'editprofile' ) ? ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY : '';
            }
            
            function user_avatar_url($mode, &$error, &$error_msg, $avatar_filename)
            {
            	if ( !preg_match('#^http:\/\/#i', $avatar_filename) )
            	{
            		$avatar_filename = 'http://' . $avatar_filename;
            	}
            
            	if ( !preg_match('#^(http:\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)*[a-z]+(:[0-9]+)*\/[^\"]*?\.(gif|jpg|jpeg|png)$)#is', $avatar_filename) )
            	{
            		$error = true;
            		$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format'];
            		return;
            	}
            
            	return ( $mode == 'editprofile' ) ? ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_REMOTE : '';
            
            }
            


            REPLACE WITH
            Code: Select all
            function user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename)
            {
            	global $board_config;
            	if ( file_exists($board_config['avatar_gallery_path'] . '/' . $avatar_filename) && ($mode == 'editprofile') )
            	{
            		$return = ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY;
            	}
            	else
            	{
            		$return = '';
            	}
            	return $return;
            }
            
            function user_avatar_url($mode, &$error, &$error_msg, $avatar_filename)
            {
            	if ( !preg_match('#^(http)|(ftp):\/\/#i', $avatar_filename) )
            	{
            		$avatar_filename = 'http://' . $avatar_filename;
            	}
            
            	if ( !preg_match('#^((http)|(ftp):\/\/[a-z0-9\-]+?\.([a-z0-9\-]+\.)+[a-z]+(:[0-9]+)*\/.*?\.(gif|jpg|jpeg|png)$)#is', $avatar_filename) )
            	{
            		$error = true;
            		$error_msg = ( !empty($error_msg) ) ? $error_msg . '<br />' . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format'];
            		return;
            	}
            
            	return ( $mode == 'editprofile' ) ? ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_REMOTE : '';
            
            }
            

          • includes/usercp_email.php
          Another security fix.

          1. Intval the HTTP-Headers user id.
            FIND - Line 32
            Code: Select all
            	$user_id = ( !empty($HTTP_GET_VARS[POST_USERS_URL]) ) ? $HTTP_GET_VARS[POST_USERS_URL] : $HTTP_POST_VARS[POST_USERS_URL];
            


            REPLACE WITH
            Code: Select all
            	$user_id = ( !empty($HTTP_GET_VARS[POST_USERS_URL]) ) ? intval($HTTP_GET_VARS[POST_USERS_URL]) : intval($HTTP_POST_VARS[POST_USERS_URL]);
            

          • includes/usercp_register.php
          Fixes for the new group_id schema in the database, added check for logged in users and avatar (security fix included) and signature fixes.

          1. Security fix for avatar gallerys.
            FIND - Line 177
            Code: Select all
            	if ( isset($HTTP_POST_VARS['avatargallery']) || isset($HTTP_POST_VARS['submitavatar']) || isset($HTTP_POST_VARS['cancelavatar']) )
            


            REPLACE WITH
            Code: Select all
            	if ( (isset($HTTP_POST_VARS['avatargallery']) || isset($HTTP_POST_VARS['submitavatar']) || isset($HTTP_POST_VARS['cancelavatar'])) && (!isset($HTTP_POST_VARS['submit'])) )
            

          2. Delete avatar if gallery avatar is chosen and a check is added to prevent users logged in while registration.
            FIND - Line 199
            Code: Select all
            		if ( !isset($HTTP_POST_VARS['cancelavatar'])) 
            		{
            			$user_avatar = $user_avatar_local;
            			$user_avatar_type = USER_AVATAR_GALLERY;
            		}
            	}
            }
            


            REPLACE WITH
            Code: Select all
            		if ( !isset($HTTP_POST_VARS['cancelavatar'])) 
            		{
            			$user_avatar = $user_avatar_local;
            			$user_avatar_type = USER_AVATAR_GALLERY;
            
            			if ( $userdata['user_avatar_type'] == USER_AVATAR_UPLOAD && @file_exists('./' . $board_config['avatar_path'] . '/' . $userdata['user_avatar']) )
            			{
            				@unlink('./' . $board_config['avatar_path'] . '/' . $userdata['user_avatar']);
            			}
            
            		}
            	}
            }
            //
            // Let's make sure the user isn't logged in while registering,
            // and ensure that they were trying to register a second time
            // (Prevents double registrations)
            //
            if ( $userdata['session_logged_in'] && $mode =="register" && $username == $userdata['username'])
            {
            	message_die(GENERAL_MESSAGE, $lang['Username_taken'], '', __LINE__, __FILE__);
            }
            
            

          3. Rawurlencode the entered website.
            FIND - Line 367
            Code: Select all
            		$signature = prepare_message($signature, $allowhtml, $allowbbcode, $allowsmilies, $signature_bbcode_uid);
            	}
            


            AFTER, ADD
            Code: Select all
            	if ( $website != '' )
            	{
            		rawurlencode($website);
            	}
            
            

          4. Fix for avatar handling.
            FIND - Line 400
            Code: Select all
            		$avatar_sql = user_avatar_gallery($mode, $error, $error_msg, $user_avatar_local);
            	}
            


            AFTER, ADD
            Code: Select all
            	else
            	{
            		$avatar_sql = '';
            	}
            

          5. Delete the group id block, since the group_id is now auto incremented.
            DELETE - Line 400-510
            Code: Select all
            			$sql = "SELECT MAX(group_id) AS total
            				FROM " . GROUPS_TABLE;
            			if ( !($result = $db->sql_query($sql)) )
            			{
            				message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
            			}
            
            			if ( !($row = $db->sql_fetchrow($result)) )
            			{
            				message_die(GENERAL_ERROR, 'Could not obtain next user_id information', '', __LINE__, __FILE__, $sql);
            			}
            			$group_id = $row['total'] + 1;
            
            

          6. Changed the SQL-Statement for adding the user to the groups table.
            FIND - Line 520
            Code: Select all
            			$sql = "INSERT INTO " . GROUPS_TABLE . " (group_id, group_name, group_description, group_single_user, group_moderator)
            				VALUES ($group_id, '', 'Personal User', 1, 0)";
            


            REPLACE WITH
            Code: Select all
            			$sql = "INSERT INTO " . GROUPS_TABLE . " (group_name, group_description, group_single_user, group_moderator)
            				VALUES ('', 'Personal User', 1, 0)";
            

          7. This is for determining the previously generated group id.
            FIND - Line 524
            Code: Select all
            				message_die(GENERAL_ERROR, 'Could not insert data into groups table', '', __LINE__, __FILE__, $sql);
            			}
            


            AFTER, ADD
            Code: Select all
            			
            			$group_id = $db->sql_nextid();
            

          8. Fix for sending admin activation mail to admin in board configs default lang, instead of the users language.
            FIND - Line 607
            Code: Select all
            				$emailer->use_template("admin_activate", stripslashes($user_lang));
            


            REPLACE WITH
            Code: Select all
            				//$emailer->use_template("admin_activate", stripslashes($user_lang));
            				$emailer->use_template("admin_activate", $board_config['default_lang']);
            

          9. Fix for entered signature, parse it through bbcode.
            FIND - Line 646
            Code: Select all
            	$website = htmlspecialchars(stripslashes($website));
            	$location = htmlspecialchars(stripslashes($location));
            	$occupation = htmlspecialchars(stripslashes($occupation));
            	$interests = htmlspecialchars(stripslashes($interests));
            	$signature = stripslashes($signature);
            


            AFTER, ADD
            Code: Select all
            	$signature = ( $signature_bbcode_uid != '' ) ? preg_replace("/:(([a-z0-9]+:)?)$signature_bbcode_uid\]/si", ']', $signature) : $signature;
            

          User avatar
          Acyd Burn
          Consultant
           
          Posts: 650
          Joined: April 19th 2002, 7:00 pm
          Location: Germany (Oldb)

          Postby Acyd Burn » December 7th 2002, 10:54 am

          • admin/admin_db_utilities.php
          Only bugfixes assigned to this file.

          1. A fix for a missing error-check. instead of result.
            FIND - Line 380
            Code: Select all
            	if(!result)
            


            REPLACE WITH
            Code: Select all
            	if(!$result)
            

          2. This is the array-definition for tables that will be backed up. The fix is to not back up the table search_results twice.
            FIND - Line 715
            Code: Select all
            			$tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words');
            


            REPLACE WITH
            Code: Select all
            			$tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words');
            

          • admin/admin_forums.php
          Bugfixes for a staticly placed language variable and the category name.

          1. Assign a language variable instead of writing it directly.
            FIND - Line 305
            Code: Select all
            			$statuslist = "<option value=\"" . FORUM_UNLOCKED . "\" $forumunlocked>Unlocked</option>\n";
            			$statuslist .= "<option value=\"" . FORUM_LOCKED . "\" $forumlocked>Locked</option>\n";
            


            REPLACE WITH
            Code: Select all
            			$statuslist = "<option value=\"" . FORUM_UNLOCKED . "\" $forumunlocked>" . $lang['Status_unlocked'] . "</option>\n";
            
            			$statuslist .= "<option value=\"" . FORUM_LOCKED . "\" $forumlocked>" . $lang['Status_locked'] . "</option>\n"; 
            
            
            

          2. Bugfix for single quotes in category names.
            FIND - Line 498
            Code: Select all
            				VALUES ('" . $HTTP_POST_VARS['categoryname'] . "', $next_order)";
            


            REPLACE WITH
            Code: Select all
            				VALUES ('" . str_replace("\'", "''", $HTTP_POST_VARS['categoryname']) . "', $next_order)";
            

          • admin/admin_groups.php
          Because the group id is now auto incremental, this file changed too to reflect this.

          1. Change the handling of group_id.
            FIND - Line 287
            Code: Select all
            			$sql = "SELECT MAX(group_id) AS new_group_id 
            				FROM " . GROUPS_TABLE;
            			if ( !($result = $db->sql_query($sql)) )
            			{
            				message_die(GENERAL_ERROR, 'Could not insert new group', '', __LINE__, __FILE__, $sql);
            			}
            			$row = $db->sql_fetchrow($result);
            
            			$new_group_id = $row['new_group_id'] + 1;
            
            			$sql = "INSERT INTO " . GROUPS_TABLE . " (group_id, group_type, group_name, group_description, group_moderator, group_single_user) 
            				VALUES ($new_group_id, $group_type, '" . str_replace("\'", "''", $group_name) . "', '" . str_replace("\'", "''", $group_description) . "', $group_moderator,	'0')";
            			if ( !$db->sql_query($sql) )
            			{
            				message_die(GENERAL_ERROR, 'Could not insert new group', '', __LINE__, __FILE__, $sql);
            			}
            


            REPLACE WITH
            Code: Select all
            			$sql = "INSERT INTO " . GROUPS_TABLE . " (group_type, group_name, group_description, group_moderator, group_single_user) 
            				VALUES ($group_type, '" . str_replace("\'", "''", $group_name) . "', '" . str_replace("\'", "''", $group_description) . "', $group_moderator,	'0')";
            			if ( !$db->sql_query($sql) )
            			{
            				message_die(GENERAL_ERROR, 'Could not insert new group', '', __LINE__, __FILE__, $sql);
            			}
            			$new_group_id = $db->sql_nextid();
            

          • admin/admin_smilies.php
          Only one change to allow adding of smilies through added URL Parameters too.

          1. Add HTTP_GET_VARS.
            FIND - Line 268
            Code: Select all
            else if( isset($HTTP_POST_VARS['add']) )
            


            REPLACE WITH
            Code: Select all
            else if( isset($HTTP_POST_VARS['add']) || isset($HTTP_GET_VARS['add']) )
            

          • admin/admin_users.php
          Bugfixes for deleting private messages and votes if a user gets deleted. Additional bugfixes to avatars and user editing.

          1. Do not delete the data from the sessions table.
            DELETE - Line 204-214
            Code: Select all
            		if( $user_status == 0 )
            		{
            			// User is (made) inactive. Delete all their sessions.
            			$sql = "DELETE FROM " . SESSIONS_TABLE . " 
            				WHERE session_user_id = $user_id";
            			if( !$db->sql_query($sql) )
            			{
            				message_die(GENERAL_ERROR, 'Could not delete this users sessions', '', __LINE__, __FILE__, $sql);
            			}
            		}
            
            

          2. Delete doubled sig length check.
            DELETE - Line 211
            Code: Select all
            			$sig_length_check = preg_replace('/(\[.*?)(=.*?)\]/is', '\\1]', stripslashes($signature));
            

          3. Set poster id to DELETED instead of ANONYMOUS.
            FIND - Line 513
            Code: Select all
            					SET poster_id = " . ANONYMOUS . ", post_username = '$username' 
            


            REPLACE WITH
            Code: Select all
            					SET poster_id = " . DELETED . ", post_username = '$username' 
            

          4. Set topic poster to DELETED instead of ANONYMOUS.
            FIND - Line 521
            Code: Select all
            					SET topic_poster = " . ANONYMOUS . " 
            


            REPLACE WITH
            Code: Select all
            					SET topic_poster = " . DELETED . " 
            

          5. Update vote and group informations to reflect the delete.
            FIND - Line 525
            Code: Select all
            					message_die(GENERAL_ERROR, 'Could not update topics for this user', '', __LINE__, __FILE__, $sql);
            				}
            


            AFTER, ADD
            Code: Select all
            				
            				$sql = "UPDATE " . VOTE_USERS_TABLE . "
            					SET vote_user_id = " . DELETED . "
            					WHERE vote_user_id = $user_id";
            				if( !$db->sql_query($sql) )
            				{
            					message_die(GENERAL_ERROR, 'Could not update votes for this user', '', __LINE__, __FILE__, $sql);
            				}
            				
            				$sql = "SELECT group_id
            					FROM " . GROUPS_TABLE . "
            					WHERE group_moderator = $user_id";
            				if( !($result = $db->sql_query($sql)) )
            				{
            					message_die(GENERAL_ERROR, 'Could not select groups where user was moderator', '', __LINE__, __FILE__, $sql);
            				}
            				
            				while ( $row_group = $db->sql_fetchrow($result) )
            				{
            					$group_moderator[] = $row_group['group_id'];
            				}
            				
            				if ( count($group_moderator) )
            				{
            					$update_moderator_id = implode(', ', $group_moderator);
            					
            					$sql = "UPDATE " . GROUPS_TABLE . "
            						SET group_moderator = " . $userdata['user_id'] . "
            						WHERE group_moderator IN ($update_moderator_id)";
            					if( !$db->sql_query($sql) )
            					{
            						message_die(GENERAL_ERROR, 'Could not update group moderators', '', __LINE__, __FILE__, $sql);
            					}
            				}
            

          6. Update the private message informations to reflect the deletion.
            FIND - Line 594
            Code: Select all
            					message_die(GENERAL_ERROR, 'Could not delete user from topic watch table', '', __LINE__, __FILE__, $sql);
            				}
            
            


            AFTER, ADD
            Code: Select all
            				$sql = "SELECT privmsgs_id
            					FROM " . PRIVMSGS_TABLE . "
            					WHERE ( ( privmsgs_from_userid = $user_id 
            							AND privmsgs_type = " . PRIVMSGS_NEW_MAIL . " )
            						OR ( privmsgs_from_userid = $user_id
            							AND privmsgs_type = " . PRIVMSGS_SENT_MAIL . " )
            						OR ( privmsgs_to_userid = $user_id
            							AND privmsgs_type = " . PRIVMSGS_READ_MAIL . " )
            						OR ( privmsgs_to_userid = $user_id
            							AND privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . " )
            						OR ( privmsgs_from_userid = $user_id
            							AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . " ) )";
            				if ( !($result = $db->sql_query($sql)) )
            				{
            					message_die(GENERAL_ERROR, 'Could not select all user\'s private messages', '', __LINE__, __FILE__, $sql);
            				}
            				
            				//
            				// This little bit of code directly from the private messaging section.
            				// Thanks Paul!
            				//
            				
            				while ( $row_privmsgs = $db->sql_fetchrow($result) )
            				{
            					$mark_list[] = $row_privmsgs['privmsgs_id'];
            				}
            				
            				if ( count($mark_list) )
            				{
            					$delete_sql_id = implode(', ', $mark_list);
            					
            					//
            					// We shouldn't need to worry about updating conters here...
            					// They are already gone!
            					//
            					
            					$delete_text_sql = "DELETE FROM " . PRIVMSGS_TEXT_TABLE . "
            						WHERE privmsgs_text_id IN ($delete_sql_id)";
            					$delete_sql = "DELETE FROM " . PRIVMSGS_TABLE . "
            						WHERE privmsgs_id IN ($delete_sql_id)";
            					
            					//
            					// Shouldn't need the switch statement here, either, as we just want
            					// to take out all of the private messages.  This will not affect
            					// the other messages we want to keep; the ids are unique.
            					//
            					
            					if ( !$db->sql_query($delete_sql) )
            					{
            						message_die(GENERAL_ERROR, 'Could not delete private message info', '', __LINE__, __FILE__, $delete_sql);
            					}
            					
            					if ( !$db->sql_query($delete_text_sql) )
            					{
            						message_die(GENERAL_ERROR, 'Could not delete private message text', '', __LINE__, __FILE__, $delete_text_sql);
            					}
            				}
            				
            				$sql = "UPDATE " . PRIVMSGS_TABLE . "
            					SET privmsgs_to_userid = " . DELETED . "
            					WHERE privmsgs_to_userid = $user_id";
            				if ( !$db->sql_query($sql) )
            				{
            					message_die(GENERAL_ERROR, 'Could not update private messages saved to the user', '', __LINE__, __FILE__, $sql);
            				}
            				
            				$sql = "UPDATE " . PRIVMSGS_TABLE . "
            					SET privmsgs_from_userid = " . DELETED . "
            					WHERE privmsgs_from_userid = $user_id";
            				if ( !$db->sql_query($sql) )
            				{
            					message_die(GENERAL_ERROR, 'Could not update private messages saved from the user', '', __LINE__, __FILE__, $sql);
            				}
            
            

          7. Fix for not displayed username.
            FIND - Line 1037
            Code: Select all
            			'RANK_SELECT_BOX' => $rank_select_box,
            
            


            AFTER, ADD
            Code: Select all
            			'L_USERNAME' => $lang['Username'],
            

          8. Fix for not displayed location.
            FIND - Line 1053
            Code: Select all
            			'L_LOCATION' => $lang['From'],
            


            REPLACE WITH
            Code: Select all
            			'L_LOCATION' => $lang['Location'],
            

          9. Bugfix for avatars.
            FIND - Line 1111
            Code: Select all
            		if( file_exists('./../' . $board_config['avatar_path'] ) )
            		{
            			if ( $form_enctype != '' )
            			{
            				$template->assign_block_vars('avatar_local_upload', array() );
            			}
            			$template->assign_block_vars('avatar_remote_upload', array() );
            		}
            
            		if( file_exists('./../' . $board_config['avatar_gallery_path'] ) )
            		{
            			$template->assign_block_vars('avatar_local_gallery', array() );
            		}
            	}
            
            	$template->pparse('body');
            
            


            REPLACE WITH
            Code: Select all
            		if( file_exists('./../' . $board_config['avatar_path'] ) && ($board_config['allow_avatar_upload'] == TRUE) )
            		{
            			if ( $form_enctype != '' )
            			{
            				$template->assign_block_vars('avatar_local_upload', array() );
            			}
            			$template->assign_block_vars('avatar_remote_upload', array() );
            		}
            
            		if( file_exists('./../' . $board_config['avatar_gallery_path'] ) && ($board_config['allow_avatar_local'] == TRUE) )
            		{
            			$template->assign_block_vars('avatar_local_gallery', array() );
            		}
            		
            		if( $board_config['allow_avatar_remote'] == TRUE )
            		{
            			$template->assign_block_vars('avatar_remote_link', array() );
            		}
            	}
            
            	$template->pparse('body');
            

          • language/lang_english/lang_admin.php
          Some language issues, you should update your other language files, too. I am not sure if all language packs available for phpBB 2 are up-to-date with phpBB 2.0.2.

          1. Changed the explanation of the smilies path.
            FIND - Line 278
            Code: Select all
            $lang['Smilies_path_explain'] = 'Path under your phpBB root dir, e.g. images/smilies';
            


            REPLACE WITH
            Code: Select all
            $lang['Smilies_path_explain'] = 'Path under your phpBB root dir, e.g. images/smiles';
            

          2. Added the Locked/Unlocked language variables.
            FIND - Line 352
            Code: Select all
            $lang['Forum_delete_explain'] = 'The form below will allow you to delete a forum (or category) and decide where you want to put all topics (or forums) it contained.';
            


            AFTER, ADD
            Code: Select all
            $lang['Status_locked'] = 'Locked';
            $lang['Status_unlocked'] = 'Unlocked';
            

          • language/lang_english/lang_faq.php
          Some language issues, you should update your other language files, too. I am not sure if all language packs available for phpBB 2 are up-to-date with phpBB 2.0.2.

          1. Only changed 'rouge' to 'rogue'.
            FIND - Line 42
            Code: Select all
            $faq[] = array("I registered but cannot login!", "Firstly check your are entering the correct username and password. If they are okay then one of two things may have happened. If COPPA support is enabled and you clicked the <u>I am under 13 years old</u> link while registering then you will have to follow the instructions you received. If this is not the case then does your account need activating? Some boards will require all new registrations be activated, either by yourself or by the administrator before you can logon. When you registered it would have told you whether activation was required. If you were sent an email then follow the instructions, if you did not receive the email then are you sure your email address is valid? One reason activation is used is to reduce the possibility of <i>rouge</i> users abusing the board anonymously. If you are sure the email address you used is valid then try contacting the board administrator.");
            


            REPLACE WITH
            Code: Select all
            $faq[] = array("I registered but cannot login!", "Firstly check your are entering the correct username and password. If they are okay then one of two things may have happened. If COPPA support is enabled and you clicked the <u>I am under 13 years old</u> link while registering then you will have to follow the instructions you received. If this is not the case then does your account need activating? Some boards will require all new registrations be activated, either by yourself or by the administrator before you can logon. When you registered it would have told you whether activation was required. If you were sent an email then follow the instructions, if you did not receive the email then are you sure your email address is valid? One reason activation is used is to reduce the possibility of <i>rogue</i> users abusing the board anonymously. If you are sure the email address you used is valid then try contacting the board administrator.");
            

          2. Closed the italic html tag.
            FIND - Line 57
            Code: Select all
            $faq[] = array("How do I post a topic in a forum?", "Easy, click the relevant button on either the forum or topic screens. You may need to register before you can post a message, the facilities available to you are listed at the bottom of the forum and topic screens (the <i>You can post new topics, You can vote in polls, etc.<i> list)");
            


            REPLACE WITH
            Code: Select all
            $faq[] = array("How do I post a topic in a forum?", "Easy, click the relevant button on either the forum or topic screens. You may need to register before you can post a message, the facilities available to you are listed at the bottom of the forum and topic screens (the <i>You can post new topics, You can vote in polls, etc.</i> list)");
            

          3. As the one above, closed the italic html tag.
            FIND - Line 78
            Code: Select all
            $faq[] = array("What are Moderators?", "Moderators are individuals (or groups of individuals) whose job it is to look after the running of the forums from day to day. They have the power to edit or delete posts and lock, unlock, move, delete and split topics in the forum they moderate. Generally moderators are there to prevent people going <i>off-topic<i> or posting abusive or offensive material.");
            


            REPLACE WITH
            Code: Select all
            $faq[] = array("What are Moderators?", "Moderators are individuals (or groups of individuals) whose job it is to look after the running of the forums from day to day. They have the power to edit or delete posts and lock, unlock, move, delete and split topics in the forum they moderate. Generally moderators are there to prevent people going <i>off-topic</i> or posting abusive or offensive material.");
            

          • language/lang_english/lang_main.php
          Some language issues, you should update your other language files, too. I am not sure if all language packs available for phpBB 2 are up-to-date with phpBB 2.0.2.

          1. Changed the text to describe it more precisely.
            FIND - Line 633
            Code: Select all
            $lang['Agree_over_13'] = 'I Agree to these terms and am <b>over</b> 13 years of age';
            


            REPLACE WITH
            Code: Select all
            $lang['Agree_over_13'] = 'I Agree to these terms and am <b>over</b> or <b>exactly</b> 13 years of age';
            



          Now run the update_to_202.php file and enjoy your upgraded forum. :D
          User avatar
          Acyd Burn
          Consultant
           
          Posts: 650
          Joined: April 19th 2002, 7:00 pm
          Location: Germany (Oldb)


          Return to phpBB 2: Fixes and Code Changes

          Who is online

          Users browsing this forum: No registered users and 0 guests