Phpbb Primetime


Not your daddy's portal

Categories

Who is online

In total there are 8 users online :: 2 registered, 0 hidden and 6 guests

Most users ever online was 84 on December 7th, 2011, 11:36 pm

Registered users: Corrine, Google [Bot]


Legend :: Administrators, Primetime Staff, Registered users

Recent Articles

Articles

HOW TO: Creating a primetime module (PART 1)

by Blitze on April 8th, 2009, 5:56 am
Rating:
  • 6 votes
(6 votes)

If you are like me and you just don't want to sit around and wait for someone to create a module you want, or you simply want to understand how this whole thing works, this article is for you. In this article, we discuss how to create a module for phpbb primetime and how that differs from a module for phpbb3. We also set the stage for creating a sample phpbb primetime module.


Subtitles
So how do we create a module for phpbb primetime any way? Well, it's easier than you might think. But first, let's take a brief step back to find out how phpbb primetime actually works. Phpbb primetime relies on phpbb3's module system, which is really not a hook system but rather a fairly smart way to have specially defined php classes to work together, wrapped up in a menu system that relies on Modified Preorder Tree Traversal technique, and uses phpbb3's permission system to decide which modules to display or not to display. This system is mainly used in the user control panel (ucp), moderator control panel (mcp), and the administrative control panel (acp) in a vanilla phpbb installation. Phpbb Primetime modules are only an extension of this system, and so we talk about phpbb3's module system first.

Creating a phpbb3 module

A typical phpbb3 module would have an info file that provides information such as the module's parent, class, mode, language variables, permission requirements, etc, and the module class that's executed when that module is called. A typical phpbb3 module's info file will look like this:

includes/acp/info/acp_foo.php
Code: Select all
class acp_foo_info
{
   function module()
   {
      return array(
         'filename'   => 'acp_foo',
         'title'      => 'ACP_FOO',
         'version'   => '1.0.0',
         'modes'      => array(
            'foo_mode'   => array('title' => 'ACP_FOO_MODE_TITLE', 'auth' => 'acl_a_foo_auth', 'cat' => array('')),
         ),
      );
   }

   function install()
   {
   }

   function uninstall()
   {
   }
}
Where:
  • acp - module class
  • filename - the php file to be executed
  • title - title of the module
  • version - the module version (not really used)
  • modes - the module's modes
    • title - the language variable representing the module modes' title
    • auth - module modes' permission
    • cat - the module modes' parent category
  • Install/Uninstall functions - Not currently used in phpbb3


While a typical module's php main file (in this example acp_foo.php specified in the info file) will look like this:

includes/acp/acp_foo.php
Code: Select all
class acp_foo
{
   var $u_action;

   function main($id, $mode)
   {
      switch($mode)
      {
         case 'foo_mode':
            // code here
         break;
      }

      $this->page_title = 'ACP_FOO';
      $this->tpl_name = 'acp_foo';
   }
}
Where:
  • $this->page_title - the page title
  • $this->tpl_name - the name of the template file used by the module


Note that a language file (holding the value of ACP_FOO, and ACP_FOO_MODE_TITLE variables), and a template file to display the module kept in styles/<style>/template/ folder. You can view a full tutorial on creating a phpbb module here.

 

Creating a primetime module

Comments

valkriun
valkriun
April 16th, 2009, 10:40 pm
Hey It wouldn't let me pm you for some reason. Just to let you know im not dead lol and still am interested. Its just been super busy with school especially since the term is ending. I wont have time till may to do any other hobbies.

I took a glance over the article. Ill have to check it out indepth when I actually try to make a module.

mentaleak
mentaleak
July 25th, 2009, 5:07 pm
I can't wait for part two the example. :)

Pete
Pete
November 25th, 2009, 7:57 am
mentaleak wrote:I can't wait for part two the example. :)

testing comment.

AmigaLink
AmigaLink
November 5th, 2010, 10:46 pm
mentaleak wrote:I can't wait for part two the example. :)

Me too :)

  • Login
Username:

Password:


Remember Me
Hide Me
Register
  • Topics Calendar
May 2013

S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31