MKPortal SingleBoard  1.4.2  Invision Power Board 1.3
Mod Description MKPortal for Invisionboard (Please read the instructions below)
Mod Compatibility Invision Power Board 1.3
Mod Category Major Mod
Mod Author Coder: Meo, Peter
Designer: Kim
Tester and Translator: Our team at mkportal.it
Mod Author's Email luponero@mclink.it, Peter@ibforen.de
Info File sources/mods/mkportal/mod_mkportal_howto.htm
Mod Version 1.4.2
Comment Distribution is not allowed. Download from ibforen.de or invisionize.com
All changes could be recognized by mod_token

This html-howto was created with The ModInstaller 1.3.2 by
Peter@ibforen.de, released on 8th January, 2007
Creation time 2007-09-11

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_mkportal

 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

1.4.2
1.3 Final ⇒ 1.4All files of MKPortal have to get iexhchanged with the newer version (except of lan_custom.php". Then you have to reinstall the mod MKPortal in IPB ACP.
If you are running an upgrade, then you have to process the script upgrade_13_14.php. Do not forget to remove that script thereafter

 2.  Changes
Changed file Changed function
index.php body
sources/Drivers/mySQL.php class properties or methods
sources/Drivers/mySQL.php query(..)
sources/functions.php authorise(..)
sources/functions.php board_offline(..)
sources/functions.php class properties or methods
sources/functions.php do_output(..)
sources/functions.php do_output(..), do_output(..)
sources/functions.php Error(..)
sources/lib/emailer.php build_headers(..)
sources/Login.php delete_cookies(..)

 3.  Copy

Decompressing
Decompress the archive. You will find a directory uploads and 2 directories Invisionboard and mkportal inside uploads.

Copy Invisionboard files
Copy all files and dirs in Invisionboard into the root dir of your ipb und take care of the structure.
Best if you copy the entire directores. They are prestructured.
Copy MKPortal files

New Installation
Upgrade
Do the same as above except of mkportal/conf_mk.php. Do not overwrite this file. Attention: Do avoid overwriting your language entries for custom blocks, copy the folder lang_update instead of lang.

After these steps you will have this structureExample
Let us assume, that you have your ipb in /home/htdocs/forum, then you should have this structure
Permissions (chmod)
Now you have to set some permissions on the new directories. (Sometimes we can chmod lower, but only if we know, which user is used for access).

Use your favorite ftp-client and set the follwing permissions:
  1. mkportal itself: 0777
  2. mkportal/conf_mk.php: 0666
  3. mkportal/blog: 0777
  4. mkportal/cache: 0777
  5. mkportal/files: 0777
  6. mkportal/files/downloads: 0777
  7. mkportal/files/gallery: 0777
  8. mkportal/files/reviews: 0777
  9. mkportal/files/uploads: 0777
  10. mkportal/lang/xx: 0777 (all subdirs in this dir)
  11. mkportal/lang/xx/xx: 0666 (all files in the subdirs, but not the admin subdir).

 4.  Code


Step  1:  Open index.php

  A. Find

$DB->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];

     Insert below the blue code

$DB->obj['sql_tbl_prefix']   = $INFO['sql_tbl_prefix'];



//-- mod_mkportal begin
    define('IN_FORUM', TRUE);
    define("MK_PATH", "../");
    require MK_PATH."mkportal/conf_mk.php";
    if ($MK_CONFIG['forum_view'] == "1") {
        unset ($DB);
        require MK_PATH."mkportal/include/mk_mySQL.php";
        $DB = new mk_db_driver( $INFO['sql_database'],
                                $INFO['sql_user'],
                                $INFO['sql_pass'],
                                $INFO['sql_host'],
                                $INFO['sql_tbl_prefix'],
                                $MK_CONFIG['mk_tbl_prefix'],
                                $INFO['debug_level']
                                );
    }
//-- mod_mkportal end


  B. Find

$skin_universal = $std->load_template('skin_global');

     Insert below the blue code

$skin_universal = $std->load_template('skin_global');



//-- mod_mkportal begin
    define('IN_MK', TRUE);
    if ($MK_CONFIG['forum_view'] == "1") {
        require MK_PATH."mkportal/include/functions.php";
        require "$mklib->template_path/tpl_main.php";
    }
//-- mod_mkportal end



Step  2:  Open sources/functions.php

  A. Find in function Error(..)

        }


        $print = new display();

     Insert below the blue code

        }


        $print = new display();



//-- mod_mkportal begin
        global $MK_CONFIG, $Skin, $mklib;
        if (!defined("IN_IPB")) {
            $this->boink_it($MK_CONFIG['forum_path']."/index.php");
        }
        if (!defined("IN_MK")) {
            define('IN_MK', TRUE);
            require MK_PATH."mkportal/include/functions.php";
            require "$mklib->template_path/tpl_main.php";
        }
        if ($MK_CONFIG['forum_view'] == "1") {
            if (!class_exists("mkportal") ) {
                if (file_exists(ROOT_PATH."sources/mods/mkportal/mod_mkportal_func.php")) {
                    require ROOT_PATH."sources/mods/mkportal/mod_mkportal_func.php";
                }
                else {
                    die("Could not call required function from file 'sources/mods/mkportal/mod_mkportal_func.php'<br />Does it exist?");
                }
            }
            $print->add_output($mkportal->insert_js());
            $print->add_output($html);
            $print->to_print = str_replace( "<% MEMBER BAR %>", "", $print->to_print);
            $FORUM_OUT = $mkportal->clean_html($print->to_print);
            $mklib->forum['js'] = $FORUM_OUT['js'];
            $mklib->forum['css'] = $FORUM_OUT['css'];
            $mklib->printpage(!$mklib->forumcs, !$mklib->forumcd, $mklib->sitename."->".$ibforums->lang['error_title'], $FORUM_OUT['html']);
            exit();
        }
//-- mod_mkportal end


  B. Find in function board_offline(..)

        $html = $skin_universal->board_offline( $msg );

        $print = new display();

     Insert below the blue code

        $html = $skin_universal->board_offline( $msg );

        $print = new display();



//-- mod_mkportal begin
        global $MK_CONFIG;
        if ($MK_CONFIG['forum_view'] == "1") {
            $TAGS = $DB->query("SELECT macro_value, macro_replace FROM ibf_macro WHERE macro_set={$ibforums->skin['macro_id']}");
            while ( $row = $DB->fetch_row($TAGS) ) {
                if ($row['macro_value'] != "") {
                    $print->to_print = str_replace( "<{".$row['macro_value']."}>", $row['macro_replace'], $print->to_print );
                }
            }

            $print->to_print = str_replace("<#IMG_DIR#>", $ibforums->skin['img_dir'], $print->to_print);
            if (!class_exists("mkportal") ) {
                if (file_exists(ROOT_PATH."sources/mods/mkportal/mod_mkportal_func.php")) {
                    require ROOT_PATH."sources/mods/mkportal/mod_mkportal_func.php";
                }
                else {
                    die("Could not call required function from file 'sources/mods/mkportal/mod_mkportal_func.php'<br />Does it exist?");
                }
            }
            $print->add_output($mkportal->insert_js());
            $print->add_output($html);
            $print->to_print = str_replace( "<% MEMBER BAR %>", "", $print->to_print);
            global $mklib;
            $FORUM_OUT = $mkportal->clean_html($print->to_print);
            $mklib->forum['js'] = $FORUM_OUT['js'];
            $mklib->forum['css'] = $FORUM_OUT['css'];
            $mklib->printpage(!$mklib->forumcs, !$mklib->forumcd, $mklib->sitename."->".$ibforums->lang['offline_title'], $FORUM_OUT['html']);
            exit();
        }
//-- mod_mkportal end


  C. Find in function do_output(..)

        $nav  = $skin_universal->start_nav();

     Insert below the blue code

        $nav  = $skin_universal->start_nav();



//-- mod_mkportal begin
        global $MK_CONFIG;
        if (!$MK_CONFIG['forum_view']) {
            $nav .= "<a href='".$MK_CONFIG['site_url']."/index.php'>".$MK_CONFIG['site_name']."</a>"."<{F_NAV_SEP}>";
        }
//-- mod_mkportal end


  D. Find in function do_output(..)

        $this_header  = $skin_universal->BoardHeader();

     Insert above the blue code



//-- mod_mkportal begin
        global $MK_CONFIG;
        if ($MK_CONFIG['forum_view'] == "1" ) {
            if (!class_exists("mkportal") ) {
                if (file_exists(ROOT_PATH."sources/mods/mkportal/mod_mkportal_func.php")) {
                    require ROOT_PATH."sources/mods/mkportal/mod_mkportal_func.php";
                }
                else {
                    die("Could not call required function from file 'sources/mods/mkportal/mod_mkportal_func.php'<br />Does it exist?");
                }
            }
            $this_header  = $mkportal->insert_js();
        } 
        else
//-- mod_mkportal end


        $this_header  = $skin_universal->BoardHeader();

  E. Find in function do_output(..)

            if ($ibforums->member['show_popup'])

     Insert above the blue code



//-- mod_mkportal begin
            if (empty($output_array['OVERRIDE']) && $MK_CONFIG['forum_view'] != "1") {
                if ($ibforums->member['show_popup']) {
                    $DB->query("UPDATE ibf_members SET show_popup=0 WHERE id={$ibforums->member['id']}");
                    if ( $ibforums->input['act'] != 'Msg' ) {
                        $pm_js = $skin_universal->PM_popup();
                    }
                }
            }
            else {
                $css = preg_replace("`url\s*\(css.php`i", "url(".$ibforums->vars['board_url']."/css.php", $css);
            }
//-- mod_mkportal end


            if ($ibforums->member['show_popup'])

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

        if ( empty($output_array['OVERRIDE']) )

     Insert above the blue code



//-- mod_mkportal begin
        if (empty($output_array['OVERRIDE']) && $MK_CONFIG['forum_view'] == "1") {
            $ibforums->skin['template'] = str_replace( "<% MEMBER BAR %>", "", $ibforums->skin['template']);
        }
//-- mod_mkportal end


        if ( empty($output_array['OVERRIDE']) )

  G. Find

        print $ibforums->skin['template'];

        exit;

     Insert above the blue code



//-- mod_mkportal begin
        if ($MK_CONFIG['forum_view'] == "1") {
            if (empty($output_array['OVERRIDE'])) {
                global $mklib;
                $FORUM_OUT = $mkportal->clean_html($ibforums->skin['template']);
                unset($ibforums->skin['template']);
                $mklib->forum['js'] = $FORUM_OUT['js'];
                $mklib->forum['css'] = $FORUM_OUT['css'];
                $nav = str_replace("<{F_NAV_SEP}>", "->", $nav);
                $nav = preg_replace("`<.*?".">`", "", $nav);
                $mklib->printpage(!$mklib->forumcs, !$mklib->forumcd, $mklib->sitename."->".$nav, $FORUM_OUT['html']);
                exit();
            }
            else {
                $ibforums->skin['template'] = preg_replace("`('|\")style_images/`i", "\\1".ROOT_PATH."style_images/", $ibforums->skin['template']);
            }
        }
//-- mod_mkportal end


        print $ibforums->skin['template'];

        exit;

  H. Find in function authorise(..)

        return $this->member;

    }

     Insert above the blue code



//-- mod_mkportal begin
        if (! $this->member['id'])
        {
            $lang = $std->my_getcookie('language');
            if ($lang) {
                $this->member['language'] = $lang;
            }
            $skin = $std->my_getcookie('skin');
            if ($skin !== FALSE) {
                $this->member['skin'] = $skin;
            }
        }
//-- mod_mkportal end


        return $this->member;

    }


Step  3:  Open sources/Login.php

  Find in function delete_cookies(..)

         $std->my_setcookie('forum_read', '-1');

     Insert below the blue code

         $std->my_setcookie('forum_read', '-1');



//-- mod_mkportal begin
         $std->my_setcookie('language', 'en');
//-- mod_mkportal end



Step  4:  Open sources/lib/emailer.php

  Find in function build_headers(..)

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

     Insert below the blue code

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



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



Step  5:  Open sources/Admin/admin_functions.php


Step  6:  Open sources/Drivers/mySQL.php

  A. Find

                       'debug'          => 0,

     Insert below the blue code

                       'debug'          => 0,



//-- mod_mkportal begin
                       'debug_level'    => 0,
//-- mod_mkportal end


  B. Find in function query(..)

        $this->obj['cached_queries'][] = $the_query;

     Insert above the blue code



//-- mod_mkportal begin
        if ($this->obj['debug_level'] >= 3) 
//-- mod_mkportal end


        $this->obj['cached_queries'][] = $the_query;

 5.  Customize

Installation of MKportal

Run the install script in directory mkportal

http://.../mkportal/mk_install.php

and follow the instructions.


Customize your Invisionboard

Zitat

Important
Before modifiying your Invisionboard files be sure, not to have installed my mod Customize Date In Your Own language with mod_token mod_customize_date. If this mod is installed, please remove it completely. This mod is integrated into MKPortal.


Several files must be modified. Follow the instruction above or use The ModInstaller (recommended).


Customize the lang-id translation to MKPortal language names

This step could be done directly in MKPortal's Control Center. Go to Main ⇒ Preferences and assign languages of MKPortal to languages of your board.


Integration of MKPortal into the skin engine of Invisionboard

The archive contains a new template for MKPortal: "Forum_Skin".
New MKPortal Skin for your Invisionboard 1.3

We have added a new MKPortal Skin, including buttons in several languages. When you have imported the skin via ACP, you will see some subdirs in style_images/mkportal-xxx.

These subdirs are named as en, de, fr, it etc. and you will understand its purpose immediately. With the above modifications you will be able to select the proper image directory automatically.
Look thru your lang dir in IPB and remember the dir names. They will be like en, 2, 3 etc. Take a look at some files to be sure, which language is assigned to which name.

Now rename the new dirs in the image folder according to these dir names.

You can choose this solution for other skins too. Simply create new dirs in the image folder and name them in this sense. Copy the orignal image files into these new directories and thereafter copy all your new buttons in according languages into these new dirs.

If users choose their language, your board will show the right buttons.

Upgrade MKportal 0.1 ⇒ MKPortal 1.0.x

Run the upgrade script upgrade.php in directory mkportal. Do not forget to remove this script after having used it.

Upgrade MKportal 1.0.1 ⇒ MKPortal 1.1
  1. Run the upgrade script upgrade_101_11.php in the root directory (above of mkportal with index.php inside). It will modify the existing database.

    Do not forget to remove this script after having used it.
  2. Remove all modification to Invisionboard, made by an previous installation of MKPortal.
  3. Remove all modification to Invisionboard, made by my mod "Customize Date In Your Own Language" (if necessary)
  4. Modify the Invisionboard files, as described above. Follow the instructions very carefully or use The ModInstaller (recommended).
  5. Go to your Portal Control Panel and set the options for your needs.

Upgrade MKportal 1.1a ⇒ MKPortal 1.2
  1. Run the upgrade script upgrade_11a_12.php in the root directory (above of mkportal with index.php inside). It will modify the existing database.

    Do not forget to remove this script after having used it.
  2. Go to your Portal Control Panel and set the options for your needs.

Upgrade MKportal 1.2 ⇒ MKPortal 1.3
  1. Exchange all files as described above except mk_conf.php
  2. Create a new folder ./mkportal/files/uploads and chmod to 0777
  3. We have customized the skin file mod_mkportal_skin.php for Invisionboard. Copy that file in all skin folders and customize it as you like it.
  4. Go to your Portal Control Panel and set the options for your needs.

 6.  Comment

Feedback is welcomed and desired. Support and Feedback at mkportal.it

 7.  Older Change History and Change Logs

1.2 Final ⇒ 1.3
1.1b Final ⇒ 1.2

General

Admin

User

1.1 Final ⇒ 1.1b