From fe01a43d453f81e4c6229eed2d40e2281a7dcffa Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 17 Aug 2009 14:42:27 +0000 Subject: [PATCH] Added section about special constants able to be used. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10007 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/coding-guidelines.html | 59 +++++++++++++++++++++++++++++-- phpBB/docs/hook_system.html | 48 +++++++++++++++++++------ 2 files changed, 94 insertions(+), 13 deletions(-) diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 37bad06587..37b9629362 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -57,6 +57,7 @@
  • Editor Settings
  • File Header
  • File Locations
  • +
  • Special Constants
  • Code Layout/Guidelines @@ -223,6 +224,54 @@ class ...
  • styles
    /styles, style.php
    phpBB Styles/Templates/Themes/Imagesets
  • + 1.iv. Special Constants + +

    There are some special constants application developers are able to utilize to bend some of phpBB's internal functionality to suit their needs.

    + +
    +PHPBB_MSG_HANDLER          (overwrite message handler)
    +PHPBB_DB_NEW_LINK          (overwrite new_link parameter for sql_connect)
    +PHPBB_ROOT_PATH            (overwrite $phpbb_root_path)
    +PHPBB_ADMIN_PATH           (overwrite $phpbb_admin_path)
    +PHPBB_USE_BOARD_URL_PATH   (use generate_board_url() for image paths instead of $phpbb_root_path)
    +PHPBB_DISABLE_ACP_EDITOR   (disable ACP style editor for templates)
    +PHPBB_DISABLE_CONFIG_CHECK (disable ACP config.php writeable check)
    +
    +PHPBB_ACM_MEMCACHE_PORT     (overwrite memcached port, default is 11211)
    +PHPBB_ACM_MEMCACHE_COMPRESS (overwrite memcached compress setting, default is disabled)
    +PHPBB_ACM_MEMCACHE_HOST     (overwrite memcached host name, default is localhost)
    +
    +PHPBB_QA                   (Set board to QA-Mode, which means the updater also checks for RC-releases)
    +
    + +

    PHPBB_USE_BOARD_URL_PATH

    + +

    If the PHPBB_USE_BOARD_URL_PATH constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:

    + + + +

    Path locations for the following template variables are affected by this too:

    + + +
    Back to Top
    @@ -1123,7 +1172,7 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&

    Template defined variables can also be utilised.

     <!-- DEFINE $SOME_VAR = 'my_file.html' -->
    -<!-- INCLUDE {$SOME_VAR} -->	
    +<!-- INCLUDE {$SOME_VAR} -->
     

    PHP

    @@ -2297,13 +2346,13 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) - +

    7.ii. Commit Messages

    The commit message should contain a brief explanation of all changes made within the commit. Often identical to the changelog entry. A bug ticket can be referenced by specifying the ticket ID with a hash, e.g. #12345. A reference to another revision should simply be prefixed with r, e.g. r12345.

    Junior Developers need to have their patches approved by a development team member first. The commit message must end in a line with the following format:

    - +
     Authorised by: developer1[, developer2[, ...]]
     	
    @@ -2322,7 +2371,11 @@ Authorised by: developer1[, developer2[, ...]]
    +

    Revision 10007

    +

    Revision 9817

    diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html index 565e0096fc..b23ebab869 100644 --- a/phpBB/docs/hook_system.html +++ b/phpBB/docs/hook_system.html @@ -104,14 +104,14 @@ h3 { border-top: 1px solid #ccc; } -code { - color: #006600; - font-weight: normal; - font-family: 'Courier New', monospace; - border-color: #D1D7DC; - border-width: 1px; - border-style: solid; - background-color: #FAFAFA; +code { + color: #006600; + font-weight: normal; + font-family: 'Courier New', monospace; + border-color: #D1D7DC; + border-width: 1px; + border-style: solid; + background-color: #FAFAFA; } #wrap { @@ -387,8 +387,36 @@ PHPBB_MSG_HANDLER (overwrite message handler) PHPBB_DB_NEW_LINK (overwrite new_link parameter for sql_connect) PHPBB_ROOT_PATH (overwrite $phpbb_root_path) PHPBB_ADMIN_PATH (overwrite $phpbb_admin_path) +PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of $phpbb_root_path)
    +

    If the PHPBB_USE_BOARD_URL_PATH constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:

    + + + +

    Path locations for the following template variables are affected by this too:

    + + + +
    Back to Top
    @@ -616,7 +644,7 @@ echo $second_object->hook_me('first', 'second') . '<br />';
     not hooked
    -hooked 
    +hooked
     

    A different possibility would be using a function variable (which could be left out on passing the function variables to the hook):

    @@ -670,7 +698,7 @@ echo $second_object->hook_me('first', 'second') . '<br />';
     not hooked
    -hooked 
    +hooked