Translations of this page: en bg cs de fi fr hu it ja pl ru tr zh

This is an old revision of the document!


Struct of PunBB development extensions

General information

Система расширений позволяет создавать шибкую систему дополнений, позволяющие создавать дополнения без внесения изменений в ядро PunBB. Управляя системой расширений вы можете определять уровень функциональности, дополняя сайт нужными для вас функциями.

Names of variable, functions

Любые обозначения в коде PunBB имеют свое значение. Систематизация обозначений повышает уровень читаемости и наглядности кода. Принципы обозначения:

  • Любые константы форума пишутся заглавными буквами
  • При указании переменных, содержащих несколько имен, используется в качастве разделителя символ “_”
  $str_name = 'My name is Jake';
 
  • При указании имен переменных, первым словом идет указание какой части форума она принадлежит
  echo '<pre>';
  print_r($forum_config);
  echo '</pre>';
 

Code styles

PHP specification

SQL specification

The manifest

Manifest in general

Blocks of manifest

<extension>
<id>
<title>
<version>
<description>
<author>
<minversion>
<maxtestedon>
<note>
Install
Uninstall
Type
<dependencies>
<dependency>
<install> and <uninstall>
<hooks>
Parameter "priority" in the tag <hook>

Idea of work extensions

Install extensions

Uninstall extensions

Upgrade extensions (EXT_CUR_VERSION)

Work of extensions on PunBB (hooks)

Including files

Language files

Javascript and CSS

PHP

$ext_info

Steps of development

  • Create the idea of extension
  • Create the wiki article for the extension and write the general idea and the specification there.
  • Add the ticket to the Trac (or just start a text file, if you have no Trac). List the main tasks to complete the extension.
  • //To be invented:// Create the automatic test (e.g. using pun_admin_simpletest) for all the features in your task-list.
  • Code them all! Follow your task-list and strike out done.
    • Commit your changes to the SVN separately: one feature or one bug fix is one commit. Do not commit multiple changes simultaneously.
    • BTW: Use SVN or other VCS. (I personally prefer Bazaar.)
  • Add the documentation to the wiki article.
    • Extension usage.
    • Extension customization and integration.
  • Publish extension in the extension repository (as soon as it passed all the automatic tests).
    • Third-party developers may propose their extensions to be reviewed and published in the repository.
  • Release the extension in Forums.

Recipes


Personal Tools