PHP Nuke Nederland
 
•   Home  •  Downloads  •  Your Account  •  Forums  •
PHP-Nuke Nederland: Forums

PHP-Nuke Nederland :: View topic - [FIX] Handmatig upgraden van 2.0.14 -> 2.0.15
 Forum FAQ  •   Search   •  Memberlist  •  Usergroups   •  Register   •    •  Profile  •  Log in to check your private messages  •  Log in

 
Post new topicThis topic is locked: you cannot edit posts or make replies.
View previous topic Log in to check your private messages View next topic
Author Message
BlueLion
Administrator
Administrator


Joined: Aug 21, 2004
Posts: 2834

PostPosted: Sun 08 May 2005 6:02 Reply with quoteBack to top

phpBB 2.0.14 to phpBB 2.0.15 Code Changes



These are the Changes from phpBB 2.0.14 to phpBB 2.0.15 summed up into a little Mod. This might be very helpful if you want to update your Board and have installed a bunch of Mods. Then it's normally easier to apply the Code Changes than to install all Mods again.

When you find a 'AFTER, ADD'-Statement, the Code have to be added after the last line quoted in the 'FIND'-Statement.
When you find a 'BEFORE, ADD'-Statement, the Code have to be added before the first line quoted in the 'FIND'-Statement.
When you find a 'REPLACE WITH'-Statement, the Code quoted in the 'FIND'-Statement have to be replaced completely with the quoted Code in the 'REPLACE WITH'-Statement.

After you have finished this tutorial, you have to upload the install/update_to_latest.php file, execute it and then delete it from your webspace.

  • modules/Forums/admin/admin_forums.php



  1. FIND - Line 236
    Code:


       if( $mode == "addforum" )
       {
          list($cat_id) = each($HTTP_POST_VARS['addforum']);


    AFTER, ADD
    Code:


          $cat_id = intval($cat_id);



  • modules/Forums/admin/admin_smilies.php



  1. FIND - Line 450
    Code:


             $smile_code = ( isset($HTTP_POST_VARS['smile_code']) ) ? $HTTP_POST_VARS['smile_code'] : $HTTP_GET_VARS['smile_code'];
             $smile_url = ( isset($HTTP_POST_VARS['smile_url']) ) ? $HTTP_POST_VARS['smile_url'] : $HTTP_GET_VARS['smile_url'];
             $smile_emotion = ( isset($HTTP_POST_VARS['smile_emotion']) ) ? $HTTP_POST_VARS['smile_emotion'] : $HTTP_GET_VARS['smile_emotion'];


    AFTER, ADD
    Code:


             $smile_code = trim($smile_code);
             $smile_url = trim($smile_url);
             $smile_emotion = trim($smile_emotion);



  • modules/Forums/admin/pagestart.php



  1. FIND - Line 62
    Code:


    */
    if ( empty($no_page_header) )



    AFTER, ADD
    Code:


    if (!$userdata['session_admin'])
    {
       $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', $_SERVER['SERVER_SOFTWARE']) ) ? 'Refresh: 0; URL=' : 'Location: ';
       header($header_location . '../../../' . append_sid("login.$phpEx?redirect=admin/&admin=1", true));
       exit;
    }




  • db/postgres7.php



  1. FIND - Line 126
    Code:


             $query = preg_replace('#(.*WHERE.*)(username|user_email|ban_email) = \'(.*)\'#ise', "\"\\1LOWER(\\2) = '\" . strtolower('\\3') . \"'\"", $query);


    REPLACE WITH
    Code:


    //         $query = preg_replace('#(.*WHERE.*)(username|user_email|ban_email) = \'(.*)\'#ise', "\"\\1LOWER(\\2) = '\" . strtolower('\\3') . \"'\"", $query);



  • modules/Forums/groupcp.php



  1. FIND - Line 340
    Code:


             if ( !($row = $db->sql_fetchrow($result)) )


    REPLACE WITH
    Code:


             if ( !($row = $db->sql_fetchrow($result)) || $row['is_auth_mod'] == 0 )



  • includes/bbcode.php



  1. FIND - Line 127
    Code:


    {
       global $lang, $bbcode_tpl;



    AFTER, ADD
    Code:


       $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);




  2. FIND - Line 197
    Code:


       // [img]image_url_here[/img] code..
       // This one gets first-passed..
       $patterns[] = "#\[img:$uid\](.*?)\[/img:$uid\]#si";


    REPLACE WITH
    Code:


       // [img]image_url_here[/img] code..
       // This one gets first-passed..
       $patterns[] = "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i";



  3. FIND - Line 210
    Code:


       // [url=xxxx://www.phpbb.com]phpBB[/url] code..
       $patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is";
       $replacements[] = $bbcode_tpl['url3'];

       // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
       $patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is";


    REPLACE WITH
    Code:


       // [url=xxxx://www.phpbb.com]phpBB[/url] code..
       $patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\]([^?].*?)\[/url\]#i";
       $replacements[] = $bbcode_tpl['url3'];

       // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
       $patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\]([^?].*?)\[/url\]#i";



  4. FIND - Line 619
    Code:


     */
    function make_clickable($text)
    {


    AFTER, ADD
    Code:


       $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);



  • includes/sessions.php



  1. FIND - Line 27
    Code:


    function session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_autologin = 0)


    REPLACE WITH
    Code:


    function session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_autologin = 0, $admin = 0)



  2. FIND - Line 158
    Code:


          SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login
          WHERE session_id = '" . $session_id . "'
             AND session_ip = '$user_ip'";
       if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )
       {
          $session_id = md5(uniqid($user_ip));

          $sql = "INSERT INTO " . SESSIONS_TABLE . "
             (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in)
             VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login)";


    REPLACE WITH
    Code:


          SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login, session_admin = $admin
          WHERE session_id = '" . $session_id . "'
             AND session_ip = '$user_ip'";
       if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )
       {
          list($sec, $usec) = explode(' ', microtime());
          mt_srand((float) $sec + ((float) $usec * 100000));
          $session_id = md5(uniqid(mt_rand(), true));

          $sql = "INSERT INTO " . SESSIONS_TABLE . "
             (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in, session_admin)
             VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login, $admin)";



  3. FIND - Line 180
    Code:


       {// ( $userdata['user_session_time'] > $expiry_time && $auto_create ) ? $userdata['user_lastvisit'] : (
          $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;



    AFTER, ADD
    Code:


          if (!$admin)
          {



  4. FIND - Line 189
    Code:



          $userdata['user_lastvisit'] = $last_visit;

          $sessiondata['autologinid'] = ( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '';


    REPLACE WITH
    Code:


          }

          $userdata['user_lastvisit'] = $last_visit;

          $sessiondata['autologinid'] = (!$admin) ? (( $enable_autologin && $sessionmethod == SESSION_METHOD_COOKIE ) ? $auto_login_key : '') : $sessiondata['autologinid'];



  5. FIND - Line 204
    Code:


       $userdata['session_page'] = $page_id;
       $userdata['session_start'] = $current_time;
       $userdata['session_time'] = $current_time;


    AFTER, ADD
    Code:


       $userdata['session_admin'] = $admin;



  6. FIND - Line 294
    Code:


                   $sql = "UPDATE " . SESSIONS_TABLE . "
                      SET session_time = $current_time, session_page = $thispage_id


    REPLACE WITH
    Code:


                   // A little trick to reset session_admin on session re-usage
                   $update_admin = (!defined('IN_ADMIN') && $current_time - $userdata['session_time'] > ($board_config['session_length']+60)) ? ', session_admin = 0' : '';

                   $sql = "UPDATE " . SESSIONS_TABLE . "
                      SET session_time = $current_time, session_page = $thispage_id$update_admin



  • includes/smtp.php



  1. FIND - Line 109
    Code:


       if( !$socket = fsockopen($board_config['smtp_host'], 25, $errno, $errstr, 20) )


    REPLACE WITH
    Code:


       if( !$socket = @fsockopen($board_config['smtp_host'], 25, $errno, $errstr, 20) )



  • includes/usercp_viewprofile.php



  1. FIND - Line 36
    Code:


    }
    $profiledata = get_userdata($HTTP_GET_VARS[POST_USERS_URL]);



    AFTER, ADD
    Code:


    if (!$profiledata)
    {
       message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
    }




  • modules/Forums/language/lang_english/lang_main.php



  1. FIND - Line 1021
    Code:


    $lang['An_error_occured'] = 'An Error Occurred';
    $lang['A_critical_error'] = 'A Critical Error Occurred';



    AFTER, ADD
    Code:


    $lang['Admin_reauthenticate'] = 'To administer the board you must re-authenticate yourself.';




  • modules/Forums/login.php



  1. FIND - Line 55
    Code:


       if( ( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) ) && !$userdata['session_logged_in'] )


    REPLACE WITH
    Code:


       if( ( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) ) && (!$userdata['session_logged_in'] || isset($HTTP_POST_VARS['admin'])) )



  2. FIND - Line 80
    Code:


                   $session_id = session_begin($row['user_id'], $user_ip, PAGE_INDEX, FALSE, $autologin);


    REPLACE WITH
    Code:


                   $admin = (isset($HTTP_POST_VARS['admin'])) ? 1 : 0;
                   $session_id = session_begin($row['user_id'], $user_ip, PAGE_INDEX, FALSE, $autologin, $admin);



  3. FIND - Line 162
    Code:


       if( !$userdata['session_logged_in'] )


    REPLACE WITH
    Code:


       if( !$userdata['session_logged_in'] || (isset($HTTP_GET_VARS['admin']) && $userdata['session_logged_in'] && $userdata['user_level'] == ADMIN))



  4. FIND - Line 211
    Code:



          make_jumpbox('viewforum.'.$phpEx, $forum_id);
          $template->assign_vars(array(
             'USERNAME' => $username,

             'L_ENTER_PASSWORD' => $lang['Enter_password'],


    REPLACE WITH
    Code:


          $s_hidden_fields .= (isset($HTTP_GET_VARS['admin'])) ? '<input type="hidden" name="admin" value="1" />' : '';

          make_jumpbox('viewforum.'.$phpEx, $forum_id);
          $template->assign_vars(array(
             'USERNAME' => $username,

             'L_ENTER_PASSWORD' => (isset($HTTP_GET_VARS['admin'])) ? $lang['Admin_reauthenticate'] : $lang['Enter_password'],



  • modules/Forums/viewtopic.php



  1. FIND - Line 1110
    Code:


          $message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace('#\b(" . $highlight_match . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] . "\"><b>\\\\1</b></span>', '\\0')", '>' . $message . '<'), 1, -1));


    REPLACE WITH
    Code:


          $message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace('#\b(" . str_replace('\\', '\\\\', $highlight_match) . ")\b#i', '<span style=\"color:#" . $theme['fontcolor3'] . "\"><b>\\\\1</b></span>', '\\0')", '>' . $message . '<'), 1, -1));



  • modules/Forums/admin/admin_ug_auth.php



  1. FIND - Line 553
    Code:


          message_die(GENERAL_MESSAGE, $message);
       }
    }
    else if ( ( $mode == 'user' && ( isset($HTTP_POST_VARS['username']) || $user_id ) ) || ( $mode == 'group' && $group_id ) )


    BEFORE, ADD
    Code:



          $sql = 'SELECT user_id FROM ' . USER_GROUP_TABLE . "
             WHERE group_id = $group_id";
          $result = $db->sql_query($sql);

          $group_user = array();
          while ($row = $db->sql_fetchrow($result))
          {
             $group_user[$row['user_id']] = $row['user_id'];
          }
          $db->sql_freeresult($result);

          $sql = "SELECT ug.user_id, COUNT(auth_mod) AS is_auth_mod
             FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug
             WHERE ug.user_id IN (" . implode(', ', $group_user) . ")
                AND aa.group_id = ug.group_id
                AND aa.auth_mod = 1
             GROUP BY ug.user_id";
          if ( !($result = $db->sql_query($sql)) )
          {
             message_die(GENERAL_ERROR, 'Could not obtain moderator status', '', __LINE__, __FILE__, $sql);
          }

          while ($row = $db->sql_fetchrow($result))
          {
             if ($row['is_auth_mod'])
             {
                unset($group_user[$row['user_id']]);
             }
          }
          $db->sql_freeresult($result);

          if (sizeof($group_user))
          {
             $sql = "UPDATE " . USERS_TABLE . "
                SET user_level = " . USER . "
                WHERE user_id IN (" . implode(', ', $group_user) . ")";
             if ( !($result = $db->sql_query($sql)) )
             {
                message_die(GENERAL_ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
             }
          }



  • includes/usercp_register.php



  1. FIND - Line 414
    Code:


             if (strtolower($username) != strtolower($userdata['username']))


    REPLACE WITH
    Code:


             if (strtolower($username) != strtolower($userdata['username']) || $mode == 'register')


    • Database Changes (run through phpMyAdmin)

    Code:

    UPDATE nuke_bbconfig SET config_value='.0.15' where config_name='version';
    ALTER TABLE nuke_bbsessions ADD COLUMN session_admin tinyint(2) DEFAULT '0' NOT NULL;




Last edited by BlueLion on Tue 10 May 2005 8:22; edited 4 times in total
View user's profileSend private messageSend e-mailVisit poster's website
BlueLion
Administrator
Administrator


Joined: Aug 21, 2004
Posts: 2834

PostPosted: Sun 08 May 2005 6:03 Reply with quoteBack to top

Fix/Upgrade
View user's profileSend private messageSend e-mailVisit poster's website
Display posts from previous:      
 Donaties   Adverteren 
Wilt u het forum steunen, dan kunt u nu eenvoudig doneren met PayPal.
Post new topicThis topic is locked: you cannot edit posts or make replies.
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Web site powered by PHP-Nuke

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2004-2008 by BlueLion.
SEO enhanced with the Sitemapper script
You can syndicate our news using the file backend.php or ultramode.txt
Powered by PHP Powered by MySQL Apache Webserver Valid robots.txt
PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Pagina rendering: 0.15 seconden


[Valid News RSS]

RSS Feeds:
[RSS 2.0 News Feed]
[RSS 2.0 Download Feed]
[RSS 2.0 Forum Feed]
[RSS 2.0 Link Feed]
:: fisubsilver shadow phpbb2 style by Daz :: PHP-Nuke theme by BlueLion ::