Logo name

Ipb 2.1:Migrate Ipb 2.0 to Ipb 2.1

From IpbWiki

  • Currently0.00/5
Jump to: navigation, search

Contents

Global changes variables / classes

$ibforums is now $this->ipsclass
$std is now $this->ipsclass
$DB is now $this->ipsclass->DB
$print is now $this->ipsclass->print
$sess is now $this->ipsclass->sess
$forums is now $this->ipsclass->forums
$ibforums->input['IP_ADDRESS'] is now $this->ipsclass->ip_address

Function Names

$std->clean_value is now $this->ipsclass->parse_clean_value

Class Names

modfunctions.php is now func_mod.php
msg_functions.php is now func_msg.php
usercp_functions.php is now func_usercp.php
chat_functions.php is now func_chat_legacy.php
chat04_functions.php is now func_chat.php

Class Calls

new chat_functions() is now new func_chat()
new modfunctions() is now new func_mod()
new msg_functions() is now new func_msg()
new usercp_functions() is now new func_usercp()

Recommended Class Loading

It is recommended that you load classes as follows, being sure to pass ipsclass to the module

CODE
require_once( ROOT_PATH.'sources/module.php' );
$class = new module();
$class->ipsclass =& $this->ipsclass;

Note the =& which ensures we pass a reference to $this->ipsclass to ensure that any changes to the ipsclass method is reflected in all instances.

Loading language files

IPB 2.1 introduces a new cleaner method of loading language files:

CODE
$this->ipsclass->load_language('lang_calendar');

The changes to the $this->ipsclass->lang array is handled internally and the member's language ID is handled internally.

Member Management

When you're dealing with the member's name for display purposes (when showing in a post, quote, topic starter, etc) be sure to use "members_display_name" inplace of "name". members_display_name is populated even if the admin chooses not to use the display name feature.

Using Skins

Unless legacy mode is enabled, skins no longer return the class identifier from "load_template". You can access skin classes via the:
CODE
$this->ipsclass->compiled_skins[ {skin_name} ] array.
For example:

$this->ipsclass->load_template( 'skin_boards' );
print $this->ipsclass->compiled_templates[ 'skin_boards' ]->page_top( $data );
This page was last modified on 11 November 2006, at 15:16.  This page has been accessed 2,598 times.  Content is available under GNU Free Documentation License 1.2Disclaimers