Security Fixes, Updates And Enhancements For IPB 1.3.1, Part B  2.7.1  Invision Power Board 1.3.1
Mod Description Updates your Invisionboard 1.3.1, inserts all known security fixes and adds more essential features.
Mod Compatibility Invision Power Board 1.3.1
Mod Category ACP Mod
Mod Author Peter
Mod Author's Email Peter@ibforen.de
Info File sources/mods/sec_update_131_B/mod_sec_update_131_howto.htm
Mod Version 2.7.1
Comment Distribution is not allowed. Download from ibforen.de
All changes could be recognized by mod_token

This html-howto was created with The ModInstaller 1.3.3 by
Peter@ibforen.de, released on 1st June, 2011
Creation time July 29, 2011

It is not for public use.

Attention
  • This modification is no freeware.
  • Redistribution of this howto or of one of the mod files is prohibited. Redistribution of the mod or its files only with my authorisation.
  • Customizing of the mod, in order to fit your board's skin, is welcomed. Share your experiences with the community.But do not hurt my copyright by distributing code segment derivated from this mod.
  • Violation of these rules will finally let me stop any production of free available modifications or programs. Please, respect the creative work of coders and take care of their copyrights.
Mod Token mod_sec_update_131

 Content

1 Newest History and Change Logs
2 Changes
3 Copy
4 Code
5 Customize
6 Comment
7 Older Change History and Change Logs

 1.  Newest History and Change Logs

Important: DO NOT INSTALL MANUALLY. Use my ModInstaller and read section Customize!

I have split the mod into 3 parts in order to avoid timeout problems. Remove the directory of an older version.

Take care of installing all three parts.


Before installing this mod:
Do not forget to remove my mods Customize Date, Load Lang Bug, Extension Bug and some other mod providing relative dates.


2.7.0 ⇒ 2.7.1, dated on July 29th, 2011

Update


2.6.9 ⇒ 2.7.0, dated on July 25th, 2011

Update


2.6.8 ⇒ 2.6.9, dated on July 15th, 2011


2.6.7 ⇒ 2.6.8, dated on June 26th, 2011


2.6.6 ⇒ 2.6.7, dated on June 14th, 2011


2.6.5 ⇒ 2.6.6, dated on November 30th, 2010
Minor bugfixes for request system. Replace mod_sec_update_ad_req_func.php and mod_sec_update_ucp_func.php in sources/mods/sec_update_131_A.

2.6.1 ⇒ 2.6.5, dated on June 6th, 2010
Attention
If you have Mod BBCode installed then you must reinstall it with version > 2.2.11. This is because a feature of Mod BBCode was moved to the new version of Mod Security&Updates (this mod).




2.6.0 ⇒ 2.6.1, dated on December 14th, 2009


2.5.2 ⇒ 2.6.0, dated on December 1st, 2009
Attention: This is a big update with a lot of code changes and sql changes. Do not install manually.


Complete Feature List (Only new functions and modules)

User Mode

Common features

Register and Login

Views

Posting

Messaging


Admin Mode (Admin Control Panel ACP)

Common Features In Admin Control Panel

Security Features For Admin Access


 2.  Changes
Changed file Changed function
sources/lib/emailer.php build_headers(..)
sources/lib/emailer.php send_mail(..)
sources/lib/post_edit_post.php complete_edit(..)
sources/lib/post_edit_post.php post_functions(..)
sources/lib/post_edit_post.php show_form(..)
sources/lib/post_new_post.php add_new_topic(..)
sources/lib/post_parser.php class properties or methods
sources/lib/post_parser.php convert(..)
sources/lib/post_parser.php post_parser(..), convert(..)
sources/lib/post_parser.php regex_check_image(..)
sources/lib/post_parser.php regex_font_attr(..)
sources/lib/post_parser.php regex_list(..)
sources/lib/post_parser.php regex_list_item(..)
sources/lib/post_parser.php regex_parse_quotes(..)
sources/lib/post_parser.php regex_simple_quote_tag(..)
sources/lib/post_parser.php unconvert(..)
sources/lib/post_poll.php add_new_poll(..)
sources/lib/post_q_reply_post.php add_reply(..)
sources/lib/post_q_reply_post.php post_functions(..)
sources/lib/post_q_reply_post.php process(..)
sources/lib/post_reply_post.php add_reply(..)
sources/lib/post_reply_post.php process(..)
sources/lib/post_reply_post.php show_form(..)
sources/lib/tar.php class properties or methods
sources/lib/tar.php read_tar(..)
sources/lib/usercp_functions.php do_avatar(..)
sources/lib/usercp_functions.php do_board_prefs(..)
sources/lib/usercp_functions.php do_photo(..)
sources/lib/usercp_functions.php do_photo(..), do_avatar(..)
sources/lib/usercp_functions.php do_profile(..)
sources/misc/attach.php attach(..)
sources/misc/contact_member.php board_rules(..)
sources/misc/contact_member.php check_access(..)
sources/misc/contact_member.php class properties or methods
sources/misc/contact_member.php send_report(..)
sources/misc/contact_member.php send_report(..), send_report(..)
sources/misc/contact_member.php show_integ(..)
sources/misc/contact_member.php show_msn(..)
sources/misc/forward_page.php check_access(..)
sources/misc/forward_page.php Forward(..)
sources/misc/legends.php find_user_two(..)
sources/misc/print_page.php get_posts(..)
sources/misc/print_page.php Printable(..)
sources/misc/stats.php check_access(..)
sources/misc/stats.php show_leaders(..)
sources/misc/stats.php show_today_posters(..)
sources/misc/tracker.php tracker(..)
sources/misc/warn.php view_log(..)
sources/Register.php class properties or methods
sources/Register.php create_account(..)
sources/Register.php create_account(..), create_account(..)
sources/Register.php lost_password_end(..)
sources/Register.php Register(..)
sources/Register.php revalidate_two(..)
sources/Register.php show_reg_form(..)
sources/Search.php check_access(..)
sources/Search.php convert_highlite_words(..)
sources/Search.php get_active(..)
sources/Search.php get_replies(..), get_active(..)
sources/Search.php Search(..)
sources/Search.php Search(..), get_last_ten(..)
sources/Topics.php class properties or methods
sources/Topics.php edit_button(..)
sources/Topics.php parse_member(..)
sources/Topics.php reply_button(..)
sources/Topics.php return_last_post(..)
sources/Topics.php Topics(..)
sources/Usercp.php board_prefs(..)
sources/Usercp.php class properties or methods
sources/Usercp.php do_email_change(..)
sources/Usercp.php personal(..)
sources/Usercp.php UserCP(..)

 3.  Copy

Copy all files of archive into the root dir of your board. Take care of the structure of this archive.


 4.  Code


Step  1:  Open sources/Register.php

  A. Find in function Register(..)

        $ibforums->lang = $std->load_words($ibforums->lang, 'lang_register', $ibforums->lang_id );

     Insert below the blue code

        $ibforums->lang = $std->load_words($ibforums->lang, 'lang_register', $ibforums->lang_id );



//-- mod_sec_update_131 begin
        $ibforums->lang = $std->load_words($ibforums->lang, 'mod_sec_lang_reg', $ibforums->lang_id );
//-- mod_sec_update_131 end


  B. Find in function lost_password_end(..)

        $DB->query("SELECT name, id, email, mgroup FROM ibf_members WHERE LOWER(name)='$member_name'");

     Insert above the blue code



//-- mod_sec_update_131 begin
        $member_name = str_replace( '|', '|', $member_name);
        $DB->query("SELECT name, id, email, mgroup FROM ibf_members WHERE LOWER(name)='$member_name'");
        if (!$DB->get_num_rows()) {
            if (strlen($member_name) <= 128 && preg_match("/^([^@]+)@(.*)$/", $member_name, $parts)) {
                $user = $parts[1];
                $domain = $parts[2];
                if (!preg_match("/[^a-zA-Z0-9_.+-]/", $user) && strlen($domain) <= 128 && !preg_match("/[^a-zA-Z0-9.-]/", $domain) && preg_match("/\\./", $domain)) {
                    $DB->query("SELECT name, id, email, mgroup FROM ibf_members WHERE LOWER(email)='$member_name'");
                    if (!$DB->get_num_rows())
                        $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_such_user' ) );
                }
            }
        }
        if (FALSE)
//-- mod_sec_update_131 end


        $DB->query("SELECT name, id, email, mgroup FROM ibf_members WHERE LOWER(name)='$member_name'");

  C. Find in function create_account(..), create_account(..)

'LONG'

     Insert below the blue code

'LONG'



//-- mod_sec_update_131 begin
        , TRUE
//-- mod_sec_update_131 end


  D. Find in function lost_password_end(..)

                                                             'lost_pass'   => 1,
                                                             'ip_address'  => $ibforums->input['IP_ADDRESS']
                                                   )       );

     Insert below the blue code

                                                             'lost_pass'   => 1,
                                                             'ip_address'  => $ibforums->input['IP_ADDRESS']
                                                   )       );



//-- mod_sec_update_131 begin
            $DB->query("DELETE FROM ibf_validating WHERE member_id={$member['id']} AND lost_pass=1");
//-- mod_sec_update_131 end


  E. Find in function show_reg_form(..)

        $DB->query("SELECT * from ibf_pfields_data WHERE fedit=1 AND fshowreg=1 ORDER BY forder");

     Insert above the blue code



//-- mod_sec_update_131 begin
        $lang = $std->load_words($lang, 'lang_ucp', $ibforums->lang_id );
        $fields = array("website"  => "website",
                        "icq_number" => "icq",
                        "aim_name" => "aol",
                        "yahoo" => "yahoo",
                        "msnname" => "msn", 
                        "location" => "location"
                        );
        $settings = array();
        $config = explode("|", $ibforums->vars['profile_fields']);
        for ($i = 0; $i < count($config); $i++) {
            $value = explode(",", $config[$i]);
            $settings[$value[0]] = array($value[1], $value[2]);
        }
        if ($settings["birthday"][0]) {
            $date = getdate();
            $day  = "<option value='0'>--</option>";
            $month  = "<option value='0'>--</option>";
            $year = "<option value='0'>--</option>";
            for ( $i = 1 ; $i < 32 ; $i++ ) {
                $day .= "<option value='$i'";
                $day .= $i == $ibforums->input['day'] ? "selected>$i</option>" : ">$i</option>";
            }
            $day  = "<select name='day' class='forminput'>$day</select>";
            for ( $i = 1 ; $i < 13 ; $i++ ) {
                $month .= "<option value='$i'";
                $month .= $i == $ibforums->input['month'] ? "selected>{$lang['month'.$i]}</option>" : ">{$lang['month'.$i]}</option>";
            }
            $month  = "<select name='month' class='forminput'>$month</select>";
            $i = $date['year'] - 1;
            $j = $date['year'] - 100;
            for ( $i ; $j < $i ; $i-- ) {
                $year .= "<option value='$i'";
                $year .= $i == $ibforums->input['year'] ? "selected>$i</option>" : ">$i</option>";
            }
            $year  = "<select name='year' class='forminput'>$year</select>";
            $entry = $this->html->field_entry($lang['birthday'], "", $day.$month.$year);
            if ($settings["birthday"][1])
                $required_output .= $entry;
            else
                $optional_output .= $entry;
        }
        foreach ($fields as $field => $desc) {
            if ($settings[$field][0]) {
                $entry = $this->html->field_entry($lang[$desc], "", $this->html->field_textinput("pfield_".$field, $ibforums->input["pfield_".$field]));
                if ($settings[$field][1])
                    $required_output .= $entry;
                else
                    $optional_output .= $entry;
            }
        }
        if ($settings["interests"][0]) {
            $entry = $this->html->field_entry($lang['interests'], "", $this->html->field_textarea( 'pfield_interests', $ibforums->input['pfield_interests']));
            if ($settings["interests"][1])
                $required_output .= $entry;
            else
                $optional_output .= $entry;
        }
//-- mod_sec_update_131 end


        $DB->query("SELECT * from ibf_pfields_data WHERE fedit=1 AND fshowreg=1 ORDER BY forder");

  F. Find in function create_account(..)

                                                                 'new_reg'     => 1,
                                                                 'ip_address'  => $member['ip_address']
                                                       )       );

     Insert below the blue code

                                                                 'new_reg'     => 1,
                                                                 'ip_address'  => $member['ip_address']
                                                       )       );



//-- mod_sec_update_131 begin
                $DB->query("DELETE FROM ibf_validating WHERE member_id={$member['id']} AND new_reg=1");
//-- mod_sec_update_131 end


  G. Find in function show_reg_form(..)

        $this->output    .= $this->html->ShowForm( array( 'TEXT'        => $ibforums->lang['std_text'],

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (file_exists(ROOT_PATH."lang/".$ibforums->lang_id."/lang_glines.php")) {
            $ibforums->lang = $std->load_words($ibforums->lang, 'lang_glines', $ibforums->lang_id );
            $ibforums->lang['click_wrap'] = $std->my_nl2br($ibforums->lang['terms_of_use']);
        }
        $this->html = $std->load_template('mod_sec_update_skin_reg');
//-- mod_sec_update_131 end


        $this->output    .= $this->html->ShowForm( array( 'TEXT'        => $ibforums->lang['std_text'],

  H. Find in function show_reg_form(..)

        if ($required_output != "")

     Insert above the blue code



//-- mod_sec_update_131 begin
        require_once (ROOT_PATH."sources/mods/sec_update_131_A/mod_sec_update_func.php");
        $xajax = new mod_sec_update_xajax();
        if ($ibforums->input['tz'])
            $xajax->process("reg", "process_xajax");
        else
            $required_output .= $xajax->process("reg", "get_javascript");
        $lang = $std->load_words($lang, "lang_ucp", $ibforums->lang_id);
        $time_select = "<select name='time_offset' id='time_offset' class='forminput'>";
        $offset = $ibforums->vars['time_offset'];
        $dst = $ibforums->vars['dst_in_use'];
        foreach( $lang as $off => $words ) {
            if (preg_match("/^time_(\S+)$/", $off, $match))
                $time_select .= (string) $match[1] == (string) $offset ? "<option value='{$match[1]}' selected='selected'>$words</option>"
                                                                        : "<option value='{$match[1]}'>$words</option>";
        }
        $time_select .= "</select><br /><br />";
        $dst_check = $dst?"checked='checked'":"";
        $dst_in_use = "<input type='checkbox' class='forminput' name='dst_in_use' id='dst_in_use' value='1' $dst_check />&nbsp;";
        $time_select .= $dst_in_use;
        $lang = $std->load_words($lang, 'lang_date', $ibforums->lang_id);
        $time_select .= $lang['dst_box'];
        $site = parse_url($ibforums->vars['board_url']);
        $site = $site['host'];
        $time_select .= "<br /><input type='button' value='".$lang['calculate_zone']."' onClick='xajax_get_time_zone();' class='forminput' /></b><br/>".str_replace("{site}", $site, $lang['calculate_zone_info']);
        $required_output .= $this->html->field_entry( $lang['settings_time'], $lang['settings_time_txt']."<div id='tz_location'><b><font color='red'>{$lang['calculated_zone']}</font></div>", $time_select );
//-- mod_sec_update_131 end


        if ($required_output != "")

  I. Find in function create_account(..)

                                                             'new_reg'     => 1,
                                                             'ip_address'  => $member['ip_address']
                                                   )       );

     Insert below the blue code

                                                             'new_reg'     => 1,
                                                             'ip_address'  => $member['ip_address']
                                                   )       );



//-- mod_sec_update_131 begin
            $DB->query("DELETE FROM ibf_validating WHERE member_id={$member['id']} AND new_reg=1");
//-- mod_sec_update_131 end


  J. Find in function revalidate_two(..)

        $DB->query("SELECT * FROM ibf_members WHERE LOWER(name)='".strtolower($ibforums->input['username'])."'");

     Insert above the blue code



//-- mod_sec_update_131 begin
         $ibforums->input['username'] = str_replace( '|', '&#124;',trim($ibforums->input['username']));
         $ibforums->input['username'] = preg_replace("/&#([0-9]+);/ie", "\$this->convert_html_char('\\1')", $ibforums->input['username'] );
         $ibforums->input['username'] = preg_replace("`(\.|\!)+$`", "_", $ibforums->input['username'] );
//-- mod_sec_update_131 end


        $DB->query("SELECT * FROM ibf_members WHERE LOWER(name)='".strtolower($ibforums->input['username'])."'");

  K. Find in function create_account(..)

        //----------------------------------
        // Custom profile field stuff

     Insert above the blue code



//-- mod_sec_update_131 begin
        $fields = array("website"  => "website",
                        "icq_number" => "icq",
                        "aim_name" => "aol",
                        "yahoo" => "yahoo",
                        "msnname" => "msn", 
                        "location" => "location",
                        "interests" => "interests"
                        );
        $settings = array();
        $config = explode("|", $ibforums->vars['profile_fields']);
        for ($i = 0; $i < count($config); $i++) {
            $value = explode(",", $config[$i]);
            $settings[$value[0]] = array($value[1], $value[2]);
        }
        if ($settings["birthday"][0] && $settings["birthday"][1]) {
            if (!$ibforums->input['day'] || !$ibforums->input['month'] || (!$ibforums->vars['birthday_wo_year'] && !$ibforums->input['year']))
                $std->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form' ) );
        }
        foreach ($fields as $field) {
            if ($settings[$field][0] && $settings[$field][1]) {
                if (empty($ibforums->input["pfield_".$field]))
                    $std->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form' ) );
            }
        }
//-- mod_sec_update_131 end


        //----------------------------------
        // Custom profile field stuff

  L. Find in function create_account(..)

        // Trim off the username and password

     Insert below the blue code

        // Trim off the username and password



//-- mod_sec_update_131 begin
        $ibforums->input['UserName'] = preg_replace("/&#([0-9]+);/ie", "\$this->convert_html_char('\\1')", $ibforums->input['UserName'] );
        $ibforums->input['UserName'] = preg_replace("`(\.|\!)+$`", "_", $ibforums->input['UserName'] );
//-- mod_sec_update_131 end


  M. Find in function create_account(..)

        //+--------------------------------------------
        //| Insert into the DB

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($settings["birthday"][0]) {
            $member['bday_day'] = $ibforums->input['day'];
            $member['bday_month'] = $ibforums->input['month'];
            $member['bday_year'] = $ibforums->input['year'];
        }
        foreach ($fields as $field => $desc) {
            if ($settings[$field][0]) {
                $member[$field] = $ibforums->input["pfield_".$field];
            }
        }
        if ($ibforums->vars['profile_allow_ibc']) {
            require "./sources/lib/post_parser.php";
            $this->parser = new post_parser();
            $member['interests'] = $this->parser->convert($member['interests']);
            $member['location'] = $this->parser->convert($member['location']);
        }
        $member['language'] = $ibforums->lang_id;
        $member['time_offset'] = intval($ibforums->input['time_offset']);
        $member['dst_in_use'] = intval($ibforums->input['dst_in_use']);
//-- mod_sec_update_131 end


        //+--------------------------------------------
        //| Insert into the DB

  N. Find

}

?>

     Insert above the blue code



//-- mod_sec_update_131 begin
    function convert_html_char($char = "") {
        if ($char < 126)
            return html_entity_decode("&#".$char.";");
        else
            return "";
    }
//-- mod_sec_update_131 end


}

?>


Step  2:  Open sources/Search.php

  A. Find in function Search(..)

        $ibforums->lang = $std->load_words($ibforums->lang, 'lang_search',

     Insert above the blue code



//-- mod_sec_update_131 begin
        $ibforums->lang = $std->load_words($ibforums->lang, 'mod_sec_lang', $ibforums->lang_id);
        $ibforums->vars['pre_pinned'] = $ibforums->lang['pre_pinned'];
        $ibforums->vars['pre_moved'] = $ibforums->lang['pre_moved'];
        $ibforums->vars['pre_polls'] = $ibforums->lang['pre_polls'];
//-- mod_sec_update_131 end


        $ibforums->lang = $std->load_words($ibforums->lang, 'lang_search',

  B. Find in function convert_highlite_words(..)

        $words = trim(urldecode($words));

     Insert below the blue code

        $words = trim(urldecode($words));



//-- mod_sec_update_131 begin
        global $std;
        $words = $std->clean_value($words);
//-- mod_sec_update_131 end


  C. Find in function Search(..)

            $this->first = $ibforums->input['st'];

     Insert below the blue code

            $this->first = $ibforums->input['st'];



//-- mod_sec_update_131 begin
            $this->first = max(0, $this->first);
//-- mod_sec_update_131 end


  D. Find in function Search(..), get_last_ten(..)

            $this->read_array = unserialize(stripslashes($read));

     Insert below the blue code

            $this->read_array = unserialize(stripslashes($read));



//-- mod_sec_update_131 begin
            $this->read_array = $std->clean_int_array(unserialize(stripslashes($read)));
//-- mod_sec_update_131 end


  E. Find in function get_replies(..), get_active(..)

            $topics .= $row['tid'].",";

     Insert below the blue code

            $topics .= $row['tid'].",";



//-- mod_sec_update_131 begin
            $topics .= " ";
//-- mod_sec_update_131 end


  F. Find in function get_replies(..), get_active(..)

        $topics  = preg_replace( "/,$/", "", $topics );

     Insert above the blue code



//-- mod_sec_update_131 begin
        $topics = preg_replace( "/, $/", "", $topics );
//-- mod_sec_update_131 end


        $topics  = preg_replace( "/,$/", "", $topics );

  G. Find in function get_active(..)

            $this->first = intval($ibforums->input['st']) != "" ? intval($ibforums->input['st']) : 0;

     Insert below the blue code

            $this->first = intval($ibforums->input['st']) != "" ? intval($ibforums->input['st']) : 0;



//-- mod_sec_update_131 begin
            $this->first = max(0, $this->first);
//-- mod_sec_update_131 end


  H. Find in function check_access(..)

    function check_access($i)

     Insert above the blue code



/*-- mod_sec_update_131 exclude begin


    function check_access($i)

  I. Find in function check_access(..)

        if ($i['password'] != "")

     Insert above the blue code



-- mod_sec_update_131 exclude end */

//-- mod_sec_update_131 begin
    function check_access(&$i)
    {
        global $std, $ibforums;

        $can_read = TRUE;

        if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group'] || $ibforums->member['g_is_supmod'] || ($ibforums->member['is_mod'] && $ibforums->member['mod_forums'][$i['id']]))
            $i['password'] = "";
//-- mod_sec_update_131 end


        if ($i['password'] != "")


Step  3:  Open sources/Topics.php

  A. Find in function Topics(..)

        $this->html     = $std->load_template('skin_topic');

     Insert below the blue code

        $this->html     = $std->load_template('skin_topic');



//-- mod_sec_update_131 begin
        $ibforums->lang = $std->load_words($ibforums->lang, 'mod_sec_lang_topic', $ibforums->lang_id);
        $this->html     = $std->load_template('mod_sec_update_skin_topic');
//-- mod_sec_update_131 end


  B. Find in function Topics(..)

        if ( ! $ibforums->topic_cache['tid'] )
        {

     Insert below the blue code

        if ( ! $ibforums->topic_cache['tid'] )
        {



//-- mod_sec_update_131 begin
            if (TRUE)
                $DB->query("SELECT  f.*, f.name as forum_name, f.id as forum_id, f.posts as forum_posts, f.topics as forum_topics,
                                    t.*, c.name as cat_name, c.id as cat_id, c.state as cat_state 
                                    FROM ibf_topics t, ibf_forums f , ibf_categories c
                                    WHERE t.tid=".$ibforums->input['t']." and f.id = t.forum_id and f.category=c.id");
            else
//-- mod_sec_update_131 end


  C. Find in function Topics(..)

            $this->topic = $ibforums->topic_cache;
        }

     Insert below the blue code

            $this->topic = $ibforums->topic_cache;
        }



//-- mod_sec_update_131 begin
        if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group'] || $ibforums->member['g_is_supmod'] || ($ibforums->member['is_mod'] && $ibforums->member['mod_forums'][$this->topic['forum_id']]))
            $this->topic['password'] = "";
        if ( $this->topic['cat_state'] == 0 )
            $std->Error( array( LEVEL => 1, MSG => 'is_broken_link') );
//-- mod_sec_update_131 end


  D. Find in function Topics(..)

            $this->read_array = unserialize(stripslashes($read));

     Insert below the blue code

            $this->read_array = unserialize(stripslashes($read));



//-- mod_sec_update_131 begin
            $this->read_array = $std->clean_int_array( unserialize(stripslashes($read)) );
//-- mod_sec_update_131 end


  E. Find in function Topics(..)

        if ( isset($ibforums->input['view']) )

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (!$ibforums->input['tooltip'])
//-- mod_sec_update_131 end


        if ( isset($ibforums->input['view']) )

  F. Find in function Topics(..)

                    $pid = "&#entry".$post['pid'];

     Insert below the blue code

                    $pid = "&#entry".$post['pid'];



//-- mod_sec_update_131 begin
                    $pid = "&pid=".$post['pid']."&#entry".$post['pid'];
//-- mod_sec_update_131 end


  G. Find in function Topics(..)

                    $std->boink_it($ibforums->base_url."showtopic=".$this->topic['tid']."&st=$st"."&#entry".$pid);

     Insert above the blue code



//-- mod_sec_update_131 begin
                    $std->boink_it($ibforums->base_url."showtopic=".$this->topic['tid']."&st=$st"."&pid=$pid&mode={$ibforums->input['mode']}#entry".$pid);
                    exit();
//-- mod_sec_update_131 end


                    $std->boink_it($ibforums->base_url."showtopic=".$this->topic['tid']."&st=$st"."&#entry".$pid);

  H. Find in function Topics(..)

        //-------------------------------------
        // Update the topic views counter

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($ibforums->input['tooltip']) {
            $dir = $ibforums->input['tooltip'] == "last"?"DESC":"ASC";
            if ($ibforums->input['pid'])
                $filter = "AND pid='".intval($ibforums->input['pid'])."'";
            $DB->query( "SELECT post, post_date, author_id, author_name FROM ibf_posts
                        WHERE topic_id=".$this->topic['tid']." AND queued != 1 $filter
                        ORDER BY post_date $dir LIMIT 1");
            if ($DB->get_num_rows()) {
                $row = $DB->fetch_row();
                $post = preg_replace( "#<!--emo&(.+?)-->.+?<!--endemo-->#", "\\1" , $row['post'] );
                $post = preg_replace( "/<img src=[\"'](.+?)[\"'].+?".">/", "(IMG:<a href='\\1' target='_blank'>\\1</a>)", $post );
                if ($this->forum['use_html'] == 1) {
                    if (stristr( $post, '[dohtml]')) {
                        $parse = ($this->forum['use_html'] AND $row['g_dohtml']) ? 1 : 0;
                        $post = $this->parser->post_db_parse($post, $parse );
                    }
                }
                if ( $ibforums->vars['post_wordwrap'] > 0 )
                    $post = $this->parser->my_wordwrap( $post, $ibforums->vars['post_wordwrap']) ;
                $date = $std->get_date($row['post_date'], "LONG");
                $post      = "<div class='post2' style='width:100%;'><div class='titlemedium' style='width:100%;'>[<a href='{$ibforums->base_url}showuser={$row['author_id']}' target='_blank'>{$row['author_name']}</a>]&nbsp;{$ibforums->lang['posted_on']} $date</div><div class='postcolor' style='width:100%;padding:5px;'>".str_replace( "<br>", "<br />", $post )."</div></div>";
                $print->pop_up_window("Preview", $post);
                die;
            }
            exit();
        }
//-- mod_sec_update_131 end


        //-------------------------------------
        // Update the topic views counter

  I. Find in function Topics(..)

        $this->topic['SHOW_PAGES']

     Insert above the blue code



//-- mod_sec_update_131 begin
        $first = max(0, intval($ibforums->input['st']));
        $limit = "$first, ".$ibforums->vars['display_max_posts'];
        if ($ibforums->vars['display_topic_thread']) {
            $view_thread = intval($ibforums->member['topic_thread']);
            $tc = $std->my_getcookie("topic_thread");
            $toggle_view = $this->topic['topic_thread'];
            if (isset($ibforums->input['thread'])) {
                $view_thread = intval($ibforums->input['thread']);
                if ($tc != $view_thread) {
                    $std->my_setcookie("topic_thread", $view_thread?1:2);
                }
            }
            elseif ($tc)
                $view_thread = intval($tc == 1);
//            if (!$ibforums->vars['display_topic_preview'] || !$this->topic['topic_thread'])
            if (!$this->topic['topic_thread'])
                $view_thread = false;
            elseif (!$tc && !isset($ibforums->input['thread'])) {
                if ($ibforums->member['topic_thread'] == 0)
                    $view_thread = 0;
                elseif ($ibforums->member['topic_thread'] == 1)
                    $view_thread = 1;
                elseif ($this->topic['topic_thread'] == 1 && $ibforums->vars['display_topic_thread_global']) {
                    if ( $ibforums->vars['display_topic_thread_default'])
                        $view_thread = 1;
                    else
                        $view_thread = 0;
                }
                elseif ($this->topic['topic_thread'] == 2)
                    $view_thread = 0;
                elseif ($this->topic['topic_thread'] == 3)
                    $view_thread = 1;
            }
            
            if ($view_thread) {
                $tst = intval($ibforums->input['tst']);
                $DB->query( "SELECT p.pid, p.ref, p.topic_id, p.post_date, p.post, m.id, m.name
                            FROM ibf_posts p
                              LEFT JOIN ibf_members m ON (p.author_id=m.id)
                            WHERE p.topic_id=".$this->topic['tid']." and p.queued != 1
                            ORDER BY p.post_date");
                $children = array();
                $ref = array();
                $pid = intval($ibforums->input['pid']);
                $pids = array();
                while ($r = $DB->fetch_row()) {
                    $r['post'] = str_replace("<br />", "&nbsp;", $r['post']);
                    $r['post'] = str_replace("</p>", "&nbsp;", $r['post']);
                    $r['post'] = preg_replace("`<!--.+?-->`s", "", $r['post']);
                    $r['post'] = preg_replace("`<.+?>`s", "", $r['post']);
                    if (strlen($r['post']) > 40) {
                        $i = 40;
                        while ($i < strlen($r['post']) && substr($r['post'], $i, 1) != " ") $i++;
                        $r['post'] = substr($r['post'], 0, $i)." ...";
                    }
                    if (!isset($this->first_post)) {
                        $r['post'] = $this->topic['title'];
                        $this->first_post = $r;
                    }
                    else if (!$r['ref']) {
                        $r['ref'] = $this->first_post['pid'];
                    }
                    if ($r['pid'] == $pid)
                        $this->post = $r;
                    if ($r['ref'] == $this->first_post['pid'])
                        $root_answers++;
                    if ($r['ref']) {
                        $children[$r['ref']][$r['pid']] = $r;
                        $ref[$r['pid']] = $r['ref'];
                    }
                    $pids[$r['pid']] = 1;
                }
                $this->test_children($children, $pids);
                $view_thread = intval(count($children) > 0);
                if ($view_thread)
                    if ($parents = $this->get_parents($ref, $pid)) {
                        $filter = " AND p.pid in (".implode(",", array_keys($parents)).")";
                        $this->topic['posts'] = count($parents) - 1;
                        if ($ibforums->input['st'] > count($parents)) {
                            $ibforums->input['st'] = 0;
                            $limit = "0, ".$ibforums->vars['display_max_posts'];
                        }
                        $this->topic['SHOW_PAGES']
                            = $std->build_pagelinks( array( 'TOTAL_POSS'  => ($this->topic['posts']+1),
                                                            'PER_PAGE'    => $ibforums->vars['display_max_posts'],
                                                            'CUR_ST_VAL'  => $ibforums->input['st'],
                                                            'L_SINGLE'    => "",
                                                            'BASE_URL'    => $this->base_url."thread=1&pid=$pid&tst=$st&showtopic=".$this->topic['tid'].$hl,
                                                          )
                                                   );
                    }
                    else {
                        $filter = " AND p.pid='".$this->first_post['pid']."'";
                        $limit = "1";
                        $this->topic['SHOW_PAGES'] = "";
                    }
            }
        }
        if (!$view_thread)
//-- mod_sec_update_131 end


        $this->topic['SHOW_PAGES']

  J. Find in function Topics(..)

        $this->output .= $this->html->PageTop( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ) );

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($ibforums->input['mode'] == "single") {
            $this->topic['pid'] = $ibforums->input['pid'];
            $this->output .= $this->html->PageTopSingle( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ) );
        }
        else
//-- mod_sec_update_131 end


        $this->output .= $this->html->PageTop( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ) );

  K. Find in function Topics(..)

        $first = intval($ibforums->input['st']);

     Insert below the blue code

        $first = intval($ibforums->input['st']);



//-- mod_sec_update_131 begin
        $first = max(0, $first);
//-- mod_sec_update_131 end


  L. Find in function Topics(..)

        $DB->query( "SELECT p.*,

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (!$ibforums->topic_cache['f_rte'] && $ibforums->vars['allow_multi_quote']) {
            $mqt = $std->my_getcookie("mqt_ids");
            if ($mqt) {
                $mqt_ids = explode(",", $mqt);
                array_splice($mqt_ids, 0, 1);
                if (count($mqt_ids)) {
                    $i = 0;
                    foreach ($mqt_ids as $id) {
                        $_id = explode("_", $id);
                        $i++;
                        $ids_array[$i] = $_id[0];
                    }
                    $mqt_ids = array_flip($ids_array);
                }
            }
        }
        if ($toggle_view)
            $this->output = str_replace( "<!--{IBF.TOGGLE_VIEW}-->",
                                         $this->html->toggle_view(  $this->topic['tid'],
                                                                    $ibforums->input['pid'],
                                                                    (1 - $view_thread),
                                                                    $ibforums->input['st'],
                                                                    $view_thread?$ibforums->lang['normal_view']:$ibforums->lang['thread_view'],
                                                                    $view_thread?$ibforums->lang['thread_view']:$ibforums->lang['normal_view']
                                                                  ),
                                         $this->output );
        if ($view_thread) {
            $per_page = 3*$ibforums->vars['display_max_posts'];
            $start = $tst;
            $end = $start + $per_page;
            $page_links = $std->build_pagelinks( array( 'TOTAL_POSS'  => $root_answers,
                                                        'PER_PAGE'    => $per_page,
                                                        'CUR_ST_VAL'  => $tst,
                                                        'L_SINGLE'    => "",
                                                        'BASE_URL'    => $this->base_url."showtopic=".$this->topic['tid']."&pid=$pid&thread=1",
                                                        )   );
            $page_links = str_replace("multi_page_jump", "thread_multi_page_jump", $page_links);
            $page_links = str_replace("st=", "tst=", $page_links);
            $thread[] = array($this->first_post, "", $pid);
            $thread = array_merge($thread, $this->get_children($this->first_post['pid'], $children, $parents, "", $start, $end));
            if (count($thread)) {
                $img = array("S" => "children_space", "D" => "children_down", "M" => "children_more", "L" => "children_last");
                $show_preview = $ibforums->vars['display_topic_preview'] && $ibforums->member['topic_preview'] && strpos($ibforums->skin['css_text'], "domTT") !== FALSE;
                if ($show_preview) {
                    $tooltip  = "onMouseOver=\"domTT_oneOnly = true; this.style.color = '#000000';";
                    $tooltip .= "return makeFalse(domTT_activate(this, event,
                                                        'caption', '',
                                                        'width', '510px',
                                                        'fade', 'both',
                                                        'fadeMax', 100,
                                                        'trail', false,
                                                        'offsetX', 20,
                                                        'offsetY', 5,
                                                        'lazy', true,
                                                        'delay', 500,
                                                        'content', '&lt;iframe src=&quot;{$ibforums->base_url}showtopic={$this->topic['tid']}&amp;pid={PID}&amp;tooltip=1&quot; style=&quot;width:500px;height:200px;&quot;&gt;&lt;/iframe&gt;',
                                                        'styleClass', 'domTTlegend',
                                                        'type', 'velcro'
                                                        ));\"";
                }
                foreach($thread as $entry) {
                    $prefix = $entry[1];
                    foreach ($img as $s => $r)
                        $prefix = str_replace($s, "<img src='{$ibforums->vars['img_url']}/$r.gif' />", $prefix);
                    $class = "row1";
                    if ($entry[2])
                        $class = "searchlite";
                    $out .= $this->html->thread_entry(array('class'     => $class,
                                                            'prefix'    => $prefix,
                                                            'tid'       => $this->topic['tid'],
                                                            'pid'       => $entry[0]['pid'],
                                                            'post'      => $entry[0]['post'],
                                                            'poster'    => $entry[0]['name'],
                                                            'poster_id' => $entry[0]['id'],
                                                            'date'      => $std->get_date($entry[0]['post_date'], "LONG"),
                                                            'tooltip'   => $show_preview?str_replace("{PID}", $entry[0]['pid'], $tooltip):"",
                                                            'tst'       => $tst,
                                                      )     );
                }
                $this->output = str_replace( "<!--{IBF.THREAD}-->", $this->html->show_thread($out, $page_links, intval($ibforums->input['scroll'])), $this->output );
            }
            unset($show_preview);
            unset($thread);
            unset($ref);
            unset($parents);
            unset($children);
        }
        if ($ibforums->input['mode'] == "single") {
            $filter = " AND p.pid='".$ibforums->input['pid']."'";
            $limit = "1";
        }
        $can_view_onoff = $ibforums->member['g_can_view_on_off'] || $ibforums->member['mgroup'] == $ibforums->vars['admin_group'] || $ibforums->member['access_cp'] || $ibforums->member['is_sup_mod'];
        if ($can_view_onoff) {
            $ibforums->lang = $std->load_words($ibforums->lang, 'lang_date', $ibforums->lang_id);
            $DB->query( "SELECT p.*,
                        m.id,m.name,m.mgroup,m.email,m.joined,m.avatar,m.avatar_size,m.posts,m.aim_name,m.icq_number,m.last_activity,
                        m.signature, m.website,m.yahoo,m.integ_msg,m.title,m.hide_email,m.msnname, m.warn_level, m.warn_lastwarn,
                        g.g_id, g.g_title, g.g_icon, g.g_dohtml, s.login_type, s.running_time, g.g_hide_from_list, g.g_can_view_on_off
                        $join_get_fields
                        FROM ibf_posts p
                          LEFT JOIN ibf_members m ON (p.author_id=m.id)
                          LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup)
                          LEFT JOIN ibf_sessions s ON (s.member_id=p.author_id AND s.member_id<>0 AND s.member_id IS NOT NULL)
                          $join_profile_query
                        WHERE p.topic_id=".$this->topic['tid']." and p.queued != 1 $filter
                        GROUP BY pid ORDER BY p.{$ibforums->vars['post_order_column']} {$ibforums->vars['post_order_sort']} LIMIT $limit");
        }
        else {
            $DB->query( "SELECT p.*,
                        m.id,m.name,m.mgroup,m.email,m.joined,m.avatar,m.avatar_size,m.posts,m.aim_name,m.icq_number,
                        m.signature, m.website,m.yahoo,m.integ_msg,m.title,m.hide_email,m.msnname, m.warn_level, m.warn_lastwarn,m.last_activity,
                        g.g_id, g.g_title, g.g_icon, g.g_dohtml $join_get_fields
                        FROM ibf_posts p
                          LEFT JOIN ibf_members m ON (p.author_id=m.id)
                          LEFT JOIN ibf_groups g ON (g.g_id=m.mgroup)
                          $join_profile_query
                        WHERE p.topic_id=".$this->topic['tid']." and p.queued != 1 $filter
                        ORDER BY p.{$ibforums->vars['post_order_column']} {$ibforums->vars['post_order_sort']} LIMIT $limit");
        }
        if ($this->topic['quick_reply'] && $std->check_perms( $this->topic['reply_perms']))
            $quick_reply = true;
        if (FALSE)
//-- mod_sec_update_131 end


        $DB->query( "SELECT p.*,

  M. Find in function Topics(..)

                    // Add it to the cached list

     Insert above the blue code



//-- mod_sec_update_131 begin
                    if ($can_view_onoff) {
                        $cutoff = time() - ($ibforums->vars['au_cutoff']?$ibforums->vars['au_cutoff']:15)*60;
                        
                        if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group'] || $ibforums->member['access_cp'] || $ibforums->member['is_sup_mod']) {
                            $online =$poster['login_type'] == 1?"online_anon":($poster['login_type'] === '0' || $poster['login_type'] == -1?"online":"offline");
                        }
                        else if ($ibforums->member['g_can_view_on_off']) {
                            $online =$poster['login_type'] == 1?"offline":($poster['login_type'] === '0' || $poster['login_type'] == -1?"online":"offline");
                        }
                        if ($online == "online" && intval($poster['running_time']) < $cutoff) {
                            $online = "offline";
                        }
                        
                        if (method_exists($this->html, "state_online"))
                            switch($online) {
                                case "online"       :   $poster['state_on_off'] = $this->html->state_online();
                                                        break;
                                case "online_anon"  :   $poster['state_on_off'] = $this->html->state_online_anon();
                                                        break;
                                case "offline"      :   $poster['state_on_off'] = $this->html->state_offline();
                                                        break;
                            }
                    }
//-- mod_sec_update_131 end


                    // Add it to the cached list

  N. Find in function Topics(..)

                $row['post'] = preg_replace( "/<img src=[

     Insert above the blue code



//-- mod_sec_update_131 begin
                if (!$ibforums->member['id'])
                    $row['post'] = preg_replace( "/<img src=[\"'](.+?)[\"'].+?".">/", "<img src='' alt='".$ibforums->lang['pic_attach']."' class='attach' />", $row['post'] );
                else
//-- mod_sec_update_131 end


                $row['post'] = preg_replace( "/<img src=[

  O. Find in function Topics(..)

                $keywords = str_replace( "+", " ", $ibforums->input['hl'] );

     Insert above the blue code



//-- mod_sec_update_131 begin
                $ibforums->input['hl'] = $std->clean_value(urldecode($ibforums->input['hl']));
//-- mod_sec_update_131 end


                $keywords = str_replace( "+", " ", $ibforums->input['hl'] );

  P. Find in function Topics(..)

            $row['post_date']     = $std->get_date( $row['post_date'], 'LONG' );

     Insert above the blue code



//-- mod_sec_update_131 begin
            if ($ibforums->input['mode'] == "single")
                $row['nr'] = 1;
            else
                $row['nr'] = intval($limit) + $post_count + 1;
            $row['time'] = $row['post_date'];
            if (!$ibforums->topic_cache['f_rte'] && $ibforums->vars['allow_multi_quote'])
                if (isset($mqt_ids[$row['pid']]))
                    $row['quote_link'] = $this->html->multiquote_remove_link($row['pid']);
                else
                    $row['quote_link'] = $this->html->multiquote_add_link($row['pid']);
            else
                $row['quote_link'] = $this->html->quote_link($row['pid']);
            if (!empty($ibforums->vars['cookie_domain']) && $ibforums->vars['cookie_domain'] != "localhost")
                $row['cookie_domain'] = "domain={$ibforums->vars['cookie_domain']};";
            $row['reply_link'] = $this->post_reply_button($row['pid']);
            if ($quick_reply)
                $row['quick_reply_link'] = $this->post_quick_reply_button($row['pid']);
//-- mod_sec_update_131 end


            $row['post_date']     = $std->get_date( $row['post_date'], 'LONG' );

  Q. Find in function Topics(..)

            if ($row['attach_id'])

     Insert above the blue code



//-- mod_sec_update_131 begin
            if ($ibforums->input['mode'] == "single") {
                $row['quick_reply_link'] = "";
                $row['report_link'] = "";
                $row['delete_button'] = "";
                $row['quote_link'] = $this->html->quote_link($row['pid']);
            }
//-- mod_sec_update_131 end


            if ($row['attach_id'])

  R. Find in function Topics(..)

            if ($row['attach_id'])

     Insert below the blue code

            if ($row['attach_id'])



//-- mod_sec_update_131 begin
            if (!$ibforums->member['id'] && !$ibforums->vars['guests_attach'])
                $row['attachment'] = "<br /><br /><img src='' alt='".$ibforums->lang['pic_attach']."' class='attach' />";
            else
//-- mod_sec_update_131 end


  S. Find in function Topics(..)

                    if ( $ibforums->vars['siu_thumb'] AND

     Insert above the blue code



//-- mod_sec_update_131 begin
                    if (!$ibforums->member['view_img']) {
                        if (!$ibforums->member['id'])
                            $row['attachment'] = "<br /><br /><img src='' alt='".$ibforums->lang['pic_attach']."' class='attach' />";
                        else
                            $row['attachment'] = "<br /><br />(IMG:<a href='{$ibforums->base_url}act=Attach&amp;type=post&amp;id={$row['pid']}' target='_blank'>{$ibforums->lang['pic_attach']}</a>)";
                    }
                    else
//-- mod_sec_update_131 end


                    if ( $ibforums->vars['siu_thumb'] AND

  T. Find in function Topics(..)

                    $row['attachment'] = $this->html->Show_attachments( array (

     Insert above the blue code



//-- mod_sec_update_131 begin
                    $icon = $this->mimetypes[ $row['attach_type'] ][1];
                    $ext = pathinfo($row['attach_file']);
                    $default_icon = $ext['extension'].".gif";
                    unset ($ext);
                    if (TRUE)
                        $row['attachment'] = $this->html->Show_attachments( array (
                                                                                'hits'  => $row['attach_hits'],
                                                                                'image' => file_exists($ibforums->vars['html_dir']."mime_types/".$icon)?$icon:$default_icon,
                                                                                'name'  => $row['attach_file'],
                                                                                'pid'  => $row['pid'],
                                                                          )        );
                    else
//-- mod_sec_update_131 end


                    $row['attachment'] = $this->html->Show_attachments( array (

  U. Find in function Topics(..)

        $this->output .= $this->html->TableFooter

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($ibforums->input['mode'] == "single") {
            if (strpos($this->output, "<!-timestamp=") !== False)
                $this->output = preg_replace("`<!-timestamp=(.*?)-->`ie", "\$std->get_date(\\1, \"LONG\")", $this->output);
            if (strpos($this->output, "<!-post_link=") !== False)
                $this->output = preg_replace("`<!-post_link=(.*?)-->`ie", "\$this->get_post_link('\\1')", $this->output);
            $this->output .= $this->html->TableFooterSingle( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ) );
            $print->pop_up_window($ibforums->lang['single_post_title'], $this->output);
            exit;
        }
//-- mod_sec_update_131 end


        $this->output .= $this->html->TableFooter

  V. Find in function Topics(..)

$this->output .= $this->html->TableFooter( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ) );

     Insert below the blue code

$this->output .= $this->html->TableFooter( array( 'TOPIC' => $this->topic, 'FORUM' => $this->forum ) );



//-- mod_sec_update_131 begin
        if (strpos($this->output, "<!-timestamp=") !== False)
            $this->output = preg_replace("`<!-timestamp=(.*?)-->`ie", "\$std->get_date(\\1, \"LONG\")", $this->output);
        if (strpos($this->output, "<!-post_link=") !== False)
            $this->output = preg_replace("`<!-post_link=(.*?)-->`ie", "\$this->get_post_link('\\1')", $this->output);
        
        if ($view_thread) {
            $this->output = str_replace( "<!--{IBF.THREAD}-->", $this->html->show_thread($out, $page_links, intval($ibforums->input['scroll'])), $this->output );
            unset($out);
            unset($page_links);
        }
//-- mod_sec_update_131 end


  W. Find in function Topics(..)

        if ($ibforums->vars['no_au_topic'] != 1

     Insert below the blue code

        if ($ibforums->vars['no_au_topic'] != 1



//-- mod_sec_update_131 begin
            && $ibforums->member['g_can_view_online']
//-- mod_sec_update_131 end


  X. Find in function Topics(..)

            $DB->query("SELECT s.member_id, s.member_name, s.login_type, s.location, g.suffix, g.prefix, g.g_perm_id, m.org_perm_id

     Insert above the blue code



//-- mod_sec_update_131 begin
            if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) {
                $DB->query("SELECT s.member_id, s.member_name, s.login_type, s.location, g.suffix, g.prefix, g.g_perm_id, m.org_perm_id
                            FROM ibf_sessions s
                             LEFT JOIN ibf_groups g ON (g.g_id=s.member_group)
                             LEFT JOIN ibf_members m on (s.member_id=m.id)
                            WHERE s.in_topic={$this->topic['tid']}
                            AND s.running_time > $time
                             ORDER BY s.running_time DESC");
            }
            else {
                $DB->query("SELECT s.member_id, s.member_name, s.login_type, s.location, g.suffix, g.prefix, g.g_perm_id, m.org_perm_id
                            FROM ibf_sessions s
                             LEFT JOIN ibf_groups g ON (g.g_id=s.member_group)
                             LEFT JOIN ibf_members m on (s.member_id=m.id)
                            WHERE s.in_topic={$this->topic['tid']}
                            AND s.running_time > $time
                            AND ((s.login_type IS NULL) OR s.login_type<>'1' OR (s.login_type='1' AND s.member_group<>'{$ibforums->vars['admin_group']}'))
                             ORDER BY s.running_time DESC");
            }
            if (FALSE)
//-- mod_sec_update_131 end


            $DB->query("SELECT s.member_id, s.member_name, s.login_type, s.location, g.suffix, g.prefix, g.g_perm_id, m.org_perm_id

  Y. Find in function Topics(..)

        $this->output = str_replace( "<!--IBF.TOPIC_OPTIONS_CLOSED-->"

     Insert above the blue code



//-- mod_sec_update_131 begin
        else if ($std->check_perms( $this->topic['reply_perms']) && $this->topic['state'] != 'closed')
            $this->output = str_replace( "<!--IBF.QUICK_REPLY_OPEN-->"  , $this->html->quick_reply_box_open($this->topic['forum_id'], $this->topic['tid'], "none", $this->md5_check), $this->output );
//-- mod_sec_update_131 end


        $this->output = str_replace( "<!--IBF.TOPIC_OPTIONS_CLOSED-->"

  Z. Find in function parse_member(..)

        if ($member['msnname'])

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($member['msnname'] && $ibforums->member['id']) {
            $member['msn_icon'] = "<a href=\"javascript:PopUp('{$this->base_url}act=MSN&amp;control=1&amp;MID={$member['id']}','MSNCONTROL','455','300',0,1,1,5,50);PopUp('{$this->base_url}act=MSN&amp;MID={$member['id']}','Pager',450,370,1,0,0,50,50);\"><{P_MSN}></a>";
            $name = $member['msnname'];
            $names = explode("(", $name);
            if (count($names) > 1) {
                $result = "";
                $names[1] = trim(str_replace(")", "", $names[1]));
                $lid = $names[1]."@apps.messenger.live.com";
                $url = "http://messenger.services.live.com/users/{$lid}/presenceimage";
                $a = parse_url($url);
                $fp = @fsockopen ($a['host'], 80, $errno, $errstr, 30);
                if (!$errno && !$errstr) {
                    @fwrite ($fp, "GET {$a['path']} HTTP/1.0\r\nHost: {$a['host']}\r\n\r\n");
                    while (!feof($fp)) {
                        $result .= @fgets($fp,1024);
                    }
                    @fclose($fp);
                }
                if ($result) {
                    $img = trim(preg_replace("`^.*location:\s*(.*?)\n.*?$`is", "\\1", $result));
                }
                $member['msn_icon'] .= "<img style='position:relative;left:-8px' src='$img' />";
            }
        }
        if (FALSE)
//-- mod_sec_update_131 end


        if ($member['msnname'])

  AA. Find in function parse_member(..)

        if ($member['integ_msg'])

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (FALSE)
//-- mod_sec_update_131 end


        if ($member['integ_msg'])

  AB. Find in function edit_button(..)

            if ($ibforums->member['g_edit_cutoff'] > 0)

     Insert above the blue code



//-- mod_sec_update_131 begin
            if ($ibforums->topic_cache['editable'] == "overwrite") {
                if ( $post_date > (time() - (intval($ibforums->topic_cache['edit_time']) * 60 )))
                    return $button;
            }
            elseif ($ibforums->topic_cache['editable'] == "always")
                    return $button;
            else
//-- mod_sec_update_131 end


            if ($ibforums->member['g_edit_cutoff'] > 0)

  AC. Find in function reply_button(..)

        if ($this->topic['state'] == 'closed')

     Insert above the blue code



//-- mod_sec_update_131 begin
        return $this->topic_reply_button();
//-- mod_sec_update_131 end


        if ($this->topic['state'] == 'closed')

  AD. Find in function return_last_post(..)

        $std->boink_it($ibforums->base_url."showtopic=".$this->topic['tid']."&st=$st&"."#entry".$post['pid']);

     Insert above the blue code



//-- mod_sec_update_131 begin
        $std->boink_it($ibforums->base_url."showtopic=".$this->topic['tid']."&st=$st&pid=".$post['pid']."&#entry".$post['pid']);
        exit();
//-- mod_sec_update_131 end


        $std->boink_it($ibforums->base_url."showtopic=".$this->topic['tid']."&st=$st&"."#entry".$post['pid']);

  AE. Find

}

?>

     Insert above the blue code



//-- mod_sec_update_131 begin
    function topic_reply_button() {
        global $ibforums;
        
        if ($this->topic['state'] == 'closed') {
            if ($ibforums->member['g_post_closed'] == 1)
                return "<a href='{$this->base_url}act=Post&amp;CODE=02&amp;f=".$this->forum['id']."&amp;t=".$this->topic['tid']."' title='".$ibforums->lang['reply_to_topic']."' onClick='if (typeof(document.REPLIER) != \"undefined\" && document.REPLIER.Post.value) {document.REPLIER.is_preview.value=1; document.REPLIER.submit(); return false;}'><{A_LOCKED_B}></a>";
            else
                return "<{A_LOCKED_B}>";
        }
        if ($this->topic['state'] == 'moved')
            return "<{A_MOVED_B}>";
        if ($this->topic['poll_state'] == 'closed')
            return "<{A_POLLONLY_B}>";
        return "<a href='{$this->base_url}act=Post&amp;CODE=02&amp;f=".$this->forum['id']."&amp;t=".$this->topic['tid']."' title='".$ibforums->lang['reply_to_topic']."' onClick='if (typeof(document.REPLIER) != \"undefined\" && document.REPLIER.Post.value) {document.REPLIER.is_preview.value=1; document.REPLIER.submit(); return false;}'><{A_REPLY}></a>";
    }

    function post_reply_button($pid = 0) {
        global $ibforums;
        
        if (!$pid) return;
        if ($this->topic['state'] == 'closed') {
            if ($ibforums->member['g_post_closed'] == 1) 
                return "<a href='{$this->base_url}act=Post&amp;CODE=02&amp;f=".$this->forum['id']."&amp;t=".$this->topic['tid']."&amp;pid=".$pid."' title='".$ibforums->lang['reply_this_post']."' onClick='if (typeof(document.REPLIER) != \"undefined\" && document.REPLIER.Post.value) {document.REPLIER.is_preview.value=1; document.REPLIER.submit(); return false;}'><{P_REPLY}></a>";
            else
                return;
        }
        if ($this->topic['state'] == 'moved')
            return;
        if ($this->topic['poll_state'] == 'closed')
            return;
        return "<a href='{$this->base_url}act=Post&amp;CODE=02&amp;f=".$this->forum['id']."&amp;t=".$this->topic['tid']."&amp;pid=".$pid."' title='".$ibforums->lang['reply_this_post']."' onClick='if (typeof(document.REPLIER) != \"undefined\" && document.REPLIER.Post.value) {document.REPLIER.is_preview.value=1; document.REPLIER.submit(); return false;}'><{P_REPLY}></a>";
    }

    function post_quick_reply_button($pid = 0) {
        global $ibforums;
        
        if (!$pid) return;
        if ($this->topic['state'] == 'closed') {
            if ($ibforums->member['g_post_closed'] == 1)
                return "<a href='javascript:ToggleQR(\"$pid\");' title='{$ibforums->lang['qreply_this_post']}' accesskey='f'><{P_QREPLY}></a>";
            else
                return;
        }
        if ($this->topic['state'] == 'moved')
            return;
        if ($this->topic['poll_state'] == 'closed')
            return;
        return "<a href='javascript:ToggleQR(\"$pid\");' title='{$ibforums->lang['qreply_this_post']}' accesskey='f'><{P_QREPLY}></a>";
    }

    function get_post_link($pid = "") {
        global $ibforums;
        if ($pid == "") return;
        return "&nbsp;<a href='{$ibforums->base_url}&showtopic={$this->topic['tid']}&view=findpost&p=$pid&pid=$pid' target='_blank' title='{$ibforums->lang['quoted_post_link']}'><img src='{$ibforums->vars['img_url']}/item.gif' /></a>";
    }

    function get_parents(&$ref, $pid = "") {
        if (!$pid || !isset($ref[$pid])) return;
        $parents[$this->first_post['pid']] = 1;
        $id = $pid;
        while (isset($ref[$id])) {
            $parents[$ref[$id]] = 1;
            $id = $ref[$id];
        }
        if ($this->post)
            $parents[$this->post['pid']] = 1;
        return $parents;
    }

    function get_children($parent_id, &$children, &$parents, $level = "", $start = 0, $end = 0) {
        $thread = array();
        if (!isset($children[$parent_id])) return array();
        $i = 0;
        foreach ($children[$parent_id] as $pid => $r) {
            $i++;
            if ($end)
                if ($i <= $start) continue;
                elseif ($i > $end ) break;
            $entry = array($r, "", false);
            if (isset($parents[$pid]))
                $entry[2] = true;
            if ($i == count($children[$parent_id])) {
                $entry[1] = $level."L";
                $level1 = "S";
            }
            else {
                $entry[1] = $level."M";
                $level1 = "D";
            }
            $thread[] = $entry;
            $thread = array_merge($thread, $this->get_children($pid, $children, $parents, $level.$level1));
        }
        $children[$parent_id] = "";
        return $thread;
    }

    function test_children(&$children, &$pids) {
        foreach ($children as $pid => $r) {
            if (!isset($pids[$pid])) {
                foreach ($r as $id => $s) {
                    $children[$pid][$id]['ref'] = $this->first_post['pid'];
                    $children[$this->first_post['pid']][$id] = $s;
                }
                unset($children[$pid]);
            }
        }
    }
//-- mod_sec_update_131 end


}

?>


Step  4:  Open sources/Usercp.php

  A. Find

    var $html       = "";

     Insert below the blue code

    var $html       = "";



/*-- mod_sec_update_131 exclude begin


  B. Find

    var $member     = array();

     Insert above the blue code



-- mod_sec_update_131 exclude end */


    var $member     = array();

  C. Find in function UserCP(..)

        $ibforums->lang = $std->load_words($ibforums->lang, 'lang_post'

     Insert above the blue code



//-- mod_sec_update_131 begin
        $ibforums->lang = $std->load_words($ibforums->lang, 'mod_sec_lang', $ibforums->lang_id);
        $ibforums->lang = $std->load_words($ibforums->lang, 'mod_sec_lang_ucp', $ibforums->lang_id);
        $ibforums->vars['pre_pinned'] = $ibforums->lang['pre_pinned'];
        $ibforums->vars['pre_moved'] = $ibforums->lang['pre_moved'];
        $ibforums->vars['pre_polls'] = $ibforums->lang['pre_polls'];
//-- mod_sec_update_131 end


        $ibforums->lang = $std->load_words($ibforums->lang, 'lang_post'

  D. Find in function UserCP(..)

            if (empty($this->member['vdirs']))

     Insert above the blue code



//-- mod_sec_update_131 begin
            $ibforums->lang = $std->load_words($ibforums->lang, "mod_sec_lang_msg", $ibforums->lang_id);
//-- mod_sec_update_131 end


            if (empty($this->member['vdirs']))

  E. Find in function UserCP(..)

                $folder_links .= $this->html->menu_bar_msg_folder_link($id, $real);

     Insert above the blue code



//-- mod_sec_update_131 begin
                if ($id == "in")
                    $real = $ibforums->lang['inbox'];
                if ($id == "sent")
                    $real = $ibforums->lang['outbox'];
//-- mod_sec_update_131 end


                $folder_links .= $this->html->menu_bar_msg_folder_link($id, $real);

  F. Find in function UserCP(..)

        //--------------------------------------------
        // Using Sub Manager?

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($ibforums->vars['requests_active']) {
            require(ROOT_PATH."sources/mods/sec_update_131_A/mod_sec_update_ucp_func.php");
            $ucp = new mod_sec_update_ucp();
            $req_html  = $ucp->get_menu();
            if (strpos($menu_html, "<!--REQUEST_LINK-->") !== FALSE) {
                $menu_html = str_replace(  "<!--REQUEST_LINK-->", $req_html, $menu_html);
            }
            else {
                $menu_html = str_replace("<!-- Options -->", $req_html."\n<!-- Options -->", $menu_html);
            }
        }
//-- mod_sec_update_131 end


        //--------------------------------------------
        // Using Sub Manager?

  G. Find in function UserCP(..)

            default:
                $this->splash();

     Insert above the blue code



//-- mod_sec_update_131 begin
            case 'requests':    if (isset($ucp))
                                    $ucp->dispatch($this);
                                break;
//-- mod_sec_update_131 end


            default:
                $this->splash();

  H. Find in function do_email_change(..)

            $DB->query("INSERT INTO ibf_validating ({$db_str['FIELD_NAMES']}) VALUES({$db_str['FIELD_VALUES']})");

     Insert above the blue code



//-- mod_sec_update_131 begin
            $DB->query("DELETE FROM ibf_validating WHERE member_id={$this->member['id']} AND email_chg=1");
//-- mod_sec_update_131 end


            $DB->query("INSERT INTO ibf_validating ({$db_str['FIELD_NAMES']}) VALUES({$db_str['FIELD_VALUES']})");

  I. Find in function board_prefs(..)

time(), 'LONG'

     Insert below the blue code

time(), 'LONG'



//-- mod_sec_update_131 begin
        , TRUE
//-- mod_sec_update_131 end


  J. Find in function board_prefs(..)

         $time_select = "<select name='u_timezone' class='forminput'>";

     Insert above the blue code



//-- mod_sec_update_131 begin
        $time = "<br /><span name='tz_location' id='tz_location'><b>$time</b></span>";
        require_once (ROOT_PATH."sources/mods/sec_update_131_A/mod_sec_update_func.php");
        $xajax = new mod_sec_update_xajax();
        if ($ibforums->input['tz'])
            $xajax->process("usercp", "process_xajax");
        else
            $time .= $xajax->process("usercp", "get_javascript");
        if (TRUE)
            $time_select = "<select name='u_timezone' id='u_timezone' class='forminput'>";
        else
//-- mod_sec_update_131 end


         $time_select = "<select name='u_timezone' class='forminput'>";

  K. Find in function board_prefs(..)

         $hide_sess   = $std->my_getcookie('hide_sess');

     Insert above the blue code



//-- mod_sec_update_131 begin
        $this->output = str_replace("name='DST'", "name='DST' id='DST'", $this->output);
        if ($ibforums->member['time_offset'] != "") {
            $lang = $std->load_words($lang, 'lang_date', $ibforums->lang_id);
            $calc_html = "<div align='center'><input type='button' value='{$lang['calc_time']}' onClick='xajax_get_time_zone();' class='forminput' /></div>";
            $this->output .= $calc_html;
        }
//-- mod_sec_update_131 end


         $hide_sess   = $std->my_getcookie('hide_sess');

  L. Find in function board_prefs(..)

                                                             'PPS'  => $post_select,
                                                   )       );

     Insert below the blue code

                                                             'PPS'  => $post_select,
                                                   )       );



//-- mod_sec_update_131 begin
        if ($ibforums->vars['display_topic_preview']) {
            if ($this->member['topic_preview'])
                $s_y = "selected='selected'";
            else
                $s_n = "selected='selected'";
            $topic_preview = "<option value='1' $s_y>".$ibforums->lang['yes']."</option>\n<option value='0' $s_n>".$ibforums->lang['no']."</option>";
            $this->output = str_replace("</table>", "<tr><td>{$ibforums->lang['ucp_topic_preview']}</td><td><select name='topic_preview' class='forminput'>$topic_preview</select></td></tr>\n</table>", $this->output);
        }
        if ($ibforums->vars['display_topic_thread']) {
            $s_y = "";
            $s_n = "";
            if ($this->member['topic_thread'] == 1)
                $s_y = "selected='selected'";
            elseif ($this->member['topic_thread'] == 2)
                $s_f = "selected='selected'";
            else
                $s_n = "selected='selected'";
            $topic_thread = "<option value='2' $s_f>".$ibforums->lang['ucp_topic_forum']."</option>\n<option value='0' $s_n>".$ibforums->lang['ucp_topic_normal']."</option>\n<option value='1' $s_y>".$ibforums->lang['ucp_topic_thread']."</option>";
            $this->output = str_replace("</table>", "<tr><td>{$ibforums->lang['ucp_topic_view']}</td><td><select name='topic_thread' class='forminput'>$topic_thread</select></td></tr>\n</table>", $this->output);
        }
//-- mod_sec_update_131 end


  M. Find in function personal(..)

            $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cant_use_feature' ) );
        }

     Insert below the blue code

            $std->Error( array( 'LEVEL' => 1, 'MSG' => 'cant_use_feature' ) );
        }



//-- mod_sec_update_131 begin
        $ibforums->lang = $std->load_words($ibforums->lang, 'mod_sec_lang_msg', $ibforums->lang_id);
        $ibforums->lang['msn'] = $ibforums->lang['ucp_msn'];
        if ($ibforums->input['getID']) {
            $this->html = $std->load_template('skin_emails');
            $this->html2 = $std->load_template('mod_sec_update_skin_emails');
            $return_url = str_replace("&", "%26", str_replace("?", "%3F", $ibforums->base_url));
            $privacy_url = $return_url;
            $return_url .= "act=UserCP%26CODE=01%26getID=1%26return=1";
            $privacy_url .= "act=UserCP%26CODE=01%26getID=1%26privacy=1";
            if ($ibforums->input['privacy'])
                echo $this->html2->privacy();
            else {
                if ($ibforums->input['return']) {
                    if ($ibforums->input['result'] == "Accepted") {
                        $id = explode("@", $ibforums->input['id']);
                        echo $this->html2->setID_window($id[0]);
                    }
                    else {
                        echo $this->html2->closeWindow();
                    }
                }
                else {
                    echo $this->html2->getID_window($return_url, $privacy_url);
                }
            }
            exit();
        }
//-- mod_sec_update_131 end


  N. Find in function personal(..)

        $this->output .= $this->html->personal_panel($this->member);

     Insert below the blue code

        $this->output .= $this->html->personal_panel($this->member);



//-- mod_sec_update_131 begin
        $this->output = preg_replace("`(^.*)<tr.*?name='integ_msg'.*?</tr>`is", "\\1", $this->output);
        $getid = "<input type='button' value='{$ibforums->lang['ucp_msn_getid']}' onClick=\"javascript:var w=window.open('{$ibforums->base_url}act=UserCP&CODE=01&getID=1','GETID','455','300',0,1,1,5,50);\" />";
        $info = $ibforums->lang['ucp_msn_info'];
        $this->output = preg_replace("`(^.*)(<input.*?)maxlength='30'(.*?name='MSNName'.*?>)`is", "\\1<div style='float:left;height:70px;margin-right:20px;'>\\2maxlength='64'\\3<div style='margin-top:5px;'>$getid</div></div>$info", $this->output);
//-- mod_sec_update_131 end


  O. Find in function personal(..)

            if ( $row['ftype'] == 'drop' )

     Insert above the blue code



//-- mod_sec_update_131 begin
            if ($row['ftype'] != "drop") {
                $field_data[$row['fid']] = $this->parser->unconvert( $field_data[$row['fid']], $ibforums->vars['profile_allow_ibc'], 0 );
            }
//-- mod_sec_update_131 end


            if ( $row['ftype'] == 'drop' )


Step  5:  Open sources/lib/emailer.php

  A. Find in function build_headers(..)

        $this->mail_headers .= "X-Mailer: IPB PHP Mailer\n";

     Insert below the blue code

        $this->mail_headers .= "X-Mailer: IPB PHP Mailer\n";



//-- mod_sec_update_131 begin
        $offset = $ibforums->vars['time_offset'];
        $offset += round($ibforums->vars['time_adjust']/60);
        $offset += $ibforums->vars['dst_in_use'];
        $offset_h = floor(abs($offset));
        $offset_m = round((abs($offset) - $offset_h)*60);
        $offset_h = str_pad($offset_h, 2, "0", STR_PAD_LEFT);
        if ($offset < 0) {
            $offset_h = "-".$offset_h;
        }
        else {
            $offset_h = "+".$offset_h;
        }
        $offset_m = str_pad($offset_m, 2, "0", STR_PAD_LEFT);
        $this->mail_headers .= "Date: ".date("D, d M Y H:i:s ", time()).$offset_h.$offset_m."\n";
//-- mod_sec_update_131 end


  B. Find in function send_mail(..)

        $this->build_headers();

     Insert below the blue code

        $this->build_headers();



//-- mod_sec_update_131 begin
        if (preg_match("`^\s*<html>.*</html>\s*$`is", $this->message)) {
            $this->mail_headers = str_replace("X-Mailer: IPB PHP Mailer", "X-Mailer: IPB PHP Mailer\nContent-Type: text/html; charset=\"iso-8859-1\"",$this->mail_headers);
        }
//-- mod_sec_update_131 end



Step  6:  Open sources/lib/post_new_post.php

  A. Find in function add_new_topic(..)

        $this->topic = array(

     Insert above the blue code



//-- mod_sec_update_131 begin
        $ibforums->input['UserName'] = str_replace("|", "&#124;", $ibforums->input['UserName']);
//-- mod_sec_update_131 end


        $this->topic = array(

  B. Find in function add_new_topic(..)

                              'pinned'           => $pinned,
                             );

     Insert below the blue code

                              'pinned'           => $pinned,
                             );



//-- mod_sec_update_131 begin
        $this->topic['last_post'] = $this->post['post_date'];
//-- mod_sec_update_131 end


  C. Find in function add_new_topic(..)

        $class->forum['last_post']        = time();

     Insert below the blue code

        $class->forum['last_post']        = time();



//-- mod_sec_update_131 begin
        $class->forum['last_post']        = $this->post['post_date'];
//-- mod_sec_update_131 end



Step  7:  Open sources/lib/post_poll.php

  A. Find in function add_new_poll(..)

        $this->topic = array(

     Insert above the blue code



//-- mod_sec_update_131 begin
        $ibforums->input['UserName'] = str_replace("|", "&#124;", $ibforums->input['UserName']);
//-- mod_sec_update_131 end


        $this->topic = array(

  B. Find in function add_new_poll(..)

                              'pinned'           => 0,
                             );

     Insert below the blue code

                              'pinned'           => 0,
                             );



//-- mod_sec_update_131 begin
        $this->topic['last_post'] = $this->post['post_date'];
//-- mod_sec_update_131 end


  C. Find in function add_new_poll(..)

        $class->forum['last_post']        = time();

     Insert below the blue code

        $class->forum['last_post']        = time();



//-- mod_sec_update_131 begin
        $class->forum['last_post']        = $this->post['post_date'];
//-- mod_sec_update_131 end



Step  8:  Open sources/lib/post_edit_post.php

  A. Find in function post_functions(..)

        $this->orig_post = $DB->fetch_row();

     Insert below the blue code

        $this->orig_post = $DB->fetch_row();



//-- mod_sec_update_131 begin
        if( $this->orig_post['topic_id'] != $this->topic['tid'] ) {
            $std->Error( array( LEVEL => 1, MSG => 'missing_files') );
        }
//-- mod_sec_update_131 end


  B. Find in function post_functions(..)

            if ($ibforums->member['g_edit_cutoff'] > 0)

     Insert above the blue code



//-- mod_sec_update_131 begin
            if ($class->forum['editable'] == "overwrite") {
                if ( $this->orig_post['post_date'] > (time() - (intval($class->forum['edit_time']) * 60 )))
                    $can_edit = 1;
            }
            elseif ($class->forum['editable'] == "always")
                $can_edit = 1;
            else
//-- mod_sec_update_131 end


            if ($ibforums->member['g_edit_cutoff'] > 0)

  C. Find in function complete_edit(..)

'LONG'

     Insert below the blue code

'LONG'



//-- mod_sec_update_131 begin
        , TRUE
//-- mod_sec_update_131 end


  D. Find in function complete_edit(..)

        $print->redirect_screen

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (isset($ibforums->input['redirect_opener'])) {
            if  (isset($ibforums->input['opener_reload']))
                $reload = "opener.location.reload();";
            echo "<html><head></head><body><script language='JavaScript' type='text/javascript'>{$reload}self.close();</script></body></html>";
            die;
        }
        else
            $print->redirect_screen( $ibforums->lang['post_edited'], "act=ST&f={$class->forum['id']}&t={$this->topic['tid']}&pid={$this->post['pid']}&st={$ibforums->input['st']}#entry{$this->post['pid']}");
        exit();
//-- mod_sec_update_131 end


        $print->redirect_screen

  E. Find in function show_form(..)

$class->forum['use_html'] AND $ibforums->member['g_dohtml'] ? 1 : 0);

     Insert below the blue code

$class->forum['use_html'] AND $ibforums->member['g_dohtml'] ? 1 : 0);



//-- mod_sec_update_131 begin
        $this->post['post'] = preg_replace("`<!-timestamp=(.*?)-->`ie", "\$std->get_date(\\1, \"LONG\")", $this->post['post']);
        $this->post['post'] = preg_replace("`<!-post_link=(.*?)-->`ie", "\$class->get_post_link('\\1', \$this->topic['tid'])", $this->post['post']);
//-- mod_sec_update_131 end


  F. Find in function show_form(..)

        $class->output .= $class->html->table_structure();

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (isset($ibforums->input['redirect_opener'])) {
            $class->output .= "\n<input type='hidden' name='redirect_opener' value='1' />\n";
            if  (isset($ibforums->input['opener_reload']))
                $class->output .= "<input type='hidden' name='opener_reload' value='1' />\n";
        }
//-- mod_sec_update_131 end


        $class->output .= $class->html->table_structure();


Step  9:  Open sources/lib/post_q_reply_post.php

  A. Find in function process(..)

        if ( ($class->obj['post_errors'] != "") or ($class->obj['preview_post'] != "") )

     Insert above the blue code



//-- mod_sec_update_131 begin
        $class->obj['preview_post'] = $ibforums->input['preview'] || $ibforums->input['is_preview'];
//-- mod_sec_update_131 end


        if ( ($class->obj['post_errors'] != "") or ($class->obj['preview_post'] != "") )

  B. Find in function post_functions(..)

        // Lets load the topic from the database before we do anything else.

     Insert above the blue code



//-- mod_sec_update_131 begin
        $ibforums->input['pid'] = $ibforums->input['p'];
//-- mod_sec_update_131 end


        // Lets load the topic from the database before we do anything else.

  C. Find in function process(..)

'LONG'

     Insert below the blue code

'LONG'



//-- mod_sec_update_131 begin
        , TRUE
//-- mod_sec_update_131 end


  D. Find in function add_reply(..)

        $class->forum['last_post']        = time();

     Insert below the blue code

        $class->forum['last_post']        = time();



//-- mod_sec_update_131 begin
        $class->forum['last_post']        = $this->post['post_date'];
        $ibforums->input['UserName'] = str_replace("|", "&#124;", $ibforums->input['UserName']);
        $std->my_setcookie("mqt_ids", "");
//-- mod_sec_update_131 end


  E. Find in function add_reply(..)

            $std->boink_it($class->base_url."showtopic={$this->topic['tid']}&st=$page&#entry{$this->post['pid']}");

     Insert above the blue code



//-- mod_sec_update_131 begin
            $std->boink_it($class->base_url."showtopic={$this->topic['tid']}&pid={$this->post['pid']}&st=$page&#entry{$this->post['pid']}");
            exit();
//-- mod_sec_update_131 end


            $std->boink_it($class->base_url."showtopic={$this->topic['tid']}&st=$page&#entry{$this->post['pid']}");


Step 10:  Open sources/lib/post_reply_post.php

  A. Find in function process(..)

        if ( ($class->obj['post_errors'] != "") or ($class->obj['preview_post'] != "") )

     Insert above the blue code



//-- mod_sec_update_131 begin
        $class->obj['preview_post'] = $ibforums->input['preview'] || $ibforums->input['is_preview'];
//-- mod_sec_update_131 end


        if ( ($class->obj['post_errors'] != "") or ($class->obj['preview_post'] != "") )

  B. Find in function add_reply(..)

        $class->forum['last_post']        = time();

     Insert below the blue code

        $class->forum['last_post']        = time();



//-- mod_sec_update_131 begin
        $class->forum['last_post']        = $this->post['post_date'];
        $ibforums->input['UserName'] = str_replace("|", "&#124;", $ibforums->input['UserName']);
        $std->my_setcookie("mqt_ids", "");
//-- mod_sec_update_131 end


  C. Find in function add_reply(..)

            $std->boink_it($class->base_url."showtopic={$this->topic['tid']}&st=$page&#entry{$this->post['pid']}");

     Insert above the blue code



//-- mod_sec_update_131 begin
            $std->boink_it($class->base_url."showtopic={$this->topic['tid']}&pid={$this->post['pid']}&st=$page&#entry{$this->post['pid']}");
            exit();
//-- mod_sec_update_131 end


            $std->boink_it($class->base_url."showtopic={$this->topic['tid']}&st=$page&#entry{$this->post['pid']}");

  D. Find in function show_form(..)

        // we have a <textarea> tag in the raw post var.

     Insert below the blue code

        // we have a <textarea> tag in the raw post var.



//-- mod_sec_update_131 begin
        if (!isset($HTTP_POST_VARS['Post']) || $ibforums->input['is_preview']) {
            if (!$ibforums->skin['use_rte'] && $ibforums->vars['allow_multi_quote'] && $mqt = $std->my_getcookie("mqt_ids")) {
                $mqt_ids = explode(",", $mqt);
                if ($mqt_ids[0] == $this->topic['tid'] && count($mqt_ids) > 1) {
                    array_splice($mqt_ids, 0, 1);
                    foreach ($mqt_ids as $i => $id) {
                        $_id = explode("_", $id);
                        $ids_array[] = $_id[0];
                        if ($_id[1] == -1 && $_id[2] == -1)
                            $mqt_ids[$i] = $_id[0];
                    }
                    if ($ibforums->input['is_preview'] && isset($HTTP_POST_VARS['Post'])) {
                        $raw_post = $std->txt_htmlspecialchars($HTTP_POST_VARS['Post']);
                    }
                    $ids = implode(",", $ids_array);
                    $DB->query("SELECT pid, post, post_date, author_name FROM ibf_posts WHERE topic_id={$this->topic['tid']} AND pid in ($ids) ORDER BY FIND_IN_SET(pid,'$ids');");
                    while ($r = $DB->fetch_row()) {
                        if ($ibforums->input['is_preview']) {
                            if ($raw_post && in_array($r['pid'], $mqt_ids))
                                if (strpos($raw_post, "post=\\'{$r['pid']}\\'") !== FALSE) {
                                    $match = "`(^.*)\[QUOTE.*?post='".$r['pid']."'\].*?\[/quote\]`is";
                                    $raw_post = preg_replace($match, "\\1",  stripslashes($raw_post));
                            }
                            if (strpos($raw_post, "post=\\'{$r['pid']}\\'") !== FALSE || strpos($raw_post, "post='{$r['pid']}'") !== FALSE)
                                continue;
                        }
                        $raw_post .= "[QUOTE name='".$r['author_name']."' timestamp='".$r['post_date']."' post='".$r['pid']."']"; 
                        if ($ibforums->vars['strip_quotes']) {
                            $quoted_post = trim(preg_replace( "#\[QUOTE(=.+?,.+?)?\].+?\[/QUOTE\]#is", "", $class->parser->unconvert($r['post'], $class->forum['use_ibc'], $class->forum['use_html'])));
                            $raw_post .= trim(preg_replace( "#\[QUOTE name=.+?timestamp=.+?post=.+?\].+?\[/QUOTE\]#is", "", $quoted_post));
                        }
                        else
                            $raw_post .= trim($class->parser->unconvert($r['post'], $class->forum['use_ibc'], $class->forum['use_html']));
                        $raw_post .= "[/QUOTE]\n\n"; 
                    }
                    if ($raw_post && isset($HTTP_POST_VARS['Post']) && $ibforums->input['is_preview']) {
                        $this->post['post'] = $std->clean_value(stripslashes($raw_post));
                    }
                }
            }
            else
                $raw_post = "";
        }
        else
//-- mod_sec_update_131 end


  E. Find in function show_form(..)

$class->forum['use_html'] AND $ibforums->member['g_dohtml'] ? 1 : 0);

     Insert below the blue code

$class->forum['use_html'] AND $ibforums->member['g_dohtml'] ? 1 : 0);



//-- mod_sec_update_131 begin
        $this->post['post'] = preg_replace("`<!-timestamp=(.*?)-->`ie", "\$std->get_date(\\1, \"LONG\")", $this->post['post']);
        $this->post['post'] = preg_replace("`<!-post_link=(.*?)-->`ie", "\$class->get_post_link('\\1', \$this->topic['tid'])", $this->post['post']);
//-- mod_sec_update_131 end



Step 11:  Open sources/lib/post_parser.php

  A. Find

    var $allow_unicode  = 1;

     Insert below the blue code

    var $allow_unicode  = 1;



//-- mod_sec_update_131 begin
    var $no_bad_words = 0;
//-- mod_sec_update_131 end


  B. Find in function unconvert(..)

            $txt = preg_replace( "#<!--QuoteBegin-->(.+?)<!--QuoteEBegin-->#"                , '[QUOTE]'         , $txt );

     Insert below the blue code

            $txt = preg_replace( "#<!--QuoteBegin-->(.+?)<!--QuoteEBegin-->#"                , '[QUOTE]'         , $txt );



//-- mod_sec_update_131 begin
            $txt = preg_replace( "#<!--QuoteBegin-{1,2}([^>]+?)\+([^>]+?)\+([^>]+?)-->(.+?)<!--QuoteEBegin-->#"  , "[QUOTE name='\\1' timestamp='\\2' post='\\3']" , $txt );
//-- mod_sec_update_131 end


  C. Find in function unconvert(..)

            $txt = preg_replace( "#(\n){0,}<ul>#" , "\\1\[LIST\]"  , $txt );

     Insert below the blue code

            $txt = preg_replace( "#(\n){0,}<ul>#" , "\\1\[LIST\]"  , $txt );



//-- mod_sec_update_131 begin
            if (TRUE)
                $txt = preg_replace( "#(\n){0,}<ol type='(a|A|i|I|1)'>(\n){0,}<li value='(.*?)'>#is" , "\\1\[LIST=\\2\,\\4]\n\[*\]"  , $txt );
            else
//-- mod_sec_update_131 end


  D. Find in function regex_list(..)

    function regex_list( $txt="", $type=""

     Insert below the blue code

    function regex_list( $txt="", $type=""



//-- mod_sec_update_131 begin
    , $start=""
//-- mod_sec_update_131 end


  E. Find in function regex_parse_quotes(..)

        $this->quote_html = $this->wrap_style( array( 'STYLE' => 'QUOTE' ) );

     Insert below the blue code

        $this->quote_html = $this->wrap_style( array( 'STYLE' => 'QUOTE' ) );



//-- mod_sec_update_131 begin
        $txt = str_replace("\\\"", "\"", $txt);
        $txt = preg_replace( "`\[quote\s+name=(&quot;|&#39;)([^\]]+?)(&quot;|&#39;)\s+timestamp=(&quot;|&#39;)([^\]]+?)(&quot;|&#39;)\s+post=(&quot;|&#39;)([^\]]+?)(&quot;|&#39;)\s*\]`ie", "\$this->regex_quote_post('\\2', '\\5', '\\8')", $txt );
//-- mod_sec_update_131 end


  F. Find in function regex_list(..)

            return "<ol type=

     Insert above the blue code



//-- mod_sec_update_131 begin
            if ($start) {
                return "<ol type='$type'>".$this->regex_list_item($txt, $start)."</ol>";
            }
            else
                if (intval($type) != 0) {
                    return "<ol type='1'>".$this->regex_list_item($txt, $type)."</ol>";
                }
                else
//-- mod_sec_update_131 end


            return "<ol type=

  G. Find in function regex_list_item(..)

    function regex_list_item($txt

     Insert below the blue code

    function regex_list_item($txt



//-- mod_sec_update_131 begin
    , $start=""
//-- mod_sec_update_131 end


  H. Find in function regex_list_item(..)

        return str_replace( "\n</li>", "</li>", $txt."</li>" );

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($start) {
            $txt = preg_replace( "#^<li>#"  , "<li value='$start'>", $txt );
        }
//-- mod_sec_update_131 end


        return str_replace( "\n</li>", "</li>", $txt."</li>" );

  I. Find in function regex_simple_quote_tag(..)

    function regex_simple_quote_tag() {

     Insert above the blue code



//-- mod_sec_update_131 begin
    function regex_quote_post($name="", $date="", $pid = "") {
        global $ibforums;
        
        $default = "\[quote name='$name' timestamp='$date' post='$pid'\]";
        if ( strstr( $name, '<!--c1-->' ) or strstr( $date, '<!--c1-->' ) ) {
            $this->quote_error++;
            return $default;
        }
        $name = str_replace( "+", "&#043;", $name );
        $name = str_replace( "-", "&#045;", $name );
        $name = str_replace( '[', "&#091;", $name );
        $name = str_replace( ']', "&#093;", $name );
        $this->quote_open++;
        if ($date == "")
            $html = $this->wrap_style( array( 'STYLE' => 'QUOTE', 'EXTRA' => "($name)" ) );
        else
            $html = $this->wrap_style( array( 'STYLE' => 'QUOTE', 'EXTRA' => "($name&nbsp;&#064;&nbsp;<!-timestamp=$date-->)<!-post_link=$pid-->" ) );
        $extra = "-".$name.'+'.$date.'+'.$pid;
        return "<!--QuoteBegin".$extra."-->{$html['START']}<!--QuoteEBegin-->";
    }
//-- mod_sec_update_131 end


    function regex_simple_quote_tag() {

  J. Find in function regex_check_image(..)

        $default = "[img]".$url."[/img]";

     Insert below the blue code

        $default = "[img]".$url."[/img]";



//-- mod_sec_update_131 begin
        $default = "[img]".str_replace( '[', '&# 091;', $url )."[/img]";
//-- mod_sec_update_131 end


  K. Find in function regex_check_image(..)

            if (preg_match( "/[?&;]/", $url))

     Insert above the blue code



/*-- mod_sec_update_131 exclude begin


            if (preg_match( "/[?&;]/", $url))

  L. Find in function regex_check_image(..)

            if (preg_match( "/[?&;]/", $url))

     Insert below the blue code

            if (preg_match( "/[?&;]/", $url))



-- mod_sec_update_131 exclude end */

//-- mod_sec_update_131 begin
            if (preg_match( "/[?&;\<\[]/", $url))
//-- mod_sec_update_131 end


  M. Find in function regex_check_image(..)

            $extension = preg_replace( "#^.*\.(\S+)$#", "\\1", $url );

     Insert below the blue code

            $extension = preg_replace( "#^.*\.(\S+)$#", "\\1", $url );



//-- mod_sec_update_131 begin
            $extension = preg_replace( "#^.*\.(\w+).*$#", "\\1", $url );
//-- mod_sec_update_131 end


  N. Find in function convert(..)

        $txt = $in['TEXT'];

     Insert below the blue code

        $txt = $in['TEXT'];



//-- mod_sec_update_131 begin
        $txt = str_replace("`", "&#96;", $txt);;
//-- mod_sec_update_131 end


  O. Find in function convert(..)

                while( preg_match( "#\n?\[list\](.+?)\[/list\]\n?#ies" , $txt ) )

     Insert above the blue code



//-- mod_sec_update_131 begin
                if (TRUE) {
                    while( preg_match( "#\[list\](.+?)\[/list\]#ies" , $txt ) )
                        $txt = preg_replace( "#\[list\](.+?)\[/list\]#ies", "\$this->regex_list('\\1')" , $txt );
                    while( preg_match( "#\[list=(a|A|i|I|\d+)\](.+?)\[/list\]#ies" , $txt ) )
                        $txt = preg_replace( "#\[list=(a|A|i|I|\d+)\](.+?)\[/list\]#ies", "\$this->regex_list('\\2','\\1')" , $txt );
                    while( preg_match( "#\[list=(a|A|i|I|\d+),(\d+)\](.+?)\[/list\]#ies" , $txt ) )
                        $txt = preg_replace( "#\[list=(a|A|i|I|\d+),(\d+)\](.+?)\[/list\]#ies", "\$this->regex_list('\\3','\\1','\\2')" , $txt );
                }
                else 
//-- mod_sec_update_131 end


                while( preg_match( "#\n?\[list\](.+?)\[/list\]\n?#ies" , $txt ) )

  P. Find in function convert(..)

                while( preg_match( "#\n?\[list=(a|A|i|I|1)\](.+?)\[/list\]\n?#ies" , $txt ) )

     Insert above the blue code



//-- mod_sec_update_131 begin
                if (FALSE)
//-- mod_sec_update_131 end


                while( preg_match( "#\n?\[list=(a|A|i|I|1)\](.+?)\[/list\]\n?#ies" , $txt ) )

  Q. Find in function regex_font_attr(..)

            return "<span style='color:".$IN['1']."'>".$IN['2']."</span>";

     Insert above the blue code



//-- mod_sec_update_131 begin
            $IN[1] = preg_replace( "/[^\d\w\#\s]/s", "", $IN[1] );
//-- mod_sec_update_131 end


            return "<span style='color:".$IN['1']."'>".$IN['2']."</span>";

  R. Find in function regex_font_attr(..)

            return "<span style='font-family:".$IN['1']."'>".$IN['2']."</span>";

     Insert above the blue code



//-- mod_sec_update_131 begin
            $IN['1'] = preg_replace( "/[^\d\w\,\#\-\_\s]/s", "", $IN['1'] );
//-- mod_sec_update_131 end


            return "<span style='font-family:".$IN['1']."'>".$IN['2']."</span>";

  S. Find in function post_parser(..), convert(..)

$DB->query("SELECT typed, image from ibf_emoticons");

     Insert above the blue code



//-- mod_sec_update_131 begin
            if (TRUE)
                $DB->query("SELECT * from ibf_emoticons");
            else
//-- mod_sec_update_131 end


$DB->query("SELECT typed, image from ibf_emoticons");


Step 12:  Open sources/lib/tar.php

  A. Find

    var $tar_header_length = '512';

     Insert below the blue code

    var $tar_header_length = '512';



/*-- mod_sec_update_131 exclude begin


  B. Find

    var $tar_pack_header

     Insert above the blue code



-- mod_sec_update_131 exclude end */

//-- mod_sec_update_131 begin
    var $tar_unpack_header = 'a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8chksum/a1typeflag/a100linkname/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor/a155prefix';
//-- mod_sec_update_131 end


    var $tar_pack_header

  C. Find in function read_tar(..)

            $fa = unpack( $this->tar_unpack_header, $buffer);

     Insert above the blue code



//-- mod_sec_update_131 begin
            if (true)
                $fa = @unpack( $this->tar_unpack_header, $buffer);
            else
//-- mod_sec_update_131 end


            $fa = unpack( $this->tar_unpack_header, $buffer);

  D. Find in function read_tar(..)

            $prefix   = trim($fa[prefix]);

     Insert below the blue code

            $prefix   = trim($fa[prefix]);



//-- mod_sec_update_131 begin
            if (!$size)
                $size = 1024;
//-- mod_sec_update_131 end



Step 13:  Open sources/lib/usercp_functions.php

  A. Find in function do_photo(..)

        if ( empty($ibforums->input['url_photo']) )

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ( preg_match( "#javascript:#is", $ibforums->input['url_photo'] ) ) {
            $ibforums->input['url_photo'] = "";
        }
//-- mod_sec_update_131 end


        if ( empty($ibforums->input['url_photo']) )

  B. Find in function do_photo(..)

                if ($FILE_SIZE > ($p_max * 1024))
                {
                    $std->Error( array( 'LEVEL' => 1, 'MSG' => 'upload_to_big' ) );
                }

     Insert below the blue code

                if ($FILE_SIZE > ($p_max * 1024))
                {
                    $std->Error( array( 'LEVEL' => 1, 'MSG' => 'upload_to_big' ) );
                }



//-- mod_sec_update_131 begin
                require "./conf_mime_types.php";
                if ( $mime_types[ $FILE_TYPE ][3] != 1 ) {
                    $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_av_type' ) );
                }
//-- mod_sec_update_131 end


  C. Find in function do_board_prefs(..)

            $ibforums->input['topicpage'] = '-1';
        }

     Insert below the blue code

            $ibforums->input['topicpage'] = '-1';
        }



//-- mod_sec_update_131 begin
        if (TRUE) {
            $set = array(   'time_offset'  => $ibforums->input['u_timezone'],
                            'view_avs'     => $ibforums->input['VIEW_AVS'],
                            'view_sigs'    => $ibforums->input['VIEW_SIGS'],
                            'view_img'     => $ibforums->input['VIEW_IMG'],
                            'view_pop'     => $ibforums->input['DO_POPUP'],
                            'dst_in_use'   => $ibforums->input['DST'],
                            'view_prefs'   => $ibforums->input['postpage']."&".$ibforums->input['topicpage'],
                        );
            if ($ibforums->vars['display_topic_preview']) {
                $set['topic_preview'] = intval($ibforums->input['topic_preview']);
            }
            if ($ibforums->vars['display_topic_preview']) {
                $set['topic_thread'] = intval($ibforums->input['topic_thread']);
            }
            $db_string = $DB->compile_db_update_string($set);
        }
        else
//-- mod_sec_update_131 end


  D. Find in function do_board_prefs(..)

        if ($ibforums->input['OPEN_QR'] == 1)

     Insert above the blue code



//-- mod_sec_update_131 begin
        $std->my_setcookie('topic_thread', '');
//-- mod_sec_update_131 end


        if ($ibforums->input['OPEN_QR'] == 1)

  E. Find in function do_photo(..), do_avatar(..)

                    @chmod( $ibforums->vars['upload_dir']."/".$real_name, 0777 );

     Insert below the blue code

                    @chmod( $ibforums->vars['upload_dir']."/".$real_name, 0777 );



//-- mod_sec_update_131 begin
                    $img_size = @getimagesize( $ibforums->vars['upload_dir']."/".$real_name );
                    if (!is_array($img_size))
                        $img_size = @getimagesize( $ibforums->vars['upload_dir']."/".$real_name, $info );
                    if (!is_array($img_size)) {
                        @unlink($ibforums->vars['upload_dir']."/".$real_name);
                        $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_av_type' ) );
                    }
                    if (function_exists("imagecreatefromgif")) {
                        $image = $ibforums->vars['upload_dir']."/".$real_name;
                        switch($ext) {
                            case '.gif' :   $im = @imagecreatefromgif($image);
                                            break;
                            case '.jpg':    $im = @imagecreatefromjpeg($image);
                                            break;
                            case '.png':    $im = @imagecreatefrompng($image);
                                            break;
                        }
                        if ($im) {
                            imagedestroy($im);
                        }
                        elseif ($ext == ".gif" || $ext == ".jpg" || $ext == ".png") {
                            @unlink($image);
                            $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_av_type' ) );
                        }
                    }
//-- mod_sec_update_131 end


  F. Find in function do_avatar(..)

        if ( empty($ibforums->input['url_avatar']) )

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ( preg_match( "#javascript:#is", $ibforums->input['url_avatar'] ) ) {
            $ibforums->input['url_avatar'] = "";
        }
//-- mod_sec_update_131 end


        if ( empty($ibforums->input['url_avatar']) )

  G. Find in function do_profile(..)

        $DB->query("SELECT * from ibf_pfields_data WHERE fedit=1");

     Insert above the blue code



//-- mod_sec_update_131 begin
        $in = array('SMILIES'   => 0,
                    'CODE'      => 1,
                    'HTML'      => 0,
                    'SIGNATURE' => 0
                    );
//-- mod_sec_update_131 end


        $DB->query("SELECT * from ibf_pfields_data WHERE fedit=1");

  H. Find in function do_profile(..)

            $custom_fields[ 'field_'.$row['fid'] ] =

     Insert above the blue code



//-- mod_sec_update_131 begin
            if ($ibforums->vars['profile_allow_ibc'] && $row['ftype'] != "drop") {
                $in['TEXT'] = $ibforums->input['field_'.$row['fid']];
                $query_id = $DB->query_id;
                $custom_fields[ 'field_'.$row['fid'] ] = $this->class->parser->convert($in);
                $DB->query_id = $query_id;
            }
            else
//-- mod_sec_update_131 end


            $custom_fields[ 'field_'.$row['fid'] ] =

  I. Find in function do_profile(..)

        // Start off our array
        //----------------------------------

     Insert below the blue code

        // Start off our array
        //----------------------------------



//-- mod_sec_update_131 begin
        if ($ibforums->vars['profile_allow_ibc']) {
            $in['TEXT'] = $ibforums->input['Interests'];
            $ibforums->input['Interests'] = $this->class->parser->convert($in);
            $in['TEXT'] = $ibforums->input['Location'];
            $ibforums->input['Location'] = $this->class->parser->convert($in);
        }
//-- mod_sec_update_131 end



Step 14:  Open sources/misc/attach.php

  A. Find in function attach(..)

        if ($ibforums->input['id'] == "")

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (!$ibforums->member['id'] && !$ibforums->vars['guests_attach'])
            $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
//-- mod_sec_update_131 end


        if ($ibforums->input['id'] == "")

  B. Find in function attach(..)

            $DB->query("SELECT pid, attach_id, attach_type, attach_file FROM ibf_posts WHERE pid='".$ibforums->input['id']."'");

     Insert above the blue code



//-- mod_sec_update_131 begin
            $DB->query("SELECT p.pid, p.attach_id, p.attach_type, p.attach_file, f.read_perms FROM ibf_posts p 
                        LEFT JOIN ibf_forums f ON (p.forum_id=f.id)
                        WHERE pid='".$ibforums->input['id']."'");
            if (FALSE)
//-- mod_sec_update_131 end


            $DB->query("SELECT pid, attach_id, attach_type, attach_file FROM ibf_posts WHERE pid='".$ibforums->input['id']."'");

  C. Find in function attach(..)

            $file = $ibforums->vars['upload_dir']."/".$post['attach_id'];

     Insert above the blue code



//-- mod_sec_update_131 begin
            if (!$std->check_perms($post['read_perms']))
                $std->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files' ) );
//-- mod_sec_update_131 end


            $file = $ibforums->vars['upload_dir']."/".$post['attach_id'];

  D. Find in function attach(..)

                @header( "Content-Type: ".$post['attach_type']."\nContent-Disposition: inline; filename=\"".$post['attach_file']."\"\nContent-Length: ".(string)(filesize( $file ) ) );

     Insert above the blue code



//-- mod_sec_update_131 begin
                if (TRUE) {
                    @header( "Content-Type: ".$post['attach_type']);
                    @header( "Content-Disposition: inline; filename=\"".$post['attach_file']."\"" );
                    @header( "Content-Length: ".(string)(filesize( $file ) ) );
                }
                else
//-- mod_sec_update_131 end


                @header( "Content-Type: ".$post['attach_type']."\nContent-Disposition: inline; filename=\"".$post['attach_file']."\"\nContent-Length: ".(string)(filesize( $file ) ) );


Step 15:  Open sources/misc/contact_member.php

  A. Find

    var $forum     = "";

     Insert below the blue code

    var $forum     = "";



/*-- mod_sec_update_131 exclude begin


  B. Find

    var $int_error  = "";

     Insert above the blue code



-- mod_sec_update_131 exclude end */


    var $int_error  = "";

  C. Find in function show_integ(..)

    function show_integ()
    {

     Insert below the blue code

    function show_integ()
    {



//-- mod_sec_update_131 begin
        die;
//-- mod_sec_update_131 end


  D. Find in function board_rules(..)

        $DB->query("SELECT * FROM ibf_cache_store WHERE cs_key='boardrules'");

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (file_exists(ROOT_PATH."/lang/{$ibforums->lang_id}/lang_glines.php")) {
            $ibforums->lang = $std->load_words($ibforums->lang, 'lang_glines', $ibforums->lang_id );
            $this->nav[] = $ibforums->lang['gl_title'];
            $this->page_title = $ibforums->lang['gl_title'];
            $this->output .= $this->html->board_rules( $ibforums->lang['gl_title'], $ibforums->lang['gl_guidelines'] );
            return;
        }
//-- mod_sec_update_131 end


        $DB->query("SELECT * FROM ibf_cache_store WHERE cs_key='boardrules'");

  E. Find in function send_report(..)

        $DB->query("SELECT m.name, m.email, mod.member_id FROM ibf_moderators mod, ibf_members m WHERE mod.forum_id='$fid' and mod.member_id=m.id");

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($ibforums->vars['disable_reportpost'])
            $std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') );
        if (TRUE)
            $DB->query("SELECT m.id, m.name, m.email, moderator.member_id FROM ibf_moderators moderator, ibf_members m WHERE moderator.forum_id='$fid' and (moderator.member_id=m.id OR (moderator.is_group=1 AND moderator.group_id=m.mgroup))");
        else
//-- mod_sec_update_131 end


        $DB->query("SELECT m.name, m.email, mod.member_id FROM ibf_moderators mod, ibf_members m WHERE mod.forum_id='$fid' and mod.member_id=m.id");

  F. Find in function send_report(..), send_report(..)

                                 'name'  => $r['name'],

     Insert above the blue code



//-- mod_sec_update_131 begin
                                 'id'    => $r['id'],
//-- mod_sec_update_131 end


                                 'name'  => $r['name'],

  G. Find in function send_report(..)

        //--------------------------------------------
        // Get the emailer module

     Insert above the blue code



//-- mod_sec_update_131 begin
// Get the supermods
        $mod_ids = array(0);
        foreach ($mods as $data)
            $mod_ids[] = $data['id'];
        $DB->query("SELECT m.id, m.name, m.email FROM ibf_members m, ibf_groups g WHERE g.g_access_cp<>1 AND g.g_is_supmod AND m.mgroup=g.g_id AND m.id NOT IN (".implode(',', $mod_ids).")");
        if ($DB->get_num_rows()) {
            while($r = $DB->fetch_row()) {
                $mods[] = array( 'id'    => $r['id'],
                                 'name'  => $r['name'],
                                 'email' => $r['email']
                               );
            }
        }
//-- mod_sec_update_131 end


        //--------------------------------------------
        // Get the emailer module

  H. Find in function send_report(..)

        }

        $print->redirect_screen( $ibforums->lang['report_redirect'], "act=ST&f=$fid&t=$tid&st=$st&#entry$pid");

     Insert above the blue code



//-- mod_sec_update_131 begin
            if ($ibforums->vars['reportpost_pm']) {
                $msg = array(
                              'member_id'      => $data['id'],
                              'msg_date'       => time(),
                              'read_state'     => 0,
                              'title'          => $this->email->subject,
                              'message'        => $std->clean_value($this->email->message),
//                              'message'        => mysql_escape_string($this->email->message),
                              'from_id'        => $ibforums->member['id'],
                              'vid'            => 'in',
                              'recipient_id'   => $data['id'],
                              'report'         => "p=$pid&t=$tid&f=$fid&st=$st",
                            );
                $db_string = $DB->compile_db_insert_string($msg);
                $DB->query("INSERT INTO ibf_messages (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")");
            }
//-- mod_sec_update_131 end


        }

        $print->redirect_screen( $ibforums->lang['report_redirect'], "act=ST&f=$fid&t=$tid&st=$st&#entry$pid");

  I. Find in function check_access(..)

        $this->forum = $DB->fetch_row();

     Insert below the blue code

        $this->forum = $DB->fetch_row();



//-- mod_sec_update_131 begin
        if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group'] || $ibforums->member['g_is_supmod'] || ($ibforums->member['is_mod'] && $ibforums->member['mod_forums'][$this->forum['id']]))
            $this->forum['password'] = "";
//-- mod_sec_update_131 end


  J. Find in function show_msn(..)

        $html .= $this->html->msn_body( $member['msnname'] );

     Insert above the blue code



//-- mod_sec_update_131 begin
        $this->html = $std->load_template('mod_sec_update_skin_emails');
        $ibforums->lang = $std->load_words($ibforums->lang, 'mod_sec_lang_msg', $ibforums->lang_id );
        $name = $member['msnname'];
        $names = explode("(", $name);
        if (count($names) > 1) {
            $name = trim($names[0]);
        }
        if ($ibforums->input['control'])
            $html = $this->html->live_msn_control_body();
        else
            $html = $this->html->live_msn_body($member['name'], $ibforums->member['name'], $name );
        global $skin_universal;
        if ( $ibforums->skin['css_method'] == 'external' ) {
            $css = $skin_universal->css_external($ibforums->skin['css_id'], $ibforums->skin['img_dir']);
        }
        else {
            $css = $skin_universal->css_inline( str_replace( "<#IMG_DIR#>", $ibforums->skin['img_dir'], $ibforums->skin['css_text'] ) );
        }
        if ($ibforums->input['control'])
            $html = $this->html->live_msn_control_window($title, $css, $html);
        else
            $html = $this->html->live_msn_window($title, $css, $html);
        $TAGS = $DB->query("SELECT macro_value, macro_replace FROM ibf_macro WHERE macro_set='{$ibforums->skin['macro_id']}'");
        while ($row = $DB->fetch_row($TAGS)) {
            if ($row['macro_value'] != "") {
                $html = str_replace( "<{".$row['macro_value']."}>", $row['macro_replace'], $html );
            }
        }
        $html = str_replace( "<#IMG_DIR#>", $ibforums->skin['img_dir'], $html );
        $DB->close_db();
        if ($ibforums->vars['disable_gzip'] != 1) {
            $buffer = ob_get_contents();
            ob_end_clean();
            ob_start('ob_gzhandler');
            print $buffer;
        }
        $print->do_headers();
        echo ($html);
        exit;
//-- mod_sec_update_131 end


        $html .= $this->html->msn_body( $member['msnname'] );


Step 16:  Open sources/misc/legends.php

  Find in function find_user_two(..)

         $ibforums->input['username'] = strtolower(trim($ibforums->input['username']));

     Insert above the blue code



//-- mod_sec_update_131 begin
         $ibforums->input['username'] = str_replace( '|', '&#124;',$ibforums->input['username']);
//-- mod_sec_update_131 end


         $ibforums->input['username'] = strtolower(trim($ibforums->input['username']));


Step 17:  Open sources/misc/forward_page.php

  A. Find in function Forward(..)

       $DB->query("SELECT t.*, f.name as forum_name,

     Insert above the blue code



//-- mod_sec_update_131 begin
       $DB->query("SELECT t.*, f.name as forum_name, f.id as forum_id, f.password, f.read_perms, f.reply_perms, f.start_perms, f.allow_poll, f.posts as forum_posts, f.topics as forum_topics, c.name as cat_name, c.id as cat_id FROM ibf_topics t, ibf_forums f , ibf_categories c where t.tid='".$ibforums->input[t]."' and f.id = t.forum_id and f.category=c.id");
       if (FALSE)
//-- mod_sec_update_131 end


       $DB->query("SELECT t.*, f.name as forum_name,

  B. Find in function check_access(..)

        if ($this->forum['password'])

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group'] || $ibforums->member['g_is_supmod'] || ($ibforums->member['is_mod'] && $ibforums->member['mod_forums'][$this->forum['id']]))
            $this->forum['password'] = "";
//-- mod_sec_update_131 end


        if ($this->forum['password'])


Step 18:  Open sources/misc/print_page.php

  A. Find in function Printable(..)

        $this->topic = $DB->fetch_row();

     Insert below the blue code

        $this->topic = $DB->fetch_row();



//-- mod_sec_update_131 begin
        if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group'] || $ibforums->member['g_is_supmod'] || ($ibforums->member['is_mod'] && $ibforums->member['mod_forums'][$this->topic['forum_id']]))
            $this->topic['password'] = "";
//-- mod_sec_update_131 end


  B. Find in function get_posts(..)

'LONG'

     Insert below the blue code

'LONG'



//-- mod_sec_update_131 begin
        , TRUE
//-- mod_sec_update_131 end



Step 19:  Open sources/misc/stats.php

  A. Find in function check_access(..)

        $this->forum = $DB->fetch_row();

     Insert below the blue code

        $this->forum = $DB->fetch_row();



//-- mod_sec_update_131 begin
        if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group'] || $ibforums->member['g_is_supmod'] || ($ibforums->member['is_mod'] && $ibforums->member['mod_forums'][$this->forum['id']]))
            $this->forum['password'] = "";
//-- mod_sec_update_131 end


  B. Find in function show_leaders(..)

        $DB->query("SELECT m2.id, m2.name, m2.email, m2.hide_email, m2.location, m2.aim_name, m2.icq_number,

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (TRUE)
            $DB->query("SELECT m2.id, m2.name, m2.email, m2.hide_email, m2.location, m2.aim_name, m2.icq_number,
                               f.id as forum_id, f.read_perms, f.name as forum_name, c.state
                        FROM ibf_moderators moderator
                          LEFT JOIN ibf_forums f ON(f.id=moderator.forum_id)
                          LEFT JOIN ibf_categories c ON(c.id=f.category AND c.state != 0)
                          LEFT JOIN ibf_members m2 ON (moderator.member_id=m2.id)
                        ");
        else
//-- mod_sec_update_131 end


        $DB->query("SELECT m2.id, m2.name, m2.email, m2.hide_email, m2.location, m2.aim_name, m2.icq_number,

  C. Find in function show_leaders(..)

        $DB->query("SELECT m.id, m.name, m.email, m.hide_email, m.location, m.aim_name, m.icq_number,
                           f.id as forum_id, f.read_perms, f.name as forum_name, c.state

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (TRUE)
            $DB->query("SELECT m.id, m.name, m.email, m.hide_email, m.location, m.aim_name, m.icq_number,
                               f.id as forum_id, f.read_perms, f.name as forum_name, c.state
                        FROM ibf_moderators moderator
                          LEFT JOIN ibf_forums f ON(f.id=moderator.forum_id)
                          LEFT JOIN ibf_categories c ON(c.id=f.category AND c.state != 0)
                          LEFT JOIN ibf_members m ON (moderator.group_id=m.mgroup AND moderator.is_group=1)
                        ");
        else
//-- mod_sec_update_131 end


        $DB->query("SELECT m.id, m.name, m.email, m.hide_email, m.location, m.aim_name, m.icq_number,
                           f.id as forum_id, f.read_perms, f.name as forum_name, c.state

  D. Find in function show_today_posters(..)

            $DB->query("SELECT COUNT(p.pid) as tpost, m.id, m.name, m.joined, m.posts FROM ibf_posts p, ibf_members m "

     Insert above the blue code



//-- mod_sec_update_131 begin
            if (TRUE)
                $DB->query("SELECT COUNT(p.pid) as tpost, m.id, m.name, m.joined, m.posts FROM ibf_members m, ibf_posts p LEFT JOIN ibf_forums f ON (f.id=p.forum_id)"
                          ."WHERE f.inc_postcount <> 0 AND m.id > 0 AND m.id=p.author_id and post_date < $time_high and post_date > $time_low GROUP BY p.author_id ORDER BY tpost DESC LIMIT 0,10");
            else
//-- mod_sec_update_131 end


            $DB->query("SELECT COUNT(p.pid) as tpost, m.id, m.name, m.joined, m.posts FROM ibf_posts p, ibf_members m "


Step 20:  Open sources/misc/tracker.php

  Find in function tracker(..)

        $this->topic = $DB->fetch_row();

     Insert below the blue code

        $this->topic = $DB->fetch_row();



//-- mod_sec_update_131 begin
        if ($ibforums->member['mgroup'] == $ibforums->vars['admin_group'] || $ibforums->member['g_is_supmod'] || ($ibforums->member['is_mod'] && $ibforums->member['mod_forums'][$this->topic['fid']]))
            $this->topic['password'] = "";
//-- mod_sec_update_131 end



Step 21:  Open sources/misc/warn.php

  Find in function view_log(..)

        $start   = intval($ibforums->input['st']);

     Insert above the blue code



//-- mod_sec_update_131 begin
        $start = max(0, $start);
//-- mod_sec_update_131 end


        $start   = intval($ibforums->input['st']);

 5.  Customize

Attention
If you have Mod BBCode installed then you must reinstall it with version > 2.2.11. This is because a feature of Mod BBCode was moved to the Mod Security&Updates > 2.6.1.


Time and calendar bugs
In ACP the logic of Date and Time Formats has changed. You can set the time zone for guests and new users and you can finetune the time calculations if the server time is not set correctly. Normally the server time settings are out of your scope.

In calendar module there are a lot of bugs which are not fixed by this update. I recommend strongly to apply my mod Enhanced Calendar.

Language dependant skins
If you want language dependant buttons like New Topic then create a new subdirectory in the style_images directory of the skin.

Example:
The English language resides in lang/en and the German language resides in lang/2. The image directory of your skin is style_images/ipb-001

Now create style_images/ipb-001/en and style_images/ipb-001/2. Copy the content of the original directory style_images/ipb-001 to the new sub directories.

Finally copy the language dependant buttons like t_new.gif for "New Topic" in their assigned subdirectories. That means: t_new.gif for the English "New Topic" to style_images/ipb-001/en and t_new.gif for the German "Neues Thema" to style_images/ipb-001/2.

Skin dependant emoticons, avatars, team icons and mime type icons
This is similar to the last item. Create new subdirectories in the style_images folder of the skin. Name them

and copy the appropriate images into these folders. If a subdirectory does not exist then the default images will be used.

Load Lang Bug
This is not really a bug but a code design bug. In the original version every call to a missing language file results in a blank page. Now you will get an error message.

Mime types icons
For each file extension of allowed uploads create a new icon in html/mime_types like tar.gif, pdf.gif swf.gif etc.

In topic view the attachments will be displayed with the new icons.

Online/Offline
If the member group is allowed to view online/offline state of other members, the state can be displayed in topic view and in message view.

There are 2 new skin files of the mod

The new classes inside these files replace some functions of the original skin files. By example you will find functions RenderRow and Render_msg. I have added new lines:
CODE

{$author['state_on_off']}<br /><br />

and
CODE

<br />{$data['member']['state_on_off']}

If you have a customized skin then you should copy the original function RenderRow (Render_msg) to the mod skin files and insert the lines above.

Then you will find 2 sets with 3 functions

The first set is for macro based displaying the state and the second (outcommented) for text based displaying. You can customize these functions as you like it. Define new macros in ACP for STATE_ONLINE, STATE_ONLINE_ANON and STATE_OFFLINE.

By the way: You will find other functions in the mod skin files replacing functions in original skin files.

Tooltips, message and topic preview - the domTT library
Some new features are based on the domTT library. Here is an installation guide:

Be sure to have copied the domTT library (domTTxxx.js and fadomaticm.js) into the html folder.

Next insert the following code into the boardwrapper in the HEAD section
CODE


   <script language="javascript" type="text/javascript" src="html/domLibm.js"></script>
   <script language="javascript" type="text/javascript" src="html/domTTm.js"></script>

   <script language="javascript" type="text/javascript" src="html/domTT_drag.js"></script>
   <script language="javascript" type="text/javascript" src="html/fadomaticm.js"></script>
   <script language="javaScript" type="text/javascript">
   var domTT_classPrefix = 'domTTOverlib';
   var domTT = 0;
   var domTTs = 0;
   </script>


And last add these css styles to your Style Sheets in ACP
CODE


div.domTT { border: 1px solid #333333; background-color: #333333 }
div.domTT .caption { font-family: serif; font-size: 12px; font-weight: bold; padding: 1px 2px; color: #FFFFFF }
div.domTT a:link { text-decoration: none; color: #FFFFFF }
div.domTT a:visited { text-decoration: none; color: #FFFFFF }
div.domTT a:active { text-decoration: none; color: #0000FF }
div.domTT a:hover { text-decoration: none; color: #FF0000 }
div.domTT .contents { font-size: 11px; font-family: sans-serif; padding: 3px 2px; background-color: #F1F1FF }
div.domTT .contents a:link { text-decoration: none; color: #000000 }
div.domTT .contents a:visited { text-decoration: none; color: #777777 }
div.domTT .contents a:active { text-decoration: none; color: #0000FF }
div.domTT .contents a:hover { text-decoration: none; color: #FF0000 }
div.domTTlegend { border: 1px solid #333333; background-color: #333333 }
div.domTTlegend .caption { font-family: serif; font-size: 12px; font-weight: bold; padding: 1px 2px; color: #FFFFFF }
div.domTTlegend a:link { text-decoration: none; color: #000000 }
div.domTTlegend a:visited { text-decoration: none; color: #000000 }
div.domTTlegend a:active { text-decoration: none; color: #FF0000 }
div.domTTlegend a:hover { color: #FF0000; text-decoration: none }
div.domTTlegend .contents { font-size: 10px; font-family: sans-serif; padding: 3px 2px; background-color: #F1F1FF }



Threaded view
This is a very big modification of our IPB. Therefore we have some modifications of the files in /sources and of the skin files in Skin/. In order to keep the original skin files untouched I have added new skin files:

These files contain new classes with functions replacing original skin functions. If you have a customized skin then you should copy the appropriate functions of your original skin files to the mod skin files.
Do not overwrite the mod skin code but compare the original code with the new code. Find the differences in the Javascript section and in the topic options. I have changed the topic options like report, new poll etc. in a dropdown field. At the end you can find the insert location for the threaded view
CODE

<!--{IBF.TOGGLE_VIEW}-->

In function TableFooter we have
CODE

<div class="tableborder">
       <!--{IBF.THREAD}-->
</div>

If you have problems to fit the mod skin files to your skin feel free to visit our support forum at ibforen.de

In ACP ⇒ System Settings ⇒ Topics, Posts & Polls you can enable thread view as a global option. Forums can have their own thread settings or they can inherit the options from the global settings.

Users can set preferences in their User Control Panel (UserCP).

When everything is ok your members can toggle the view from normal to threaded by clicking on the topic options in the upper right corner of a topic. The thread list will be displayed below of the topic.
Clicking on a line in the thread list will display the thread beginning with the start post and ending with the choosen post. The specific thread is marked in the thread list.

The member selection of the view mode is stored in a cookie to save the choosen mode. In the Personal CP⇒Board Settings members can select the preferred view mode.


New Macros
In order to use the post reply and post quick reply feature you will find new images for the buttons: p_reply.gif and p_qreply.gif. You can use these graphics if you have defined new macros in ACP.
Use this:
Macro key:
CODE

{<P_QREPLY>}

Macro Replacement:
CODE

<img src='style_images/<#IMG_DIR#>/p_qreply.gif' border='0'  alt='Reply quickly to this post' />


Macro key:
CODE

{<P_REPLY>}

Macro Replacement:
CODE

<img src='style_images/<#IMG_DIR#>/p_reply.gif' border='0'  alt='Reply to this post' />
.

Draggable Quick Reply Box with scriptaculous
If you want to let your members drag the quick reply box then I recommend to use the scriptaculous library.



Multi quote
You can enable this feature in ACP ⇒ System Settings ⇒ Topics, Posts & Polls. When activated the behavior of the quote button changes: A click inserts the post into a quote list. A second click removes the post from quote list. Clicking on the reply button inserts the list of quoted posts into the reply textarea.

The quote list is based upon the use of cookies and Javascript. The cookies have a lifetime of 15 Minutes. Submitting the reply process removes the list of cookies.

Attention: IE8 users will run into problems because that browser behaves a little bit strange: If you have not set the cookie domain in ACP ⇒ System Settings ⇒ Cookies then IE8 will not set the cookies for multiquoting. I have tried to handle this as an exception but you should set the domain like .your_domain.com. Do not forget the leading point.

Page links
Modify function make_page_jump in skin_global.php. Wrap the a-tag with
CODE

<span class='page_link'><a ...>..</a></span>

It will look like this:
CODE

function make_page_jump($tp="", $pp="", $ub="", $p) {
global $ibforums;
return <<<EOF
<span class='page_link' ><a title="{$ibforums->lang['tpl_jump']}" href="javascript:multi_page_jump('$ub',$tp,$pp);">$p {$ibforums->lang['tpl_pages']}</a></span>
EOF;
}


Now you can customize the page links. The topic_page_link style is used in forum view for the topic items. For the standard IPB skin add these css styles to your Style Sheets in ACP
CODE


.page_link {border:1px solid #8FA8C4;padding-left:5px;padding-right:5px;padding-top:2px;padding-bottom:2px;background-color: #F1F7FE;}
.page_link a:link,
.page_link a:visited,
.page_link a:active{text-decoration: none;color:#000000;}
.page_link_active {font-weight:bold;border:1px solid #345487; padding:5px;padding-top:4px;padding-bottom:4px;background-color:  #FFCCCC;}
.topic_page_link {border:1px solid #C2C2DF;padding-left:3px;padding-right:3px;padding-top:0px;padding-bottom:0px;background-color: #DFE6EF;}
.topic_page_link a:link,
.topic_page_link a:visited,
.topic_page_link a:active{text-decoration: none;color:#000000;}


If you want a space between the page symbols add a margin:..px; to the styles.

Request System
As described in the change log above this release implements a request system. User requests appear in ACP and the administrators can process those requests.


Profile Fields
You will find a new option in ACP ⇒ Users and Groups ⇒ Profile Fields: Make Profile Fields searchable in member search.
Now you can customize the location of profile fields: In the original version you could place the custom profile fields by inserting <!--{CUSTOM.FIELDS}--> into skin_profile.php. In the new version you can use
<--{CUSTOM.FIELDS}--> or <!--{CUSTOM.FIELD_1}--> or <!--{CUSTOM.FIELD_2}--> etc. according to the number of profile field in ACP.

Report System
In ACP ⇒ System Settings ⇒ Security & Privacy you will find a new option below of 'Disable 'Report this post to a moderator' link?': 'Report this post' as PM?
If activated report messsages are sent as email and as personal message in order to improve notification about reports.

Guidelines and Terms of Use
New in ACP ⇒ Board Guidelines: Board guidelines are language dependent and stored in lang_glines.php. The dialogue includes fields for editing the Terms of Use in registration process.
Now you can use genuine html for board guidelines and terms of use.

 6.  Comment

This modification updates your Invisionboard 1.3.1 and adds all security code known after release date of 1.3.1. It adds more essential features e.g. like relative dates etc.

If you want to apply this update package to IPB 1.3, you have first to update that version to IPB 1.3.1. At ibforen.de you can find instructions how to fix this.

 7.  Older Change History and Change Logs

2.5.1 ⇒ 2.5.2, dated on August 24th, 2009


2.5.0 ⇒ 2.5.1, dated on March 29th, 2009


2.4.5 ⇒ 2.5.0, dated on February 23th, 2009
Reinstall completely: Replace all mod files in sources/mods and the language files. New skin file is to be copied in all skin folders. Run my ModInstaller.

2.4.4 ⇒ 2.4.5, dated on April 28th, 2008


2.4.3 ⇒ 2.4.4, dated on April 15th, 2008


2.4.2 ⇒ 2.4.3, dated on February 6th, 2008


2.4.1 ⇒ 2.4.2, dated on September 5th, 2007


2.4.0 ⇒ 2.4.1, dated on August 9th, 2007


2.3.4 ⇒ 2.4.0, dated on August 3rd, 2007


User Mode

Admin Mode

Security fixes


2.3.3 ⇒ 2.3.4, dated on June 15th, 2007


2.3.2 ⇒ 2.3.3, dated on May 17th, 2007


2.3.1 ⇒ 2.3.2, dated on May 16th, 2007


2.3.0 ⇒ 2.3.1, dated on January 8th, 2007


2.2.9 ⇒ 2.3.0, dated on December 4rd, 200


2.2.8 ⇒ 2.2.9 , dated on November 26th, 2006


2.2.7 ⇒ 2.2.8 , dated on November 3rd, 2006


2.2.6.2 ⇒ 2.2.7 , dated on September 26th, 2006


2.2.6.1 ⇒ 2.2.6.2 , dated on September 25th, 2006


2.2.6 ⇒ 2.2.6.1 , dated on September 24th, 2006


2.2.5 ⇒ 2.2.6 , dated on September 20th, 2006


2.2.4 ⇒ 2.2.5 , dated on May, 26th 2006


2.2.3 ⇒ 2.2.4 , dated on May, 25th 2006


2.2.2 ⇒ 2.2.3 , dated on May, 10th 2006


2.2.1 ⇒ 2.2.2 , dated on April, 28th 2006


2.2 ⇒ 2.2.1 , dated on April, 27th 2006


2.1.1 ⇒ 2.2 , dated on April, 26th 2006


2.1 ⇒ 2.1.1 , dated on March, 23th 2006


2.0.1 ⇒ 2.1 , dated on March, 5th 2006


2.0 ⇒ 2.0.1 , dated on March, 3th 2006


2.0 ⇒ 2.0.1 , dated on March, 3th 2006


2.0 , dated on February, 29th 2006
Only available for IPB 1.3.1. Make your IPB 1.3 ready for this mod

1.4.1 ⇒ 1.5 , dated on November, 23th 2005


1.4 ⇒ 1.4.1 , dated on October, 12th 2005


1.3 ⇒ 1.4 , dated on September, 2th 2005


1.2 ⇒ 1.3 , dated on May, 10th 2005


1.1 ⇒ 1.2 , dated on April, 27th 2005


1.0 ⇒ 1.1 , dated on April, 25th 2005


Version 1.0 , dated on April, 19th 2005