Differences
This shows you the differences between the selected revision and the current version of the page.
punbb13:extension_development 2010/04/12 07:33 | punbb13:extension_development 2020/02/06 11:04 current | ||
---|---|---|---|
Line 153: | Line 153: | ||
* You must not use includes in the uninstall process, since the code within the uninstall hook is copied to the database upon installation (and thus must be able to be run by itself). All of the code for these must be contained within the manifest.xml file. | * You must not use includes in the uninstall process, since the code within the uninstall hook is copied to the database upon installation (and thus must be able to be run by itself). All of the code for these must be contained within the manifest.xml file. | ||
* When using includes in hooks it's recommended in general to include functions and libraries. | * When using includes in hooks it's recommended in general to include functions and libraries. | ||
+ | |||
+ | ==== Including CSS/JavaScript ==== | ||
+ | |||
+ | * To include CSS/JavaScript use the ''$forum_loader'' class' "''add_css''" and "''add_js''" methods. | ||
+ | * For more information on the forum_loader class, see [[punbb13:extension_development:forum_loader]]. | ||
==== Language files ==== | ==== Language files ==== | ||
Line 170: | Line 175: | ||
else | else | ||
require $ext_info['path'].'/lang/English.php';</code> | require $ext_info['path'].'/lang/English.php';</code> | ||
+ | |||
+ | ==== Databases ==== | ||
+ | |||
+ | It is important your extension work in all 3 database systems supported by PunBB. To do this, you should use the helper functions provided in the [[punbb13:database helpers|database abstraction layer]] as much as possible. | ||
==== Version numbers ==== | ==== Version numbers ==== | ||
Line 177: | Line 186: | ||
==== Extensions must be able to be disabled ==== | ==== Extensions must be able to be disabled ==== | ||
- | Extensions in PunBB can be disabled from the administration panel or via a constant in ''config.php''. This action does not uninstall the extension but simply turns off its hooks. It is important you think about this situation when coding your extension. As a result, in general you can not perform destructive actions on the core database (eg: remove the Guest user, delete a core configuration value, shrink a column to an unusable size, drop a table or column, etc). | + | Extensions in PunBB can be disabled from the administration panel or via a [[punbb13:constants#forum_disable_hooks|constant in config.php]]. This action does not uninstall the extension but simply turns off its hooks. It is important you think about this situation when coding your extension. As a result, in general you can not perform destructive actions on the core database (eg: remove the Guest user, delete a core configuration value, shrink a column to an unusable size, drop a table or column, etc). |
It is also important to make sure that any files in your extension that are accessed directly return some form of error message if they are accessed when the extension is disabled. | It is also important to make sure that any files in your extension that are accessed directly return some form of error message if they are accessed when the extension is disabled. | ||
Line 189: | Line 198: | ||
===== PunBB team extension development life cycle ===== | ===== PunBB team extension development life cycle ===== | ||
- Create the wiki article for the extension and write the general idea and the specification there. | - Create the wiki article for the extension and write the general idea and the specification there. | ||
- | * The page url must be ''%%http://punbb.informer.com/wiki/punbb13:extensions:<extension_id>%%'', e.g. http://punbb.informer.com/wiki/punbb13:extensions:pun_pm. | + | * The page url must be ''%%https://punbb.informer.com/wiki/punbb13:extensions:<extension_id>%%'', e.g. https://punbb.informer.com/wiki/punbb13:extensions:pun_pm. |
- | * You may also start the discussion in [[http://punbb.informer.com/forums/forum/65/13-extensions-talk/|Forums]] to ask users to add their feature requests to the specification. | + | * You may also start the discussion in [[https://punbb.informer.com/forums/forum/65/13-extensions-talk/|Forums]] to ask users to add their feature requests to the specification. |
- | - Add the ticket to the [[http://punbb.informer.com/trac/|Trac]] (or just start a text file, if you have no [[http://en.wikipedia.org/wiki/Trac|Trac]]). List the main tasks to complete the extension. | + | - Add the ticket to the [[https://punbb.informer.com/trac/|Trac]] (or just start a text file, if you have no [[http://en.wikipedia.org/wiki/Trac|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. | - //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. | - Code them all! Follow your task-list and strike out done. | ||
- | * Commit your changes to the [[http://punbb.informer.com/svn/|SVN]] separately: one feature or one bug fix is one commit. Do not commit multiple changes simultaneously. | + | * Commit your changes to the [[https://punbb.informer.com/svn/|SVN]] separately: one feature or one bug fix is one commit. Do not commit multiple changes simultaneously. |
* BTW: Use [[http://en.wikipedia.org/wiki/Subversion_(software)|SVN]] or other [[http://en.wikipedia.org/wiki/Version_control_system|VCS]]. (I personally prefer [[http://en.wikipedia.org/wiki/Bazaar_(software)|Bazaar]].) | * BTW: Use [[http://en.wikipedia.org/wiki/Subversion_(software)|SVN]] or other [[http://en.wikipedia.org/wiki/Version_control_system|VCS]]. (I personally prefer [[http://en.wikipedia.org/wiki/Bazaar_(software)|Bazaar]].) | ||
- Add the documentation to the wiki article. | - Add the documentation to the wiki article. | ||
* Extension usage. | * Extension usage. | ||
* Extension customization and integration. | * Extension customization and integration. | ||
- | - Publish extension in the [[http://punbb.informer.com/extensions/|extension repository]] //(as soon as it passed all the automatic tests)//. | + | - Publish extension in the [[https://punbb.informer.com/extensions/|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 [[http://punbb.informer.com/extensions/|repository]]. | + | * Third-party developers may propose their extensions to be reviewed and published in the [[https://punbb.informer.com/extensions/|repository]]. |
- | - Release the extension in [[http://punbb.informer.com/forums/forum/65/13-extensions-talk/|Forums]]. | + | - Release the extension in [[https://punbb.informer.com/forums/forum/65/13-extensions-talk/|Forums]]. |
+ | |||
+ | ===== See also ===== | ||
+ | * [[punbb13:extensions|PunBB 1.3 Extensions]] | ||
+ | |||
+ | //This description is mainly based on the [[http://fluxbb.org/wiki/v1.3:developing_extensions|FluxBB documentation]]. We would like to express our thanks to the FluxBB development team.// |