IPS Tutorials: Components and Modules > Create an IPB Components Public |
|
|||||||||
This section is focused on Invision Power Services products...
IPS, widely praised for the continuous efforts aimed to a stable, fast and efficient board system has brought to us Invision Power Board, but not only that..
Invision Power Gallery & Invision Community Blog allow the forum members :
IPS Tutorials: Components and Modules > Create an IPB Components Public |
31 Dec 2008, 06:42 AM
Post
#1
|
|
yourforum Robot Group: Private Members Posts: 196639 Joined: 12-July 05 From: RSS World Member No.: 125 |
First to start off with open an ftp program / find your forums folder / sources / components_public
Download and open the file example.php as you can see Matt has a simple example. Step 1. Open notepad copy the below text and save it as yourpage.php <?php if ( ! defined( 'IN_IPB' ) ) { print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; exit(); } class component_public { var $output = ""; var $page_title = ""; var $nav = array(); var $html = ""; var $ipsclass; /*-------------------------------------------------------------------------*/ // Run Component /*-------------------------------------------------------------------------*/ function run_component() { global $ipsclass; $this->ipsclass->load_language('lang_yourpage'); $this->ipsclass->load_template('skin_yourpage'); $this->base_url = $this->ipsclass->base_url; $this->main(); $this->nav[] = "<a href='{$this->ipsclass->base_url}autocom=yourpage'>{$this->ipsclass->lang['page_title']}</a>"; $this->page_title = $this->ipsclass->lang['page_title']; $this->ipsclass->print->add_output( $this->output ); $this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->vars['board_name']." - ".$this->page_title, 'JS' => 0, NAV => $this->nav ) ); } /*-------------------------------------------------------------------------*/ // Main /*-------------------------------------------------------------------------*/ function main() { global $ipsclass; $this->output .= $this->ipsclass->compiled_templates['skin_yourpage']->main(); } } ?> Step 2. Open your AdminCP / LOOK & FEEL / Select your skin / Edit Template HTML / All Global HTML / down the bottom click Add Template Bit New Template Bit Name: main Or Create New Group: yourpage Click Continue / In the text box copy and paste the below code into it and Click Save Template <div class='borderwrap'> <div class="maintitle">{$this->ipsclass->lang['welcome_message']}</div> <table width='100%' cellpadding='4' cellspacing='1'> <tr><td class='row2' width='100%' align='left'>{$this->ipsclass->lang['welcome_message']} {$this->ipsclass->member['name']} Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla erat libero, posuere non, adipiscing vel, aliquam vitae, metus. Integer elementum viverra elit. Aenean quis odio at nisl viverra cursus. Phasellus nibh. Nulla tellus est, aliquam a, consequat ac, sodales elementum, arcu. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce mi. In hac habitasse platea dictumst. Nullam est erat, dapibus eu, tempor eget, molestie nec, massa. Mauris eu enim sit amet magna dapibus sodales. Nulla hendrerit mauris eget purus. Fusce enim magna, luctus placerat, ornare eget, venenatis sit amet, magna. Proin tellus.</td></tr> </table> </div> Step 3. Open notepad and copy the following code, save this as lang_yourpage.php <?php $lang = array ( 'page_title' => "Your Page", 'welcome_message' => "Welcome to Your Page", ); ?> Step 4. Upload all the files as described below yourpage.php -> sources/components_public lang_yourpage.php -> cache/lang_cache/en Step 5. You can access your file from http://www.yourforum.com/index.php?autocom=yourpage View the full article |
|
18 Nov 2009, 08:29 AM
Post
#2
|
|
Newbie Group: Members Posts: 9 Joined: 17-November 09 Member No.: 38823 Gender: |
|
|
19 Nov 2009, 10:52 AM
Post
#3
|
|
Newbie Group: Members Posts: 9 Joined: 17-November 09 Member No.: 38823 Gender: |
|
|
Lo-Fi Version | Time is now: 18th April 2024 - 01:24 PM |
Skin and Graphics by Dan Ellis and Anubis. Hosting by Forums & More © 2005-2011. |