Security Fixes, Updates And Enhancements For IPB 1.3.1, Part C  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_C/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/Admin/admin_functions.php admin_functions(..)
sources/Admin/admin_functions.php build_jump_menu(..)
sources/Admin/admin_functions.php build_tree(..)
sources/Admin/admin_functions.php class properties or methods
sources/Admin/admin_functions.php done_screen(..)
sources/Admin/admin_functions.php get_date(..)
sources/Admin/admin_pages.php body
sources/Admin/admin_skin.php admin_skin(..)
sources/Admin/admin_skin.php class properties or methods
sources/Admin/admin_skin.php frame_set(..)
sources/Admin/admin_skin.php get_css(..)
sources/Admin/admin_skin.php js_template_tools(..)
sources/Admin/admin_skin.php make_page_jump(..)
sources/Admin/admin_skin.php menu_cat_expanded(..)
sources/Admin/admin_skin.php menu_top(..)
sources/Admin/admin_skin.php print_top(..)
sources/Admin/ad_forums.php delete_form(..)
sources/Admin/ad_forums.php dosubdelete(..)
sources/Admin/ad_forums.php do_new(..), do_edit(..), doeditsub(..)
sources/Admin/ad_forums.php edit_form(..)
sources/Admin/ad_forums.php edit_form(..), subedit(..)
sources/Admin/ad_forums.php new_form(..)
sources/Admin/ad_forums.php subdeleteform(..)
sources/Admin/ad_forums.php subedit(..)
sources/Admin/ad_groups.php do_delete(..)
sources/Admin/ad_groups.php group_form(..)
sources/Admin/ad_groups.php save_group(..)
sources/Admin/ad_imagemacros.php export(..)
sources/Admin/ad_imagemacros.php show_macros(..)
sources/Admin/ad_index.php index_page(..)
sources/Admin/ad_languages.php ad_langs(..)
sources/Admin/ad_languages.php class properties or methods
sources/Admin/ad_languages.php do_form(..)
sources/Admin/ad_languages.php show_file(..)
sources/Admin/ad_member.php change_name_complete(..)
sources/Admin/ad_member.php change_name_start(..)
sources/Admin/ad_member.php delete_lookup_form(..)
sources/Admin/ad_member.php dodelete(..)
sources/Admin/ad_member.php dodelete(..), do_edit_form(..)
sources/Admin/ad_member.php domod(..)
sources/Admin/ad_member.php doprune(..)
sources/Admin/ad_member.php do_add(..)
sources/Admin/ad_member.php do_advanced_search(..)
sources/Admin/ad_member.php do_bulk_mail(..)
sources/Admin/ad_member.php temp_ban_complete(..)
sources/Admin/ad_member.php temp_ban_start(..)
sources/Admin/ad_moderator.php add_two(..)
sources/Admin/ad_prefs.php ad_prefs(..)
sources/Admin/ad_prefs.php get_html(..)
sources/Admin/ad_profilefields.php ad_fields(..)
sources/Admin/ad_profilefields.php main_form(..)
sources/Admin/ad_profilefields.php main_save(..)
sources/Admin/ad_profilefields.php main_screen(..)
sources/Admin/ad_remote_template.php print_css_searchlinks(..), print_searchlinks(..)
sources/Admin/ad_settings.php ad_settings(..)
sources/Admin/ad_settings.php avatars(..)
sources/Admin/ad_settings.php class properties or methods
sources/Admin/ad_settings.php dates(..)
sources/Admin/ad_settings.php do_guidelines(..)
sources/Admin/ad_settings.php guidelines(..)
sources/Admin/ad_settings.php pm(..)
sources/Admin/ad_settings.php post(..)
sources/Admin/ad_settings.php secure(..)
sources/Admin/ad_settings.php upload_emoticon(..)
sources/Admin/ad_settings.php url(..)
sources/Admin/ad_skin_import.php set_import(..), safe_set_import(..)
sources/Admin/ad_stylesets.php list_sets(..)
sources/Admin/ad_stylesets.php list_sets(..), list_sets(..)
sources/Admin/ad_templates.php checkcheckall(..), edit_bit(..)
sources/Admin/ad_templates.php do_edit(..)
sources/Admin/ad_templates.php do_form(..)
sources/Admin/ad_templates.php edit_bit(..)
sources/Admin/ad_templates.php list_current(..), list_current(..)
sources/Admin/ad_templates.php pop_win(..)
sources/Admin/ad_templates.php show_cats(..)
sources/Admin/ad_templates.php upload_form(..), show_cats(..), edit_bit(..)

 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/Admin/ad_forums.php

  A. Find in function subdeleteform(..)

        $DB->query("SELECT c.id, c.name, f.id as forum_id, f.subwrap, f.name as forum_name, f.parent_id, f.category FROM ibf_categories c, ibf_forums f WHERE c.id > 0 ORDER BY c.position, f.position");

     Insert above the blue code



//-- mod_sec_update_131 begin
        $DB->query("SELECT name, subwrap, sub_can_post FROM ibf_forums WHERE id = '{$IN['f']}'");
        if (!$DB->get_num_rows()) {
            $ADMIN->error("Could not determine the forum ID to delete.");
        }
        $r = $DB->fetch_row();
        $name = $r['name'];
        $subwrap = $r['subwrap'];
        $sub_can_post = $r['sub_can_post'];
        if ($subwrap && $sub_can_post) {
            $query = "SELECT f.id, f.name, f.parent_id, f.subwrap, f.sub_can_post, c.id as cat_id, c.name as cat
                        FROM ibf_forums f
                        LEFT JOIN ibf_categories c ON (c.id=f.category)
                        WHERE f.redirect_on <> 1
                        ORDER BY c.position, c.id, f.position, f.id";
            $DB->query($query);
            if ($DB->get_num_rows()) {
                $cats = array();
                $forums = array();
                $children = array();
                while ($r = $DB->fetch_row()) {
                    if ($IN['f'] == $r['id']) {
                        $name = $r['name'];
                        continue;
                    }
                    $forums[$r['cat_id']][$r['id']] = $r;
                    if ($r['parent_id'] != -1)
                        $children[$r['parent_id']][$r['id']] = $r;
                    if ($last_cat_id != $r['cat_id']) {
                        $cats[$r['cat_id']] = $r['cat'];
                        $last_cat_id = $r['cat_id'];
                    }
                }
                $post_form .= "<select name='MOVE_ID_F' class='dropdown'>\n";
                foreach ($cats as $cat_id => $cat) {
                    if (count($forums[$cat_id])) {
                        $post_form .= "<optgroup label='$cat'>\n";
                        foreach ($forums[$cat_id] as $fid => $forum) {
                            if ($forum['parent_id'] != -1)
                                continue;
                            if ($forum['subwrap'] && count($children[$fid])) {
                                if (!$forum['sub_can_post']) {
                                    $post_form .= "<optgroup label='&nbsp;&nbsp;&nbsp;{$forum['name']}'>\n";
                                }
                                else {
                                    $post_form .= "<option value='$fid' label='&nbsp;&nbsp;&nbsp;{$forum['name']}'>&nbsp;&nbsp;&nbsp;{$forum['name']}</option>\n";
                                }
                                foreach ($children[$fid] as $cid => $child) {
                                    $post_form .= "<option value='$cid' label='&nbsp;&nbsp;&nbsp;{$child['name']}'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$child['name']}</option>\n";
                                }
                                if (!$forum['sub_can_post']) {
                                    $post_form .= "</optgroup>\n";
                                }
                            }
                            else
                                $post_form .= "<option value='$fid' label='&nbsp;&nbsp;&nbsp;{$forum['name']}'>&nbsp;&nbsp;&nbsp;{$forum['name']}</option>\n";
                            }
                        $post_form .= "</optgroup>\n";
                    }
                }
                $post_form .= "</select>\n";
                unset ($cats);
                unset ($forums);
                unset ($children);
            }
        }
        $query = "SELECT id, name
                    FROM ibf_categories
                    ORDER BY position, id";
        $DB->query($query);
        $cats = array();
        if ($DB->get_num_rows()) {
            while ($r = $DB->fetch_row()) {
                $cats[$r['id']] = $r['name'];
            }
        }
        $query = "SELECT id, name, category 
                    FROM ibf_forums
                    WHERE parent_id = -1 AND redirect_on <> 1 AND id <> '{$IN['f']}'
                    ORDER BY category, position";
        $DB->query($query);
        $forums = array();
        if ($DB->get_num_rows()) {
            while ($r = $DB->fetch_row()) {
                $forums[$r['category']][$r['id']] = $r['name'];
            }
            $cat_form .= "<select name='MOVE_ID' class='dropdown'>\n";
            foreach ($cats as $cat_id => $cat) {
                $cat_form .= "<option value='c_{$cat_id}' style='font-weight:bold;font-style:italic;'>$cat</option>\n";
                if (count($forums[$cat_id])) {
                    foreach ($forums[$cat_id] as $fid => $forum) {
                        $cat_form .= "<option value='c_{$cat_id}_f_{$fid}'>&nbsp;&nbsp;&nbsp;$forum</option>\n";
                    }
                }
            }
            $cat_form .= "</select>\n";
            unset ($cats);
            unset ($forums);
        }
//-- mod_sec_update_131 end

/*-- mod_sec_update_131 exclude begin


        $DB->query("SELECT c.id, c.name, f.id as forum_id, f.subwrap, f.name as forum_name, f.parent_id, f.category FROM ibf_categories c, ibf_forums f WHERE c.id > 0 ORDER BY c.position, f.position");

  B. Find in function subdeleteform(..)

        $ADMIN->page_title = "Removing Sub

     Insert above the blue code



-- mod_sec_update_131 exclude end */


        $ADMIN->page_title = "Removing Sub

  C. Find in function subdeleteform(..)

        $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code'  , 'dosubdelete'),

     Insert above the blue code



//-- mod_sec_update_131 begin
        $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code'  , 'dosubdelete'),
                                                  2 => array( 'act'   , 'forum'     ),
                                                  3 => array( 'f'     , $IN['f']  ),
                                                  4 => array( 'name'  , $name ),
                                            ) );
        $SKIN->td_header[] = array( "&nbsp;"  , "40%" );
        $SKIN->td_header[] = array( "&nbsp;"  , "60%" );
        $ADMIN->html .= $SKIN->start_table( "Required" );
        $ADMIN->html .= $SKIN->add_td_row( array( "<b>Forum to remove: </b>" , $name )      );
        if ($subwrap && $sub_can_post)
            $ADMIN->html .= $SKIN->add_td_row( array( "<b>Move all <i>existing topics and posts in this forum</i> to which forum?</b>" ,
                                                      $post_form
                                             )      );
        $ADMIN->html .= $SKIN->add_td_row( array( "<b>Move all <i>existing subforums in this forum</i> to which parent?</b>" ,
                                                  $cat_form
                                         )      );
        $ADMIN->html .= $SKIN->end_form("Move sub forums and remove this forum");
        $ADMIN->html .= $SKIN->end_table();
        $ADMIN->output();
//-- mod_sec_update_131 end


        $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code'  , 'dosubdelete'),

  D. Find in function dosubdelete(..)

            $parent = preg_replace( "/^f_/", "", $IN['MOVE_ID'] );

     Insert below the blue code

            $parent = preg_replace( "/^f_/", "", $IN['MOVE_ID'] );



//-- mod_sec_update_131 begin
            $cat =    preg_replace( "/^c_(\d+).*$/e", "\\1", $IN['MOVE_ID'] );
            $parent = preg_replace( "/^c.*_/e", "", $IN['MOVE_ID'] );
//-- mod_sec_update_131 end


  E. Find in function dosubdelete(..)

        // Move sub forums...

     Insert above the blue code



//-- mod_sec_update_131 begin
        $DB->query("UPDATE ibf_forums SET category='$cat', parent_id='$parent' WHERE parent_id='".$IN['f']."'");
        $DB->query("DELETE FROM ibf_forums WHERE id='".$IN['f']."'");
        $DB->query("DELETE FROM ibf_moderators WHERE forum_id='".$IN['f']."'");
        if ($parent != -1) {
            $DB->query("UPDATE ibf_forums SET subwrap=1 WHERE id='".$IN['MOVE_ID']."'");
        }
        if (isset($IN['MOVE_ID_F'])) {
            $DB->query("UPDATE ibf_topics SET forum_id='".$IN['MOVE_ID_F']."' WHERE forum_id='".$IN['f']."'");
            $DB->query("UPDATE ibf_posts SET forum_id='".$IN['MOVE_ID_F']."' WHERE forum_id='".$IN['f']."'");
            $DB->query("UPDATE ibf_polls SET forum_id='".$IN['MOVE_ID_F']."' WHERE forum_id='".$IN['f']."'");
            $DB->query("UPDATE ibf_voters SET forum_id='".$IN['MOVE_ID_F']."' WHERE forum_id='".$IN['f']."'");
            $this->recount($IN['MOVE_ID_F']);
        }
        $ADMIN->save_log("Removed sub-forum '{$IN['name']}'");

        $ADMIN->done_screen("Forum Removed", "Forum Control", "act=cat" );
//-- mod_sec_update_131 end


        // Move sub forums...

  F. Find in function delete_form(..)

        $DB->query("SELECT id, name FROM ibf_forums ORDER BY position");

     Insert above the blue code



//-- mod_sec_update_131 begin
        $query = "SELECT f.id, f.name, f.parent_id, f.subwrap, f.sub_can_post, c.id as cat_id, c.name as cat
                    FROM ibf_forums f
                    LEFT JOIN ibf_categories c ON (c.id=f.category)
                    WHERE f.redirect_on <> 1
                    ORDER BY c.position, c.id, f.position, f.id";
        $DB->query($query);
        if ($DB->get_num_rows()) {
            $cats = array();
            $forums = array();
            $children = array();
            while ($r = $DB->fetch_row()) {
                if ($IN['f'] == $r['id']) {
                    $name = $r['name'];
                    continue;
                }
                $forums[$r['cat_id']][$r['id']] = $r;
                if ($r['parent_id'] != -1)
                    $children[$r['parent_id']][$r['id']] = $r;
                if ($last_cat_id != $r['cat_id']) {
                    $cats[$r['cat_id']] = $r['cat'];
                    $last_cat_id = $r['cat_id'];
                }
            }
            $form .= "<select name='MOVE_ID' class='dropdown'>\n";
            foreach ($cats as $cat_id => $cat) {
                if (count($forums[$cat_id])) {
                    $form .= "<optgroup label='$cat'>\n";
                    foreach ($forums[$cat_id] as $fid => $forum) {
                        if ($forum['parent_id'] != -1)
                            continue;
                        if ($forum['subwrap'] && count($children[$fid])) {
                            if (!$forum['sub_can_post']) {
                                $form .= "<optgroup label='&nbsp;&nbsp;&nbsp;{$forum['name']}'>\n";
                            }
                            else {
                                $form .= "<option value='$fid' label='&nbsp;&nbsp;&nbsp;{$forum['name']}'>&nbsp;&nbsp;&nbsp;{$forum['name']}</option>\n";
                            }
                            foreach ($children[$fid] as $cid => $child) {
                                $form .= "<option value='$cid' label='&nbsp;&nbsp;&nbsp;{$child['name']}'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$child['name']}</option>\n";
                            }
                            if (!$forum['sub_can_post']) {
                                $form .= "</optgroup>\n";
                            }
                        }
                        else
                            $form .= "<option value='$fid' label='&nbsp;&nbsp;&nbsp;{$forum['name']}'>&nbsp;&nbsp;&nbsp;{$forum['name']}</option>\n";
                        }
                    $form .= "</optgroup>\n";
                }
            }
            $form .= "</select>\n";
            unset ($cats);
            unset ($forums);
            unset ($children);
        }
//-- mod_sec_update_131 end

/*-- mod_sec_update_131 exclude begin


        $DB->query("SELECT id, name FROM ibf_forums ORDER BY position");

  G. Find in function delete_form(..)

        $ADMIN->page_title = "Removing forum '$name'";

     Insert above the blue code



-- mod_sec_update_131 exclude end */


        $ADMIN->page_title = "Removing forum '$name'";

  H. Find in function delete_form(..)

                                                  $SKIN->form_dropdown( "MOVE_ID", $form_array )

     Insert above the blue code



//-- mod_sec_update_131 begin
    TRUE?$form:
//-- mod_sec_update_131 end


                                                  $SKIN->form_dropdown( "MOVE_ID", $form_array )

  I. Find in function new_form(..)

                                                  $SKIN->form_dropdown("CATEGORY", $cats)
                                         )      );

     Insert below the blue code

                                                  $SKIN->form_dropdown("CATEGORY", $cats)
                                         )      );



//-- mod_sec_update_131 begin
        $this->lang = $std->load_words($this->lang, 'mod_sec_update_ad_lang', $ADMIN->lang_id);
        $this->lang['topic_thread_options'] = str_replace("{url}", $SKIN->base_url."&act=op&code=post", $this->lang['topic_thread_options']); 
        $options[] = array(0, $this->lang['topic_thread_options_not_allowed']);
        $options[] = array(1, $this->lang['topic_thread_options_allowed_global']);
        $options[] = array(2, $this->lang['topic_thread_options_allowed_normal']);
        $options[] = array(3, $this->lang['topic_thread_options_allowed_thread']);
        $ADMIN->html .= $SKIN->add_td_basic( $this->lang['topic_thread_title'], 'left', 'catrow2' );
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['topic_thread_options'] ,
                                                  $SKIN->form_dropdown("topic_thread", $options, $forum['topic_thread'] )
                                         )      );
//-- mod_sec_update_131 end


  J. Find in function edit_form(..)

                                                  $SKIN->form_dropdown("CATEGORY", $cats, $real_parent)
                                         )      );

     Insert below the blue code

                                                  $SKIN->form_dropdown("CATEGORY", $cats, $real_parent)
                                         )      );



//-- mod_sec_update_131 begin
        $this->lang = $std->load_words($this->lang, 'mod_sec_update_ad_lang', $ADMIN->lang_id);
        $this->lang['topic_thread_options'] = str_replace("{url}", $SKIN->base_url."&act=op&code=post", $this->lang['topic_thread_options']); 
        $options[] = array(0, $this->lang['topic_thread_options_not_allowed']);
        $options[] = array(1, $this->lang['topic_thread_options_allowed_global']);
        $options[] = array(2, $this->lang['topic_thread_options_allowed_normal']);
        $options[] = array(3, $this->lang['topic_thread_options_allowed_thread']);
        $ADMIN->html .= $SKIN->add_td_basic( $this->lang['topic_thread_title'], 'left', 'catrow2' );
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['topic_thread_options'] ,
                                                  $SKIN->form_dropdown("topic_thread", $options, $forum['topic_thread'] )
                                         )      );
//-- mod_sec_update_131 end


  K. Find in function subedit(..)

                                                  $SKIN->form_dropdown("CATEGORY", $cats, $forum['category'])
                                         )      );

     Insert below the blue code

                                                  $SKIN->form_dropdown("CATEGORY", $cats, $forum['category'])
                                         )      );



//-- mod_sec_update_131 begin
        $this->lang = $std->load_words($this->lang, 'mod_sec_update_ad_lang', $ADMIN->lang_id);
        $this->lang['topic_thread_options'] = str_replace("{url}", $SKIN->base_url."&act=op&code=post", $this->lang['topic_thread_options']); 
        $options[] = array(0, $this->lang['topic_thread_options_not_allowed']);
        $options[] = array(1, $this->lang['topic_thread_options_allowed_global']);
        $options[] = array(2, $this->lang['topic_thread_options_allowed_normal']);
        $options[] = array(3, $this->lang['topic_thread_options_allowed_thread']);
        $ADMIN->html .= $SKIN->add_td_basic( $this->lang['topic_thread_title'], 'left', 'catrow2' );
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['topic_thread_options'] ,
                                                  $SKIN->form_dropdown("topic_thread", $options, $forum['topic_thread'] )
                                         )      );
//-- mod_sec_update_131 end


  L. Find in function new_form(..)

                                                  $SKIN->form_yes_no("inc_postcount", 1 )
                                         )      );

     Insert below the blue code

                                                  $SKIN->form_yes_no("inc_postcount", 1 )
                                         )      );



//-- mod_sec_update_131 begin
        $edit_time = "<span id='edit_time' style='display:none'>".$this->lang['forum_edit_time']."&nbsp;".$SKIN->form_simple_input("edit_time", $forum['edit_time'], "5")."</span>";
        $js = "onChange='javascript:if (this.options[this.selectedIndex].value==1) document.getElementById(\"edit_time\").style.display=\"inline\"; else document.getElementById(\"edit_time\").style.display=\"none\"'";
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['forum_editable'],
                                                  $SKIN->form_dropdown("editable", array(
                                                                                       0 => array( "global",    $this->lang['forum_editable_global']),
                                                                                       1 => array( "overwrite", $this->lang['forum_editable_overwrite']),
                                                                                       2 => array( "always",    $this->lang['forum_editable_always']),
                                                                                         ),
                                                                                  0, $js ).$edit_time
                                         )      );
//-- mod_sec_update_131 end


  M. Find in function edit_form(..), subedit(..)

                                                  $SKIN->form_yes_no("inc_postcount", $forum['inc_postcount'] )
                                         )      );

     Insert below the blue code

                                                  $SKIN->form_yes_no("inc_postcount", $forum['inc_postcount'] )
                                         )      );



//-- mod_sec_update_131 begin
        if ($forum['editable'] == "overwrite") $display = "inline"; else $display = "none";
        $edit_time = "<span id='edit_time' style='display:$display'>".$this->lang['forum_edit_time']."&nbsp;".$SKIN->form_simple_input("edit_time", $forum['edit_time'], "5")."</span>";
        $js = "onChange='javascript:if (this.options[this.selectedIndex].value==\"overwrite\") document.getElementById(\"edit_time\").style.display=\"inline\"; else document.getElementById(\"edit_time\").style.display=\"none\"'";
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['forum_editable'],
                                                  $SKIN->form_dropdown("editable", array(
                                                                                       0 => array( "global",    $this->lang['forum_editable_global']),
                                                                                       1 => array( "overwrite", $this->lang['forum_editable_overwrite']),
                                                                                       2 => array( "always",    $this->lang['forum_editable_always']),
                                                                                         ),
                                                                                  $forum['editable'], $js ).$edit_time
                                         )      );
//-- mod_sec_update_131 end


  N. Find in function do_new(..), do_edit(..), doeditsub(..)

                                                            'notify_modq_emails'=> $IN['notify_modq_emails'],

     Insert below the blue code

                                                            'notify_modq_emails'=> $IN['notify_modq_emails'],



//-- mod_sec_update_131 begin
                                                            'topic_thread'      =>  intval($IN['topic_thread']),
                                                            'editable'          =>  $IN['editable'], 
                                                            'edit_time'         =>  intval($IN['edit_time']), 
//-- mod_sec_update_131 end



Step  2:  Open sources/Admin/ad_imagemacros.php

  A. Find in function show_macros(..)

        $DB->query("SELECT * from ibf_macro WHERE macro_set='".$IN['id']."'");

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (is_dir(ROOT_PATH."style_images/".$skin['img_dir']."/".$ADMIN->lang_id) )
            $skin['img_dir'] .= "/".$ADMIN->lang_id;
        if (TRUE)
            $DB->query("SELECT * from ibf_macro WHERE macro_set='".$IN['id']."' ORDER BY macro_value");
        else
//-- mod_sec_update_131 end


        $DB->query("SELECT * from ibf_macro WHERE macro_set='".$IN['id']."'");

  B. Find in function export(..)

        $DB->query("SELECT macro_replace, macro_value FROM ibf_macro WHERE macro_set='".$IN['id']."'");

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (TRUE)
            $DB->query("SELECT * from ibf_macro WHERE macro_set='".$IN['id']."' ORDER BY macro_value");
        else
//-- mod_sec_update_131 end


        $DB->query("SELECT macro_replace, macro_value FROM ibf_macro WHERE macro_set='".$IN['id']."'");


Step  3:  Open sources/Admin/ad_groups.php

  A. Find in function save_group(..)

            if ($IN['id'] == $INFO['admin_group'] and $IN['g_access_cp'] != 1)

     Insert above the blue code



//-- mod_sec_update_131 begin
            if ($INFO['admin_group'] == $IN['id']) {
                if ($MEMBER['mgroup'] != $INFO['admin_group'])
                    $ADMIN->error("Sorry, you are unable to edit that group as it's the root admin group");
            }
//-- mod_sec_update_131 end


            if ($IN['id'] == $INFO['admin_group'] and $IN['g_access_cp'] != 1)

  B. Find in function group_form(..)

        $prefix = preg_replace( "/'/", "&#39;", $group['prefix'] );

     Insert above the blue code



//-- mod_sec_update_131 begin
        $group['prefix'] = preg_replace( "/&/", "&#38;" , $group['prefix']);
        $group['suffix'] = preg_replace( "/&/", "&#38;" , $group['suffix']);
//-- mod_sec_update_131 end


        $prefix = preg_replace( "/'/", "&#39;", $group['prefix'] );

  C. Find in function do_delete(..)

        if ( $DB->get_num_rows() != 2 )
        {
            $ADMIN->error("Could not resolve the ID's passed to group deletion");
        }

     Insert below the blue code

        if ( $DB->get_num_rows() != 2 )
        {
            $ADMIN->error("Could not resolve the ID's passed to group deletion");
        }



//-- mod_sec_update_131 begin
        if ($INFO['admin_group'] == $IN['id']) {
            $ADMIN->error("You can not delete the preset groups. You can rename them and edit the functionality");
        }
        if ($INFO['admin_group'] == $IN['to_id']) {
            if ($MEMBER['mgroup'] != $INFO['admin_group'])
                $ADMIN->error("You can not move members to this group.");
        }
//-- mod_sec_update_131 end


  D. Find in function save_group(..)

        if ($type == 'edit')
        {
            $rstring = $DB->compile_db_update_string( $db_string );

     Insert above the blue code



//-- mod_sec_update_131 begin
        $db_string['g_acp_perms'] = base64_decode($IN['g_acp_perms']);
        $db_string['g_can_view_online'] = intval($IN['g_can_view_online']);
        $db_string['g_can_view_on_off'] = intval($IN['g_can_view_on_off']);
//-- mod_sec_update_131 end


        if ($type == 'edit')
        {
            $rstring = $DB->compile_db_update_string( $db_string );

  E. Find in function group_form(..)

                                                  $SKIN->form_yes_no("g_access_offline", $group['g_access_offline'] )
                                         )      );

     Insert below the blue code

                                                  $SKIN->form_yes_no("g_access_offline", $group['g_access_offline'] )
                                         )      );



//-- mod_sec_update_131 begin
        $this->lang = $std->load_words($this->lang, 'mod_sec_update_ad_lang', $ADMIN->lang_id);
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['ad_group_can_view_online_list'],
                                                  $SKIN->form_yes_no("g_can_view_online", $group['g_can_view_online'] )
                                         )      );
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['ad_group_can_view_on_off'],
                                                  $SKIN->form_yes_no("g_can_view_on_off", $group['g_can_view_on_off'] )
                                         )      );
//-- mod_sec_update_131 end


  F. Find in function group_form(..)

                                                  $SKIN->form_yes_no("g_access_cp", $group['g_access_cp'] )

     Insert below the blue code

                                                  $SKIN->form_yes_no("g_access_cp", $group['g_access_cp'] )



//-- mod_sec_update_131 begin
        ."
            <script language='Javascript' type='text/javascript'>
                <!--
                function acp_perm_pop() {
                    url = '{$ADMIN->base_url}&act=sec_update&code=acp_perms&id={$IN['id']}&perms=' + document.adform.g_acp_perms.value;
                    w = window.open(url, 'ACP_PERMISSIONS', 'width=700,height=450,top=0,left=0,resizable=yes,scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,dependent=yes');
                    w.focus();
                    return false;
                 }
                //-->
            </script>
        &nbsp;&nbsp;&nbsp;<a href='javascript:void(0);' onClick='return acp_perm_pop();' style='text-decoration:none;'><button id='button' style='cursor:pointer;color:red;font-weight:bold'>{$this->lang['ad_tuning_access']}</button></a>
        <textarea name='g_acp_perms' style='display:none;' readonly='readonly'>".base64_encode($group['g_acp_perms'])."</textarea>
        "
//-- mod_sec_update_131 end



Step  4:  Open sources/Admin/ad_index.php

  A. Find in function index_page(..)

            unset($$k);
        }

     Insert below the blue code

            unset($$k);
        }



//-- mod_sec_update_131 begin
        global $_SET_PCRE;
        if (!$_SET_PCRE) {
            $limit = intval(@ini_get("pcre.backtrack_limit"));
            if ($limit > -1 && $limit <= 100000) {
                $_SET_PCRE = 1;
                @ini_set("pcre.backtrack_limit", "1000000");
            }
            $limit = intval(@ini_get("pcre.recursion_limit"));
            if ($limit > -1 && $limit <= 100000) {
                $_SET_PCRE = 1;
                @ini_set("pcre.recursion_limit", "1000000");
            }
        }
        if (!$INFO['set_pcre'] || ($INFO['set_pcre'] != $_SET_PCRE)) {
            $INFO = $ADMIN->rebuild_config(array('set_pcre' => $_SET_PCRE));
        }
//-- mod_sec_update_131 end


  B. Find in function index_page(..)

$ad_notes = "<form action='{$ADMIN->base_url}&act=index&save=1' method='post'>

     Insert above the blue code



//-- mod_sec_update_131 begin
        $notes['cs_value'] = $std->clean_value($notes['cs_value']);
        $notes['cs_value'] = str_replace("<br>", "\n", $notes['cs_value']);
//-- mod_sec_update_131 end


$ad_notes = "<form action='{$ADMIN->base_url}&act=index&save=1' method='post'>

  C. Find in function index_page(..)

        // Printy-poos
        //---------------------------------

     Insert below the blue code

        // Printy-poos
        //---------------------------------



//-- mod_sec_update_131 begin
        $lang = $std->load_words($lang, "mod_sec_update_ad_lang", $ADMIN->lang_id);
        $version_info = "<b><a href='http://www.php.net' target='_blank'>PHP</a> {$lang['version']}:</b> $phpv<br /> <b><a href='http://www.mysql.com' target='_blank'>MySQL</a> {$lang['version']}:</b> ".$this->mysql_version;
        if (!$INFO['not_get_update_info']) {
            $my_version = 0;
            $DB->query("SHOW TABLES FROM `{$DB->obj['sql_database']}` LIKE '{$DB->obj['sql_tbl_prefix']}mods'");
            if (!$DB->get_num_rows()) {
                $my_version_info = "<br /><span style='color:red;font-weight:bold;font-size:12pt'>{$lang['no_installer']}</span>";
            }
            else {
                $DB->query("SELECT version FROM ibf_mods WHERE mod_token='mod_sec_update_131'");
                if (!$DB->get_num_rows()) {
                    $my_version_info = "<span style='color:red;font-weight:bold;font-size:12pt'>{$lang['mod_not_installed']}</span>";
                }
                else {
                    $r = $DB->fetch_row();
                    $my_version_info = "<span style='color:black;font-weight:bold;font-size:12pt'>".$r['version']."</span>";
                    $my_version = $r['version'];
                }
            }
            $errno = 0;
            $errstr = "";
            $url = parse_url("http://www.ibforen.de/forum/update_info.php?version=".$my_version);
            $url['query'] = str_replace("&amp;", "&", $url['query']);
            $fp = @fsockopen ($url['host'], 80, $errno, $errstr, 3);
            if ($fp && !$errno && !$errstr) {
                @fwrite ($fp, "GET {$url['path']}?{$url['query']}#{$url['fragment']} HTTP/1.0\r\nHost: {$url['host']}\r\n\r\n");
                while (!feof($fp)) {
                    $update .= @fgets($fp,1024);
                }
                @fclose($fp);
                $update = explode("\n", $update);
                $update_info[1] = array_pop($update);
                $update_info[0] = array_pop($update);
                unset($update);
            }
            if (!is_array($update_info))
                $update_version_info = $lang['no_updates'];
            else {
                $size = "12pt";
                $color = "blue";
                $update_version = trim($update_info[0]);
                $update_version_info = $update_version;
                if (!$update_version)
                    $update_version_info = $my_version;
                if (isset($update_info[1]))
                    $update_version_info = "<a href='".trim($update_info[1])."' target='_blank' style='color:{color};font-size:{size};font-weight:bold;' title='{$lang['goto_updates']}'>$update_version_info</a>";
                $update_version_info = "<span style='color:{color};font-size:{size};font-weight:bold;'>$update_version_info</span>";
                if ($update_version) {
                    $size = "18pt";
                    $color = "red";
                }
                $update_version_info = str_replace("{color}", $color, $update_version_info);
                $update_version_info = str_replace("{size}", $size, $update_version_info);
            }
            $update_html = "
                        <div style='border:1px dotted #555;padding:6px;background-color:#EEF2F7;'>
                            <b style='font-size:12px;color:#336699'>{$lang['title_updates']} <a href='http://www.ibforen.de' target='_blank' title='{$lang['home_of_updates']}'>ibforen.de</a></b>
                            <br /><br />{$lang['installed_version']}:&nbsp;<b>$my_version_info</b>
                            <br /><br />{$lang['available_version']}:&nbsp;$update_version_info
                        </div>";
            $ADMIN->html .= "
                        <table width='100%' border='0' cellpadding='0' cellspacing='0'>
                            <tr>
                                <td width='65%' valign='middle' align='center' style='padding:6px;background-color:#FAFFAF;'>{$ad_notes}</td>
                                <td style='width:10px'>&nbsp;</td>
                                <td width='35%' valign='top' align='left'>$update_html<br /><br />$version_info</td>
                            </tr>
                        </table><br />\n";
        }
        else if (TRUE)
            $ADMIN->html .= "<table width='100%' border='0' cellpadding='0' cellspacing='0'>
                             <tr>
                              <td width='80%' valign='middle' align='center' style='padding:6px;background-color:#FAFFAF;'>{$ad_notes}</td>
                              <td style='width:10px'>&nbsp;</td>
                              <td width='18%' valign='top' align='left'>{$version_info}</td>
                             </tr>
                             </table><br />\n";
        else
//-- mod_sec_update_131 end


  D. Find in function index_page(..)

        if ($dh = opendir(

     Insert above the blue code



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


        if ($dh = opendir(

  E. Find in function index_page(..)

        if ($MEMBER['mgroup'] == $INFO['admin_group'])

     Insert above the blue code



//-- mod_sec_update_131 begin
        $DB->query("SELECT count(*) as requests FROM ibf_requests WHERE done_date = '' OR done_date IS NULL");
        $r = $DB->fetch_row();
        $req_count = $r['requests'];
        $DB->query("SELECT * FROM ibf_requests WHERE done_date = '' OR done_date IS NULL ORDER BY request_date DESC LIMIT 1");
        $req_last = $DB->fetch_row();
        $DB->query("SELECT * FROM ibf_requests WHERE done_date = '' OR done_date IS NULL ORDER BY request_date ASC LIMIT 1");
        $req_first = $DB->fetch_row();
        if ($req_count > 0) {
            $SKIN->td_header[] = array( "<a href='{$SKIN->base_url}&act=requests'>".$lang['user_requests_count']."</a>", "20%" );
            $SKIN->td_header[] = array( $lang['user_requests_first'], "20%" );
            $SKIN->td_header[] = array( $lang['user_requests_date'], "20%" );
            $SKIN->td_header[] = array( $lang['user_requests_last'], "20%" );
            $SKIN->td_header[] = array( $lang['user_requests_date'], "20%" );
            $ADMIN->html .= $SKIN->start_table( $lang['user_requests'] );
            $ADMIN->html .= $SKIN->add_td_row(array("<center>".$r['requests']."</center>",
                                                    "<center><a href='{$INFO['board_url']}/index.{$INFO['php_ext']}?act=Profile&MID={$req_last['member_id']}' target='User'>{$req_last['member_name']}</a></center>",
                                                    "<center>".$std->get_date($req_last['request_date'], "LONG")."</center>",
                                                    "<center><a href='{$INFO['board_url']}/index.{$INFO['php_ext']}?act=Profile&MID={$req_first['member_id']}' target='User'>{$req_first['member_name']}</a></center>",
                                                    "<center>".$std->get_date($req_first['request_date'], "LONG")."</center>",
                                            ), "center"      );
            $ADMIN->html .= $SKIN->end_table();
            $ADMIN->html .= $SKIN->add_td_spacer();
        }
        require_once (ROOT_PATH."sources/mods/sec_update_131_A/mod_sec_update_func.php");
        $xajax = new mod_sec_update_xajax();
        if ($IN['get_uploads_size'])
            $xajax->process("ad_uploads_size", "process_xajax");
        else
            $uploads_size = $xajax->process("ad_uploads_size", "get_javascript");
//-- mod_sec_update_131 end


        if ($MEMBER['mgroup'] == $INFO['admin_group'])

  F. Find in function index_page(..)

        $ADMIN->html .= $SKIN->add_td_row( array( "<a href='{$SKIN->base_url}&act=mem&code=mod

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($MEMBER['mgroup'] == $INFO['admin_group'])
//-- mod_sec_update_131 end


        $ADMIN->html .= $SKIN->add_td_row( array( "<a href='{$SKIN->base_url}&act=mem&code=mod

  G. Find in function index_page(..)

                    <form name='DOIT' action=''>

        ";

     Insert below the blue code

                    <form name='DOIT' action=''>

        ";



//-- mod_sec_update_131 begin
        $edit_member = TRUE;
        $edit_cat = TRUE;
        $edit_forum = TRUE;
        if ($MEMBER['mgroup'] != $INFO['admin_group']) {
            if (file_exists(ROOT_PATH."sources/mods/sec_update_131_A/mod_sec_update_ad_func.php")) {
                global $mod_sec_update;
                require_once(ROOT_PATH."sources/mods/sec_update_131_A/mod_sec_update_ad_func.php");
                $IN['act'] = "mem";
                $IN['code'] = "edit";
                $edit_member = $mod_sec_update->test_access();
                $IN['act'] = "cat";
                $IN['code'] = "new";
                $edit_cat = $mod_sec_update->test_access();
                $IN['act'] = "forum";
                $IN['code'] = "newsp";
                $edit_forum = $mod_sec_update->test_access();
            }
            else {
                die("Could not call required function from file 'sources/mods/sec_update_131_A/mod_sec_update_ad_func.php'<br />Does it exist?");
            }
        }
        if ($edit_member)
//-- mod_sec_update_131 end


  H. Find in function index_page(..)

id='button' onClick='edit_member()'>"
                                         )      );

     Insert below the blue code

id='button' onClick='edit_member()'>"
                                         )      );



//-- mod_sec_update_131 begin
        if ($edit_cat)
//-- mod_sec_update_131 end


  I. Find in function index_page(..)

id='button' onClick='new_cat()'>"
                                         )      );

     Insert below the blue code

id='button' onClick='new_cat()'>"
                                         )      );



//-- mod_sec_update_131 begin
        if ($edit_forum)
//-- mod_sec_update_131 end



Step  5:  Open sources/Admin/ad_languages.php

  A. Find in function ad_langs(..)

            unset($$k);
        }

     Insert below the blue code

            unset($$k);
        }



//-- mod_sec_update_131 begin
        if (!isset($INFO['default_language']) || empty($INFO['default_language'])) {
            $ADMIN->rebuild_config( array( 'default_language' => "en" ) );
            $std->boink_it($SKIN->base_url."&act=lang");
        }
//-- mod_sec_update_131 end


  B. Find in function show_file(..)

            $v = stripslashes($v);

     Insert above the blue code



//-- mod_sec_update_131 begin
            $v = str_replace("\\\\", "\\\\\\\\", $v );  // Have we some intended backslashes?
//-- mod_sec_update_131 end


            $v = stripslashes($v);

  C. Find in function do_form(..)

        if ($row['lauthor'] and $row['lemail'])

     Insert above the blue code



//-- mod_sec_update_131 begin
        usort($form_array, array("ad_langs", "cmp_lang_array"));
//-- mod_sec_update_131 end


        if ($row['lauthor'] and $row['lemail'])

  D. Find

}


?>

     Insert above the blue code



//-- mod_sec_update_131 begin
    function cmp_lang_array($a, $b) {
        return strcasecmp($a[0], $b[0]);
    }
//-- mod_sec_update_131 end


}


?>


Step  6:  Open sources/Admin/ad_member.php

  A. Find in function do_bulk_mail(..)

'MOST_DATE'], 'SHORT'

     Insert below the blue code

'MOST_DATE'], 'SHORT'



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


  B. Find in function change_name_complete(..)

        $DB->query("SELECT name, email FROM ibf_members WHERE id='".$IN['mid']."'");

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (TRUE)
            $DB->query("SELECT name, email, mgroup FROM ibf_members WHERE id='".$IN['mid']."'");
        else
//-- mod_sec_update_131 end


        $DB->query("SELECT name, email FROM ibf_members WHERE id='".$IN['mid']."'");

  C. Find in function change_name_complete(..)

        $mid = $IN['mid']; // Save me poor ol' carpels

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($INFO['admin_group'] == $member['mgroup']) {
            if ($MEMBER['mgroup'] != $INFO['admin_group'])
                $ADMIN->error("You cannot edit this member.");
        }
//-- mod_sec_update_131 end


        $mid = $IN['mid']; // Save me poor ol' carpels

  D. Find in function change_name_start(..)

        $DB->query("SELECT name FROM ibf_members WHERE id='".$IN['mid']."'");

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (TRUE)
            $DB->query("SELECT name, mgroup FROM ibf_members WHERE id='".$IN['mid']."'");
        else
//-- mod_sec_update_131 end


        $DB->query("SELECT name FROM ibf_members WHERE id='".$IN['mid']."'");

  E. Find in function change_name_start(..)

        $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code'  , 'dochangename'  ),

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($INFO['admin_group'] == $member['mgroup']) {
            if ($MEMBER['mgroup'] != $INFO['admin_group'])
                $ADMIN->error("You cannot edit this member.");
        }
//-- mod_sec_update_131 end


        $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code'  , 'dochangename'  ),

  F. Find in function delete_lookup_form(..)

        $DB->query("SELECT id, name FROM ibf_members WHERE name LIKE '".$IN['USER_NAME']."%'");

     Insert above the blue code



//-- mod_sec_update_131 begin
        $IN['USER_NAME'] = str_replace( '|', '&#124;', $IN['USER_NAME']);
        $IN['USER_NAME'] = str_replace( '*', '%', $IN['USER_NAME']);
//-- mod_sec_update_131 end


        $DB->query("SELECT id, name FROM ibf_members WHERE name LIKE '".$IN['USER_NAME']."%'");

  G. Find in function domod(..)

            $DB->query("DELETE FROM ibf_members WHERE id IN(".implode( ",",$ids ).")");

     Insert below the blue code

            $DB->query("DELETE FROM ibf_members WHERE id IN(".implode( ",",$ids ).")");



//-- mod_sec_update_131 begin
            $DB->query("DELETE FROM ibf_sessions WHERE member_id IN(".implode( ",",$ids ).")");
            $DB->query("DELETE FROM ibf_admin_sessions WHERE MEMBER_ID IN(".implode( ",",$ids ).")");
//-- mod_sec_update_131 end


  H. Find in function do_advanced_search(..)

                $rq = "name LIKE '".$IN['USER_NAME']."%'";

     Insert above the blue code



//-- mod_sec_update_131 begin
                $IN['USER_NAME'] = str_replace( '|', '&#124;', $IN['USER_NAME']);
                $IN['USER_NAME'] = str_replace( '*', '%', $IN['USER_NAME']);
//-- mod_sec_update_131 end


                $rq = "name LIKE '".$IN['USER_NAME']."%'";

  I. Find in function do_add(..)

        $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".$IN['name']."'");

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($INFO['admin_group'] == $IN['mgroup']) {
            if ($MEMBER['mgroup'] != $INFO['admin_group'])
                $IN['mgroup'] = $ibforums->vars['member_group'];
        }
        $member_name = str_replace( '|', '&#124;', trim($IN['name']));
        $IN['name'] = strtolower(str_replace( '|', '&#124;', trim($IN['name'])));
//-- mod_sec_update_131 end


        $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".$IN['name']."'");

  J. Find in function do_add(..)

        $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".$IN['name']."'");

     Insert below the blue code

        $DB->query("SELECT id FROM ibf_members WHERE LOWER(name)='".$IN['name']."'");



//-- mod_sec_update_131 begin
        $IN['name'] = $member_name;
//-- mod_sec_update_131 end


  K. Find in function dodelete(..), do_edit_form(..)

        if ($mem['id'] == "")

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($INFO['admin_group'] == $mem['mgroup']) {
            if ($MEMBER['mgroup'] != $INFO['admin_group'] || ($IN['code'] == "dodelete" && $mem['id'] == $MEMBER['id']))
                $ADMIN->error("You cannot edit or delete this member.");
        }
//-- mod_sec_update_131 end


        if ($mem['id'] == "")

  L. Find in function temp_ban_start(..)

$ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code'  , 'dobanmember'  ),

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($INFO['admin_group'] == $member['mgroup']) {
            if ($MEMBER['mgroup'] != $INFO['admin_group'])
                $ADMIN->error("You cannot ban this member.");
        }
//-- mod_sec_update_131 end


$ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code'  , 'dobanmember'  ),

  M. Find in function temp_ban_complete(..)

        //+-------------------------------
        // Work out end date

     Insert above the blue code



//-- mod_sec_update_131 begin
        if ($INFO['admin_group'] == $member['mgroup']) {
            if ($MEMBER['mgroup'] != $INFO['admin_group'])
                $ADMIN->error("You cannot ban this member.");
        }
//-- mod_sec_update_131 end


        //+-------------------------------
        // Work out end date

  N. Find in function doprune(..)

        $DB->query("SELECT id FROM ibf_members WHERE ".$query);

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (TRUE)
            $DB->query("SELECT id,mgroup FROM ibf_members WHERE ".$query);
        else
//-- mod_sec_update_131 end


        $DB->query("SELECT id FROM ibf_members WHERE ".$query);

  O. Find in function doprune(..)

                $ids[] = $i['id'];

     Insert above the blue code



//-- mod_sec_update_131 begin
                if ($INFO['admin_group'] == $i['mgroup']) {
                    if ($MEMBER['mgroup'] != $INFO['admin_group'] || $i['id'] == $MEMBER['id'])
                        continue;
                }
//-- mod_sec_update_131 end


                $ids[] = $i['id'];

  P. Find in function doprune(..)

        $id_string = implode( "," , $ids );

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (!count($ids))
            $ADMIN->error("Could not find any members that matched the prune criteria");
//-- mod_sec_update_131 end


        $id_string = implode( "," , $ids );

  Q. Find in function doprune(..)

        $DB->query("DELETE from ibf_members WHERE id IN(".$id_string.")");

     Insert above the blue code



//-- mod_sec_update_131 begin
        $DB->query("DELETE from ibf_admin_sessions WHERE MEMBER_ID IN(".$id_string.")");
        $DB->query("DELETE from ibf_sessions WHERE member_id IN(".$id_string.")");
//-- mod_sec_update_131 end


        $DB->query("DELETE from ibf_members WHERE id IN(".$id_string.")");

  R. Find in function dodelete(..)

        $DB->query("DELETE from ibf_members WHERE id='".$IN['MEMBER_ID']."'");

     Insert above the blue code



//-- mod_sec_update_131 begin
        $DB->query("DELETE from ibf_admin_sessions WHERE MEMBER_ID='".$IN['MEMBER_ID']."'");
        $DB->query("DELETE from ibf_sessions WHERE member_id='".$IN['MEMBER_ID']."'");
//-- mod_sec_update_131 end


        $DB->query("DELETE from ibf_members WHERE id='".$IN['MEMBER_ID']."'");


Step  7:  Open sources/Admin/ad_moderator.php

  Find in function add_two(..)

        $DB->query("SELECT id, name FROM ibf_members WHERE name LIKE '".$IN['USER_NAME']."%'");

     Insert above the blue code



//-- mod_sec_update_131 begin
        $IN['USER_NAME'] = str_replace( '|', '&#124;', trim($IN['USER_NAME']));
//-- mod_sec_update_131 end


        $DB->query("SELECT id, name FROM ibf_members WHERE name LIKE '".$IN['USER_NAME']."%'");


Step  8:  Open sources/Admin/ad_prefs.php

  A. Find in function ad_prefs(..)

                $std->my_setcookie( 'acpprefs',

     Insert above the blue code



//-- mod_sec_update_131 begin
                $DB->query("REPLACE INTO ibf_acp_config (member_id, name, value) VALUES ('".$MEMBER['id']."', 'acpprefs', '".$IN['menu'] .','. $IN['tx'] .','. $IN['ty'] .','. $IN['preview']."')");
//-- mod_sec_update_131 end


                $std->my_setcookie( 'acpprefs',

  B. Find in function ad_prefs(..)

                list( $state, $tx, $ty, $prev_show ) = explode( ",", $cookie );
            }

     Insert below the blue code

                list( $state, $tx, $ty, $prev_show ) = explode( ",", $cookie );
            }



//-- mod_sec_update_131 begin
            else {
                $DB->query("SELECT value FROM ibf_acp_config WHERE member_id='".$MEMBER['id']."' AND name='acpprefs'");
                if ($r = $DB->fetch_row())
                    list($state, $tx, $ty, $prev_show) = explode( ",", $r['value'] );
            }
//-- mod_sec_update_131 end


  C. Find in function get_html(..)

    return $hit_muhl;

     Insert above the blue code



//-- mod_sec_update_131 begin
    $table = <<<EOT
<fieldset style='padding:10px'>
    <legend>Your ACP Prefs</legend>
    <table width='100%' cellspacing='4' cellpadding='4' border='0'>
        <tr>
            <td width='45%'><strong>Save ACP Menu State</strong></td>
            <td width='55%'><select class='textinput' name='menu'><option value='1' {$this->s_yes}>Yes</option><option value='0' {$this->s_no}>No</option></select></td>
        </tr>
        <tr>
            <td><strong>Template's Textbox Size</strong></td>
            <td><input  class='textinput' type='text' size='3' name='tx' value='{$this->tx}' /> <strong>X</strong> <input  class='textinput' type='text' size='3' name='ty' value='{$this->ty}' /></td>
        </tr>
        <tr>
            <td><strong>Show Macro Preview?</strong></td>
            <td><select class='textinput' name='preview'><option value='1' {$this->p_yes}>Yes</option><option value='0' {$this->p_no}>No</option></select></td>
        </tr>
        <tr>
            <td colspan='2' style='text-align:center'><input type='submit'  class='textinput' style='color:red;font-weight:bold;' value='Save' />&nbsp;&nbsp;<input type='submit'  class='textinput' value='Close' onClick='self.close()' /></td>
        </tr>
</fieldset>
EOT;
    $hit_muhl = preg_replace("`\<fieldset.*?\/fieldset\>`is", $table, $hit_muhl);
//-- mod_sec_update_131 end


    return $hit_muhl;


Step  9:  Open sources/Admin/ad_profilefields.php

  A. Find in function ad_fields(..)

        switch($IN['code'])

     Insert above the blue code



//-- mod_sec_update_131 begin
        $this->lang = $std->load_words($this->lang, 'mod_sec_update_ad_lang', $ADMIN->lang_id);
//-- mod_sec_update_131 end


        switch($IN['code'])

  B. Find in function main_save(..)

                            'fshowreg'  => $IN['fshowreg'],

     Insert below the blue code

                            'fshowreg'  => $IN['fshowreg'],



//-- mod_sec_update_131 begin
                            'fsearchable'  => $IN['fsearchable'],
//-- mod_sec_update_131 end


  C. Find in function main_form(..)

                                                  $SKIN->form_yes_no("fhide", $fields['fhide'] )
                                         )      );

     Insert below the blue code

                                                  $SKIN->form_yes_no("fhide", $fields['fhide'] )
                                         )      );



//-- mod_sec_update_131 begin
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['pfields_searchable'],
                                                  $SKIN->form_yes_no("fsearchable", $fields['fsearchable'] )
                                         )      );
//-- mod_sec_update_131 end


  D. Find in function main_screen(..)

        $SKIN->td_header[] = array( "Delete"         , "10%" );

     Insert below the blue code

        $SKIN->td_header[] = array( "Delete"         , "10%" );



//-- mod_sec_update_131 begin
        $fields = array("birthday" => "birthday",
                        "website"  => "website",
                        "icq_number" => "icq",
                        "aim_name" => "aol",
                        "yahoo" => "yahoo",
                        "msnname" => "msn", 
                        "location" => "location",
                        "interests" => "interests");
        if ($IN['code'] == "save") {
            global $HTTP_POST_VARS;
            foreach ($fields as $field => $desc) {
                $config[] = implode(",", array($field, intval($IN[$field."_reg"]), intval($IN[$field."_req"]), intval($IN[$field."_searchable"])));
            }
            $master["profile_fields"] = implode("|", $config);
            $ADMIN->rebuild_config($master);
            $ADMIN->save_log("Board Settings Profile Field Services Updated");
            $ADMIN->done_screen("Profile Field Settings Updated", "Profile Field Control", "act=field" );
        }
        $ADMIN->page_title = $this->lang['pfields_title'];
        $SKIN->td_header = array();
        $SKIN->td_header[] = array( $this->lang['pfield_name'],         "20%" );
        $SKIN->td_header[] = array( $this->lang['pfield_type'],         "10%" );
        $SKIN->td_header[] = array( $this->lang['pfield_topic'],        "22%" );
        $SKIN->td_header[] = array( $this->lang['pfield_required'],     "8%" );
        $SKIN->td_header[] = array( $this->lang['pfield_hidden'],       "8%" );
        $SKIN->td_header[] = array( $this->lang['pfield_register'],     "8%" );
        $SKIN->td_header[] = array( $this->lang['pfield_searchable'],   "8%" );
        $SKIN->td_header[] = array( $this->lang['pfield_edit'],         "8%" );
        $SKIN->td_header[] = array( $this->lang['pfield_delete'],       "8%" );
//-- mod_sec_update_131 end


  E. Find in function main_screen(..)

        $DB->query("SELECT * FROM ibf_pfields_data");

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (TRUE)
            $DB->query("SELECT * FROM ibf_pfields_data ORDER BY forder");
        else
//-- mod_sec_update_131 end


        $DB->query("SELECT * FROM ibf_pfields_data");

  F. Find in function main_screen(..)

                $ADMIN->html .= $SKIN->add_td_row( array( "<b>{$r['ftitle']}</b>" ,

     Insert above the blue code



//-- mod_sec_update_131 begin
                if ($r['fsearchable'] == 1)
                    $search = '<center><span style="color:red">Y</span></center>';
                else
                    $search = "&nbsp;";
//-- mod_sec_update_131 end


                $ADMIN->html .= $SKIN->add_td_row( array( "<b>{$r['ftitle']}</b>" ,

  G. Find in function main_screen(..)

                                                          $regi,

     Insert below the blue code

                                                          $regi,



//-- mod_sec_update_131 begin
                                                          $search,
//-- mod_sec_update_131 end


  H. Find in function main_screen(..)

        $ADMIN->html .= $SKIN->add_td_basic("<a href='{$ADMIN->base_url}&act=field&code=add' class='fauxbutton'>ADD NEW FIELD</a></center>", "center", "pformstrip");

        $ADMIN->html .= $SKIN->end_table();

     Insert below the blue code

        $ADMIN->html .= $SKIN->add_td_basic("<a href='{$ADMIN->base_url}&act=field&code=add' class='fauxbutton'>ADD NEW FIELD</a></center>", "center", "pformstrip");

        $ADMIN->html .= $SKIN->end_table();



//-- mod_sec_update_131 begin
        $SKIN->td_header[] = array($this->lang['pfield_name']     , "30%" );
        $SKIN->td_header[] = array($this->lang['pfield_reg']      , "10%" );
        $SKIN->td_header[] = array($this->lang['pfield_req'] , "10%" );
        $SKIN->td_header[] = array($this->lang['pfield_searchable'] , "10%" );
        $SKIN->td_header[] = array("&nbsp;"                 , "40%" );
        $ADMIN->html .= $SKIN->start_table($this->lang['pfields_title_sys']);
        $ADMIN->html .= $SKIN->start_form( array( 1 => array( 'code'  , 'save'  ),
                                                  2 => array( 'act'   , 'field'     ),
                                         )      );
        $settings = array();
        $config = explode("|", $INFO['profile_fields']);
        for ($i = 0; $i < count($config); $i++) {
            $value = explode(",", $config[$i]);
            $settings[$value[0]] = array($value[1], $value[2], $value[3]);
        }
        foreach ($fields as $field => $desc) {
            $ADMIN->html .= $SKIN->add_td_row(array("<b>".$this->lang["pfield_".$desc]."</b>" ,
                                                    "<center>".$SKIN->form_checkbox($field."_reg", $settings[$field][0] )."</center>",
                                                    "<center>".$SKIN->form_checkbox($field."_req", $settings[$field][1] )."</center>",
                                                    "<center>".$SKIN->form_checkbox($field."_searchable", $settings[$field][2] )."</center>",
                                                    "&nbsp;",
                                                 )      );
        }
        $ADMIN->html .= $SKIN->end_form($this->lang['pfield_save']);
        $ADMIN->html .= $SKIN->end_table();
//-- mod_sec_update_131 end



Step 10:  Open sources/Admin/ad_settings.php

  A. Find in function ad_settings(..)

'guests_ava',

     Insert above the blue code



//-- mod_sec_update_131 begin
'guests_attach', 'profile_allow_ibc',
//-- mod_sec_update_131 end


'guests_ava',

  B. Find in function ad_settings(..)

                                            'allow_flash','new_reg_notify'

     Insert above the blue code



//-- mod_sec_update_131 begin
    'reportpost_pm',
//-- mod_sec_update_131 end


                                            'allow_flash','new_reg_notify'

  C. Find in function ad_settings(..)

'display_max_topics',

     Insert below the blue code

'display_max_topics',



//-- mod_sec_update_131 begin
'display_topic_preview',
'display_topic_thread',
'display_topic_thread_global',
'display_topic_thread_default',
'allow_multi_quote',
'post_icons',
//-- mod_sec_update_131 end


  D. Find in function ad_settings(..)

            case 'dodates':

     Insert below the blue code

            case 'dodates':



//-- mod_sec_update_131 begin
                $current_version = (int)str_replace('.', '', phpversion());
                if ($current_version < 420) {
                    $magic = ini_get ('magic_quotes_gpc');
                } else {
                    $a = ini_get_all();
                    $magic = $a['magic_quotes_gpc']['global_value'];
                    unset ($a);
                }
                if (!$magic) {
                    global $HTTP_POST_VARS;
                    $HTTP_POST_VARS['clock_short'] = addslashes($HTTP_POST_VARS['clock_short']);
                    $HTTP_POST_VARS['clock_joined'] = addslashes($HTTP_POST_VARS['clock_joined']);
                    $HTTP_POST_VARS['clock_long'] = addslashes($HTTP_POST_VARS['clock_long']);
                }
                $this->save_config( array ( 'time_offset','dst_in_use', 'use_relative_date', 'clock_short','clock_joined','clock_long', 'time_adjust' ) );
                break;
//-- mod_sec_update_131 end


  E. Find in function ad_settings(..)

                $this->save_config( array ( 'number_format', 'html_dir','safe_mode_skins', 'board_name','board_url','home_name','home_url', 'disable_gzip',
                                            'html_url','upload_url', 'upload_dir', 'print_headers', 'header_redirect', 'debug_level', 'sql_debug' ) );

     Insert above the blue code



//-- mod_sec_update_131 begin
                global $HTTP_POST_VARS;
                $HTTP_POST_VARS['board_start'] = mktime(0,0,0,intval($IN['month']),intval($IN['day']),intval($IN['year'])) - $INFO['time_offset'] - $INFO['time_adjust'];
                $IN['board_start'] = $HTTP_POST_VARS['board_start'];
                $this->save_config( array ( 'board_start', 'ip2loc_service', 'ip2loc_user', 'ip2loc_pwd',
                                            'number_format', 'html_dir','safe_mode_skins', 'board_name','board_url','home_name','home_url', 'disable_gzip',
                                            'html_url','upload_url', 'upload_dir', 'print_headers', 'header_redirect', 'debug_level', 'sql_debug' ) );
                break;
//-- mod_sec_update_131 end


                $this->save_config( array ( 'number_format', 'html_dir','safe_mode_skins', 'board_name','board_url','home_name','home_url', 'disable_gzip',
                                            'html_url','upload_url', 'upload_dir', 'print_headers', 'header_redirect', 'debug_level', 'sql_debug' ) );

  F. Find in function ad_settings(..)

                $this->save_config( array ( 'show_max_msg_list', 'msg_allow_code', 'msg_allow_html' ) );

     Insert above the blue code



//-- mod_sec_update_131 begin
                if (true)
                    $this->save_config( array ( 'show_max_msg_list', 'msg_allow_code', 'msg_allow_html', 'msg_preview' ) );
                else
//-- mod_sec_update_131 end


                $this->save_config( array ( 'show_max_msg_list', 'msg_allow_code', 'msg_allow_html' ) );

  G. Find in function do_guidelines(..)

        $master['gl_show']  = $IN['gl_show'];

     Insert above the blue code



//-- mod_sec_update_131 begin
        $this->lang = $std->load_words($this->lang, "mod_sec_update_ad_lang", $ADMIN->lang_id);
        $lang = $IN['lang'];
        $lang_file = ROOT_PATH."/lang/$lang";
        if (!is_dir($lang_file) )
            $ADMIN->error($this->lang['error_lang_dir']);
        $lang_file .= "/lang_glines.php";
        $fh = @fopen($lang_file, "wb");
        if (!$fh) 
            $ADMIN->error($this->lang['error_lang_file']);
        $text = array();
        $text['gl_link'] = $IN['gl_link'];
        $text['gl_title'] = $IN['gl_title'];
        $text['gl_guidelines'] = stripslashes($HTTP_POST_VARS['gl_guidelines']);
        $text['gl_guidelines'] = str_replace( "<br>", "<br />", $text['gl_guidelines']);
        $text['terms_of_use'] = stripslashes($HTTP_POST_VARS['terms_of_use']);
        $text['terms_of_use'] = str_replace( "<br>", "<br />", $text['terms_of_use']);
        $start = "<?php\n\n";
        foreach($text as $k => $v) {
            $v = preg_replace("/&#39;/", "'", $v);
            $v = preg_replace("/&#60;/", "<",  $v );
            $v = preg_replace("/&#62;/", ">", $v );
            $v = preg_replace("/&#38;/", "&", $v );
            $v = preg_replace("/\r/", "", $v );
            $start .= "\n".'$lang['."'$k'".']  = "'.addslashes($v).'";';
        }
        $start .= "\n\n?".">";
        @fwrite($fh, $start, strlen($start) );
        @fclose($fh);
        
        $master['gl_show']  = $IN['gl_show'];
        $ADMIN->rebuild_config($master);
        
        $ADMIN->save_log("Board Guidelines Updated");
        $ADMIN->done_screen("Forum Configurations updated", "Administration CP Home", "act=index" );
//-- mod_sec_update_131 end


        $master['gl_show']  = $IN['gl_show'];

  H. Find in function guidelines(..)

        $this->common_header('doglines', 'Board Guidelines/Rules', 'You may change the configuration below');

     Insert below the blue code

        $this->common_header('doglines', 'Board Guidelines/Rules', 'You may change the configuration below');



//-- mod_sec_update_131 begin
        $this->lang = $std->load_words($this->lang, "mod_sec_update_ad_lang", $ADMIN->lang_id);
        $lang = $ADMIN->lang_id;
        if (!$lang) $lang = "en";
        if (isset($IN['lang']))
            $lang = $IN['lang'];
        $DB->query("SELECT ldir, lname FROM ibf_languages WHERE 1 ORDER BY lname");
        while ($r = $DB->fetch_row()) {
            $langs[] = array($r['ldir'], $r['lname']);
        }
        $js = "onChange='window.location.href=\"".$ADMIN->base_url."&act=op&code=glines&lang=\"+this.options[this.selectedIndex].value;'";
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['choose_language'] ,
                                          $SKIN->form_dropdown( "lang", $langs, $lang, $js)
                                 )      );
        if (file_exists(ROOT_PATH."lang/".$lang."/lang_glines.php")) {
            $this->lang = $std->load_words($this->lang, "lang_glines", $ADMIN->lang_id);
        }
        else {
            $DB->query("SELECT * FROM ibf_cache_store WHERE cs_key='boardrules'");
            $r = $DB->fetch_row();
            $this->lang['gl_guidelines'] = $r['cs_value'];
            $this->lang['gl_guidelines'] = $std->my_br2nl($this->lang['gl_guidelines']);
            $l = $std->load_words($l, "lang_register", $lang);
            $this->lang['terms_of_use'] = $l['click_wrap'];
            $this->lang['gl_link'] = $INFO['gl_link'];
            $this->lang['gl_title'] = $INFO['gl_title'];
            unset($l);
        }
        $ADMIN->html .= "<input type='hidden' name='lang' value='$lang' />\n";
        
        $ADMIN->html .= $SKIN->add_td_basic( $this->lang['title_guide_lines'], "left", "catrow2");
        
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['item_gl_show'],
                                          $SKIN->form_yes_no( "gl_show", $INFO['gl_show'] )
                                 )      );
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['item_gl_link'],
                                          $SKIN->form_input( "gl_link", $this->lang['gl_link'] )
                                 )      );
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['item_gl_title'],
                                          $SKIN->form_input( "gl_title", $this->lang['gl_title'] )
                                 )      );
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['item_gl_glines'],
                                          $SKIN->form_textarea( "gl_guidelines", $this->lang['gl_guidelines'], 65, 20  )
                                 )      );
        
        $ADMIN->html .= $SKIN->add_td_basic( $this->lang['title_terms_of_use'], "left", "catrow2");
        
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['item_terms_of_use'],
                                          $SKIN->form_textarea( "terms_of_use", $std->my_br2nl($this->lang['terms_of_use']), 65, 20  )
                                 )      );
        
        $this->common_footer();
        
        die;
//-- mod_sec_update_131 end


  I. Find in function pm(..)

                                          $SKIN->form_input( "show_max_msg_list", $INFO['show_max_msg_list']  )
                                 )      );

     Insert below the blue code

                                          $SKIN->form_input( "show_max_msg_list", $INFO['show_max_msg_list']  )
                                 )      );



//-- mod_sec_update_131 begin
        $lang = $std->load_words($lang, 'mod_sec_update_ad_lang', $ADMIN->lang_id);
        $ADMIN->html .= $SKIN->add_td_row( array( $lang['msg_preview'] ,
                                          $SKIN->form_yes_no( "msg_preview", $INFO['msg_preview']  )
                                 )      );
//-- mod_sec_update_131 end


  J. Find in function url(..)

                                          $SKIN->form_input( "upload_dir", $INFO['upload_dir']  )
                                 )      );

     Insert below the blue code

                                          $SKIN->form_input( "upload_dir", $INFO['upload_dir']  )
                                 )      );



//-- mod_sec_update_131 begin
        $this->lang = $std->load_words($this->lang, "mod_sec_update_ad_lang", $ADMIN->lang_id);
        $start = explode('.', date("Y.m.d", $INFO['board_start']+$INFO['time_offset']+$INFO['time_adjust']));
        $ADMIN->html .= $SKIN->add_td_row( array("<b>{$this->lang['board_start_date']}</b><input type='hidden' name='board_start' value='0'>" ,
                "{$this->lang['year']}&nbsp;".$SKIN->form_dropdown( "year"  , $this->make_year() , $start[0] ).'&nbsp;&nbsp;'.
                "{$this->lang['month']}&nbsp;".$SKIN->form_dropdown( "month" , $this->make_month(), $start[1]  ).'&nbsp;&nbsp;'.
                "{$this->lang['day']}&nbsp;".$SKIN->form_dropdown( "day"  , $this->make_day()  , $start[2] )
                    )      );
        $ADMIN->html .= $SKIN->add_td_basic( $this->lang['ip2loc_title'], 'left', 'catrow2' );
        include ROOT_PATH."sources/mods/sec_update_131_A/ip2loc/services.php";
        if (is_array($IP2LOC)) {
            $service_array[] = array(0 => "auto", 1 => $this->lang['ip2loc_auto']);
            $access = "<span id='ip2loc_auto' style='display:none;'></span>";
            foreach($IP2LOC as $service) {
                $service_array[] = array(0 => $service['id'], 1 => $service['name']);
                $show_js .= "document.getElementById('ip2loc_{$service['id']}').style.display='none';"; 
                $display = "none";
                if ($service['id'] == $INFO['ip2loc_service'])
                    $display = "inline";
                $access .= "<span id='ip2loc_{$service['id']}' style='display:$display;'>";
                if (isset($service['user']))
                    $access .= "<b>".$service['user']."</b>&nbsp;".$SKIN->form_simple_input("ip2loc_user",  $INFO['ip2loc_user'], 30);
                if (isset($service['pwd']))
                    $access .= "&nbsp;&nbsp;<b>".$service['pwd']."</b>&nbsp;".$SKIN->form_simple_input("ip2loc_pwd",  $INFO['ip2loc_pwd'], 30);
                $access .= "<br /><br /><a href='http://{$service['website']}' target=_blank'>{$service['website']}</a>";
                if (isset($this->lang['ip2loc_service_'.$service['id']]))
                    $access .= $this->lang['ip2loc_service_'.$service['id']];
                $access .= "</span>";
            }
        }
        $js = "onChange='showAccessCode(this.options[this.selectedIndex].value)'";
        $ADMIN->html .= " <script type='text/javascript'>function showAccessCode(id) { $show_js; document.getElementById('ip2loc_' + id).style.display='inline'; }</script>";
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['ip2loc_service'] ,
                                          $SKIN->form_dropdown( "ip2loc_service", $service_array, $INFO['ip2loc_service'], $js  )."&nbsp;".$access
                                 )      );
//-- mod_sec_update_131 end


  K. Find in function upload_emoticon(..)

            @chmod( $INFO['html_dir'].'emoticons'."/".$FILE_NAME, 0777 );
        }

     Insert below the blue code

            @chmod( $INFO['html_dir'].'emoticons'."/".$FILE_NAME, 0777 );
        }



//-- mod_sec_update_131 begin
        $img_size = @getimagesize( $INFO['html_dir'].'emoticons'."/".$FILE_NAME );
        if (!is_array($img_size))
            $img_size = @getimagesize($INFO['html_dir'].'emoticons'."/".$FILE_NAME, $info );
        if (!is_array($img_size)) {
            @unlink($INFO['html_dir'].'emoticons'."/".$FILE_NAME);
            $ADMIN->error("Wrong file type");
        }
        switch($FILE_TYPE) {
            case 'image/gif':   $ext = '.gif';
                                break;
            case 'image/jpeg':  $ext = '.jpg';
                                break;
            case 'image/pjpeg': $ext = '.jpg';
                                break;
            case 'image/x-png': $ext = '.png';
                                break;
            case 'image/png':   $ext = '.png';
                                break;
        }
        if (function_exists("imagecreatefromgif")) {
            $image = $INFO['html_dir'].'emoticons'."/".$FILE_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);
                $ADMIN->error("Wrong file type");
            }
        }
//-- mod_sec_update_131 end


  L. Find in function dates(..)

        $this->common_header('dodates', 'Dates', 'Define date formats');

     Insert above the blue code



//-- mod_sec_update_131 begin
        require ROOT_PATH."sources/mods/sec_update_131_A/mod_sec_update_ad_func.php";
        $mod_sec_update->dates();
        exit();
//-- mod_sec_update_131 end


        $this->common_header('dodates', 'Dates', 'Define date formats');

  M. Find in function post(..)

        $INFO['img_ext'] =

     Insert above the blue code



//-- mod_sec_update_131 begin
        $this->lang = $std->load_words($this->lang, 'mod_sec_lang', $ADMIN->lang_id);
        $this->lang = $std->load_words($this->lang, 'mod_sec_update_ad_lang', $ADMIN->lang_id);
        $INFO['pre_pinned'] = $this->lang['pre_pinned'];
        $INFO['pre_moved'] = $this->lang['pre_moved'];
        $INFO['pre_polls'] = $this->lang['pre_polls'];
//-- mod_sec_update_131 end


        $INFO['img_ext'] =

  N. Find in function post(..)

, $INFO['pre_pinned']

     Insert below the blue code

, $INFO['pre_pinned']



//-- mod_sec_update_131 begin
        , "text", " readonly='readonly' ") .("&nbsp;&nbsp;".$this->lang['pre_info']
//-- mod_sec_update_131 end


  O. Find in function post(..)

, $INFO['pre_moved']

     Insert below the blue code

, $INFO['pre_moved']



//-- mod_sec_update_131 begin
        , "text", " readonly='readonly' ") .("&nbsp;&nbsp;".$this->lang['pre_info']
//-- mod_sec_update_131 end


  P. Find in function post(..)

, $INFO['pre_polls']

     Insert below the blue code

, $INFO['pre_polls']



//-- mod_sec_update_131 begin
        , "text", " readonly='readonly' ") .("&nbsp;&nbsp;".$this->lang['pre_info']
//-- mod_sec_update_131 end


  Q. Find in function post(..)

                                          $SKIN->form_yes_no( "etfilter_shout", $INFO['etfilter_shout'] )
                                 )      );

     Insert below the blue code

                                          $SKIN->form_yes_no( "etfilter_shout", $INFO['etfilter_shout'] )
                                 )      );



//-- mod_sec_update_131 begin
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['topic_preview'],
                                          $SKIN->form_yes_no( "display_topic_preview", $INFO['display_topic_preview'] )
                                 )      );
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['topic_thread'],
                                          $SKIN->form_yes_no( "display_topic_thread", $INFO['display_topic_thread'] )
                                 )      );
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['topic_thread_global'],
                                          $SKIN->form_yes_no( "display_topic_thread_global", $INFO['display_topic_thread_global'] )
                                 )      );
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['topic_thread_default'],
                                          $SKIN->form_yes_no( "display_topic_thread_default", $INFO['display_topic_thread_default'] )
                                 )      );
//-- mod_sec_update_131 end


  R. Find in function post(..)

                                          $SKIN->form_input( "max_emos", $INFO['max_emos'] )
                                 )      );

     Insert below the blue code

                                          $SKIN->form_input( "max_emos", $INFO['max_emos'] )
                                 )      );



//-- mod_sec_update_131 begin
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['post_icons'],
                                          $SKIN->form_yes_no( "post_icons", isset($INFO['post_icons'])?$INFO['post_icons']:1 )
                                 )      );
//-- mod_sec_update_131 end


  S. Find in function post(..)

                                          $SKIN->form_yes_no( "strip_quotes", $INFO['strip_quotes'] )
                                 )      );

     Insert below the blue code

                                          $SKIN->form_yes_no( "strip_quotes", $INFO['strip_quotes'] )
                                 )      );



//-- mod_sec_update_131 begin
        $ADMIN->html .= $SKIN->add_td_row( array( $this->lang['topic_multi_quote'],
                                          $SKIN->form_yes_no( "allow_multi_quote", $INFO['allow_multi_quote'] )
                                 )      );
//-- mod_sec_update_131 end


  T. Find in function avatars(..)

                                          $SKIN->form_yes_no( "sig_allow_ibc", $INFO['sig_allow_ibc'] )
                                 )      );

     Insert below the blue code

                                          $SKIN->form_yes_no( "sig_allow_ibc", $INFO['sig_allow_ibc'] )
                                 )      );



//-- mod_sec_update_131 begin
        $lang = $std->load_words($lang, "mod_sec_update_ad_lang", $ADMIN->lang_id);
        $ADMIN->html .= $SKIN->add_td_row( array( $lang['profile_allow_ibc'],
                                          $SKIN->form_yes_no( "profile_allow_ibc", $INFO['profile_allow_ibc'] )
                                 )      );
//-- mod_sec_update_131 end


  U. Find in function avatars(..)

        $ADMIN->html .= $SKIN->add_td_basic( 'Guest Permissions', 'left', 'catrow2' );

        //-----------------------------------------------------------------------------------------------------------

     Insert below the blue code

        $ADMIN->html .= $SKIN->add_td_basic( 'Guest Permissions', 'left', 'catrow2' );

        //-----------------------------------------------------------------------------------------------------------



//-- mod_sec_update_131 begin
        $ADMIN->html .= $SKIN->add_td_row( array( $lang['guests_view_attach'] ,
                                          $SKIN->form_yes_no( "guests_attach", $INFO['guests_attach'] )
                                 )      );
//-- mod_sec_update_131 end


  V. Find in function secure(..)

                                          $SKIN->form_yes_no( "disable_reportpost", $INFO['disable_reportpost'] )
                                 )      ); //

     Insert below the blue code

                                          $SKIN->form_yes_no( "disable_reportpost", $INFO['disable_reportpost'] )
                                 )      ); //



//-- mod_sec_update_131 begin
        $lang = $std->load_words($this->lang, "mod_sec_update_ad_lang", $ADMIN->lang_id);
        $ADMIN->html .= $SKIN->add_td_row( array( $lang['ad_reportpost_pm'],
                                          $SKIN->form_yes_no( "reportpost_pm", $INFO['reportpost_pm'] )
                                 )      ); 
//-- mod_sec_update_131 end


  W. Find

}


?>

     Insert above the blue code



//-- mod_sec_update_131 begin
function make_year() {
    $time_now = getdate();
    $return = array();
    $start_year = 1990;
    $latest_year = intval($time_now['year']);
    if ($latest_year == $start_year) {
        $start_year -= 1;
    }
    for ( $y = $start_year; $y <= $latest_year; $y++ ) {
        $return[] = array( $y, $y);
    }
    return $return;
}


function make_month() {
    global $std, $INFO;
   
    $return = array();
    for ( $m = 1 ; $m <= 12; $m++ ) {
        $return[] = array( $m, $m<10?("0".$m):$m );
    }
    return $return;
}


function make_day() {
    $return = array();
    for ( $d = 1 ; $d <= 31; $d++ ) {
        $return[] = array( $d, $d<10?("0".$d):$d );
    }
    return $return;
}

//-- mod_sec_update_131 end


}


?>


Step 11:  Open sources/Admin/ad_skin_import.php

  Find in function set_import(..), safe_set_import(..)

        $new_name = stripslashes( $this->name_translated )." (Import)".$set['new_id'];

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (TRUE)
            $new_name = stripslashes( $this->name_translated )." (Import)";
        else
//-- mod_sec_update_131 end


        $new_name = stripslashes( $this->name_translated )." (Import)".$set['new_id'];


Step 12:  Open sources/Admin/ad_stylesets.php

  A. Find in function list_sets(..), list_sets(..)

                $default = '&nbsp;';

     Insert above the blue code



//-- mod_sec_update_131 begin
                $extra = " [sid=".$r['sid']."]  ".$extra;
//-- mod_sec_update_131 end


                $default = '&nbsp;';

  B. Find in function list_sets(..)

            $DB->query("SELECT * FROM ibf_skins");

     Insert above the blue code



//-- mod_sec_update_131 begin
            if (TRUE)
                $DB->query("SELECT * FROM ibf_skins ORDER BY  sname");
            else
//-- mod_sec_update_131 end


            $DB->query("SELECT * FROM ibf_skins");

  C. Find in function list_sets(..)

            $DB->query("SELECT * FROM ibf_skins WHERE uid NOT IN(".implode(",",$used_ids).")");

     Insert above the blue code



//-- mod_sec_update_131 begin
            if (TRUE)
                $DB->query("SELECT * FROM ibf_skins WHERE uid NOT IN(".implode(",",$used_ids).") ORDER BY sname");
            else
//-- mod_sec_update_131 end


            $DB->query("SELECT * FROM ibf_skins WHERE uid NOT IN(".implode(",",$used_ids).")");


Step 13:  Open sources/Admin/admin_functions.php

  A. Find in function admin_functions(..)

        $this->base_url = $INFO['board_url']."/admin.".$INFO['php_ext']."?adsess=".$IN['AD_SESS'];

     Insert below the blue code

        $this->base_url = $INFO['board_url']."/admin.".$INFO['php_ext']."?adsess=".$IN['AD_SESS'];



//-- mod_sec_update_131 begin
        $this->base_url = $INFO['board_url']."/".ADMIN_SCRIPT_NAME."?adsess=".$IN['AD_SESS'];
//-- mod_sec_update_131 end


  B. Find in function get_date(..)

    function get_date($date="", $method="")

     Insert above the blue code



//-- mod_sec_update_131 begin
    function set_time_replace() {
        global $ADMIN, $MEMBER, $INFO, $std;
        
        $this->time_options = array( 'JOINED' => $INFO['clock_joined'],
                                     'SHORT'  => $INFO['clock_short'],
                                     'LONG'   => $INFO['clock_long']
                                   );
        
        $this->lang = $std->load_words($this->lang, 'lang_date', $ADMIN->lang_id);
        $this->Date_Replace_Array = array(
                                            "January" => $this->lang['M1'],
                                            "February" => $this->lang['M2'],
                                            "March" => $this->lang['M3'],
                                            "April" => $this->lang['M4'],
                                            "May" => $this->lang['M5'],
                                            "June" => $this->lang['M6'],
                                            "July" => $this->lang['M7'],
                                            "August" => $this->lang['M8'],
                                            "September" => $this->lang['M9'],
                                            "October" => $this->lang['M10'],
                                            "November" => $this->lang['M11'],
                                            "December" => $this->lang['M12'],
                                            "Jan" => $this->lang['m1'],
                                            "Feb" => $this->lang['m2'],
                                            "Mar" => $this->lang['m3'],
                                            "Apr" => $this->lang['m4'],
                                            "May" => $this->lang['m5'],
                                            "Jun" => $this->lang['m6'],
                                            "Jul" => $this->lang['m7'],
                                            "Aug" => $this->lang['m8'],
                                            "Sep" => $this->lang['m9'],
                                            "Oct" => $this->lang['m10'],
                                            "Nov" => $this->lang['m11'],
                                            "Dec" => $this->lang['m12'],
                                            "Sunday" => $this->lang['D0'],
                                            "Monday" => $this->lang['D1'],
                                            "Tuesday" => $this->lang['D2'],
                                            "Wednesday" => $this->lang['D3'],
                                            "Thursday" => $this->lang['D4'],
                                            "Friday" => $this->lang['D5'],
                                            "Saturday" => $this->lang['D6'],
                                            "Sun" => $this->lang['d0'],
                                            "Mon" => $this->lang['d1'],
                                            "Tue" => $this->lang['d2'],
                                            "Wed" => $this->lang['d3'],
                                            "Thu" => $this->lang['d4'],
                                            "Fri" => $this->lang['d5'],
                                            "Sat" => $this->lang['d6']
                                         );
    }

    function get_date($date = "", $method = "") {
        
        if (!$date) {
            return '--';
        }
        if (empty($method)) {
            $method = 'LONG';
        }
        if ($this->offset_set == 0) {
            $this->offset = $this->get_time_offset();
            $this->offset_set = 1;
        }
        if (!isset($this->Date_Replace_Array)) {
            $this->set_time_replace();
        }
        if ($this->time_options[$method] != "") {
            return Strtr(gmdate((isset($this->lang["time_format_".$method])?$this->lang["time_format_".$method]:$this->time_options[$method]),
                                ($date + $this->offset) ),
                                $this->Date_Replace_Array);
        } else {
            return Strtr(gmdate($method, ($date + $this->offset) ), $this->Date_Replace_Array);
        }
    }

    function get_time_offset() {
        global $MEMBER, $INFO;
        $d = 0;
        if (!$MEMBER['id'] || ($MEMBER['time_offset'] === "" && !$MEMBER['dst_in_use'])) {
            $d = ($INFO['time_offset'] + $INFO['dst_in_use'])*3600 + ($INFO['time_adjust']) * 60;
        }
        else {
            $d  = ($MEMBER['time_offset'] + $MEMBER['dst_in_use'])*3600 + ($INFO['time_adjust']) * 60;
        }
        return $d;
    }

//-- mod_sec_update_131 end

/*-- mod_sec_update_131 exclude begin


    function get_date($date="", $method="")

  C. Find in function get_date(..)

        return gmdate($this->time_options[$method], ($date + $this->time_offset) );



    }

     Insert below the blue code

        return gmdate($this->time_options[$method], ($date + $this->time_offset) );



    }



-- mod_sec_update_131 exclude end */


  D. Find in function done_screen(..)

    function done_screen($title, $link_text="", $link_url=""

     Insert below the blue code

    function done_screen($title, $link_text="", $link_url=""



//-- mod_sec_update_131 begin
          , $custom_link= array()
//-- mod_sec_update_131 end


  E. Find in function done_screen(..)

        $this->html .= $SKIN->add_td_basic( "<a href='{$this->base_url}&{$link_url}' target='body'>Go to: $link_text</a>", "center" );

     Insert below the blue code

        $this->html .= $SKIN->add_td_basic( "<a href='{$this->base_url}&{$link_url}' target='body'>Go to: $link_text</a>", "center" );



//-- mod_sec_update_131 begin
        if (is_array($custom_link))
            foreach ($custom_link as $url=>$text) {
                $this->html .= $SKIN->add_td_basic( "<a href='{$this->base_url}&{$url}' target='body'>Go to: $text</a>", "center" );
            }
//-- mod_sec_update_131 end


  F. Find in function build_jump_menu(..)

    function build_jump_menu()

     Insert above the blue code



-- mod_sec_update_131 exclude end */


    function build_jump_menu()

  G. Find in function build_tree(..)

    function build_tree() {

     Insert above the blue code



//-- mod_sec_update_131 begin
    function build_tree() {
        global $IN, $std, $INFO, $PAGES, $CATS, $SKIN, $DESC;
        
        $html  = $SKIN->get_men_js();
        $links = "";
        foreach($CATS as $cid => $name) {
            $ADMIN->jump_menu .= "<optgroup label='$name'>\n";
            if ( preg_match( "/(?:^|,)$cid(?:,|$)/", $IN['show'] ) ) {
                $display_s = "block";
                $display_c = "none";
            }
            else {
                $display_s = "none";
                $display_c = "block";
            }
            foreach($PAGES[ $cid ] as $pid => $pdata) {
                if ( $pdata[2] != "" )
                    if ( ! @is_dir( ROOT_PATH.$pdata[2] ) )
                          continue;
                $links .= $SKIN->menu_cat_link($pdata[1], $pdata[0], $pdata[3]);
            }
            $html .= $SKIN->menu_cat_expanded( $name, $links, $cid, $display_s );
            unset($links);
            $html .= $SKIN->menu_cat_collapsed( $name, $cid, $DESC[ $cid ], $display_c );
            $ADMIN->jump_menu .= "</optgroup>\n";
        }
        return $html;
    }

//-- mod_sec_update_131 end

/*-- mod_sec_update_131 exclude begin


    function build_tree() {

  H. Find

}





?>

     Insert above the blue code



//-- mod_sec_update_131 begin
    function adjust_skin_info(&$skin_names, &$bit_names){
        
        if (is_array($skin_names))
            foreach ($skin_names as $k => $v) {
                $v[0] .= " ($k.php)";
                $skin_names[$k] = $v;
        }
        if (is_array($bit_names))
            foreach ($bit_names as $k => $v) {
                foreach ($v as $f => $d)
                    $v[$f] .= " (function $f)";
                $bit_names[$k] = $v;
        }
    }
//-- mod_sec_update_131 end


}





?>


Step 14:  Open sources/Admin/admin_pages.php

  Find

?>

     Insert above the blue code



//-- mod_sec_update_131 begin
$PAGES[5][9][0] = "Profile Fields";
unset($PAGES[1]);
unset($CATS[1]);
unset($DESC[1]);
unset($PAGES[2][20]);
unset($PAGES[7][7]);
$PAGES[6][] = array( 'User Requests', 'act=requests'   );
$PAGES[11][] = array( 'Online Stats', 'act=online'   );
$PAGES[11][] = array( 'User Requests', 'act=requests'   );
//-- mod_sec_update_131 end


?>


Step 15:  Open sources/Admin/admin_skin.php

  A. Find in function admin_skin(..)

        $this->base_url = $INFO['board_url']."/admin.".$INFO['php_ext']."?adsess=".$IN['AD_SESS'];

     Insert below the blue code

        $this->base_url = $INFO['board_url']."/admin.".$INFO['php_ext']."?adsess=".$IN['AD_SESS'];



//-- mod_sec_update_131 begin
        global $std, $MEMBER, $ADMIN;
        $this->base_url = $INFO['board_url']."/".ADMIN_SCRIPT_NAME."?adsess=".$IN['AD_SESS'];
        $this->board_url = $INFO['board_url']."/index.php?adsess=".$IN['AD_SESS'];
//-- mod_sec_update_131 end


  B. Find in function js_template_tools(..)

    function js_template_tools()
    {

     Insert below the blue code

    function js_template_tools()
    {



//-- mod_sec_update_131 begin
        global $INFO;
        return "
<script language='javascript'>
<!--
    var baseUrl = \"{$this->base_url}\";
    function restore(suid, expand) {
        if (confirm(\"Are you sure you want to restore the template?\\nALL UNSAVED CHANGES WILL BE LOST!\"))
            self.location.href= baseUrl + '&act=templ&code=edit_bit&suid=' + suid + '&expand=' + expand;
        else
            alert (\"Restore Cancelled\");
    }
    function edit_box_size(cols, rows) {
        if (cols == '') cols = 80;
        if (rows == '') rows = 40;
        userCols = prompt(\"Enter the number of columns for the text area (width)\", cols);
        if ( (userCols != null) && (userCols != \"\") ) {
            userRows = prompt(\"Enter the number of rows for the text area (height)\", rows);
            if ( (userRows != null) && (userRows != \"\") ) {
                document.cookie = '{$INFO['cookie_id']}' + 'ad_tempform='+userRows+'-'+userCols+'; path={$INFO['cookie_path']}; domain={$INFO['cookie_domain']}; expires=Wed, 1 Jan 2020 00:00:00 GMT;';
                alert('Edit box preferences updated.\\nThe changes will take effect next time the edit screen is loaded');
            }
            else
                alert('You must enter a value for the number of rows');
        }
        else
            alert('You must enter a value for the number of columns');
    }
    function pop_win(theUrl, winName, theWidth, theHeight) {
        if (winName == '') winName = 'Preview';
        if (theHeight == '') theHeight = 400;
        if (theWidth == '') theWidth = 400;
        window.open('{$this->base_url}&act=rtempl&'+theUrl,winName,'width='+theWidth+',height='+theHeight+',resizable=yes,scrollbars=yes');
    }
//-->
</script>
";
//-- mod_sec_update_131 end


  C. Find in function make_page_jump(..)

        return "<a href='#' title=\"Jump to a page...\" onclick=\"multi_page_jump('$ub',$tp,$pp);\">Pages:</a>";

     Insert above the blue code



//-- mod_sec_update_131 begin
        return "<span class='page_link' ><a title='Jump to a page...' href=\"javascript:multi_page_jump('$ub',$tp,$pp);\">Pages</a></span>";
//-- mod_sec_update_131 end


        return "<a href='#' title=\"Jump to a page...\" onclick=\"multi_page_jump('$ub',$tp,$pp);\">Pages:</a>";

  D. Find in function get_css(..)

"<style type='text/css'>

     Insert above the blue code



//-- mod_sec_update_131 begin
"
    <style type='text/css'>
        .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;}
        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 }
        img  { border:none; }
    </style>
    ".
//-- mod_sec_update_131 end


"<style type='text/css'>

  E. Find in function print_top(..)

        $css = $this->get_css();

     Insert below the blue code

        $css = $this->get_css();



//-- mod_sec_update_131 begin
        $css .= "
    <script language=\"javascript\" type=\"text/javascript\" src=\"{$INFO['board_url']}/html/domLibm.js\"></script>
    <script language=\"javascript\" type=\"text/javascript\" src=\"{$INFO['board_url']}/html/domTTm.js\"></script>
    <script language=\"javascript\" type=\"text/javascript\" src=\"{$INFO['board_url']}/html/domTT_drag.js\"></script>
    <script type=\"text/javascript\" language=\"javascript\" src=\"{$INFO['board_url']}/html/fadomaticm.js\"></script>
";
//-- mod_sec_update_131 end


  F. Find in function menu_top(..)

$pop_win = $this->js_pop_win();

     Insert below the blue code

$pop_win = $this->js_pop_win();



//-- mod_sec_update_131 begin
        global $ADMIN, $MEMBER;
        
        if ($MEMBER['mgroup'] == $INFO['admin_group'])
            $board_acp_session = "<div width='100%' class='item'><img src='{$this->img_url}/item.gif' border='0' alt='' valign='absmiddle'>&nbsp;<a href=\"{$this->board_url}\" target='body' onClick='makeActive(this.parentNode)' title='{$ADMIN->lang['board_acp_session_title']}'>{$ADMIN->lang['board_acp_session']}</a></div>";

        return "<html>
                  <head><title>Menu</title>
                  <style type='text/css'>
                    TABLE, TR, TD     { font-family:Verdana, Arial;font-size: 9px; color:#000 }
                    BODY      {
                                 font: 9px Verdana;
                                 color:#000;
                                 background-color:#FFF;
                                 margin:0px 3px 0px 3px;
                                 padding:0px;
                              }
                    a:link, a:visited  { color:#000; text-decoration:none; }
                    a:hover   { cursor:pointer; color:#FF0000; text-decoration:underline;}
                    a:active  { text-color:#0000FF; font-weight:bold;}

                    img { vertical-align:middle }
                    #title  { font-size:10px; font-weight:bold; line-height:150%; color:#FFFFFF; height: 24px; background-image: url({$this->img_url}/tile_back.gif); }
                    #title  a:link, #title  a:visited, #title  a:active { text-decoration: none; color : #555555 }

                    .desc {
                            font-size:9px;
                            color: #000;
                            background-color:#DFE6EF;
                            padding:2px 0px 2px 5px;
                            line-height:1.2em;
                           }

                    .plain {
                            font-size:9px;
                            color: #000;
                            background-color:#EEF2F7;
                            padding:2px 0px 2px 5px;
                            line-height:1.7em;
                           }

                    .item {
                            font-size:9px;
                            color: #000;
                            background-color:#EEF2F7;
                            font-weight:normal;
                           }
                    .item_active {
                            font-size:11px;
                            color: #000;
                            background-color:#CCCC99;
                            font-weight:bold;
                           }
                    .tableborder { border:1px solid #345487;background-color:#FFF; }

                    .cattitle  {
                                font-size:10px;
                                font-weight:bold;
                                line-height:150%;
                                background-color:#C4DCF7;
                                color:#000;
                                padding:5px 4px 5px 5px;
                                background-image: url({$this->img_url}/tile_sub.gif);
                                border-bottom:1px solid #345487;
                               }
                    .cattitle  a:link, .cattitle  a:visited, .cattitle  a:active { text-decoration: underline; color:#000; }

                  </style>
                  $pop_win
                <script language='javascript'>
                <!--
                    function makeActive(element) {
                        e = document.getElementsByTagName('div');
                        for (var i=0; i < e.length; i++) {
                            if (e[i].className=='item_active')
                                e[i].className='item';
                        }
                        element.className='item_active';
                    }
                //-->
                </script>
                  </head>
                 <body marginheight='0' marginwidth='0' leftmargin='0' topmargin='0' bgcolor='#FFF'>
                 <div align='center'><img src='{$this->img_url}/ad-logo.jpg' border='0' style='width:100%'></div>
                 <div class='tableborder'>
                  <div class='plain'>
                   <img src='{$this->img_url}/item.gif' border='0' alt='' valign='absmiddle'>&nbsp;<a href='{$this->base_url}&act=menu&show=all' target='menu'>{$ADMIN->lang['expand']}</a> &middot; <a href='{$this->base_url}&act=menu&show=none' target='menu'>{$ADMIN->lang['reduce']}</a> Menu<br />
                   $board_acp_session
                   <div class='item' style='width:30%;float:left;'><img src='{$this->img_url}/item.gif' border='0' alt='' valign='absmiddle'>&nbsp;<a href='{$this->base_url}&act=index' target='body' onClick='makeActive(this.parentNode)' title='{$ADMIN->lang['acp_title']}'>{$ADMIN->lang['acp']}</a></div><div class='item' style='float:left;width:30%;'><img src='{$this->img_url}/item.gif' border='0' alt='' valign='absmiddle'>&nbsp;<a href='{$INFO['board_url']}/index.{$INFO['php_ext']}' target='body' onClick='makeActive(this.parentNode)' title='{$ADMIN->lang['board_title']}'>{$ADMIN->lang['board']}</a></div>
                   <br clear='both' />
                   <img src='{$this->img_url}/item.gif' border='0' alt='' valign='absmiddle'>&nbsp;{$ADMIN->lang['support']}
                   <div width='100%' class='item'><img src='{$this->img_url}/item.gif' border='0' alt='' valign='absmiddle'>&nbsp;<a href=\"javascript:pop_win('&act=prefs', 'prefs', 400, 200 )\" onClick='makeActive(this.parentNode)' title='{$ADMIN->lang['acp_prefs_title']}'>{$ADMIN->lang['acp_prefs']}</a></div>
                   <img src='{$this->img_url}/item.gif' border='0' alt='' valign='absmiddle'>&nbsp;<a href='{$this->base_url}&act=logout' style='text-decoration:none;'><button style='font-weight:bold;font-size:12px;color:red;' onclick='document.location.href=\"{$this->base_url}&act=logout\"' title='{$ADMIN->lang['logout_title']}'>   {$ADMIN->lang['logout']}   </button></a>
                  </div>
                 </div>
                 <br />
                ";
//-- mod_sec_update_131 end


  G. Find in function menu_cat_expanded(..)

    function menu_cat_expanded($name="", $links="", $id = "") {

     Insert above the blue code



//-- mod_sec_update_131 begin
    function get_men_js() {
        global $IN, $INFO;
        
        return "
<script type='text/javascript' language='javascript'>
<!--
    var DHTML = (document.getElementById || document.all || document.layers);
    var myAgent   = navigator.userAgent.toLowerCase();
    var myVersion = parseInt(navigator.appVersion);
    var is_ie   = ((myAgent.indexOf(\"msie\") != -1)  && (myAgent.indexOf(\"opera\") == -1));
    
    function getObj(name) {
      if (document.getElementById) {
          return document.getElementById(name);
      }
      else if (document.all) {
        return document.all[name];
      }
      else if (document.layers) {
           return document.layers[name];
      }
    }
    
    function show(id) {
        if (!DHTML) return true;
        s = getObj(\"men_s_\" + id);
        c = getObj(\"men_c_\" + id);
        if (!s || !c) return true;
        s.style.display = s.style.display == 'none' ? 'block': 'none';
        c.style.display = c.style.display == 'none' ? 'block' : 'none';
        cookie = decodeURIComponent(document.cookie);
        if (cookie) {
            var Search = /acpprefs=(.*?)(;|$)/i;
            menu = Search.exec(cookie);
            if (menu)
                menu = menu[1];
            if (!menu || !menu[0]) return false;
            Search = /acpmenu=(.*?)(;|$)/i;
            cookie = Search.exec(cookie);
            if (cookie)
                cookie = cookie[1];
            if (cookie) {
                eval(\"cookie = cookie.replace(/^\" + id + \"$/, '');\");
                eval(\"cookie = cookie.replace(/^\" + id + \",/, '');\");
                eval(\"cookie = cookie.replace(/,\" + id + \"$/, '');\");
                eval(\"cookie = cookie.replace(/,\" + id + \",/, ',');\");
            }
        }
        if (s.style.display == 'block')
            if (cookie)
                cookie += ',' + id;
            else
                cookie = id;
        expires = new Date();
        if (cookie)
            expires.setTime(expires.getTime() + 31536000000);
        else
            expires.setTime(expires.getTime() - 1);
        cookie = encodeURIComponent(cookie);
        document.cookie = \"{$INFO['cookie_id']}\" + \"acpmenu=\" + cookie + \"; path={$INFO['cookie_path']};domain={$INFO['cookie_domain']}; expires=\" + expires.toGMTString();
        return false;
    } 
//-->
</script>
";
    }

    function menu_cat_expanded($name="", $links="", $id = "", $display = "block") {
        global $IN, $ADMIN;
        
        $save = intval($INFO['menu']);
        return "<div id='men_s_$id' style='display:$display;'>\n
                <a name='cat$id'></a>
                <div class='tableborder'>
                  <div class='cattitle'>
                    <a href='{$this->base_url}&act=menu&show={$IN['show']}&out=$id' target='menu' onClick='return show(\"$id\");' ><img src='{$this->img_url}/minus.gif' border='0' title='{$ADMIN->lang['reduce']}'></a>
                    <a href='{$this->base_url}&act=menu&show={$IN['show']}&out=$id' target='menu' onClick='return show(\"$id\");' title='{$ADMIN->lang['reduce']}' >$name</a>
                  </div>
                  <div class='plain'>$links</div>
                </div>
                <br />
                </div>
                ";
    }

    //+--------------------------------------------------------------------


    function menu_cat_collapsed($name="", $id = "", $desc="", $display = "block") {
        global $IN, $ADMIN;
        
        $save = intval($INFO['menu']);
        return "<div id='men_c_$id' style='display:$display;'>\n
                <div class='tableborder'>
                  <div class='cattitle'>
                    <a href='{$this->base_url}&act=menu&show=,{$IN['show']},$id#cat$id' target='menu' onClick='return show(\"$id\");' ><img src='{$this->img_url}/plus.gif' border='0' alt='Collapse Category'  title='{$ADMIN->lang['expand']}'></a>
                    <a href='{$this->base_url}&act=menu&show=,{$IN['show']},$id#cat$id' target='menu' onClick='return show(\"$id\");' title='{$ADMIN->lang['expand']}'>$name</a>
                  </div>
                  <div class='desc'>$desc</div>
                </div>
                <br />
                </div>
                ";

    }
    
    function menu_cat_link($url="", $name="", $urltype=0) {
        global $INFO;

        if ( $urltype == 1 )
            $theurl = $INFO['board_url'].'/index.'.$INFO['php_ext'].'?';
        else
            $theurl = $this->base_url;

        return "<div width='100%' name='item'><img src='{$this->img_url}/item.gif' border='0' alt='' valign='absmiddle'>&nbsp;<a href='{$theurl}&$url' target='body' onClick='makeActive(this.parentNode)'>$name</a></div>";

    }

//-- mod_sec_update_131 end

/*-- mod_sec_update_131 exclude begin


    function menu_cat_expanded($name="", $links="", $id = "") {

  H. Find in function frame_set(..)

    function frame_set() {

     Insert above the blue code



-- mod_sec_update_131 exclude end */


    function frame_set() {

  I. Find in function frame_set(..)

        $frames = "<html>

     Insert above the blue code



//-- mod_sec_update_131 begin
        $frames = "<html>
                        <head><title>Invision Power Board Administration Center</title></head>
                       <frameset cols='215, *' frameborder='no' border='0' framespacing='0'>
                           <frame name='menu' noresize scrolling='auto' src='{$this->base_url}&act=menu'>
                           <frame name='body' noresize scrolling='auto' src='{$this->base_url}&act=index'>
                       </frameset>
                   </html>";

        return $frames;
//-- mod_sec_update_131 end


        $frames = "<html>

  J. Find

}






?>

     Insert above the blue code



//-- mod_sec_update_131 begin
function pop_up_window($title, $text) {
    global $INFO;

    $css = $this->get_css();

    $html = <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> 
    <title>$title</title>
$css
</head>
<body>
    <div style='text-align:left'>
$text
    </div>
</body>
</html>
EOF;
    if ($INFO['disable_gzip'] != 1) {
        $buffer = ob_get_contents();
        ob_end_clean();
        ob_start('ob_gzhandler');
        print $buffer;
    }
    if ($INFO['print_headers']) {
        @header("HTTP/1.0 200 OK");
        @header("HTTP/1.1 200 OK");
        @header("Content-type: text/html");
        if ($ibforums->vars['nocache']) {
            @header("Cache-Control: no-cache, must-revalidate, max-age=0");
            @header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
            @header("Pragma: no-cache");
        }
    }
    echo ($html);
    exit;
}
//-- mod_sec_update_131 end


}






?>


Step 16:  Open sources/Admin/ad_remote_template.php

  Find in function print_css_searchlinks(..), print_searchlinks(..)

        require './sources/Admin/skin_info.php';

     Insert below the blue code

        require './sources/Admin/skin_info.php';



//-- mod_sec_update_131 begin
        $ADMIN->adjust_skin_info($skin_names, $bit_names);
//-- mod_sec_update_131 end



Step 17:  Open sources/Admin/ad_templates.php

  A. Find in function upload_form(..), show_cats(..), edit_bit(..)

        require './sources/Admin/skin_info.php';

     Insert below the blue code

        require './sources/Admin/skin_info.php';



//-- mod_sec_update_131 begin
        $ADMIN->adjust_skin_info($skin_names, $bit_names);
//-- mod_sec_update_131 end


  B. Find in function checkcheckall(..), edit_bit(..)

// If easy name is available, use it

     Insert below the blue code

// If easy name is available, use it



//-- mod_sec_update_131 begin
                        $sec_arry[ $i['suid'] ]['easy_name'] = ($non_default++).": function ".$i['func_name'];
//-- mod_sec_update_131 end


  C. Find in function show_cats(..)

        while ( $group = $DB->fetch_row($all_cats) )
        {

     Insert below the blue code

        while ( $group = $DB->fetch_row($all_cats) )
        {



//-- mod_sec_update_131 begin
            $sort_name = isset($skin_names[ $group['group_name'] ])?strtoupper($skin_names[ $group['group_name'] ][0]):"0".strtoupper($group['group_name']);
            $groups[$sort_name] = $group;
        }
        ksort($groups);
        foreach ($groups as $group)
        {
            $non_default = 1000;
//-- mod_sec_update_131 end


  D. Find in function pop_win(..)

                $new_q = $DB->query("SELECT func_name, LENGTH(section_content) as sec_length, suid FROM ibf_skin_templates WHERE set_id='{$IN['id']}' AND group_name='{$group['group_name']}'");

     Insert above the blue code



//-- mod_sec_update_131 begin
                if (TRUE)
                    $new_q = $DB->query("SELECT func_name, LENGTH(section_content) as sec_length, suid FROM ibf_skin_templates WHERE set_id='{$IN['id']}' AND group_name='{$group['group_name']}' ORDER BY suid");
                else
//-- mod_sec_update_131 end


                $new_q = $DB->query("SELECT func_name, LENGTH(section_content) as sec_length, suid FROM ibf_skin_templates WHERE set_id='{$IN['id']}' AND group_name='{$group['group_name']}'");

  E. Find in function edit_bit(..)

        $DB->query("SELECT * FROM ibf_skin_templates WHERE suid IN (".implode(",",$ids).")");

     Insert above the blue code



//-- mod_sec_update_131 begin
        if (TRUE)
            $DB->query("SELECT * FROM ibf_skin_templates WHERE suid IN (".implode(",",$ids).") ORDER BY suid");
        else
//-- mod_sec_update_131 end


        $DB->query("SELECT * FROM ibf_skin_templates WHERE suid IN (".implode(",",$ids).")");

  F. Find in function do_form(..)

                                                    $SKIN->form_input('url', $row['url']),
                                         )      );

     Insert below the blue code

                                                    $SKIN->form_input('url', $row['url']),
                                         )      );



//-- mod_sec_update_131 begin
         $ADMIN->html .= $SKIN->add_td_row( array("<b>Skin directory</b>","Skin/s".$IN['id'],)      );
//-- mod_sec_update_131 end


  G. Find in function list_current(..), list_current(..)

                $ADMIN->html .= $SKIN->add_td_row( array( "<b>".stripslashes($r['skname']

     Insert above the blue code



//-- mod_sec_update_131 begin
                    $r['skname'] .= "&nbsp;&nbsp;(Skin/s".$r['skid'].")";
//-- mod_sec_update_131 end


                $ADMIN->html .= $SKIN->add_td_row( array( "<b>".stripslashes($r['skname']

  H. Find in function do_edit(..)

        $ADMIN->done_screen("Template file(s) updated", "Manage Templates in template set: {$row['skname']}", "act=templ&code=edit&id={$template['set_id']}" );

     Insert above the blue code



//-- mod_sec_update_131 begin
        foreach ($ids as $id) {
            $query .= "&cb_".$id."=1";
        }
        $query .= "&expand=".$ids[0];
        $ADMIN->done_screen("Template file(s) updated", "Manage Templates in template set: {$row['skname']}",
                            "act=templ&code=edit&id={$template['set_id']}",
                            array("act=templ&code=edit_bit".$query => "Back to last edited skin function") );
        exit();
//-- mod_sec_update_131 end


        $ADMIN->done_screen("Template file(s) updated", "Manage Templates in template set: {$row['skname']}", "act=templ&code=edit&id={$template['set_id']}" );

 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