From: Meik S. <acy...@ph...> - 2009-08-17 14:42:38
|
Author: acydburn Date: Mon Aug 17 15:42:27 2009 New Revision: 10007 Log: Added section about special constants able to be used. Modified: branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html branches/phpBB-3_0_0/phpBB/docs/hook_system.html Modified: branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html (original) --- branches/phpBB-3_0_0/phpBB/docs/coding-guidelines.html Mon Aug 17 15:42:27 2009 *************** *** 57,62 **** --- 57,63 ---- <li><a href="#editorsettings">Editor Settings</a></li> <li><a href="#fileheader">File Header</a></li> <li><a href="#locations">File Locations</a></li> + <li><a href="#constants">Special Constants</a></li> </ol> </li> <li><a href="#code">Code Layout/Guidelines</a> *************** *** 223,228 **** --- 224,277 ---- <li><strong>styles</strong><br /><code>/styles</code>, <code>style.php</code><br />phpBB Styles/Templates/Themes/Imagesets</li> </ul> + <a name="constants"></a></h3>1.iv. Special Constants</h3> + + <p>There are some special constants application developers are able to utilize to bend some of phpBB's internal functionality to suit their needs.</p> + + <div class="codebox"><pre> + 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) + </pre></div> + + <h4>PHPBB_USE_BOARD_URL_PATH</h4> + + <p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> 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:</p> + + <ul> + <li>/includes/session.php - user::img()</li> + <li>/includes/functions_content.php - smiley_text()</li> + </ul> + + <p>Path locations for the following template variables are affected by this too:</p> + + <ul> + <li>{T_THEME_PATH} - styles/xxx/theme</li> + <li>{T_TEMPLATE_PATH} - styles/xxx/template</li> + <li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li> + <li>{T_IMAGESET_PATH} - styles/xxx/imageset</li> + <li>{T_IMAGESET_LANG_PATH} - styles/xxx/imageset/yy</li> + <li>{T_IMAGES_PATH} - images/</li> + <li>{T_SMILIES_PATH} - $config['smilies_path']/</li> + <li>{T_AVATAR_PATH} - $config['avatar_path']/</li> + <li>{T_AVATAR_GALLERY_PATH} - $config['avatar_gallery_path']/</li> + <li>{T_ICONS_PATH} - $config['icons_path']/</li> + <li>{T_RANKS_PATH} - $config['ranks_path']/</li> + <li>{T_UPLOAD_PATH} - $config['upload_path']/</li> + <li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css (or link to style.php if css is parsed dynamically)</li> + <li>New template variable {BOARD_URL} for the board url + script path.</li> + </ul> + </div> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> *************** *** 1123,1129 **** <p>Template defined variables can also be utilised. <div class="codebox"><pre> <span class="comment"><!-- DEFINE $SOME_VAR = 'my_file.html' --></span> ! <span class="comment"><!-- INCLUDE {$SOME_VAR} --></span> </pre></div> <h4>PHP</h4> --- 1172,1178 ---- <p>Template defined variables can also be utilised. <div class="codebox"><pre> <span class="comment"><!-- DEFINE $SOME_VAR = 'my_file.html' --></span> ! <span class="comment"><!-- INCLUDE {$SOME_VAR} --></span> </pre></div> <h4>PHP</h4> *************** *** 2297,2309 **** </ul> </li> </ul> ! <a name="commitmessage"></a><h3>7.ii. Commit Messages</h3> <p>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.</p> <p>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:</p> ! <div class="codebox"><pre> Authorised by: developer1[, developer2[, ...]] </pre></div> --- 2346,2358 ---- </ul> </li> </ul> ! <a name="commitmessage"></a><h3>7.ii. Commit Messages</h3> <p>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.</p> <p>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:</p> ! <div class="codebox"><pre> Authorised by: developer1[, developer2[, ...]] </pre></div> *************** *** 2322,2328 **** --- 2371,2381 ---- <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> + <h3>Revision 10007</h3> + <ul> + <li>Added <a href="#constants">Special Constants</a> section.</li> + </ul> <h3>Revision 9817</h3> Modified: branches/phpBB-3_0_0/phpBB/docs/hook_system.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/docs/hook_system.html (original) --- branches/phpBB-3_0_0/phpBB/docs/hook_system.html Mon Aug 17 15:42:27 2009 *************** *** 104,117 **** 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; } #wrap { --- 104,117 ---- 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; } #wrap { *************** *** 387,394 **** --- 387,422 ---- 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) </pre></div> + <p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> 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:</p> + + <ul> + <li>/includes/session.php - user::img()</li> + <li>/includes/functions_content.php - smiley_text()</li> + </ul> + + <p>Path locations for the following template variables are affected by this too:</p> + + <ul> + <li>{T_THEME_PATH} - styles/xxx/theme</li> + <li>{T_TEMPLATE_PATH} - styles/xxx/template</li> + <li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li> + <li>{T_IMAGESET_PATH} - styles/xxx/imageset</li> + <li>{T_IMAGESET_LANG_PATH} - styles/xxx/imageset/yy</li> + <li>{T_IMAGES_PATH} - images/</li> + <li>{T_SMILIES_PATH} - $config['smilies_path']/</li> + <li>{T_AVATAR_PATH} - $config['avatar_path']/</li> + <li>{T_AVATAR_GALLERY_PATH} - $config['avatar_gallery_path']/</li> + <li>{T_ICONS_PATH} - $config['icons_path']/</li> + <li>{T_RANKS_PATH} - $config['ranks_path']/</li> + <li>{T_UPLOAD_PATH} - $config['upload_path']/</li> + <li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css (or link to style.php if css is parsed dynamically)</li> + <li>New template variable {BOARD_URL} for the board url + script path.</li> + </ul> + + </div> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> *************** *** 616,622 **** <div class="codebox"><pre> not hooked ! hooked </pre></div> <p>A different possibility would be using a function variable (which could be left out on passing the function variables to the hook):</p> --- 644,650 ---- <div class="codebox"><pre> not hooked ! hooked </pre></div> <p>A different possibility would be using a function variable (which could be left out on passing the function variables to the hook):</p> *************** *** 670,676 **** <div class="codebox"><pre> not hooked ! hooked </pre></div> </div> --- 698,704 ---- <div class="codebox"><pre> not hooked ! hooked </pre></div> </div> |