diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-09-22 18:13:08 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-09-22 18:13:08 +0000 |
commit | d45df55af33046d793230221039222556827d46d (patch) | |
tree | bcba31703ffa5d97248fba6041a54b40e169e1bb /phpBB | |
parent | 5462ecdc246a67e40938b8ee2cea82c49ca13b02 (diff) | |
download | forums-d45df55af33046d793230221039222556827d46d.tar forums-d45df55af33046d793230221039222556827d46d.tar.gz forums-d45df55af33046d793230221039222556827d46d.tar.bz2 forums-d45df55af33046d793230221039222556827d46d.tar.xz forums-d45df55af33046d793230221039222556827d46d.zip |
updated documents to prosilver style
git-svn-id: file:///svn/phpbb/trunk@8097 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 295 | ||||
-rw-r--r-- | phpBB/docs/FAQ.html | 453 | ||||
-rw-r--r-- | phpBB/docs/INSTALL.html | 435 | ||||
-rw-r--r-- | phpBB/docs/README.html | 483 | ||||
-rw-r--r-- | phpBB/docs/auth_api.html | 377 | ||||
-rw-r--r-- | phpBB/docs/bg_header.gif | bin | 0 -> 690 bytes | |||
-rw-r--r-- | phpBB/docs/coding-guidelines.html | 1085 | ||||
-rw-r--r-- | phpBB/docs/corners_left.gif | bin | 0 -> 55 bytes | |||
-rw-r--r-- | phpBB/docs/corners_left.png | bin | 0 -> 195 bytes | |||
-rw-r--r-- | phpBB/docs/corners_right.gif | bin | 0 -> 56 bytes | |||
-rw-r--r-- | phpBB/docs/corners_right.png | bin | 0 -> 201 bytes | |||
-rw-r--r-- | phpBB/docs/header_bg.jpg | bin | 385 -> 0 bytes | |||
-rw-r--r-- | phpBB/docs/header_left.jpg | bin | 6741 -> 0 bytes | |||
-rw-r--r-- | phpBB/docs/site_logo.gif | bin | 0 -> 3430 bytes | |||
-rw-r--r-- | phpBB/docs/stylesheet.css | 352 |
15 files changed, 1608 insertions, 1872 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 1f628a16a8..5556adfc4f 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -1,164 +1,43 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en"> <head> -<title>phpBB 3.0.x Changelog</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -<meta http-equiv="Content-Style-Type" content="text/css" /> + +<meta http-equiv="content-type" content="text/html; charset=utf-8" /> +<meta http-equiv="content-style-type" content="text/css" /> +<meta http-equiv="content-language" content="en" /> +<meta http-equiv="imagetoolbar" content="no" /> <meta name="resource-type" content="document" /> -<meta name="description" lang="en" content="phpBB 3.0.x Changelog" /> -<meta name="keywords" lang="en" content="" /> -<meta name="author" content="phpBB Group" /> -<meta name="copyright" content="phpBB Group" /> -<meta name="MSSmartTagsPreventParsing" content="true" /> - -<style type="text/css"> -<!-- - -/* The original "subSilver" theme for phpBB2 Created by subBlue design :: http://www.subBlue.com */ -body { - background-color: white; - font-family: Verdana, Arial, Helvetica, sans-serif; - margin: 0; - border: 0; - padding: 0; -} - -img { - border: 0; -} - -p { - font-size: 8pt; -} - -hr { - height: 0; - border: solid #D1D7DC 0; - border-top-width: 1px; -} - -#title, h1 { - font: bold 18pt 'Trebuchet MS', Verdana, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h2 { - font: bold 12pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h3 { - font: bold 10pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -.paragraph { - margin-left: 20px; -} - -/* Structure */ -#logo { - background: #fff url(header_bg.jpg) repeat-x top right; - height: 60px; -} - -#title { - color: #12749b; - float: right; - margin: 10px 10px 0; -} - -#main { - margin-left: 25px; - margin-right: 25px; -} - -.good { - color: green; -} - -.bad { - color: red; -} - -#footer { - margin-left: 75px; - font-size: 70%; - color: #006600; -} - -code { - color: #006600; - font-weight: normal; - font-family: 'Courier New', monospace; - border-color: #D1D7DC; - border-width: 1px; - border-style: solid; - background-color: #FAFAFA; -} - -.indent p { - padding-left: 20px; - font-size: 90%; -} - -/* Anchors */ -a { - font-size: 70%; -} - -a:link, a:active, a:visited { - color: #006699; - text-decoration: none; -} - -a:hover { - color: #DD6900; - text-decoration: underline; -} - -a.nav { - color: #006699; - text-decoration: none; -} - -a.nav:hover { - text-decoration: underline; -} - -p a { - font-size: 100%; -} - -.menu { - font-size: 80%; -} - -.menu li a { - font-size: 100%; -} - -.comment { - color: green; -} - -//--> -</style> +<meta name="distribution" content="global" /> +<meta name="copyright" content="2007 phpBB Group" /> +<meta name="keywords" content="" /> +<meta name="description" content="phpBB 3.0.x Changelog" /> +<title>phpBB3 • Changelog</title> + +<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> </head> -<body> +<body id="phpbb" class="section-docs"> -<div id="logo"> - <div id="title">phpBB 3.0.x Changelog</div> - <img src="header_left.jpg" alt="phpBB Logo" /> -</div> +<div id="wrap"> + <a id="top" name="top" accesskey="t"></a> + <div id="page-header"> + <div class="headerbar"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div id="doc-description"> + <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <h1>phpBB 3.0.x Changelog</h1> + <p style="display: none;"><a href="#start_here">Skip</a></p> + </div> + + <span class="corners-bottom"><span></span></span></div> + </div> + </div> -<a name="top"></a><div id="main"> + <a name="start_here"></a> + + <div id="page-body"> <!-- BEGIN DOCUMENT --> @@ -166,9 +45,14 @@ p a { <h1>Changelog</h1> -<ol class="menu"> + <div class="paragraph menu"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> + +<ol> <li><a href="#changelog">Changelog</a> - <ol type="i"> + <ol style="list-style-type: lower-roman;"> <li><a href="#v30rc5">Changes since RC-5</a></li> <li><a href="#v30rc4">Changes since RC-4</a></li> <li><a href="#v30rc3">Changes since RC-3</a></li> @@ -179,15 +63,23 @@ p a { <li><a href="#disclaimer">Copyright and disclaimer</a></li> </ol> -<hr /> + </div> -<a name="changelog"></a><h1>1. Changelog</h1> + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> + + <a name="changelog"></a><h2>1. Changelog</h2> - <a name="v30rc5"></a><b>1.i. Changes since 3.0.RC5</b> - <br /><br /> <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> + + <a name="v30rc5"></a><h3>1.i. Changes since 3.0.RC5</h3> - <ul class="menu"> + <ul> <li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li> <li>[Feature] The new exit_handler() function having a check for the function exit_handler_phpbb_hook().</li> <li>[Feature] Constant PHPBB_ADMIN_PATH introduced, having the same purpose as PHPBB_ROOT_PATH, but for the ACP.</li> @@ -217,17 +109,9 @@ p a { <li>[Fix] Only display PM history links if there are PM's to be displayed (Bug #14484)</li> </ul> - </div> - <a href="#top">Top</a> - <br /><br /> - - <hr /> + <a name="v30rc4"></a><h3>1.ii. Changes since 3.0.RC4</h3> - <a name="v30rc4"></a><b>1.ii. Changes since 3.0.RC4</b> - <br /><br /> - <div class="paragraph"> - - <ul class="menu"> + <ul> <li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li> <li>[Fix] Allow MS SQL to properly connect when using the mssql driver and PHP is less than either 4.4.1 or 5.1 (Bug #13874)</li> <li>[Fix] Ignore files containing HTML special chars in the filenames as gallery avatars (Bug #13906)</li> @@ -276,17 +160,9 @@ p a { <li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li> </ul> - </div> - <a href="#top">Top</a> - <br /><br /> - - <hr /> - - <a name="v30rc3"></a><b>1.iii. Changes since 3.0.RC3</b> - <br /><br /> - <div class="paragraph"> + <a name="v30rc3"></a><h3>1.iii. Changes since 3.0.RC3</h3> - <ul class="menu"> + <ul> <li>[Fix] Fixing some subsilver2 and prosilver style issues</li> <li>[Fix] Parse error in MCP ban (Bug #13109)</li> <li>[Fix] Correctly hide online status in the profile (Bug #13059)</li> @@ -393,17 +269,9 @@ p a { </ul> - </div> - <a href="#top">Top</a> - <br /><br /> - - <hr /> - - <a name="v30rc2"></a><b>1.iv. Changes since 3.0.RC2</b> - <br /><br /> - <div class="paragraph"> + <a name="v30rc2"></a><h3>1.iv. Changes since 3.0.RC2</h3> - <ul class="menu"> + <ul> <li>[Fix] Re-allow searching within the memberlist</li> <li>[Fix] Force prune related values to integers during conversions</li> <li>[Fix] Updater now detects successfully merged files having conflicts and user chose to merge with modifications (Bug #12685)</li> @@ -447,17 +315,9 @@ p a { </ul> - </div> - <a href="#top">Top</a> - <br /><br /> - - <hr /> - - <a name="v30rc1"></a><b>1.v. Changes since 3.0.RC1</b> - <br /><br /> - <div class="paragraph"> + <a name="v30rc1"></a><h3>1.v. Changes since 3.0.RC1</h3> - <ul class="menu"> + <ul> <li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li> <li>[Fix] Tiny language and grammar changes</li> <li>[Fix] Several style related fixes, mainly fixing cross-browser issues</li> @@ -574,28 +434,41 @@ p a { </ul> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> </div> - <a href="#top">Top</a> - <br /><br /> <hr /> -<a name="disclaimer"></a><h1>2. Copyright and disclaimer</h1> +<a name="disclaimer"></a><h2>2. Copyright and disclaimer</h2> <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-license.php">GPL</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) 2000, 2002, 2005, 2007 <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p> -</div> -<a href="#top">Top</a> + </div> -<!-- END DOCUMENT --> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -</div> + <span class="corners-bottom"><span></span></span></div> + </div> -<br /><br /> +<!-- END DOCUMENT --> -<div id="footer">Note that a full list of fixed bugs can be found at the bug tracker (<a href="README.html#bugs">see section on bug reporting</a>)<br /><br /></div> + <div id="page-footer"> + <div class="version">Note that a full list of fixed bugs can be found at the bug tracker (<a href="README.html#bugs">see section on bug reporting</a>)</div> + </div> +</div></div> + +<div> + <a id="bottom" name="bottom" accesskey="z"></a> +</div> </body> -</html> +</html>
\ No newline at end of file diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html index 6537adc1f9..ee92427530 100644 --- a/phpBB/docs/FAQ.html +++ b/phpBB/docs/FAQ.html @@ -1,173 +1,58 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en"> <head> -<title>phpBB 3.0.x FAQ</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -<meta http-equiv="Content-Style-Type" content="text/css" /> + +<meta http-equiv="content-type" content="text/html; charset=utf-8" /> +<meta http-equiv="content-style-type" content="text/css" /> +<meta http-equiv="content-language" content="en" /> +<meta http-equiv="imagetoolbar" content="no" /> <meta name="resource-type" content="document" /> -<meta name="description" lang="en" content="phpBB 3.0.x frequently asked questions" /> -<meta name="keywords" lang="en" content="" /> -<meta name="author" content="phpBB Group" /> -<meta name="copyright" content="phpBB Group" /> -<meta name="MSSmartTagsPreventParsing" content="true" /> - -<style type="text/css"> -<!-- - -/* The original "subSilver" theme for phpBB2 Created by subBlue design :: http://www.subBlue.com */ -body { - background-color: white; - font-family: Verdana, Arial, Helvetica, sans-serif; - margin: 0; - border: 0; - padding: 0; -} - -img { - border: 0; -} - -p { - font-size: 8pt; -} - -hr { - height: 0; - border: solid #D1D7DC 0; - border-top-width: 1px; -} - -#title, h1 { - font: bold 18pt 'Trebuchet MS', Verdana, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h2 { - font: bold 12pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h3 { - font: bold 10pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -.paragraph { - margin-left: 20px; -} - -/* Structure */ -#logo { - background: #fff url(header_bg.jpg) repeat-x top right; - height: 60px; -} - -#title { - color: #12749b; - float: right; - margin: 10px 10px 0; -} - -#main { - margin-left: 25px; - margin-right: 25px; -} - -.good { - color: green; -} - -.bad { - color: red; -} - -#footer { - margin-left: 75px; - font-size: 70%; - color: #006600; -} - -code { - color: #006600; - font-weight: normal; - font-family: 'Courier New', monospace; - border-color: #D1D7DC; - border-width: 1px; - border-style: solid; - background-color: #FAFAFA; -} - -.indent p { - padding-left: 20px; - font-size: 90%; -} - -/* Anchors */ -a { - font-size: 70%; -} - -a:link, a:active, a:visited { - color: #006699; - text-decoration: none; -} - -a:hover { - color: #DD6900; - text-decoration: underline; -} - -a.nav { - color: #006699; - text-decoration: none; -} - -a.nav:hover { - text-decoration: underline; -} - -p a { - font-size: 100%; -} - -.menu { - font-size: 80%; -} - -.menu li a { - font-size: 100%; -} - -.comment { - color: green; -} - -//--> -</style> +<meta name="distribution" content="global" /> +<meta name="copyright" content="2007 phpBB Group" /> +<meta name="keywords" content="" /> +<meta name="description" content="phpBB 3.0.x frequently asked questions" /> +<title>phpBB3 • FAQ</title> + +<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> </head> -<body> +<body id="phpbb" class="section-docs"> -<div id="logo"> - <div id="title">phpBB 3.0.x FAQ</div> - <img src="header_left.jpg" alt="phpBB Logo" /> -</div> +<div id="wrap"> + <a id="top" name="top" accesskey="t"></a> + <div id="page-header"> + <div class="headerbar"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div id="doc-description"> + <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <h1>phpBB 3.0.x FAQ</h1> + <p>phpBB 3.0.x frequently asked questions</p> + <p style="display: none;"><a href="#start_here">Skip</a></p> + </div> -<a name="top"></a><div id="main"> + <span class="corners-bottom"><span></span></span></div> + </div> + </div> + + <a name="start_here"></a> + + <div id="page-body"> <!-- BEGIN DOCUMENT --> -<p>This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the more commonly asked questions. It is by no means exhaustive and should be used in combination with the 'built-in' User FAQ within phpBB3, the community forums and our IRC channel (see <a href="README.html">README</a> for details).</p> + <p>This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the more commonly asked questions. It is by no means exhaustive and should be used in combination with the 'built-in' User FAQ within phpBB3, the community forums and our IRC channel (see <a href="README.html">README</a> for details).</p> + + <h1>FAQ</h1> + + <div class="paragraph menu"> + <div class="inner"><span class="corners-top"><span></span></span> -<h1>FAQ</h1> + <div class="content"> <!-- add entry about common UTF8 problems (for example wrong uploading, editing) --> -<ul class="menu"> +<ul> <li><a href="#install">I cannot install this it is too difficult! Will you do it?</a></li> <li><a href="#legal">I am having problems with the admin at a certain board, help!</a></li> <li><a href="#legal">A board has ripped off my graphics/software/etc., stop them!</a></li> @@ -186,11 +71,19 @@ p a { <li><a href="#disclaimer">Copyright and disclaimer</a></li> </ul> -<hr /> + </div> -<a name="install"></a><h3>I cannot install this it is too difficult! Will you do it?</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + + <a name="install"></a><h2>I cannot install this it is too difficult! Will you do it?</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>Simple answer, no we will not. We are not being difficult when we say this we are actually trying to help you. phpBB has a reputation for being easy to install, that reputation is we believe well deserved. It is a simple process of unarchiving a single file, uploading the resulting directory/files to their intended location and entering some data in a web based form. The sequence of events, what to type where, etc. is covered in detail in the accompanying <a href="INSTALL.html">INSTALL.html</a> documentation. If you cannot install phpBB3 the chances are you will be unable to administer or update it.</p> @@ -198,75 +91,104 @@ p a { <p>We think a better solution is for you to carefully read the enclosed documentation, read through our knowledge base at <a href="http://www.phpbb.com/">www.phpbb.com</a> and if necessary ask for help on any thing you get stuck on. However, the decision is yours but please note we may not offer support if we believe you have had the board installed by a third party. In such cases you should direct your questions to that company or person/s.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="legal"></a> -<h3>I am having problems with the admin at a certain board, help!</h3> -<h3>A board has ripped off my graphics/software/etc., stop them!</h3> -<h3>A board is dealing in warez/porn/etc., you need to prevent them doing this!</h3> -<h3>I want to sue you because i think you host an illegal board!</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="legal"></a><h2>I am having problems with the admin at a certain board, help!<br /> +A board has ripped off my graphics/software/etc., stop them!<br /> +A board is dealing in warez/porn/etc., you need to prevent them doing this!<br /> +I want to sue you because i think you host an illegal board!</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>We provide the software, we have absolutely nothing to do with any board that runs it (beyond phpbb.com of course!) and we also do not host any site. The GPL grants the user an unlimited right of use subject to their adherence of that licence. Therefore we cannot prevent, dictate, control or otherwise limit the use of phpBB software. So please do not contact us for such matters.</p> <p>If you have a problem with a given board please take it up with them, not us. We are not and cannot be held legally responsible for any third party use of this software (much like Microsoft et al cannot be held responsible for the use of Windows in illegal activities, etc.). Additionally we do <strong>not</strong> track the use of phpBB software in any way. So please do not ask us for details on a "given" board we will not be able to help you. If any law firms or lawyers out there send us writs, cease and desist orders, etc. for third party website use of this software we reserve the right to charge for time wasted dealing with such issues...</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="viewonline"></a><h3>According to viewonline a user is doing/reading something they should not be able to!</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="viewonline"></a><h2>According to viewonline a user is doing/reading something they should not be able to!</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>No, they probably are not. phpBB uses sessions to keep track of users as they move between pages. The session information tells us who this user is. Therefore in order to determine what a user can do on a page we first need the session details. Once this data is available we can check whether the user is permitted to do whatever it is they are trying to do. This can result in it appearing as if a user is reading a topic in a forum they should not be able to access. Or perhaps viewing private messages when they are only guests, etc. In practice the user is not doing these things, they are viewing a "You are not permitted to do this" type message. The session data has simply been updated before we were able to determine what the user could or could not do.</p> <p>Of course this only applies where permissions have been set correctly!</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="mail"></a><h3>I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="mail"></a><h2>I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>This error will occur if phpBB cannot send mail. phpBB can send email two ways; using the PHP <code>mail()</code> function or directly via SMTP. Some hosting providers limit the <code>mail()</code> function to prevent its use in spamming, others may rename it or limit its functionality. If the <code>mail()</code> function got renamed, you are able to enter the correct name within the administration control panel. In either case you may need to make use of SMTP. This requires that you have access to such a facility, e.g. your hosting provider may provide one (perhaps requiring specific written authorisation), etc. Please see <a href="http://www.phpbb.com/">www.phpbb.com</a> for additional help on this matter.</p> <p>If you do require SMTP services please do not ask (on our forums or elsewhere) for someone to provide you with one. Open relays are now things of the past thanks to the unthinking spammers out there. Therefore you are unlikely to find someone willing to offer you (free) services.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="mail_language"></a><h3>My users are complaining that emails are not in their selected language!</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="mail_language"></a><h2>My users are complaining that emails are not in their selected language!</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>You must have deleted a language pack or the language pack is incomplete. phpBB will try to send emails in the users selected language. If it cannot find a suitable email template it will switch to the boards default language.</p> <!-- additional entry about encoded emails --> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="aol_browser"></a><h3>My AOL based users keep getting logged out!</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="aol_browser"></a><h2>My AOL based users keep getting logged out!</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>phpBB uses sessions to keep track of users as they browse the board. These sessions use a combination of a unique session id, the users IP and if specified the users browser and/or the users x-forwarded-for header to identify each user. We make use of all of this as an extra safe-guard to help prevent sessions being hijacked (by discovering the unique session id).</p> @@ -274,79 +196,115 @@ p a { <p>If you are experiencing problems related to this you can set the Session IP validation parameter found in <code>Admin->General->Server Configuration->Security Settings</code> to <samp>A.B</samp>. Please note that reducing the IP validation length does potentially increase the risk of sessions being hijacked (this is something for you to consider, phpBB Group takes no responsibility should anything happen!). We suggest to at least additionally enable the browser validation.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="avatars"></a><h3>No matter what I set the uploadable avatars to I cannot upload one from my computer!</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="avatars"></a><h2>No matter what I set the uploadable avatars to I cannot upload one from my computer!</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>There are two possibilities here, the first is you have not created the directory you specified as the storage location for avatars, ie. as specified in the <code>Admin -> General -> Board Configuration -> Avatar settings</code> section. If the directory does not exist uploadeable avatars are automatically disabled. You should create the required directory (ensuring it has global write access or other appropriate permissions to allow the webserver to write files to it).</p> <p>The second possibility is that your provider has disabled file_upload support. You should contact your provider and ask them if this is the case. There is not a lot you can do, there are still three other avatar settings left to choose from including uploading via an URL which will work fine.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="gallery_avatars"></a><h3>I just cannot get gallery avatars to appear!</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="gallery_avatars"></a><h2>I just cannot get gallery avatars to appear!</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>phpBB categorises gallery avatars and it does this by reading through folders contained in the location you specified as being the gallery path. For example, if you set the gallery path to <samp>images/avatars/gallery</samp> phpBB will expect to find a series of folders within that path, e.g. <samp>images/avatars/gallery/moviestars</samp>, <samp>images/avatars/gallery/cartoons</samp>, <samp>images/avatars/gallery/misc</samp>, etc. Placing images directly in <samp>images/avatars/gallery/</samp> will result in nothing being listed in your gallery.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="permissions"></a><h3>How do I use/set permissions?</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="permissions"></a><h2>How do I use/set permissions?</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>Please read the paragraph about permissions in our extensive <a href="http://www.phpbb.com/support/documentation/3.0/">online documentation</a>.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="login_issues"></a><h3>I (or my users) cannot stay logged in to the forum!</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="login_issues"></a><h2>I (or my users) cannot stay logged in to the forum!</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>If you (or your users) are, after attempting a login, being returned to the index (or other page) without appearing to be logged in the most likely problem is incorrect cookie settings. phpBB uses cookies to store a session id and a small amount of user data. For this data to be stored correctly the cookie domain, name, path and secure settings must be correct. You can check this in <code>Admin->General->Server Configuration->Cookie Settings</code>. Typically the cookie domain can be left blank and the cookie path set to <samp>/</samp> (a single forward slash). Do <strong>not</strong> set the cookie as being secure unless your board is running over a secure sockets layer connection, ie. https://</p> <p>If you still have problems try setting the cookie domain to your full domain name, e.g. <samp>www.mysystem.tld</samp>, <samp>www.something.mydomain.tld</samp>. You <strong>must</strong> ensure the domain name contains at least two dots or browsers will be unlikely to recognise the cookie, e.g. <samp>.mydomain.com</samp>, <samp>mydomain.com</samp>. Do <strong>not</strong> add http:// or anything else to the domain name!</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="logout_issues"></a><h3>My users are complaining about being logged out too quickly!</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="logout_issues"></a><h2>My users are complaining about being logged out too quickly!</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>You can increase the default length of sessions (ie. how long before a users session is considered 'dead') in <code>Admin->General->Server Configuration->Load Settings</code>. Set it to whatever value your users feel comfortable with, remember that security issues may affect your decision (ie. having too long a session may allow non-users to abuse your board should a user forget to logout or otherwise leave a current session on a public workstation).</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="not_answered"></a><h3>My question isn't answered here!</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="not_answered"></a><h2>My question isn't answered here!</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>Please read our <a href="http://www.phpbb.com/support/documentation/3.0/">extensive user documentation</a> first, it may just explain what you want to know.</p> @@ -354,26 +312,41 @@ p a { <p><a href="http://www.phpbb.com">www.phpbb.com</a></p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="disclaimer"></a><h3>Copyright and disclaimer</h3> + <span class="corners-bottom"><span></span></span></div> + </div> -<div class="paragraph"> + <hr /> + +<a name="disclaimer"></a><h2>Copyright and disclaimer</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-license.php">GPL</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) 2000, 2002, 2005, 2007 <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p> -</div> -<a href="#top">Top</a> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> <!-- END DOCUMENT --> -</div> + <div id="page-footer"> + <div class="version"> </div> + </div> +</div></div> -<div id="footer"> <br /><br /></div> +<div> + <a id="bottom" name="bottom" accesskey="z"></a> +</div> </body> </html> diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html index 6ddb1ce4b1..afd2655bd7 100644 --- a/phpBB/docs/INSTALL.html +++ b/phpBB/docs/INSTALL.html @@ -1,164 +1,44 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en"> <head> -<title>phpBB 3.0.x Install</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -<meta http-equiv="Content-Style-Type" content="text/css" /> + +<meta http-equiv="content-type" content="text/html; charset=utf-8" /> +<meta http-equiv="content-style-type" content="text/css" /> +<meta http-equiv="content-language" content="en" /> +<meta http-equiv="imagetoolbar" content="no" /> <meta name="resource-type" content="document" /> -<meta name="description" lang="en" content="phpBB 3.0.x Installation, updating and conversion informations" /> -<meta name="keywords" lang="en" content="" /> -<meta name="author" content="phpBB Group" /> -<meta name="copyright" content="phpBB Group" /> -<meta name="MSSmartTagsPreventParsing" content="true" /> - -<style type="text/css"> -<!-- - -/* The original "subSilver" theme for phpBB2 Created by subBlue design :: http://www.subBlue.com */ -body { - background-color: white; - font-family: Verdana, Arial, Helvetica, sans-serif; - margin: 0; - border: 0; - padding: 0; -} - -img { - border: 0; -} - -p { - font-size: 8pt; -} - -hr { - height: 0; - border: solid #D1D7DC 0; - border-top-width: 1px; -} - -#title, h1 { - font: bold 18pt 'Trebuchet MS', Verdana, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h2 { - font: bold 12pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h3 { - font: bold 10pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -.paragraph { - margin-left: 20px; -} - -/* Structure */ -#logo { - background: #fff url(header_bg.jpg) repeat-x top right; - height: 60px; -} - -#title { - color: #12749b; - float: right; - margin: 10px 10px 0; -} - -#main { - margin-left: 25px; - margin-right: 25px; -} - -.good { - color: green; -} - -.bad { - color: red; -} - -#footer { - margin-left: 75px; - font-size: 70%; - color: #006600; -} - -code { - color: #006600; - font-weight: normal; - font-family: 'Courier New', monospace; - border-color: #D1D7DC; - border-width: 1px; - border-style: solid; - background-color: #FAFAFA; -} - -.indent p { - padding-left: 20px; - font-size: 90%; -} - -/* Anchors */ -a { - font-size: 70%; -} - -a:link, a:active, a:visited { - color: #006699; - text-decoration: none; -} - -a:hover { - color: #DD6900; - text-decoration: underline; -} - -a.nav { - color: #006699; - text-decoration: none; -} - -a.nav:hover { - text-decoration: underline; -} - -p a { - font-size: 100%; -} - -.menu { - font-size: 80%; -} - -.menu li a { - font-size: 100%; -} - -.comment { - color: green; -} - -//--> -</style> +<meta name="distribution" content="global" /> +<meta name="copyright" content="2007 phpBB Group" /> +<meta name="keywords" content="" /> +<meta name="description" content="phpBB 3.0.x Installation, updating and conversion informations" /> +<title>phpBB3 • Install</title> + +<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> </head> -<body> +<body id="phpbb" class="section-docs"> -<div id="logo"> - <div id="title">phpBB 3.0.x Install</div> - <img src="header_left.jpg" alt="phpBB Logo" /> -</div> +<div id="wrap"> + <a id="top" name="top" accesskey="t"></a> + <div id="page-header"> + <div class="headerbar"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div id="doc-description"> + <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <h1>phpBB 3.0.x Install</h1> + <p>phpBB 3.0.x Installation, updating and conversion informations</p> + <p style="display: none;"><a href="#start_here">Skip</a></p> + </div> + + <span class="corners-bottom"><span></span></span></div> + </div> + </div> + + <a name="start_here"></a> -<a name="top"></a><div id="main"> + <div id="page-body"> <!-- BEGIN DOCUMENT --> @@ -170,12 +50,17 @@ p a { <h1>Install</h1> -<ol class="menu"> + <div class="paragraph menu"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> + +<ol> <li><a href="#quickinstall">Quick install</a></li> <li><a href="#require">Requirements</a></li> <li><a href="#install">New installation</a></li> <li><a href="#update">Updating from stable releases of phpBB 3.0.x</a> - <ol type="i"> + <ol style="list-style-type: lower-roman;"> <li><a href="#update_full">Full package</a></li> <li><a href="#update_files">Changed files only</a></li> <li><a href="#update_patch">Patch file</a></li> @@ -184,7 +69,7 @@ p a { </ol> </li> <li><a href="#convert">Conversion from phpBB 2.0.x to phpBB 3.0.x</a> - <ol type="i"> + <ol style="list-style-type: lower-roman;"> <li><a href="#prereq">Requirements before converting</a></li> <li><a href="#conversion">Converting</a></li> <li><a href="#postreq">Things to do after conversion</a></li> @@ -192,21 +77,30 @@ p a { </ol> </li> <li><a href="#postinstall">Important (security related) post-Install tasks for all installation methods</a> - <ol type="i"> + <ol style="list-style-type: lower-roman;"> <li><a href="#avatars">Uploadable avatars</a></li> </ol> </li> <li><a href="#disclaimer">Disclaimer</a></li> </ol> -<hr /> + </div> + + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> + + <a name="quickinstall"></a><h2>1. Quick install</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> -<a name="quickinstall"></a><h1>1. Quick install</h1> + <div class="content"> -<div class="paragraph"> <p>If you have basic knowledge of using FTP and are sure your hosting service or server will run phpBB3 you can use these steps to quickly get started. For a more detailed explanation you should skip this and go to <a href="#require">section 2</a> below.</p> - <ol class="menu"> + <ol> <li>Decompress the phpBB3 archive to a local directory on your system.</li> <li>Upload all the files contained in this archive (retaining the directory structure) to a web accessible directory on your server or hosting account.</li> <li>Change the permissions on config.php to be writable by all (666 or -rw-rw-rw- within your FTP Client)</li> @@ -219,18 +113,26 @@ p a { </ol> <p>If you experienced problems or do not know how to proceed with any of the steps above please read the rest of this document.</p> -</div> -<a href="#top">Top</a> -<br /><br /> -<hr /> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> -<a name="require"></a><h1>2. Requirements</h1> + <a name="require"></a><h2>2. Requirements</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> -<div class="paragraph"> <p>phpBB3 has a few requirements which must be met before you are able to install and use it.</p> - <ul class="menu"> + <ul> <li>A webserver or web hosting account running on any major Operating System with support for PHP</li> <li>A SQL database system, <strong>one of</strong>: <ul> @@ -256,15 +158,22 @@ p a { </ul> <p>If your server or hosting account does not meet the requirements above we are afraid phpBB3 is not for you.</p> -</div> -<a href="#top">Top</a> -<br /><br /> -<hr /> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="install"></a><h1>3. New installation</h1> + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> + + <a name="install"></a><h2>3. New installation</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> -<div class="paragraph"> + <div class="content"> <p>Installation of phpBB3 will vary according to your server and database. If you have <em>shell access</em> to your account (via telnet or ssh for example) you may want to upload the entire phpBB3 archive (in binary mode!) to a directory on your host and unarchive it there.</p> @@ -276,19 +185,19 @@ p a { <p>Once all the files have been uploaded to your site you should point your browser at this location with the addition of <code>install/</code>. For example if your domain name is <em>www.mydomain.tld</em> and you placed phpBB3 in a directory /phpBB3 off your web root you would enter <em>http://www.mydomain.tld/phpBB3/install/</em> or (alternatively) <em>http://www.mydomain.tld/phpBB3/install/index.php</em> into your browser. When you have done this you should see the phpBB3 Installation screen appear.</p> - <h3>Introduction:</h3> + <h4>Introduction:</h4> <p>The installation screen gives you a short introduction into phpBB. It allows you to read the license phpBB3 is released under (General Public License) and provides information about how you can receive support. To start the installation, use the <em>Install</em> button.</p> - <h3>Requirements</h3> + <h4>Requirements</h4> <p>The first page you will see after starting the installation is the Requirements list. phpBB3 checks automatically whether everything that it needs to run properly is installed on your server. You need to have at least the minimum PHP version installed, and at least one database available to continue the installation. Also important, is that all shown folders are available and do have the correct permissions. Please see the description of each section to find out whether they are optional or required for phpBB3 to run. If everything is in order, you can continue the installation with <em>Start Install</em>.</p> - <h3>Database settings</h3> + <h4>Database settings</h4> <p>You now have to decide which database to use. See the <a href="#require">Requirements section</a> for information on which databases are supported. If you do not know your database settings, please contact your host and ask for them. You will not be able to continue without them. You need:</p> - <ul class="menu"> + <ul> <li>The Database Type - the database you will be using.</li> <li>The Database server hostname or DSN - the address of the database server.</li> <li>The Database server port - the port of the database server (most of the time this is not needed).</li> @@ -310,17 +219,17 @@ p a { <p>If you see the Successful Connection message, you can continue to the next step.</p> - <h3>Administrator details</h3> + <h4>Administrator details</h4> <p>Now you have to create your administration user. This user will have full administration access and he/she will be the first user on your forum. All fields on this page are required. You can also set the default language of your forum on this page. In a vanilla phpBB3 installation we only include English. You can download further languages from <a href="http://www.phpbb.com/">www.phpbb.com</a>, and add them before installing or later.</p> - <h3>Configuration file</h3> + <h4>Configuration file</h4> <p>In this step, phpBB will try to write the configuration file automatically. The forum needs the configuration to run properly. It contains all database settings, so without it, phpBB will not be able to access the database.</p> <p>Usually writing the configuration file automatically works fine. But in some cases it can fail due to wrong file permissions, for instance. In this case, you need to upload the file manually. phpBB asks you to download the config.php file and tells you what to do with it. Please read the instructions carefully. After you have uploaded the file, use <em>Done</em> to get to the last step. If <em>Done</em> returns you to the same page as before, and does not return a success message, you did not upload the file correctly.</p> - <h3>Advanced settings</h3> + <h4>Advanced settings</h4> <p>The Advanced settings allow you to set some parameters of the board configuration. They are optional, and you can always change them later. So if you are not sure what these settings mean, proceed to the final step and finish the installation.</p> @@ -330,21 +239,27 @@ p a { <p>At this point if you are converting from phpBB 2.0.x, you should refer to the <a href="#convert">conversion steps</a> for further information. If not, you should remove the install directory from your server as you will only be able to access the Administration Control Panel whilst it is present.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<hr /> + <span class="corners-bottom"><span></span></span></div> + </div> -<a name="update"></a><h1>4. Updating from stable releases of phpBB 3.0.x</h1> + <hr /> + + <a name="update"></a><h2>4. Updating from stable releases of phpBB 3.0.x</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>If you are currently using a stable release of phpBB3 updating to this version is straightforward. You would have downloaded one of four packages and your choice determines what you need to do. <strong>Please Note</strong>: That before updating we heavily recommend you do a <em>full backup of your database and existing phpBB3 files</em>! If you are unsure how to achieve this please ask your hosting provider for advice.</p> <p><strong>Please make sure you update your phpBB3 source files too, even if you run the <code>database_update.php</code> file.</strong></p> -<a name="update_full"></a><b>4.i. Full package</b> -<br /><br /> -<div class="paragraph"> +<a name="update_full"></a><h3>4.i. Full package</h3> <p>The full package is normally meant for new installations, but if you want to replace all source files this package comes in handy.</p> @@ -353,27 +268,16 @@ p a { <p>You should now run <code>install/database_update.php</code> which, depending on your previous version, will make a number of database changes. You may receive <em>FAILURES</em> during this procedure, they should not be a cause for concern unless you see an actual <em>ERROR</em>, in which case the script will stop (in this case you should seek help via our forums or bug tracker).</p> <p>Once the install/database_update.php has completed you may proceed to the Administration Control Panel and check remove the install directory as advised.</p> -</div> -<a href="#top">Top</a> -<br /><br /> -<a name="update_files"></a><b>4.ii. Changed files only</b> -<br /><br /> -<div class="paragraph"> +<a name="update_files"></a><h3>4.ii. Changed files only</h3> <p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.0</samp> you should select the phpBB-3.0.0_to_3.0.1.zip/tar.gz file.</p> <p>The directory structure has been preserved enabling you (if you wish) to simply upload the contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any MODs these files will overwrite the originals possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p> <p>As for the other update procedures you should run <b>install/database_update.php</b> after you have finished updating the files. This will update your database schema and increment the version number.</p> -</div> -<a href="#top">Top</a> -<br /><br /> -<a name="update_patch"></a><b>4.iii. Patch file</b> -<br /><br /> - -<div class="paragraph"> +<a name="update_patch"></a><h3>4.iii. Patch file</h3> <p>The patch file is probably the best solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application but still want to use this update approach we recommend the <a href="update_auto">Automatic update package</a> explained below.</p> @@ -382,20 +286,14 @@ p a { <p>If you do get failures you should look at using the <a href="#update_files">Changed files only</a> package to replace the files which failed to patch, please note that you will need to manually re-add any Modifications (MODs) to these particular files. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p> <p>You should of course delete the patch file (or files) after use. As for the other update procedures you should run <code>install/database_update.php</code> after you have finished updating the files. This will update your database schema and data (if appropriate) and increment the version number.</p> -</div> -<a href="#top">Top</a> -<br /><br /> - -<a name="update_auto"></a><b>4.iv. Automatic update package</b> -<br /><br /> -<div class="paragraph"> +<a name="update_auto"></a><h3>4.iv. Automatic update package</h3> <p>The automatic update package is holding - contrary to the others - only the update informations for updating the last released version to the latest available version. These package is meant for use with the automatic update tool.</p> <p>To perform the update, either follow the instructions from the <code>Administration Control Panel -> System</code> Tab - this should point out that you are running an outdated version and will guide you through the update - or following the instructions listed below.</p> - <ul class="menu"> + <ul> <li>Go to the <a href="http://www.phpbb.com/downloads/">downloads page</a> and download the latest update package listed there.</li> <li>Upload the archives contents to your phpBB installation - only the install folder is required. Upload the whole install folder, retaining the file structure.</li> <li>After the install folder is present, phpBB3 will go offline automatically.</li> @@ -403,44 +301,39 @@ p a { <li>Choose the "Update" Tab and follow the instructions</li> </ul> -</div> -<a href="#top">Top</a> -<br /><br /> - -<a name="update_all"></a><b>4.v. All package types</b> -<br /><br /> + <p> </p> -<div class="paragraph"> +<a name="update_all"></a><h3>4.v. All package types</h3> <p>If you have non-English language packs installed you may want to see if a new version has been made available. A number of missing strings may have been added which, though not essential, may be beneficial to users. Please note that at this time not all language packs have been updated so you should be prepared to periodically check for updates.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> -<hr /> + <a name="convert"></a><h2>5. Conversion from phpBB 2.0.x to phpBB 3.0.x</h2> -<a name="convert"></a><h1>5. Conversion from phpBB 2.0.x to phpBB 3.0.x</h1> + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>This paragraph explains the steps necessary to convert your existing phpBB2 installation to phpBB3.</p> -<a name="prereq"></a><b>5.i. Requirements before converting</b> -<br /><br /> +<a name="prereq"></a><h3>5.i. Requirements before converting</h3> -<div class="paragraph"> <p>Before converting we heavily recommend you do a <em>full backup of your database and files</em>! If you are unsure how to achieve this please ask your hosting provider for advice. You basically need to follow the basic instructions given for <a href="#install">New installations</a>. Please <strong>do not</strong> overwrite any old files - install phpBB3 at a different location.</p> <p>Once you made a backup of everything and also have a brand new phpBB3 installation, you can now begin the conversion.</p> <p>Note that the conversion requires CREATE and DROP privileges for the phpBB3's database user account.</p> -</div> -<a href="#top">Top</a> -<br /><br /> -<a name="conversion"></a><b>5.ii. Converting</b> -<br /><br /> - -<div class="paragraph"> +<a name="conversion"></a><h3>5.ii. Converting</h3> <p>To begin the conversion visit the install folder of your phpBB3 installation (the same as you have done for installing). Now you will see a new tab <em>Convert</em>. Click this tab.</p> @@ -449,14 +342,8 @@ p a { <p>Please note that this conversion process may take quite some time and depending on your hosting provider this may result in it failing (due to web server or other timeout issues). If this is the case you should ask your provider if they are willing to allow the convert script to temporarily exceed their limits (be nice and they will probably be quite helpful).</p> <p>Once completed your board should be immediately available. If you encountered errors you should report the problems to our bug tracker or seek help via our forums (see <a href="README.html">README</a> for details).</p> -</div> -<a href="#top">Top</a> -<br /><br /> -<a name="postreq"></a><b>5.iii. Things to do after conversion</b> -<br /><br /> - -<div class="paragraph"> +<a name="postreq"></a><h3>5.iii. Things to do after conversion</h3> <p>After successful conversion there may be a few items you need to do - apart from checking if the installation is accessible and everything displayed correctly.</p> @@ -468,14 +355,7 @@ p a { <p>Once you are pleased with your new installation you may want to give it the name of your old installation, changing the directory name. With phpBB3 this is possible without any problems - but you may still want to check your cookie settings within the administration panel, if the cookie path need to be adjusted prior to renaming.</p> -</div> -<a href="#top">Top</a> -<br /><br /> - -<a name="convprob"></a><b>5.iv. Common conversion problems</b> -<br /><br /> - -<div class="paragraph"> +<a name="convprob"></a><h3>5.iv. Common conversion problems</h3> <p><strong>Broken non-latin characters</strong> The conversion script assumes that the database encoding in the source phpBB2 matches the encoding defined in the <code>lang_main.php</code> file of the default language pack of the source installation. Edit that file to match the database's encoding and re-start the conversion procedure.</p> @@ -489,28 +369,28 @@ p a { <p><strong>Smilies</strong> During the conversion you might see warnings about image files where the copying failed. That can happen if the old board's smilies have the same file names as those on the new board. Copy those files manually after the conversion, if you want to continue using the old smilies.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="postinstall"></a><h1>6. Important (security related) post-Install tasks for all installation methods</h1> + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> + + <a name="postinstall"></a><h2>6. Important (security related) post-Install tasks for all installation methods</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> -<div class="paragraph"> + <div class="content"> <p>Once you have successfully installed phpBB3 you <strong>MUST</strong> ensure you remove the entire install/ directory. Leaving the install directory in place is a <em>very serious potential security issue</em> which may lead to deletion or alteration of files, etc. Please note that until this directory is removed, phpBB3 will not operate and a warning message will be displayed. Beyond this <strong>essential</strong> deletion, you may also wish to delete the docs/ directories if you wish.</p> <p>With these directories deleted you should proceed to the administration panel. Depending on how the installation completed you may have been directed there automatically. If not, login as the administrator you specified during install/conversion and click the <strong>Administration Panel</strong> link at the bottom of any page. Ensure that details specified in <code>Admin -> General</code> are correct!</p> -</div> -<a href="#top">Top</a> -<br /><br /> - -<a name="avatars"></a><b>6.i. Uploadable avatars</b> -<br /><br /> -<div class="paragraph"> +<a name="avatars"></a><h3>6.i. Uploadable avatars</h3> <p>phpBB3 supports several methods for allowing users to select their own <em>avatar</em> (an avatar is a small image generally unique to a user and displayed just below their username in posts).</p> @@ -521,27 +401,42 @@ p a { <p>On Windows system you need to ensure the directory is not write-protected and that it has global write permissions (see your servers documentation or contact your hosting provider if you are unsure on how to achieve this).</p> <p>Please be aware that setting a directories permissions to global write access is a potential security issue. While it is unlikely that anything nasty will occur (such as all the avatars being deleted) there are always people out there to cause trouble. Therefore you should monitor this directory and if possible make regular backups.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> -<a name="disclaimer"></a><h1>7. Copyright and disclaimer</h1> + <hr /> + +<a name="disclaimer"></a><h2>7. Copyright and disclaimer</h2> <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-license.php">GPL</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) 2000, 2002, 2005, 2007 <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p> -</div> -<a href="#top">Top</a> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> <!-- END DOCUMENT --> -</div> + <div id="page-footer"> + <div class="version"> </div> + </div> +</div></div> -<div id="footer"> <br /><br /></div> +<div> + <a id="bottom" name="bottom" accesskey="z"></a> +</div> </body> </html> diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html index 3dc47ae63b..a2aa4af60d 100644 --- a/phpBB/docs/README.html +++ b/phpBB/docs/README.html @@ -1,210 +1,102 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en"> <head> -<title>phpBB 3.0.x Readme</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -<meta http-equiv="Content-Style-Type" content="text/css" /> + +<meta http-equiv="content-type" content="text/html; charset=utf-8" /> +<meta http-equiv="content-style-type" content="text/css" /> +<meta http-equiv="content-language" content="en" /> +<meta http-equiv="imagetoolbar" content="no" /> <meta name="resource-type" content="document" /> -<meta name="description" lang="en" content="phpBB 3.0.x Readme" /> -<meta name="keywords" lang="en" content="" /> -<meta name="author" content="phpBB Group" /> -<meta name="copyright" content="phpBB Group" /> -<meta name="MSSmartTagsPreventParsing" content="true" /> - -<style type="text/css"> -<!-- - -/* The original "subSilver" theme for phpBB2 Created by subBlue design :: http://www.subBlue.com */ -body { - background-color: white; - font-family: Verdana, Arial, Helvetica, sans-serif; - margin: 0; - border: 0; - padding: 0; -} - -img { - border: 0; -} - -p { - font-size: 8pt; -} - -hr { - height: 0; - border: solid #D1D7DC 0; - border-top-width: 1px; -} - -#title, h1 { - font: bold 18pt 'Trebuchet MS', Verdana, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h2 { - font: bold 12pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h3 { - font: bold 10pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -.paragraph { - margin-left: 20px; -} - -/* Structure */ -#logo { - background: #fff url(header_bg.jpg) repeat-x top right; - height: 60px; -} - -#title { - color: #12749b; - float: right; - margin: 10px 10px 0; -} - -#main { - margin-left: 25px; - margin-right: 25px; -} - -.good { - color: green; -} - -.bad { - color: red; -} - -#footer { - margin-left: 75px; - font-size: 70%; - color: #006600; -} - -code { - color: #006600; - font-weight: normal; - font-family: 'Courier New', monospace; - border-color: #D1D7DC; - border-width: 1px; - border-style: solid; - background-color: #FAFAFA; -} - -.indent p { - padding-left: 20px; - font-size: 90%; -} - -/* Anchors */ -a { - font-size: 70%; -} - -a:link, a:active, a:visited { - color: #006699; - text-decoration: none; -} - -a:hover { - color: #DD6900; - text-decoration: underline; -} - -a.nav { - color: #006699; - text-decoration: none; -} - -a.nav:hover { - text-decoration: underline; -} - -p a { - font-size: 100%; -} - -.menu { - font-size: 80%; -} - -.menu li a { - font-size: 100%; -} - -.comment { - color: green; -} - -//--> -</style> +<meta name="distribution" content="global" /> +<meta name="copyright" content="2007 phpBB Group" /> +<meta name="keywords" content="" /> +<meta name="description" content="phpBB 3.0.x Readme" /> +<title>phpBB3 • Readme</title> + +<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> </head> -<body> +<body id="phpbb" class="section-docs"> -<div id="logo"> - <div id="title">phpBB 3.0.x Readme</div> - <img src="header_left.jpg" alt="phpBB Logo" /> -</div> +<div id="wrap"> + <a id="top" name="top" accesskey="t"></a> + <div id="page-header"> + <div class="headerbar"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div id="doc-description"> + <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <h1>phpBB 3.0.x Readme</h1> + <p style="display: none;"><a href="#start_here">Skip</a></p> + </div> + + <span class="corners-bottom"><span></span></span></div> + </div> + </div> -<a name="top"></a><div id="main"> + <a name="start_here"></a> + + <div id="page-body"> <!-- BEGIN DOCUMENT --> -<p>Thank you for downloading phpBB3. This README will guide through the basics of installation and operation of phpBB3. Please ensure you read this and the accompanying documentation fully <strong>before</strong> proceeding with the installation.</p> - -<h1>Readme</h1> - -<ol class="menu"> - <li><a href="#install">Installing phpBB3</a></li> - <li><a href="#run">Running phpBB3</a> - <ol type="i"> - <li><a href="#i18n">Internationalisation (i18n)</a></li> - <li><a href="#styles">Styles</a></li> - <li><a href="#mods">Modifications</a></li> - </ol> - </li> - <li><a href="#help">Getting help with phpBB3</a> - <ol type="i"> - <li><a href="#docs">Documentation</a></li> - <li><a href="#website">Community Forums</a></li> - <li><a href="#irc">Internet Relay Chat</a></li> - </ol> - </li> - <li><a href="#status">Status of this version</a></li> - <li><a href="#bugs">Reporting Bugs</a> - <ol type="i"> - <li><a href="#securitybugs">Security related bugs</a></li> - </ol> - </li> - <li><a href="#curbugs">Overview of current bug list</a></li> - <li><a href="#php">PHP compatibility issues</a></li> - <li><a href="#disclaimer">Disclaimer</a></li> -</ol> - -<hr /> - -<a name="install"></a><h1>1. Installing phpBB3</h1> - -<div class="paragraph"> + <p>Thank you for downloading phpBB3. This README will guide through the basics of installation and operation of phpBB3. Please ensure you read this and the accompanying documentation fully <strong>before</strong> proceeding with the installation.</p> + + <h1>Readme</h1> + + <div class="paragraph menu"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> + + <ol> + <li><a href="#install">Installing phpBB3</a></li> + <li><a href="#run">Running phpBB3</a> + <ol style="list-style-type: lower-roman;"> + <li><a href="#i18n">Internationalisation (i18n)</a></li> + <li><a href="#styles">Styles</a></li> + <li><a href="#mods">Modifications</a></li> + </ol> + </li> + <li><a href="#help">Getting help with phpBB3</a> + <ol style="list-style-type: lower-roman;"> + <li><a href="#docs">Documentation</a></li> + <li><a href="#website">Community Forums</a></li> + <li><a href="#irc">Internet Relay Chat</a></li> + </ol> + </li> + <li><a href="#status">Status of this version</a></li> + <li><a href="#bugs">Reporting Bugs</a> + <ol style="list-style-type: lower-roman;"> + <li><a href="#securitybugs">Security related bugs</a></li> + </ol> + </li> + <li><a href="#curbugs">Overview of current bug list</a></li> + <li><a href="#php">PHP compatibility issues</a></li> + <li><a href="#disclaimer">Disclaimer</a></li> + </ol> + + </div> + + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> + + <a name="install"></a><h2>1. Installing phpBB3</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>Installation, update and conversion instructions can be found in the <a href="INSTALL.html">INSTALL</a> document contained in this distribution. If you are intending to convert from a previous phpBB 2.0.x installation we highly recommend you backup any existing data before proceeding!</p> <p>Users of phpBB3 Beta versions cannot directly update.</p> <p>Please note that we won't support the following installation types:</p> - <ul class="menu"> + <ul> <li>Updates from phpBB3 Beta versions to phpBB3 RC1 and higher</li> <li>Conversions from phpBB 2.0.x to phpBB3 Beta versions</li> <li>phpBB3 Beta installations</li> @@ -212,25 +104,31 @@ p a { <p>We give support for the following installation types:</p> - <ul class="menu"> + <ul> <li>Updates from phpBB3 RC1 to any higher version</li> <li>Conversions from phpBB 2.0.x to phpBB3 RC1 and higher</li> <li>New installations of phpBB3 RC1 and higher</li> </ul> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="run"></a><h1>2. Running phpBB3</h1> + <span class="corners-bottom"><span></span></span></div> + </div> - <p>Once installed phpBB is easily managed by both admin and moderator control panels. If you need help or advice with phpBB please see <a href="#help">Section 3</a> below.</p> + <hr /> + + <a name="run"></a><h2>2. Running phpBB3</h2> - <a name="i18n"></a><b>2.i. Internationalisation (i18n)</b> - <br /><br /> <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> + + <p>Once installed phpBB is easily managed by both admin and moderator control panels. If you need help or advice with phpBB please see <a href="#help">Section 3</a> below.</p> + + <a name="i18n"></a><h3>2.i. Internationalisation (i18n)</h3> <p>A number of language packs and style localisations are available. You can find them on our official download page:</p> @@ -242,13 +140,7 @@ p a { <p>If your language is not available please visit our forums where you will find a topic listing translations currently available or in preparation. This topic also gives you information should you wish to volunteer to translate a language not currently listed</p> - </div> - <a href="#top">Top</a> - <br /><br /> - - <a name="styles"></a><b>2.ii. Styles</b> - <br /><br /> - <div class="paragraph"> + <a name="styles"></a><h3>2.ii. Styles</h3> <p>Although phpBB Group are rather proud of the included styles we realise that it may not be to everyones tastes. Therefore phpBB3 allows styles to be switched with relative ease. Firstly you need to locate and download a style you like. We maintain such a site at</p> @@ -258,13 +150,7 @@ p a { <p>Once you have downloaded a style the usual next step is to unarchive (or upload the unarchived contents of) the package into your <samp>styles/</samp> directory. You then need to visit <code>Administration -> Styles</code>, you should see the new style available, click install and it will become available for all your users.</p> - </div> - <a href="#top">Top</a> - <br /><br /> - - <a name="mods"></a><b>2.iii. Modifications</b> - <br /><br /> - <div class="paragraph"> + <a name="mods"></a><h3>2.iii. Modifications</h3> <p>Although not officially supported by phpBB Group, phpBB has a thriving modification scene. These third party modifications to the standard phpBB extend its capabilities still further and can be found at:</p> @@ -274,19 +160,25 @@ p a { <p>Also remember that any modifications which modify the database in any way may render upgrading your forum to future versions more difficult unless we state otherwise. With all this said many users have and continue to utilise many of the mods already available with great success.</p> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> </div> - <a href="#top">Top</a> - <br /><br /> -<hr /> + <hr /> + +<a name="help"></a><h2>3. Getting help with phpBB3</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> -<a name="help"></a><h1>3. Getting help with phpBB3</h1> + <div class="content"> <p>phpBB3 can seem a little daunting to new users in places, particularly with regard the permission system. The first thing you should do is check the <a href="FAQ.html">FAQ</a> which covers a few basic getting started questions. If you need additional help there are several places you should look.</p> - <a name="docs"></a><b>3.i. phpBB3 Documentation</b> - <br /><br /> - <div class="paragraph"> + <a name="docs"></a><h3>3.i. phpBB3 Documentation</h3> <p>A comprehensive documentation is now available online and can be accessed from the following location:</p> @@ -294,14 +186,7 @@ p a { <p>This covers everything from installation through setting permissions and managing users.</p> - </div> - <a href="#top">Top</a> - <br /><br /> - - <a name="website"></a><b>3.ii. Community Forums</b> - <br /><br /> - - <div class="paragraph"> + <a name="website"></a><h3>3.ii. Community Forums</h3> <p>phpBB Group maintains a thriving community where a number of people have generously decided to donate their time to help support users. This site can be found at:</p> @@ -309,25 +194,26 @@ p a { <p>If you do seek help via our forums please be sure to do a Search before posting. This may well save both you and us time and allow the developer, moderator and support groups to spend more time responding to people with unknown issues and problems. Please also remember that phpBB is an entirely volunteer effort, no one receives any compensation for the time they give, this includes moderators as well as developers. So please be respectful and mindful when awaiting responses.</p> - </div> - <a href="#top">Top</a> - <br /><br /> - - <a name="irc"></a><b>3.iii Internet Relay Chat</b> - <br /><br /> - <div class="paragraph"> + <a name="irc"></a><h3>3.iii Internet Relay Chat</h3> <p>Another place you may find help is our IRC channel. This operates on the Freenode IRC network, <em>irc.freenode.net</em> and the channel is <em>#phpbb</em> and can be accessed by any good IRC client such as mIRC, XChat, etc. Again, please do not abuse this service and be respectful of other users.</p> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> </div> - <a href="#top">Top</a> - <br /><br /> -<hr /> + <hr /> + +<a name="status"></a><h2>4. Status of this version</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> -<a name="status"></a><h1>4. Status of this version</h1> + <div class="content"> -<div class="paragraph"> <p>This is the third stable release of phpBB. The 3.0.x line is essentially feature frozen, with only point releases seeing fixes for bugs and security issues, though feature alterations and minor feature additions may be done if deemed absolutely required. Our next major release will be phpBB 3.2 and the planning phase has begun (the unstable development version is 3.1). Please do not post questions asking when 3.2 will be available, no release date has been set.</p> <p>For those interested in the development of phpBB should keep an eye on the community forums to see how things are progressing:</p> @@ -335,22 +221,30 @@ p a { <p><a href="http://area51.phpbb.com/">http://area51.phpbb.com/phpBB/</a></p> <p>Please note that this forum should <strong>NOT</strong> be used to obtain support for or ask questions about phpBB 2.0.x or phpBB 3.0.x, the main community forums are the place for this. Any such posts will be locked and go unanswered.</p> -</div> -<a href="#top">Top</a> -<br /><br /> -<hr /> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="bugs"></a><h1>5. Reporting Bugs</h1> + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> + +<a name="bugs"></a><h2>5. Reporting Bugs</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> -<div class="paragraph"> <p>The phpBB Group uses a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please <strong>DO NOT</strong> post bug reports to our forums, they will be locked. In addition please <strong>DO NOT</strong> use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).</p> <p><a href="http://www.phpbb.com/bugs/">http://www.phpbb.com/bugs/</a></p> <p>While we very much appreciate receiving bug reports (the more reports the more stable phpBB will be) we ask you carry out a few steps before adding new entries:</p> - <ul class="menu"> + <ul> <li>Firstly determine if your bug is reproduceable, how to determine this depends on the bug in question. Only if the bug is reproduceable it is likely to be a problem with phpBB3 (or in some way connected). If something cannot be reproduced it may turn out to have been your hosting provider working on something, a user doing something silly, etc. Bug reports for non-reproduceable events can slow down our attempts to fix real, reproduceable issues<br /><br /></li> <li>Next please read or search through the existing bug reports to see if <em>your</em> bug (or one very similar to it) is already listed. If it is please add to that existing bug rather than creating a new duplicate entry (all this does is slow us down).<br /><br /></li> <li>Check the forums (use search!) to see if people have discussed anything that sounds similar to what you are seeing. However, as noted above please <strong>DO NOT</strong> post your particular bug to the forum unless it's non-reproduceable or you are sure it's related to something you have done rather phpBB3<br /><br /></li> @@ -359,7 +253,7 @@ p a { <p>If you do post a new bug (i.e. one that isn't already listed in the bug tracker) firstly make sure you have logged in (your username and password are the same as for the community forums) then please include the following details:</p> - <ul class="menu"> + <ul> <li>Your server type/version, e.g. Apache 1.3.28, IIS 4, Sambar, etc.</li> <li>PHP version and mode of operation, e.g. PHP 5.1.1 as a module, PHP 4.4.4 running as CGI, etc.</li> <li>DB type/version, e.g. MySQL 4.0.1, PostgreSQL 7.3.2, MSSQL Server 2000 SP1, etc.</li> @@ -371,76 +265,97 @@ p a { <p>Once a bug has been submitted you will be emailed any follow up comments added to it. <strong>Please</strong> if you are requested to supply additional information, do so! It is frustrating for us to receive bug reports, ask for additional information but get nothing. In these cases we have a policy of closing the bug, which may leave a very real problem in place. Obviously we would rather not have this situation arise.</p> -</div> -<a href="#top">Top</a> -<br /><br /> +<a name="securitybugs"></a><h3>5.i. Security related bugs</h3> -<a name="securitybugs"></a><b>5.i. Security related bugs</b> -<br /><br /> -<div class="paragraph"> <p>If you find a potential security related vulnerability in phpBB please <strong>DO NOT</strong> post it to the bug tracker, public forums, etc.! Doing so may allow unscrupulous users to take advantage of it before we have time to put a fix in place. All security related bugs should be sent to our security tracker:</p> <p><a href="http://www.phpbb.com/security/">http://www.phpbb.com/security/</a></p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> -<hr /> +<a name="curbugs"></a><h2>6. Overview of current bug list</h2> -<a name="curbugs"></a><h1>6. Overview of current bug list</h1> + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> -<div class="paragraph"> <p>This list is not complete but does represent those bugs which may effect users on a wider scale. Other bugs listed in the tracker have typically been shown to be limited to certain setups or methods of installation, updating and/or conversions.</p> - <ul class="menu"> - <li>By default cannot post very large messages with MSSQL (this can be configured within MSSQL)</li> + <ul> <li>Conversions may fail to complete on large boards under some hosts</li> + <li>Updates may fail to complete on large update sets under some hosts</li> + <li>URL redirects are not working correctly under PHP 5.2.4 and certain conditions due to a bug within this PHP version</li> </ul> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="php"></a><h1>7. PHP compatibility issues</h1> + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> + +<a name="php"></a><h2>7. PHP compatibility issues</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> -<div class="paragraph"> <p>phpBB is no longer supported on PHP3 due to several compatibility issues and we recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 4.3.3.</p> <p>Please remember that running any application on a developmental version of PHP can lead to strange/unexpected results which may appear to be bugs in the application (which may not be true). Therefore we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a developmental version of PHP please check any bugs you find on a system running a stable release before submitting.</p> <p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite and Firebird. Versions of PHP used range from 4.3.3 to 6.0.0-dev without problem. </p> -</div> -<a href="#top">Top</a> -<br /><br /> -<a name="phpsec"></a><b>7.i. Notice on PHP security issues</b> +<a name="phpsec"></a><h3>7.i. Notice on PHP security issues</h3> -<br /><br /> -<div class="paragraph"> <p>Currently there are no known issues regarding PHP security.</p> -</div> -<a href="#top">Top</a> -<br /><br /> -<hr /> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> -<a name="disclaimer"></a><h1>8. Copyright and disclaimer</h1> +<a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2> <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-license.php">GPL</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) 2000, 2002, 2005, 2007 <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p> -</div> -<a href="#top">Top</a> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> <!-- END DOCUMENT --> -</div> + <div id="page-footer"> + <div class="version"> </div> + </div> +</div></div> -<div id="footer"> <br /><br /></div> +<div> + <a id="bottom" name="bottom" accesskey="z"></a> +</div> </body> </html> diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html index f744466254..c83aaadc2d 100644 --- a/phpBB/docs/auth_api.html +++ b/phpBB/docs/auth_api.html @@ -1,191 +1,60 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en"> <head> -<title>Auth API</title> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -<meta http-equiv="Content-Style-Type" content="text/css" /> + +<meta http-equiv="content-type" content="text/html; charset=utf-8" /> +<meta http-equiv="content-style-type" content="text/css" /> +<meta http-equiv="content-language" content="en" /> +<meta http-equiv="imagetoolbar" content="no" /> <meta name="resource-type" content="document" /> -<meta name="description" lang="en" content="Olympus coding guidelines document" /> -<meta name="keywords" lang="en" content="" /> -<meta name="author" content="phpBB Group" /> -<meta name="copyright" content="phpBB Group" /> -<meta name="MSSmartTagsPreventParsing" content="true" /> -<link rel="shortcut icon" href="" /> - -<style type="text/css"> -<!-- - -/* - The original "subSilver" theme for phpBB2 - Created by subBlue design :: http://www.subBlue.com -*/ - -body { - background-color: white; - font-family: Verdana, Arial, Helvetica, sans-serif; - margin: 0px; - border: 0px; - padding: 0px; -} - -img { - border: 0; -} - -p { - font-size: 8pt; -} - -hr { - height: 0px; - border: solid #D1D7DC 0px; - border-top-width: 1px; -} - -#title, h1 { - font: bold 18pt 'Trebuchet MS', Verdana, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h2 { - font: bold 12pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h3 { - font: bold 10pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -.paragraph { - margin-left: 20px; -} - -/* - Structure -*/ -#logo { - background: #fff url(header_bg.jpg) repeat-x top right; - height: 60px; -} - -#title { - color: #12749b; - float: right; - margin: 10px 10px 0; -} - -#main { - margin-left: 25px; - margin-right: 25px; -} - -.good { - color: green; -} - -.bad { - color: red; -} - -#footer { - margin-left: 75px; - font-size: 70%; - color: #006600; -} - -code { - color: #006600; - font-weight: normal; - font-family: 'Courier New', monospace; - border-color: #D1D7DC; - border-width: 1px; - border-style: solid; - background-color: #FAFAFA; -} - -.indent p { - padding-left: 20px; - font-size: 90%; -} - -/* - Anchors -*/ -a { - font-size: 70%; -} - -a:link, a:active, a:visited { - color: #006699; - text-decoration: none; -} - -a:hover { - color: #DD6900; - text-decoration: underline; -} - -a.nav { - color: #006699; - text-decoration: none; -} - -a.nav:hover { - text-decoration: underline; -} - -p a { - font-size: 100%; -} - -.menu { - font-size: 80%; -} - -.menu li a { - font-size: 100%; -} -//--> -</style> - -<!--[if IE]> -<style type="text/css"> -body { - scrollbar-face-color: #DEE3E7; - scrollbar-highlight-color: white; - scrollbar-shadow-color: #DEE3E7; - scrollbar-3dlight-color: #D1D7DC; - scrollbar-arrow-color: #006699; - scrollbar-track-color: #EFEFEF; - scrollbar-darkshadow-color: #98AAB1; -} -</style> -<![endif]--> +<meta name="distribution" content="global" /> +<meta name="copyright" content="2007 phpBB Group" /> +<meta name="keywords" content="" /> +<meta name="description" content="This is an explanation of how to use the phpBB auth/acl API" /> +<title>phpBB3 • Auth API</title> + +<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> </head> -<body> +<body id="phpbb" class="section-docs"> -<div id="logo"> - <div id="title">Auth API</div> - <a href="index.php"><img src="header_left.jpg" alt="phpBB Logo" /></a> -</div> +<div id="wrap"> + <a id="top" name="top" accesskey="t"></a> + <div id="page-header"> + <div class="headerbar"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div id="doc-description"> + <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <h1>Auth API</h1> + <p>This is an explanation of how to use the phpBB auth/acl API</p> + <p style="display: none;"><a href="#start_here">Skip</a></p> + </div> + + <span class="corners-bottom"><span></span></span></div> + </div> + </div> + + <a name="start_here"></a> -<a name="top"></a><div id="main"> + <div id="page-body"> -<p>This is an explanation of how to use the phpBB auth/acl API.</p> +<!-- BEGIN DOCUMENT --> -<h1>Auth API</h1> + <p>This is an explanation of how to use the phpBB auth/acl API.</p> -<ol class="menu"> + <h1>Auth API</h1> + + <div class="paragraph menu"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> + +<ol> <li><a href="#intro">Introduction</a></li> <li><a href="#methods">Methods</a> - <ol type="i"> + <ol style="list-style-type: lower-roman;"> <li><a href="#acl">acl</a></li> <li><a href="#acl_get">acl_get</a></li> <li><a href="#acl_gets">acl_gets</a></li> @@ -198,62 +67,69 @@ body { <li><a href="#disclaimer">Copyright and disclaimer</a></li> </ol> -<hr /> + </div> + + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> -<a name="intro"></a><h1>1. Introduction</h1> +<a name="intro"></a><h2>1. Introduction</h2> <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> - <h3>What is it?</h3> + <div class="content"> + + <h4>What is it?</h4> <p>The <code>auth</code> class contains methods related to authorisation users to access various board functions, e.g. posting, viewing, replying, logging in (and out), etc. If you need to check whether a user can carry out a task or handle user login/logouts this class is required.</p> - <h3>Initialisation</h3> + <h4>Initialisation</h4> <p>To use any methods contained with the <code>auth</code> class it first needs to be instantiated. This is best achieved early in the execution of the script in the following manner:</p> - <blockquote><pre> + <div class="codebox"><pre> $auth = new auth(); - </pre></blockquote> + </pre></div> <p>Once an instance of the class has been created you are free to call the various methods it contains. Please note that should you wish to use the <code>auth_admin</code> methods you will need to instantiate this separately but in the same way.</p> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> </div> - <a href="#top">Top</a> - <br /><br /> -<hr /> + <hr /> + +<a name="methods"></a><h2>2. Methods</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> -<a name="methods"></a><h1>2. Methods</h1> + <div class="content"> <p>Following are the methods you are able to use.</p> - <a name="acl"></a><b>2.i. acl</b> - <br /><br /> - <div class="paragraph"> + <a name="acl"></a><h3>2.i. acl</h3> <p>The <code>acl</code> method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:</p> - <blockquote><pre> + <div class="codebox"><pre> $auth->acl(<code>userdata</code>); - </pre></blockquote> + </pre></div> <p>Where userdata is the array containing the aforementioned data.</p> - </div> - <a href="#top">Top</a> - <br /><br /> - - - <a name="acl_get"></a><b>2.ii. acl_get</b> - <br /><br /> - <div class="paragraph"> + <a name="acl_get"></a><h3>2.ii. acl_get</h3> <p>This method is the primary way of determining what a user can and cannot do for a given option globally or in a given forum. The method should be called in the following way:</p> - <blockquote><pre> + <div class="codebox"><pre> $result = $auth->acl_get(<code>option</code>[, <code>forum</code>]); - </pre></blockquote> + </pre></div> <p>Where option is a string representing the required option, e.g. 'f_list', 'm_edit', 'a_adduser', etc. By adding a ! in front of the option, e.g. '!f_list' the result of this method will be negated. The optional forum term is the integer forum_id.</p> @@ -263,121 +139,114 @@ $result = $auth->acl_get(<code>option</code>[, <code>forum</code>]); <p>There are some special options or <em>flags</em> which are used as prefixes for other options, e.g. 'f_' or 'm_'. These flags will automatically be set to a positive integer if the user has one or more permissions with the given prefix. A local setting will result in the flag being set only locally (so it will require a forum id to retrieve). If a user has one or more global permissions with the prefix acl_get will return a positive integer regardless of the forum id.</p> - </div> - <a href="#top">Top</a> - <br /><br /> - - - <a name="acl_gets"></a><b>2.iii. acl_gets</b> - <br /><br /> - <div class="paragraph"> + <a name="acl_gets"></a><h3>2.iii. acl_gets</h3> <p>This method is funtionally similar to <code>acl_get</code> in that it returns information on whether a user can or cannot carry out a given task. The difference here is the ability to test several different options in one go. This may be useful for testing whether a user is a moderator or an admin in one call. Rather than having to call and check <code>acl_get</code> twice.</p> <p>The method should be called thus:</p> - <blockquote><pre> + <div class="codebox"><pre> $result = $auth->acl_gets(<code>option1</code>[, <code>option2</code>, ..., <code>optionN</code>, <code>forum</code>]); - </pre></blockquote> + </pre></div> <p>As with the <code>acl_get</code> method the options are strings representing the required permissions to check. The forum again is an integer representing a given forum_id.</p> <p>The method will return a positive integer if <code>acl_get</code> for one of the options evaluates to a positive integer (combines permissions with OR).</p> - </div> - <a href="#top">Top</a> - <br /><br /> - - - <a name="acl_getf"></a><b>2.iv. acl_getf</b> - <br /><br /> - <div class="paragraph"> + <a name="acl_getf"></a><h3>2.iv. acl_getf</h3> <p>This method is used to find out in which forums a user is allowed to carry out an operation or to find out in which forums he is not allowed to carry out an operation. The method should be called in the following way:</p> - <blockquote><pre> + <div class="codebox"><pre> $result = $auth->acl_getf(<code>option</code>[, <code>clean</code>]); - </pre></blockquote> + </pre></div> <p>Just like in the <code>acl_get</code> method the option is a string specifying the permission which has to be checked (negation using ! is allowed). The second parameter is a boolean. If it is set to false this method returns all forums with either zero or a positive integer. If it is set to true only those forums with a positive integer as the result will be returned.</p> <p>The method returns an associative array of the form:</p> - <blockquote><pre> + <div class="codebox"><pre> array(<em>forum_id1</em> => array(<em>option</em> => <em>integer</em>), <em>forum_id2</em> => ...) - </pre></blockquote> + </pre></div> <p>Where option is the option passed to the method and integer is either zero or a positive integer and the same <code>acl_get(option, forum_id)</code> would return.</p> - </div> - <a href="#top">Top</a> - <br /><br /> - - - <a name="acl_getf_global"></a><b>2.v. acl_getf_global</b> - <br /><br /> - <div class="paragraph"> + <a name="acl_getf_global"></a><h3>2.v. acl_getf_global</h3> <p>This method is used to find out whether a user has a permission in at least one forum or globally. This method is similar to checking whether <code>acl_getf(option, true)</code> returned one or more forums but it's faster. It should be called in the following way:</p> - <blockquote><pre> + <div class="codebox"><pre> $result = acl_getf_global(<code>option</code>) - </pre></blockquote> + </pre></div> <p>As with the previous methods option is a string specifying the permission which has to be checked.</p> <p>This method returns either zero or a positive integer.</p> - </div> - <a href="#top">Top</a> - <br /><br /> + <a name="acl_cache"></a><h3>2.vi. acl_cache</h3> + <p>This should be considered a private method and not be called externally. It handles the generation of the user_permissions data from the basic user and group authorisation data. When necessary this method is called automatically by <code>acl</code>.</p> - <a name="acl_cache"></a><b>2.vi. acl_cache</b> - <br /><br /> - <div class="paragraph"> + </div> - <p>This should be considered a private method and not be called externally. It handles the generation of the user_permissions data from the basic user and group authorisation data. When necessary this method is called automatically by <code>acl</code>.</p> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + <span class="corners-bottom"><span></span></span></div> </div> - <a href="#top">Top</a> - <br /><br /> -<hr /> + <hr /> -<a name="admin_related"></a><h1>3. Admin related functions</h1> +<a name="admin_related"></a><h2>3. Admin related functions</h2> <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>A number of additional methods are available related to <code>auth</code>. These handle more basic functions such as adding user and group permissions, new options and clearing the user cache. These methods are contained within a separate class, <code>auth_admin</code>. This can be found in <code>includes/acp/auth.php</code>.</p> <p>To use any methods this class contains it first needs to be instantiated separately from <code>auth</code>. This is achieved in the same way as <code>auth</code>:</p> - <blockquote><pre> + <div class="codebox"><pre> $auth_admin = new auth_admin(); - </pre></blockquote> + </pre></div> <p>This instance gives you access to both the methods of this specific class and that of <code>auth</code>.</p> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> </div> - <a href="#top">Top</a> - <br /><br /> <hr /> -<a name="disclaimer"></a><h1>4. Copyright and disclaimer</h1> +<a name="disclaimer"></a><h2>4. Copyright and disclaimer</h2> <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-license.php">GPL</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) 2000, 2002, 2005, 2007 <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p> -</div> -<a href="#top">Top</a> + </div> -</div> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> + +<!-- END DOCUMENT --> + + <div id="page-footer"> + <div class="version"> $Id$ </div> + </div> +</div></div> -<div id="footer"> $Id$ -<br /><br /> +<div> + <a id="bottom" name="bottom" accesskey="z"></a> </div> </body> diff --git a/phpBB/docs/bg_header.gif b/phpBB/docs/bg_header.gif Binary files differnew file mode 100644 index 0000000000..351de9f46a --- /dev/null +++ b/phpBB/docs/bg_header.gif diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index f9d75b11b2..fa3d362578 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -1,194 +1,44 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en"> <head> -<title>Coding Guidelines</title> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta http-equiv="Content-Style-Type" content="text/css" /> -<meta name="resource-type" content="document" /> -<meta name="description" lang="en" content="Olympus coding guidelines document" /> -<meta name="keywords" lang="en" content="" /> -<meta name="author" content="phpBB Group" /> -<meta name="copyright" content="phpBB Group" /> -<meta name="MSSmartTagsPreventParsing" content="true" /> - -<style type="text/css"> -<!-- - -/* The original "subSilver" theme for phpBB2 Created by subBlue design :: http://www.subBlue.com */ -body { - background-color: white; - font-family: Verdana, Arial, Helvetica, sans-serif; - margin: 0; - border: 0; - padding: 0; -} - -img { - border: 0; -} - -p { - font-size: 8pt; -} - -hr { - height: 0; - border: solid #D1D7DC 0; - border-top-width: 1px; -} - -#title, h1 { - font: bold 18pt 'Trebuchet MS', Verdana, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h2 { - font: bold 12pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -h3 { - font: bold 10pt Arial, Helvetica, sans-serif; - text-decoration: none; - line-height: 120%; -} - -.paragraph { - margin-left: 20px; -} - -.paragraph table { - font-size: 8pt; - border-collapse: collapse; - border: 1px solid #006699; -} - -.paragraph table caption { - display: none; -} -.paragraph table thead { - background-color: #D1D7DC; -} - -.paragraph table td, .paragraph table th { - border: 1px solid #006699; - padding: 0.5em; -} - -.paragraph table td dl { - margin: 0; - padding: 0; -} - -.paragraph table td dl dt { - float: left; - clear: both; - margin-right: 1em; -} - -/* Structure */ -#logo { - background: #fff url(header_bg.jpg) repeat-x top right; - height: 60px; -} - -#title { - color: #12749b; - float: right; - margin: 10px 10px 0; -} - -#main { - margin-left: 25px; - margin-right: 25px; -} - -.good { - color: green; -} - -.bad { - color: red; -} - -#footer { - margin-left: 75px; - font-size: 70%; - color: #006600; -} - -code { - color: #006600; - font-weight: normal; - font-family: 'Courier New', monospace; - border-color: #D1D7DC; - border-width: 1px; - border-style: solid; - background-color: #FAFAFA; -} - -.indent p { - padding-left: 20px; - font-size: 90%; -} - -/* Anchors */ -a { - font-size: 70%; -} - -a:link, a:active, a:visited { - color: #006699; - text-decoration: none; -} - -a:hover { - color: #DD6900; - text-decoration: underline; -} - -a.nav { - color: #006699; - text-decoration: none; -} - -a.nav:hover { - text-decoration: underline; -} - -p a { - font-size: 100%; -} +<meta http-equiv="content-type" content="text/html; charset=utf-8" /> +<meta http-equiv="content-style-type" content="text/css" /> +<meta http-equiv="content-language" content="en" /> +<meta http-equiv="imagetoolbar" content="no" /> +<meta name="resource-type" content="document" /> +<meta name="distribution" content="global" /> +<meta name="copyright" content="2007 phpBB Group" /> +<meta name="keywords" content="" /> +<meta name="description" content="Olympus coding guidelines document" /> +<title>phpBB3 • Coding Guidelines</title> -.menu { - font-size: 80%; -} +<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> -.menu li a { - font-size: 100%; -} +</head> -.comment { - color: green; -} +<body id="phpbb" class="section-docs"> -//--> -</style> +<div id="wrap"> + <a id="top" name="top" accesskey="t"></a> + <div id="page-header"> + <div class="headerbar"> + <div class="inner"><span class="corners-top"><span></span></span> -</head> + <div id="doc-description"> + <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a> + <h1>Coding Guidelines</h1> + <p>Olympus coding guidelines document</p> + <p style="display: none;"><a href="#start_here">Skip</a></p> + </div> -<body> + <span class="corners-bottom"><span></span></span></div> + </div> + </div> -<div id="logo"> - <div id="title">Coding Guidelines</div> - <img src="header_left.jpg" alt="phpBB Logo" /> -</div> + <a name="start_here"></a> -<a name="top"></a><div id="main"> + <div id="page-body"> <!-- BEGIN DOCUMENT --> @@ -196,16 +46,21 @@ p a { <h1>Coding Guidelines</h1> -<ol class="menu"> + <div class="paragraph menu"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> + +<ol> <li><a href="#defaults">Defaults</a> - <ol type="i"> + <ol style="list-style-type: lower-roman;"> <li><a href="#editorsettings">Editor Settings</a></li> <li><a href="#fileheader">File Header</a></li> <li><a href="#locations">File Locations</a></li> </ol> </li> <li><a href="#code">Code Layout/Guidelines</a> - <ol type="i"> + <ol style="list-style-type: lower-roman;"> <li><a href="#namingvars">Variable/Function Naming</a></li> <li><a href="#codelayout">Code Layout</a></li> <li><a href="#sql">SQL/SQL Layout</a></li> @@ -217,7 +72,7 @@ p a { <li><a href="#templating">Templating</a></li> <li><a href="#charsets">Character Sets and Encodings</a></li> <li><a href="#translation">Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</a> - <ol type="i"> + <ol style="list-style-type: lower-roman;"> <li><a href="#standardisation">Standardisation</a></li> <li><a href="#otherconsiderations">Other considerations</a></li> <li><a href="#writingstyle">Writing Style</a></li> @@ -227,58 +82,59 @@ p a { <li><a href="#disclaimer">Copyright and disclaimer</a></li> </ol> -<hr /> + </div> + + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> -<a name="defaults"></a><h1>1. Defaults</h1> +<a name="defaults"></a><h2>1. Defaults</h2> - <a name="editorsettings"></a><b>1.i. Editor Settings</b> - <br /><br /> <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> - <h3>Tabs vs Spaces:</h3> - <p>In order to make this as simple as possible, we will be using tabs, not spaces. We enforce 4 (four) spaces for one tab - therefore you need to set your tab width within your editor to 4 spaces. Make sure that when you <b>save</b> the file, it's saving tabs and not spaces. This way, we can each have the code be displayed the way we like it, without breaking the layout of the actual files.</p> + <div class="content"> + +<a name="editorsettings"></a><h3>1.i. Editor Settings</h3> + + <h4>Tabs vs Spaces:</h4> + <p>In order to make this as simple as possible, we will be using tabs, not spaces. We enforce 4 (four) spaces for one tab - therefore you need to set your tab width within your editor to 4 spaces. Make sure that when you <strong>save</strong> the file, it's saving tabs and not spaces. This way, we can each have the code be displayed the way we like it, without breaking the layout of the actual files.</p> <p>Tabs in front of lines are no problem, but having them within the text can be a problem if you do not set it to the amount of spaces every one of us uses. Here is a short example of how it should look like:</p> - <blockquote><pre> + <div class="codebox"><pre> {TAB}$mode{TAB}{TAB}= request_var('mode', ''); {TAB}$search_id{TAB}= request_var('search_id', ''); - </pre></blockquote> + </pre></div> <p>If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.</p> <h3>Linefeeds:</h3> <p>Ensure that your editor is saving files in the UNIX format. This means lines are terminated with a newline, not with a CR/LF combo as they are on Win32, or whatever the Mac uses. Any decent editor should be able to do this, but it might not always be the default. Know your editor. If you want advice on Windows text editors, just ask one of the developers. Some of them do their editing on Win32.</p> - </div> - <a href="#top">Top</a> - <br /><br /> + <a name="fileheader"></a><h3>1.ii. File Header</h3> - - <a name="fileheader"></a><b>1.ii. File Header</b> - <br /><br /> - <div class="paragraph"> - - <h3>Standard header for new files:</h3> + <h4>Standard header for new files:</h4> <p>This template of the header must be included at the start of all phpBB files: </p> - <blockquote><pre> + <div class="codebox"><pre> /** * * @package {PACKAGENAME} * @version $Id: $ -* @copyright (c) 2006 phpBB Group +* @copyright (c) 2007 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ - </pre></blockquote> + </pre></div> <p>Please see the <a href="#locations">File Locations section</a> for the correct package name.</p> - <h3>Files containing inline code:</h3> + <h4>Files containing inline code:</h4> <p>For those files you have to put an empty comment directly after the header to prevent the documentor assigning the header to the first code element found.</p> - <blockquote><pre> + <div class="codebox"><pre> /** * {HEADER} */ @@ -286,21 +142,21 @@ p a { /** */ {CODE} - </pre></blockquote> + </pre></div> - <h3>Files containing only functions:</h3> + <h4>Files containing only functions:</h4> <p>Do not forget to comment the functions (especially the first function following the header). Each function should have at least a comment of what this function does. For more complex functions it is recommended to document the parameters too.</p> - <h3>Files containing only classes:</h3> + <h4>Files containing only classes:</h4> <p>Do not forget to comment the class. Classes need a separate @package definition, it is the same as the header package name. Apart from this special case the above statement for files containing only functions needs to be applied to classes and it's methods too.</p> - <h3>Code following the header but only functions/classes file:</h3> + <h4>Code following the header but only functions/classes file:</h4> <p>If this case is true, the best method to avoid documentation confusions is adding an ignore command, for example:</p> - <blockquote><pre> + <div class="codebox"><pre> /** * {HEADER} */ @@ -314,25 +170,19 @@ Small code snipped, mostly one or two defines or an if statement * {DOCUMENTATION} */ class ... - </pre></blockquote> - - </div> - <a href="#top">Top</a> - <br /><br /> + </pre></div> - <a name="locations"></a><b>1.iii. File Locations</b> - <br /><br /> - <div class="paragraph"> + <a name="locations"></a><h3>1.iii. File Locations</h3> <p>Functions used by more than one page should be placed in functions.php, functions specific to one page should be placed on that page (at the bottom) or within the relevant sections functions file. Some files in <code>/includes</code> are holding functions responsible for special sections, for example uploading files, displaying "things", user related functions and so forth.</p> <p>The following packages are defined, and related new features/functions should be placed within the mentioned files/locations, as well as specifying the correct package name. The package names are bold within this list:</p> - <ul class="menu"> - <li><b>phpBB3</b><br />Core files and all files not assigned to a separate package</li> - <li><b>acm</b><br /><code>/includes/acm</code>, <code>/includes/cache.php</code><br />Cache System</li> - <li><b>acp</b><br /><code>/adm</code>, <code>/includes/acp</code>, <code>/includes/functions_admin.php</code><br />Administration Control Panel</li> - <li><b>dbal</b><br /><code>/includes/db</code><br />Database Abstraction Layer.<br />Base class is <code>dbal</code> + <ul> + <li><strong>phpBB3</strong><br />Core files and all files not assigned to a separate package</li> + <li><strong>acm</strong><br /><code>/includes/acm</code>, <code>/includes/cache.php</code><br />Cache System</li> + <li><strong>acp</strong><br /><code>/adm</code>, <code>/includes/acp</code>, <code>/includes/functions_admin.php</code><br />Administration Control Panel</li> + <li><strong>dbal</strong><br /><code>/includes/db</code><br />Database Abstraction Layer.<br />Base class is <code>dbal</code> <ul> <li><code>/includes/db/dbal.php</code><br />Base DBAL class, defining the overall framework as well as common detominators</li> <li><code>/includes/db/firebird.php</code><br />Firebird/Interbase Database Abstraction Layer</li> @@ -346,37 +196,43 @@ class ... <li><code>/includes/db/sqlite.php</code><br />Sqlite Database Abstraction Layer</li> </ul> </li> - <li><b>diff</b><br /><code>/includes/diff</code><br />Diff Engine</li> - <li><b>docs</b><br /><code>/docs</code><br />phpBB Documentation</li> - <li><b>images</b><br /><code>/images</code><br />All global images not connected to styles</li> - <li><b>install</b><br /><code>/install</code><br />Installation System</li> - <li><b>language</b><br /><code>/language</code><br />All language files</li> - <li><b>login</b><br /><code>/includes/auth</code><br />Login Authentication Plugins</li> - <li><b>VC</b><br /><code>/includes/captcha</code><br />CAPTCHA</li> - <li><b>mcp</b><br /><code>mcp.php</code>, <code>/includes/mcp</code>, <code>report.php</code><br />Moderator Control Panel</li> - <li><b>ucp</b><br /><code>ucp.php</code>, <code>/includes/ucp</code><br />User Control Panel</li> - <li><b>utf</b><br /><code>/includes/utf</code><br />UTF8-related functions/classes</li> - <li><b>search</b><br /><code>/includes/search</code>, <code>search.php</code><br />Search System</li> - <li><b>styles</b><br /><code>/styles</code>, <code>style.php</code><br />phpBB Styles/Templates/Themes/Imagesets</li> + <li><strong>diff</strong><br /><code>/includes/diff</code><br />Diff Engine</li> + <li><strong>docs</strong><br /><code>/docs</code><br />phpBB Documentation</li> + <li><strong>images</strong><br /><code>/images</code><br />All global images not connected to styles</li> + <li><strong>install</strong><br /><code>/install</code><br />Installation System</li> + <li><strong>language</strong><br /><code>/language</code><br />All language files</li> + <li><strong>login</strong><br /><code>/includes/auth</code><br />Login Authentication Plugins</li> + <li><strong>VC</strong><br /><code>/includes/captcha</code><br />CAPTCHA</li> + <li><strong>mcp</strong><br /><code>mcp.php</code>, <code>/includes/mcp</code>, <code>report.php</code><br />Moderator Control Panel</li> + <li><strong>ucp</strong><br /><code>ucp.php</code>, <code>/includes/ucp</code><br />User Control Panel</li> + <li><strong>utf</strong><br /><code>/includes/utf</code><br />UTF8-related functions/classes</li> + <li><strong>search</strong><br /><code>/includes/search</code>, <code>search.php</code><br />Search System</li> + <li><strong>styles</strong><br /><code>/styles</code>, <code>style.php</code><br />phpBB Styles/Templates/Themes/Imagesets</li> </ul> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> </div> - <a href="#top">Top</a> - <br /><br /> -<hr /> + <hr /> + +<a name="code"></a><h2>2. Code Layout/Guidelines</h2> + + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> -<a name="code"></a><h1>2. Code Layout/Guidelines</h1> + <div class="content"> <p>Please note that these Guidelines applies to all php, html, javascript and css files.</p> - <a name="namingvars"></a><b>2.i. Variable/Function Naming</b> - <br /><br /> - <div class="paragraph"> + <a name="namingvars"></a><h3>2.i. Variable/Function Naming</h3> <p>We will not be using any form of hungarian notation in our naming conventions. Many of us believe that hungarian naming is one of the primary code obfuscation techniques currently in use.</p> - <h3>Variable Names:</h3> + <h4>Variable Names:</h4> <p>Variable names should be in all lowercase, with words separated by an underscore, example:</p> <div class="indent"> @@ -385,10 +241,10 @@ class ... <p>Names should be descriptive, but concise. We don't want huge sentences as our variable names, but typing an extra couple of characters is always better than wondering what exactly a certain variable is for. </p> - <h3>Loop Indices:</h3> + <h4>Loop Indices:</h4> <p>The <em>only</em> situation where a one-character variable name is allowed is when it's the index for some looping construct. In this case, the index of the outer loop should always be $i. If there's a loop inside that loop, its index should be $j, followed by $k, and so on. If the loop is being indexed by some already-existing variable with a meaningful name, this guideline does not apply, example:</p> - <blockquote><pre> + <div class="codebox"><pre> for ($i = 0; $i < $outer_size; $i++) { for ($j = 0; $j < $inner_size; $j++) @@ -396,35 +252,28 @@ for ($i = 0; $i < $outer_size; $i++) foo($i, $j); } } - </pre></blockquote> + </pre></div> - <h3>Function Names:</h3> + <h4>Function Names:</h4> <p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character. Function names should preferably have a verb in them somewhere. Good function names are <code>print_login_status()</code>, <code>get_user_data()</code>, etc. </p> - <h3>Function Arguments:</h3> + <h4>Function Arguments:</h4> <p>Arguments are subject to the same guidelines as variable names. We don't want a bunch of functions like: <code>do_stuff($a, $b, $c)</code>. In most cases, we'd like to be able to tell how to use a function by just looking at its declaration. </p> - <h3>Summary:</h3> + <h4>Summary:</h4> <p>The basic philosophy here is to not hurt code clarity for the sake of laziness. This has to be balanced by a little bit of common sense, though; <code>print_login_status_for_a_given_user()</code> goes too far, for example -- that function would be better named <code>print_user_login_status()</code>, or just <code>print_login_status()</code>.</p> - <h3>Special Namings: </h3> + <h4>Special Namings: </h4> <p>For all emoticons use the term <code>smiley</code> in singular and <code>smilies</code> in plural.</p> - </div> - <a href="#top">Top</a> - <br /><br /> + <a name="codelayout"></a><h3>2.ii. Code Layout</h3> - - <a name="codelayout"></a><b>2.ii. Code Layout</b> - <br /><br /> - <div class="paragraph"> - - <h3>Always include the braces:</h3> + <h4>Always include the braces:</h4> <p>This is another case of being too lazy to type 2 extra characters causing problems with code clarity. Even if the body of some construct is only one line long, do <em>not</em> drop the braces. Just don't, examples:</p> <p class="bad">// These are all wrong. </p> - <blockquote><pre> + <div class="codebox"><pre> if (condition) do_stuff(); if (condition) @@ -435,10 +284,10 @@ while (condition) for ($i = 0; $i < size; $i++) do_stuff($i); - </pre></blockquote> + </pre></div> <p class="good">// These are all right. </p> - <blockquote><pre> + <div class="codebox"><pre> if (condition) { do_stuff(); @@ -453,12 +302,12 @@ for ($i = 0; $i < size; $i++) { do_stuff(); } - </pre></blockquote> + </pre></div> - <h3>Where to put the braces:</h3> + <h4>Where to put the braces:</h4> <p>This one is a bit of a holy war, but we're going to use a style that can be summed up in one sentence: Braces always go on their own line. The closing brace should also always be at the same column as the corresponding opening brace, examples:</p> - <blockquote><pre> + <div class="codebox"><pre> if (condition) { while (condition2) @@ -475,24 +324,24 @@ for ($i = 0; $i < $size; $i++) { ... } - + while (condition) { ... } - + function do_stuff() { ... } - </pre></blockquote> + </pre></div> - <h3>Use spaces between tokens:</h3> + <h4>Use spaces between tokens:</h4> <p>This is another simple, easy step that helps keep code readable without much effort. Whenever you write an assignment, expression, etc.. Always leave <em>one</em> space between the tokens. Basically, write code as if it was English. Put spaces between variable names and operators. Don't put spaces just after an opening bracket or before a closing bracket. Don't put spaces just before a comma or a semicolon. This is best shown with a few examples, examples:</p> <p>// Each pair shows the wrong way followed by the right way. </p> - <blockquote><pre> + <div class="codebox"><pre> $i=0; $i = 0; @@ -510,141 +359,141 @@ for ($i = 0; $i < $size; $i++) ... $i=($j < $size)?0:1; $i = ($j < $size) ? 0 : 1; - </pre></blockquote> + </pre></div> - <h3>Operator precedence:</h3> + <h4>Operator precedence:</h4> <p>Do you know the exact precedence of all the operators in PHP? Neither do I. Don't guess. Always make it obvious by using brackets to force the precedence of an equation so you know what it does. Remember to not over-use this, as it may harden the readability. Basically, do not enclose single expressions. Examples:</p> <p class="bad">// what's the result? who knows. </p> - <blockquote><pre> + <div class="codebox"><pre> $bool = ($i < 7 && $j > 8 || $k == 4); - </pre></blockquote> + </pre></div> <p class="bad">// now you can be certain what I'm doing here.</p> - <blockquote><pre> + <div class="codebox"><pre> $bool = (($i < 7) && (($j < 8) || ($k == 4))); - </pre></blockquote> + </pre></div> <p class="good">// But this one is even better, because it is easier on the eye but the intention is preserved</p> - <blockquote><pre> + <div class="codebox"><pre> $bool = ($i < 7 && ($j < 8 || $k == 4)); - </pre></blockquote> + </pre></div> - <h3>Quoting strings:</h3> + <h4>Quoting strings:</h4> <p>There are two different ways to quote strings in PHP - either with single quotes or with double quotes. The main difference is that the parser does variable interpolation in double-quoted strings, but not in single quoted strings. Because of this, you should <em>always</em> use single quotes <em>unless</em> you specifically need variable interpolation to be done on that string. This way, we can save the parser the trouble of parsing a bunch of strings where no interpolation needs to be done.</p> <p>Also, if you are using a string variable as part of a function call, you do not need to enclose that variable in quotes. Again, this will just make unnecessary work for the parser. Note, however, that nearly all of the escape sequences that exist for double-quoted strings will not work with single-quoted strings. Be careful, and feel free to break this guideline if it's making your code easier to read, examples:</p> <p class="bad">// wrong </p> - <blockquote><pre> + <div class="codebox"><pre> $str = "This is a really long string with no variables for the parser to find."; do_stuff("$str"); - </pre></blockquote> + </pre></div> <p class="good">// right</p> - <blockquote><pre> + <div class="codebox"><pre> $str = 'This is a really long string with no variables for the parser to find.'; do_stuff($str); - </pre></blockquote> + </pre></div> <p class="bad">// Sometimes single quotes are just not right</p> - <blockquote><pre> + <div class="codebox"><pre> $post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;start=' . $start; - </pre></blockquote> + </pre></div> <p class="good">// Double quotes are sometimes needed to not overcroud the line with concentinations</p> - <blockquote><pre> + <div class="codebox"><pre> $post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;start=$start"; - </pre></blockquote> + </pre></div> <p>In SQL Statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL Formatting), else it should be tryed to only use one method - mostly single quotes.</p> - <h3>Associative array keys:</h3> + <h4>Associative array keys:</h4> <p>In PHP, it's legal to use a literal string as a key to an associative array without quoting that string. We don't want to do this -- the string should always be quoted to avoid confusion. Note that this is only when we're using a literal, not when we're using a variable, examples:</p> <p class="bad">// wrong</p> - <blockquote><pre> + <div class="codebox"><pre> $foo = $assoc_array[blah]; - </pre></blockquote> + </pre></div> <p class="good">// right </p> - <blockquote><pre> + <div class="codebox"><pre> $foo = $assoc_array['blah']; - </pre></blockquote> + </pre></div> <p class="bad">// wrong</p> - <blockquote><pre> + <div class="codebox"><pre> $foo = $assoc_array["$var"]; - </pre></blockquote> + </pre></div> <p class="good">// right </p> - <blockquote><pre> + <div class="codebox"><pre> $foo = $assoc_array[$var]; - </pre></blockquote> + </pre></div> - <h3>Comments:</h3> + <h4>Comments:</h4> <p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present - but mostly included within the comment about the output.<br /><br />Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time.<br /><br />Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p> - <h3>Magic numbers:</h3> + <h4>Magic numbers:</h4> <p>Don't use them. Use named constants for any literal value other than obvious special cases. Basically, it's ok to check if an array has 0 elements by using the literal 0. It's not ok to assign some special meaning to a number and then use it everywhere as a literal. This hurts readability AND maintainability. The constants <code>true</code> and <code>false</code> should be used in place of the literals 1 and 0 -- even though they have the same values (but not type!), it's more obvious what the actual logic is when you use the named constants. Typecast variables where it is needed, do not rely on the correct variable type (PHP is currently very loose on typecasting which can lead to security problems if a developer does not have a very close eye to it).</p> - <h3>Shortcut operators:</h3> + <h4>Shortcut operators:</h4> <p>The only shortcut operators that cause readability problems are the shortcut increment <code>$i++</code> and decrement <code>$j--</code> operators. These operators should not be used as part of an expression. They can, however, be used on their own line. Using them in expressions is just not worth the headaches when debugging, examples:</p> <p class="bad">// wrong </p> - <blockquote><pre> + <div class="codebox"><pre> $array[++$i] = $j; $array[$i++] = $k; - </pre></blockquote> + </pre></div> <p class="good">// right </p> - <blockquote><pre> + <div class="codebox"><pre> $i++; $array[$i] = $j; $array[$i] = $k; $i++; - </pre></blockquote> + </pre></div> - <h3>Inline conditionals:</h3> + <h4>Inline conditionals:</h4> <p>Inline conditionals should only be used to do very simple things. Preferably, they will only be used to do assignments, and not for function calls or anything complex at all. They can be harmful to readability if used incorrectly, so don't fall in love with saving typing by using them, examples:</p> <p class="bad">// Bad place to use them</p> - <blockquote><pre> + <div class="codebox"><pre> ($i < $size && $j > $size) ? do_stuff($foo) : do_stuff($bar); - </pre></blockquote> + </pre></div> <p class="good">// OK place to use them </p> - <blockquote><pre> + <div class="codebox"><pre> $min = ($i < $j) ? $i : $j; - </pre></blockquote> + </pre></div> - <h3>Don't use uninitialized variables.</h3> + <h4>Don't use uninitialized variables.</h4> <p>For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set - but preferably the variable is always existing. For checking if an array has a key set this can come in handy though, examples:</p> <p class="bad">// Wrong </p> - <blockquote><pre> + <div class="codebox"><pre> if ($forum) ... - </pre></blockquote> + </pre></div> <p class="good">// Right </p> - <blockquote><pre> + <div class="codebox"><pre> if (isset($forum)) ... - </pre></blockquote> + </pre></div> <p class="good">// Also possible</p> - <blockquote><pre> + <div class="codebox"><pre> if (isset($forum) && $forum == 5) - </pre></blockquote> + </pre></div> <p>The <code>empty()</code> function is useful if you want to check if a variable is not set or being empty (an empty string, 0 as an integer or string, NULL, false, an empty array or a variable declared, but without a value in a class). Therefore empty should be used in favor of <code>isset($array) && sizeof($array) > 0</code> - this can be written in a shorter way as <code>!empty($array)</code>.</p> - <h3>Switch statements:</h3> + <h4>Switch statements:</h4> <p>Switch/case code blocks can get a bit long sometimes. To have some level of notice and being in-line with the opening/closing brace requirement (where they are on the same line for better readability), this also applies to switch/case code blocks and the breaks. An example:</p> <p class="bad">// Wrong </p> - <blockquote><pre> + <div class="codebox"><pre> switch ($mode) { case 'mode1': @@ -654,10 +503,10 @@ switch ($mode) // I am doing something completely different here break; } - </pre></blockquote> + </pre></div> <p class="good">// Good </p> - <blockquote><pre> + <div class="codebox"><pre> switch ($mode) { case 'mode1': @@ -672,10 +521,10 @@ switch ($mode) // Always assume that the case got not catched break; } - </pre></blockquote> + </pre></div> <p class="good">// Also good, if you have more code between the case and the break </p> - <blockquote><pre> + <div class="codebox"><pre> switch ($mode) { case 'mode1': @@ -696,14 +545,14 @@ switch ($mode) break; } - </pre></blockquote> + </pre></div> <p>Even if the break for the default case is not needed, it is sometimes better to include it just for readability and completeness.</p> <p>If no break is intended, please add a comment instead. An example:</p> <p class="good">// Example with no break </p> - <blockquote><pre> + <div class="codebox"><pre> switch ($mode) { case 'mode1': @@ -724,95 +573,87 @@ switch ($mode) break; } - </pre></blockquote> - - - </div> - <a href="#top">Top</a> - <br /><br /> - + </pre></div> - <a name="sql"></a><b>2.iii. SQL/SQL Layout</b> - <br /><br /> - <div class="paragraph"> + <a name="sql"></a><h3>2.iii. SQL/SQL Layout</h3> - <h3>Common SQL Guidelines: </h3> + <h4>Common SQL Guidelines: </h4> <p>All SQL should be cross-DB compatible, if DB specific SQL is used alternatives must be provided which work on all supported DB's (MySQL3/4/5, MSSQL (7.0 and 2000), PostgreSQL (7.0+), Firebird, SQLite, Oracle8, ODBC (generalised if possible)).</p> <p>All SQL commands should utilise the DataBase Abstraction Layer (DBAL)</p> - <h3>SQL code layout:</h3> + <h4>SQL code layout:</h4> <p>SQL Statements are often unreadable without some formatting, since they tend to be big at times. Though the formatting of sql statements adds a lot to the readability of code. SQL statements should be formatted in the following way, basically writing keywords: </p> - <blockquote><pre> + <div class="codebox"><pre> $sql = 'SELECT * <-one tab->FROM ' . SOME_TABLE . ' <-one tab->WHERE a = 1 <-two tabs->AND (b = 2 <-three tabs->OR b = 3) <-one tab->ORDER BY b'; - </pre></blockquote> + </pre></div> <p>Here the example with the tabs applied:</p> - <blockquote><pre> + <div class="codebox"><pre> $sql = 'SELECT * FROM ' . SOME_TABLE . ' WHERE a = 1 AND (b = 2 OR b = 3) ORDER BY b'; - </pre></blockquote> + </pre></div> - <h3>SQL Quotes: </h3> + <h4>SQL Quotes: </h4> <p>Double quotes where applicable (The variables in these examples are typecasted to integers before) ... examples: </p> <p class="bad">// These are wrong.</p> - <blockquote><pre> + <div class="codebox"><pre> "UPDATE " . SOME_TABLE . " SET something = something_else WHERE a = $b"; 'UPDATE ' . SOME_TABLE . ' SET something = ' . $user_id . ' WHERE a = ' . $something; - </pre></blockquote> + </pre></div> <p class="good">// These are right. </p> - <blockquote><pre> + <div class="codebox"><pre> 'UPDATE ' . SOME_TABLE . " SET something = something_else WHERE a = $b"; 'UPDATE ' . SOME_TABLE . " SET something = $user_id WHERE a = $something"; - </pre></blockquote> + </pre></div> <p>In other words use single quotes where no variable substitution is required or where the variable involved shouldn't appear within double quotes. Otherwise use double quotes.</p> - <h3>Avoid DB specific SQL: </h3> + <h4>Avoid DB specific SQL: </h4> <p>The "not equals operator", as defined by the SQL:2003 standard, is "<>"</p> <p class="bad">// This is wrong.</p> - <blockquote><pre> + <div class="codebox"><pre> $sql = 'SELECT * FROM ' . SOME_TABLE . ' WHERE a != 2'; - </pre></blockquote> + </pre></div> <p class="good">// This is right. </p> - <blockquote><pre> + <div class="codebox"><pre> $sql = 'SELECT * FROM ' . SOME_TABLE . ' - WHERE a <> 2'; - </pre></blockquote> + WHERE a <> 2'; + </pre></div> - <h3>Common DBAL methods: </h3> + <h4>Common DBAL methods: </h4> - <h3>sql_escape():</h3> + <h4>sql_escape():</h4> <p>Always use <code>$db->sql_escape()</code> if you need to check for a string within an SQL statement (even if you are sure the variable cannot contain single quotes - never trust your input), for example:</p> - <blockquote><pre> + <div class="codebox"><pre> $sql = 'SELECT * FROM ' . SOME_TABLE . " WHERE username = '" . $db->sql_escape($username) . "'"; - </pre></blockquote> + </pre></div> - <h3>sql_query_limit():</h3> + <h4>sql_query_limit():</h4> <p>We do not add limit statements to the sql query, but instead use <code>$db->sql_query_limit()</code>. You basically pass the query, the total number of lines to retrieve and the offset.</p> @@ -820,11 +661,11 @@ $sql = 'SELECT * <p>Make sure when using something like "SELECT x.*, y.jars" that there is not a column named jars in x; make sure that there is no overlap between an implicit column and the explicit columns.</p> - <h3>sql_build_array():</h3> + <h4>sql_build_array():</h4> <p>If you need to UPDATE or INSERT data, make use of the <code>$db->sql_build_array()</code> function. This function already escapes strings and checks other types, so there is no need to do this here. The data to be inserted should go into an array - <code>$sql_ary</code> - or directly within the statement if one or two variables needs to be inserted/updated. An example of an insert statement would be:</p> - <blockquote><pre> + <div class="codebox"><pre> $sql_ary = array( 'somedata' => $my_string, 'otherdata' => $an_int, @@ -832,11 +673,11 @@ $sql_ary = array( ); $db->sql_query('INSERT INTO ' . SOME_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); - </pre></blockquote> + </pre></div> <p>To complete the example, this is how an update statement would look like:</p> - <blockquote><pre> + <div class="codebox"><pre> $sql_ary = array( 'somedata' => $my_string, 'otherdata' => $an_int, @@ -847,65 +688,65 @@ $sql = 'UPDATE ' . SOME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . (int) $user_id; $db->sql_query($sql); - </pre></blockquote> + </pre></div> <p>The <code>$db->sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>MULTI_INSERT</code> (for returning extended inserts), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p> - <h3>sql_in_set():</h3> + <h4>sql_in_set():</h4> <p>The <code>$db->sql_in_set()</code> function should be used for building <code>IN ()</code> and <code>NOT IN ()</code> constructs. Since (specifically) MySQL tend to be faster if for one value to be compared the <code>=</code> and <code><></code> operator is used, we let the DBAL decide what to do. A typical example of doing a positive match against a number of values would be:</p> - <blockquote><pre> + <div class="codebox"><pre> $sql = 'SELECT * FROM ' . FORUMS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_ids); $db->sql_query($sql); - </pre></blockquote> + </pre></div> <p>Based on the number of values in $forum_ids, the query can look differently.</p> <p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p> - <blockquote><pre> + <div class="codebox"><pre> SELECT FROM phpbb_forums WHERE forum_id IN (1, 2, 3) - </pre></blockquote> + </pre></div> <p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p> - <blockquote><pre> + <div class="codebox"><pre> SELECT FROM phpbb_forums WHERE forum_id = 1 - </pre></blockquote> + </pre></div> <p>Of course the same is possible for doing a negative match against a number of values:</p> - <blockquote><pre> + <div class="codebox"><pre> $sql = 'SELECT * FROM ' . FORUMS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_ids, <strong>true</strong>); $db->sql_query($sql); - </pre></blockquote> + </pre></div> <p>Based on the number of values in $forum_ids, the query can look differently here too.</p> <p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p> - <blockquote><pre> + <div class="codebox"><pre> SELECT FROM phpbb_forums WHERE forum_id <strong>NOT</strong> IN (1, 2, 3) - </pre></blockquote> + </pre></div> <p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p> - <blockquote><pre> + <div class="codebox"><pre> SELECT FROM phpbb_forums WHERE forum_id <strong><></strong> 1 - </pre></blockquote> + </pre></div> <p>If the given array is empty, an error will be produced.</p> - <h3>sql_build_query():</h3> + <h4>sql_build_query():</h4> <p>The <code>$db->sql_build_query()</code> function is responsible for building sql statements for select and select distinct queries if you need to JOIN on more than one table or retrieving data from more than one table while doing a JOIN. This needs to be used to make sure the resulting statement is working on all supported db's. Instead of explaining every possible combination, i will give a short example:</p> - <blockquote><pre> + <div class="codebox"><pre> $sql_array = array( 'SELECT' => 'f.*, ft.mark_time', @@ -928,11 +769,11 @@ $sql_array = array( ); $sql = $db->sql_build_query('SELECT', $sql_array); - </pre></blockquote> + </pre></div> <p>The possible first parameter for sql_build_query() is SELECT or SELECT_DISTINCT. As you can see, the logic is pretty self-explaining. For the LEFT_JOIN key, just add another array if you want to join on to tables for example. The added benefit of using this construct is that you are able to easily build the query statement based on conditions - for example the above LEFT_JOIN is only necessary if server side topic tracking is enabled; a slight adjustement would be:</p> - <blockquote><pre> + <div class="codebox"><pre> $sql_array = array( 'SELECT' => 'f.*', @@ -964,131 +805,118 @@ else } $sql = $db->sql_build_query('SELECT', $sql_array); - </pre></blockquote> - - </div> - <a href="#top">Top</a> - <br /><br /> + </pre></div> + <a name="optimizing"></a><h3>2.iv. Optimizations</h3> - <a name="optimizing"></a><b>2.iv. Optimizations</b> - <br /><br /> - <div class="paragraph"> - - <h3>Operations in loop definition: </h3> + <h4>Operations in loop definition: </h4> <p>Always try to optimize your loops if operations are going on at the comparing part, since this part is executed every time the loop is parsed through. For assignments a descriptive name should be chosen. Example:</p> <p class="bad">// On every iteration the sizeof function is called</p> - <blockquote><pre> + <div class="codebox"><pre> for ($i = 0; $i < sizeof($post_data); $i++) { do_something(); } - </pre></blockquote> + </pre></div> <p class="good">// You are able to assign the (not changing) result within the loop itself</p> - <blockquote><pre> + <div class="codebox"><pre> for ($i = 0, $size = sizeof($post_data); $i < $size; $i++) { do_something(); } - </pre></blockquote> + </pre></div> - <h3>Use of in_array(): </h3> + <h4>Use of in_array(): </h4> <p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticable, but if checked against a huge array within a loop those checks alone can be a bunch of seconds. If you need this functionality, try using isset() on the arrays keys instead, actually shifting the values into keys and vice versa. A call to <code>isset($array[$var])</code> is a lot faster than <code>in_array($var, array_keys($array))</code> for example.</p> - </div> - <a href="#top">Top</a> - <br /><br /> - - <a name="general"></a><b>2.v. General Guidelines</b> - <br /><br /> - <div class="paragraph"> + <a name="general"></a><h3>2.v. General Guidelines</h3> - <h3>General things:</h3> + <h4>General things:</h4> <p>Never trust user input (this also applies to server variables as well as cookies).</p> <p>Try to sanitize values returned from a function.</p> <p>Try to sanitize given function variables within your function.</p> <p>The auth class should be used for all authorisation checking.</p> <p>No attempt should be made to remove any copyright information (either contained within the source or displayed interactively when the source is run/compiled), neither should the copyright information be altered in any way (it may be added to).</p> - <h3>Variables: </h3> + <h4>Variables: </h4> <p>Make use of the <code>request_var()</code> function for anything except for submit or single checking params. </p> <p>The request_var function determines the type to set from the second parameter (which determines the default value too). If you need to get a scalar variable type, you need to tell this the request_var function explicitly. Examples:</p> <p class="bad">// Old method, do not use it</p> - <blockquote><pre> + <div class="codebox"><pre> $start = (isset($HTTP_GET_VARS['start'])) ? intval($HTTP_GET_VARS['start']) : intval($HTTP_POST_VARS['start']); $submit = (isset($HTTP_POST_VARS['submit'])) ? true : false; - </pre></blockquote> + </pre></div> <p class="good">// Use request var and define a default variable (use the correct type)</p> - <blockquote><pre> + <div class="codebox"><pre> $start = request_var('start', 0); $submit = (isset($_POST['submit'])) ? true : false; - </pre></blockquote> + </pre></div> <p class="bad">// $start is an int, the following use of request_var therefore is not allowed</p> - <blockquote><pre> + <div class="codebox"><pre> $start = request_var('start', '0'); - </pre></blockquote> + </pre></div> <p class="good">// Getting an array, keys are integers, value defaults to 0</p> - <blockquote><pre> + <div class="codebox"><pre> $mark_array = request_var('mark', array(0)); - </pre></blockquote> + </pre></div> <p class="good">// Getting an array, keys are strings, value defaults to 0</p> - <blockquote><pre> + <div class="codebox"><pre> $action_ary = request_var('action', array('' => 0)); - </pre></blockquote> + </pre></div> - <h3>Login checks/redirection: </h3> + <h4>Login checks/redirection: </h4> <p>To show a forum login box use <code>login_forum_box($forum_data)</code>, else use the <code>login_box()</code> function.</p> <p>The <code>login_box()</code> function can have a redirect as the first parameter. As a thumb of rule, specify an empty string if you want to redirect to the users current location, else do not add the <code>$SID</code> to the redirect string (for example within the ucp/login we redirect to the board index because else the user would be redirected to the login screen).</p> - <h3>Sensitive Operations: </h3> + <h4>Sensitive Operations: </h4> <p>For sensitive operations always let the user confirm the action. For the confirmation screens, make use of the <code>confirm_box()</code> function.</p> - <h3>Sessions: </h3> + <h4>Sessions: </h4> <p>Sessions should be initiated on each page, as near the top as possible using the following code:</p> - <blockquote><pre> + <div class="codebox"><pre> $user->session_begin(); $auth->acl($user->data); $user->setup(); - </pre></blockquote> + </pre></div> <p>The <code>$user->setup()</code> call can be used to pass on additional language definition and a custom style (used in viewforum).</p> - <h3>Errors and messages: </h3> + <h4>Errors and messages: </h4> <p>All messages/errors should be outputed by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p> - <blockquote><pre> + <div class="codebox"><pre> trigger_error('NO_FORUM'); - </pre></blockquote> + </pre></div> - <blockquote><pre> + <div class="codebox"><pre> trigger_error($user->lang['NO_FORUM']); - </pre></blockquote> + </pre></div> - <blockquote><pre> + <div class="codebox"><pre> trigger_error('NO_MODE', E_USER_ERROR); - </pre></blockquote> + </pre></div> - <h3>Url formatting</h3> + <h4>Url formatting</h4> <p>All urls pointing to internal files need to be prepended by the <code>$phpbb_root_path</code> variable. Within the administration control panel all urls pointing to internal files need to be prepended by the <code>$phpbb_admin_path</code> variable. This makes sure the path is always correct and users being able to just rename the admin folder and the acp still working as intended (though some links will fail and the code need to be slightly adjusted).</p> <p>The <code>append_sid()</code> function from 2.0.x is available too, though does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p> - <blockquote><pre> + <div class="codebox"><pre> append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) - </pre></blockquote> + </pre></div> - <h3>General function usage: </h3> + <h4>General function usage: </h4> <p>Some of these functions are only chosen over others because of personal preference and having no other benefit than to be consistant over the code.</p> @@ -1110,16 +938,22 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp; </li> </ul> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> </div> - <a href="#top">Top</a> - <br /><br /> -<hr /> + <hr /> -<a name="styling"></a><h1>3. Styling</h1> -<div class="paragraph"> +<a name="styling"></a><h2>3. Styling</h2> + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> -<h3>General things</h3> +<h4>General things</h4> <p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the intendation and coding guidelines also apply to templates where possible.</p> <p>The outer table class <code>forumline</code> has gone and is replaced with <code>tablebg</code>.</p> @@ -1127,14 +961,14 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp; <p>Each block level element should be indented by one tab, same for tabular elements, e.g. <code><tr></code> <code><td></code> etc., whereby the intendiation of <code><table></code> and the following/ending <code><tr></code> should be on the same line. This applies not to div elements of course.</p> <p>Don't use <code><span></code> more than is essential ... the CSS is such that text sizes are dependent on the parent class. So writing <code><span class="gensmall"><span class="gensmall">TEST</span></span></code> will result in very very small text. Similarly don't use span at all if another element can contain the class definition, e.g.</p> -<blockquote><pre> +<div class="codebox"><pre> <td><span class="gensmall">TEST</span></td> -</pre></blockquote> +</pre></div> <p>can just as well become:</p> -<blockquote><pre> +<div class="codebox"><pre> <td class="gensmall">TEST</td> -</pre></blockquote> +</pre></div> <p>Try to match text class types with existing useage, e.g. don't use the nav class where viewtopic uses gensmall for example.</p> @@ -1153,99 +987,105 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp; <p>Try to keep template conditional and other statements tabbed in line with the block to which they refer.</p> <p class="good">this is correct</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- BEGIN test --></span> <tr> <td>{test.TEXT}</td> </tr> <span class="comment"><!-- END test --></span> -</pre></blockquote> +</pre></div> <p class="good">this is also correct:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- BEGIN test --></span> <tr> <td>{test.TEXT}</td> </tr> <span class="comment"><!-- END test --></span> -</pre></blockquote> +</pre></div> <p>it gives immediate feedback on exactly what is looping - decide which way to use based on the readability.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<hr /> + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> + +<a name="templating"></a><h2>4. Templating</h2> + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> -<a name="templating"></a><h1>4. Templating</h1> -<div class="paragraph"> + <div class="content"> -<h3>File naming</h3> +<h4>File naming</h4> <p>Firstly templates now take the suffix ".html" rather than ".tpl". This was done simply to make the lifes of some people easier wrt syntax highlighting, etc.</p> -<h3>Variables</h3> +<h4>Variables</h4> <p>All template variables should be named appropriately (using underscores for spaces), language entries should be prefixed with L_, system data with S_, urls with U_, javascript urls with UA_, language to be put in javascript statements with LA_, all other variables should be presented 'as is'.</p> <p>L_* template variables are automatically tried to be mapped to the corresponding language entry if the code does not set (and therefore overwrite) this variable specifically. For example <code>{L_USERNAME}</code> maps to <code>$user->lang['USERNAME']</code>. The LA_* template variables are handled within the same way, but properly escaped to be put in javascript code. This should reduce the need to assign loads of new lang vars in Modifications. </p> -<h3>Blocks/Loops</h3> +<h4>Blocks/Loops</h4> <p>The basic block level loop remains and takes the form:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- BEGIN loopname --></span> markup, {loopname.X_YYYYY}, etc. <span class="comment"><!-- END loopname --></span> -</pre></blockquote> +</pre></div> <p>A bit later loops will be explained further. To not irretate you we will explain conditionals as well as other statements first.</p> -<h3>Including files</h3> +<h4>Including files</h4> <p>Something that existed in 2.0.x which no longer exists in 3.0.x is the ability to assign a template to a variable. This was used (for example) to output the jumpbox. Instead (perhaps better, perhaps not but certainly more flexible) we now have INCLUDE. This takes the simple form:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- INCLUDE filename --></span> -</pre></blockquote> +</pre></div> <p>You will note in the 3.0 templates the major sources start with <code><!-- INCLUDE overall_header.html --></code> or <code><!-- INCLUDE simple_header.html --></code>, etc. In 2.0.x control of "which" header to use was defined entirely within the code. In 3.0.x the template designer can output what they like. Note that you can introduce new templates (i.e. other than those in the default set) using this system and include them as you wish ... perhaps useful for a common "menu" bar or some such. No need to modify loads of files as with 2.0.x.</p> -<h3>PHP</h3> +<h4>PHP</h4> <p>A contentious decision has seen the ability to include PHP within the template introduced. This is achieved by enclosing the PHP within relevant tags:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- PHP --></span> echo "hello!"; <span class="comment"><!-- ENDPHP --></span> -</pre></blockquote> +</pre></div> <p>You may also include PHP from an external file using:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- INCLUDEPHP somefile.php --></span> -</pre></blockquote> +</pre></div> <p>it will be included and executed inline.<br /><br />A note, it is very much encouraged that template designers do not include PHP. The ability to include raw PHP was introduced primarily to allow end users to include banner code, etc. without modifying multiple files (as with 2.0.x). It was not intended for general use ... hence <!-- w --><a href="http://www.phpbb.com">www.phpbb.com</a><!-- w --> will <strong>not</strong> make available template sets which include PHP. And by default templates will have PHP disabled (the admin will need to specifically activate PHP for a template).</p> -<h3>Conditionals/Control structures</h3> +<h4>Conditionals/Control structures</h4> <p>The most significant addition to 3.0.x are conditions or control structures, "if something then do this else do that". The system deployed is very similar to Smarty. This may confuse some people at first but it offers great potential and great flexibility with a little imagination. In their most simple form these constructs take the form:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- IF expr --></span> markup <span class="comment"><!-- ENDIF --></span> -</pre></blockquote> +</pre></div> <p>expr can take many forms, for example:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- IF loop.S_ROW_COUNT is even --></span> markup <span class="comment"><!-- ENDIF --></span> -</pre></blockquote> +</pre></div> <p>This will output the markup if the S_ROW_COUNT variable in the current iteration of loop is an even value (i.e. the expr is TRUE). You can use various comparison methods (standard as well as equivalent textual versions noted in square brackets) including (<code>not, or, and, eq, neq, is</code> should be used if possible for better readability):</p> -<blockquote><pre> +<div class="codebox"><pre> == [eq] != [neq, ne] <> (same as !=) @@ -1271,19 +1111,19 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp; & (bitwise and) ~ (bitwise not) is (can be used to join comparison operations) -</pre></blockquote> +</pre></div> <p>Basic parenthesis can also be used to enforce good old BODMAS rules. Additionally some basic comparison types are defined:</p> -<blockquote><pre> +<div class="codebox"><pre> even odd div -</pre></blockquote> +</pre></div> <p>Beyond the simple use of IF you can also do a sequence of comparisons using the following:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- IF expr1 --></span> markup <span class="comment"><!-- ELSEIF expr2 --></span> @@ -1296,11 +1136,11 @@ div <span class="comment"><!-- ELSE --></span> markup <span class="comment"><!-- ENDIF --></span> -</pre></blockquote> +</pre></div> <p>Each statement will be tested in turn and the relevant output generated when a match (if a match) is found. It is not necessary to always use ELSEIF, ELSE can be used alone to match "everything else".<br /><br />So what can you do with all this? Well take for example the colouration of rows in viewforum. In 2.0.x row colours were predefined within the source as either row color1, row color2 or row class1, row class2. In 3.0.x this is moved to the template, it may look a little daunting at first but remember control flows from top to bottom and it's not too difficult:</p> -<blockquote><pre> +<div class="codebox"><pre> <table> <span class="comment"><!-- IF loop.S_ROW_COUNT is even --></span> <tr class="row1"> @@ -1310,11 +1150,11 @@ div <td>HELLO!</td> </tr> </table> -</pre></blockquote> +</pre></div> <p>This will cause the row cell to be output using class row1 when the row count is even, and class row2 otherwise. The S_ROW_COUNT parameter gets assigned to loops by default. Another example would be the following: </p> -<blockquote><pre> +<div class="codebox"><pre> <table> <span class="comment"><!-- IF loop.S_ROW_COUNT > 10 --></span> <tr bgcolor="#FF0000"> @@ -1328,27 +1168,27 @@ div <td>hello!</td> </tr> </table> -</pre></blockquote> +</pre></div> <p>This will output the row cell in purple for the first two rows, blue for rows 2 to 5, green for rows 5 to 10 and red for remainder. So, you could produce a "nice" gradient effect, for example.<br /><br />What else can you do? Well, you could use IF to do common checks on for example the login state of a user:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- IF S_USER_LOGGED_IN --></span> markup <span class="comment"><!-- ENDIF --></span> -</pre></blockquote> +</pre></div> <p>This replaces the existing (fudged) method in 2.0.x using a zero length array and BEGIN/END.</p> -<h3>Extended syntax for Blocks/Loops</h3> +<h4>Extended syntax for Blocks/Loops</h4> <p>Back to our loops - they had been extended with the following additions. Firstly you can set the start and end points of the loop. For example:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- BEGIN loopname(2) --></span> markup <span class="comment"><!-- END loopname --></span> -</pre></blockquote> +</pre></div> <p>Will start the loop on the third entry (note that indexes start at zero). Extensions of this are: <br /><br /> @@ -1360,19 +1200,19 @@ div <p>A further extension to begin is BEGINELSE:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- BEGIN loop --></span> markup <span class="comment"><!-- BEGINELSE --></span> markup <span class="comment"><!-- END loop --></span> -</pre></blockquote> +</pre></div> <p>This will cause the markup between <code>BEGINELSE</code> and <code>END</code> to be output if the loop contains no values. This is useful for forums with no topics (for example) ... in some ways it replaces "bits of" the existing "switch_" type control (the rest being replaced by conditionals).</p> <p>Another way of checking if a loop contains values is by prefixing the loops name with a dot:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- IF .loop --></span> <span class="comment"><!-- BEGIN loop --></span> markup @@ -1380,11 +1220,11 @@ div <span class="comment"><!-- ELSE --></span> markup <span class="comment"><!-- ENDIF --></span> -</pre></blockquote> +</pre></div> <p>You are even able to check the number of items within a loop by comparing it with values within the IF condition:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- IF .loop > 2 --></span> <span class="comment"><!-- BEGIN loop --></span> markup @@ -1392,11 +1232,11 @@ div <span class="comment"><!-- ELSE --></span> markup <span class="comment"><!-- ENDIF --></span> -</pre></blockquote> +</pre></div> <p>Nesting loops cause the conditionals needing prefixed with all loops from the outer one to the inner most. An illustration of this:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- BEGIN firstloop --></span> {firstloop.MY_VARIABLE_FROM_FIRSTLOOP} @@ -1404,11 +1244,11 @@ div {firstloop.secondloop.MY_VARIABLE_FROM_SECONDLOOP} <span class="comment"><!-- END secondloop --></span> <span class="comment"><!-- END firstloop --></span> -</pre></blockquote> +</pre></div> <p>Sometimes it is necessary to break out of nested loops to be able to call another loop within the current iteration. This sounds a little bit confusing and it is not used very often. The following (rather complex) example shows this quite good - it also shows how you test for the first and last row in a loop (i will explain the example in detail further down):</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- BEGIN l_block1 --></span> <span class="comment"><!-- IF l_block1.S_SELECTED --></span> <strong>{l_block1.L_TITLE}</strong> @@ -1444,11 +1284,11 @@ div <a class="nav" href="{l_block1.U_TITLE}">{l_block1.L_TITLE}</a> <span class="comment"><!-- ENDIF --></span> <span class="comment"><!-- END l_block1 --></span> -</pre></blockquote> +</pre></div> <p>Let us first concentrate on this part of the example:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- BEGIN l_block1 --></span> <span class="comment"><!-- IF l_block1.S_SELECTED --></span> markup @@ -1456,13 +1296,13 @@ div <a class="nav" href="{l_block1.U_TITLE}">{l_block1.L_TITLE}</a> <span class="comment"><!-- ENDIF --></span> <span class="comment"><!-- END l_block1 --></span> -</pre></blockquote> +</pre></div> <p>Here we open the loop l_block1 and doing some things if the value S_SELECTED within the current loop iteration is true, else we write the blocks link and title. Here, you see <code>{l_block1.L_TITLE}</code> referenced - you remember that L_* variables get automatically assigned the corresponding language entry? This is true, but not within loops. The L_TITLE variable within the loop l_block1 is assigned within the code itself.</p> <p>Let's have a closer look to the markup:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- BEGIN l_block1 --></span> . . @@ -1484,11 +1324,11 @@ div . . <span class="comment"><!-- END l_block1 --></span> -</pre></blockquote> +</pre></div> <p>The <code><!-- IF S_PRIVMSGS --></code> statement clearly checks a global variable and not one within the loop, since the loop is not given here. So, if S_PRIVMSGS is true we execute the shown markup. Now, you see the <code><!-- BEGIN !folder --></code> statement. The exclamation mark is responsible for instructing the template engine to iterate through the main loop folder. So, we are now within the loop folder - with <code><!-- BEGIN folder --></code> we would have been within the loop <code>l_block1.folder</code> automatically as is the case with l_block2:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- BEGIN l_block1 --></span> . . @@ -1506,13 +1346,13 @@ div . . <span class="comment"><!-- END l_block1 --></span> -</pre></blockquote> +</pre></div> <p>You see the difference? The loop l_block2 is a member of the loop l_block1 but the loop folder is a main loop.</p> <p>Now back to our folder loop:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- IF folder.S_FIRST_ROW --></span> <ul class="nav"> <span class="comment"><!-- ENDIF --></span> @@ -1522,21 +1362,21 @@ div <span class="comment"><!-- IF folder.S_LAST_ROW --></span> </ul> <span class="comment"><!-- ENDIF --></span> -</pre></blockquote> +</pre></div> <p>You may have wondered what the comparison to S_FIRST_ROW and S_LAST_ROW is about. If you haven't guessed already - it is checking for the first iteration of the loop with <code>S_FIRST_ROW</code> and the last iteration with <code>S_LAST_ROW</code>. This can come in handy quite often if you want to open or close design elements, like the above list. Let us imagine a folder loop build with three iterations, it would go this way:</p> -<blockquote><pre> +<div class="codebox"><pre> <ul class="nav"> <span class="comment"><!-- written on first iteration --></span> <li>first element</li> <span class="comment"><!-- written on first iteration --></span> <li>second element</li> <span class="comment"><!-- written on second iteration --></span> <li>third element</li> <span class="comment"><!-- written on third iteration --></span> </ul> <span class="comment"><!-- written on third iteration --></span> -</pre></blockquote> +</pre></div> <p>As you can see, all three elements are written down as well as the markup for the first iteration and the last one. Sometimes you want to omit writing the general markup - for example:</p> -<blockquote><pre> +<div class="codebox"><pre> <span class="comment"><!-- IF folder.S_FIRST_ROW --></span> <ul class="nav"> <span class="comment"><!-- ELSEIF folder.S_LAST_ROW --></span> @@ -1544,39 +1384,45 @@ div <span class="comment"><!-- ELSE --></span> <li><a href="{folder.U_FOLDER}">{folder.FOLDER_NAME}</a></li> <span class="comment"><!-- ENDIF --></span> -</pre></blockquote> +</pre></div> <p>would result in the following markup:</p> -<blockquote><pre> +<div class="codebox"><pre> <ul class="nav"> <span class="comment"><!-- written on first iteration --></span> <li>second element</li> <span class="comment"><!-- written on second iteration --></span> </ul> <span class="comment"><!-- written on third iteration --></span> -</pre></blockquote> +</pre></div> <p>Just always remember that processing is taking place from up to down.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> -<hr /> + <hr /> -<a name="charsets"></a><h1>5. Character Sets and Encodings</h1> +<a name="charsets"></a><h2>5. Character Sets and Encodings</h2> -<div class="paragraph"> + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> -<h3>What are Unicode, UCS and UTF-8?</h3> +<h4>What are Unicode, UCS and UTF-8?</h4> <p>The <a href="http://en.wikipedia.org/wiki/Universal_Character_Set">Universal Character Set (UCS)</a> described in ISO/IEC 10646 consists of a large amount of characters. Each of them has a unique name and a code point which is an integer number. <a href="http://en.wikipedia.org/wiki/Unicode">Unicode</a> - which is an industry standard - complements the Universal Character Set with further information about the characters' properties and alternative character encodings. More information on Unicode can be found on the <a href="http://www.unicode.org/">Unicode Consortium's website</a>. One of the Unicode encodings is the <a href="http://en.wikipedia.org/wiki/UTF-8">8-bit Unicode Transformation Format (UTF-8)</a>. It encodes characters with up to four bytes aiming for maximum compatability with the <a href="http://en.wikipedia.org/wiki/ASCII">American Standard Code for Information Interchange</a> which is a 7-bit encoding of a relatively small subset of the UCS.</p> -<h3>phpBB's use of Unicode</h3> +<h4>phpBB's use of Unicode</h4> <p>Unfortunately PHP does not faciliate the use of Unicode prior to version 6. Most functions simply treat strings as sequences of bytes assuming that each character takes up exactly one byte. This behaviour still allows for storing UTF-8 encoded text in PHP strings but many operations on strings have unexpected results. To circumvent this problem we have created some alternative functions to PHP's native string operations which use code points instead of bytes. These functions can be found in <code>/includes/utf/utf_tools.php</code>. They are also covered in the <a href="http://area51.phpbb.com/docs/code/">phpBB3 Sourcecode Documentation</a>. A lot of native PHP functions still work with UTF-8 as long as you stick to certain restrictions. For example <code>explode</code> still works as long as the first and the last character of the delimiter string are ASCII characters.</p> <p>phpBB only uses the ASCII and the UTF-8 character encodings. Still all Strings are UTF-8 encoded because ASCII is a subset of UTF-8. The only exceptions to this rule are code sections which deal with external systems which use other encodings and character sets. Such external data should be converted to UTF-8 using the <code>utf8_recode()</code> function supplied with phpBB. It supports a variety of other character sets and encodings, a full list can be found below.</p> <p>With <code>request_var()</code> you can either allow all UCS characters in user input or restrict user input to ASCII characters. This feature is controlled by the function's third parameter called <code>$multibyte</code>. You should allow multibyte characters in posts, PMs, topic titles, forum names, etc. but it's not necessary for internal uses like a <code>$mode</code> variable which should only hold a predefined list of ASCII strings anyway.</p> -<blockquote><pre> +<div class="codebox"><pre> // an input string containing a multibyte character $_REQUEST['multibyte_string'] = 'Käse'; @@ -1584,77 +1430,83 @@ $_REQUEST['multibyte_string'] = 'Käse'; echo request_var('multibyte_string', '', true); // print request variable as ASCII string echo request_var('multibyte_string', ''); -</pre></blockquote> +</pre></div> <p>This code snippet will generate the following output:</p> -<blockquote><pre> +<div class="codebox"><pre> Käse K??se -</pre></blockquote> +</pre></div> -<h3>Unicode Normalization</h3> +<h4>Unicode Normalization</h4> <p>If you retrieve user input with multibyte characters you should additionally normalize the string using <code>utf8_normalize_nfc()</code> before you work with it. This is necessary to make sure that equal characters can only occur in one particular binary representation. For example the character Å can be represented either as <code>U+00C5</code> (LATIN CAPITAL LETTER A WITH RING ABOVE) or as <code>U+212B</code> (ANGSTROM SIGN). phpBB uses Normalization Form Canonical Composition (NFC) for all text. So the correct version of the above example would look like this:</p> -<blockquote><pre> +<div class="codebox"><pre> $_REQUEST['multibyte_string'] = 'Käse'; // normalize multibyte strings echo utf8_normalize_nfc(request_var('multibyte_string', '', true)); // ASCII strings do not need to be normalized echo request_var('multibyte_string', ''); -</pre></blockquote> +</pre></div> -<h3>Case Folding</h3> +<h4>Case Folding</h4> <p>Case insensitive comparison of strings is no longer possible with <code>strtolower</code> or <code>strtoupper</code> as some characters have multiple lower case or multiple upper case forms depending on their position in a word. The <code>utf8_strtolower</code> and the <code>utf8_strtoupper</code> functions suffer from the same problem so they can only be used to display upper/lower case versions of a string but they cannot be used for case insensitive comparisons either. So instead you should use case folding which gives you a case insensitive version of the string which can be used for case insensitive comparisons. An NFC normalized string can be case folded using <code>utf8_case_fold_nfc()</code>.</p> <p class="bad">// Bad - The strings might be the same even if strtolower differs</p> -<blockquote><pre> +<div class="codebox"><pre> if (strtolower($string1) == strtolower($string2)) { echo '$string1 and $string2 are equal or differ in case'; } -</pre></blockquote> +</pre></div> <p class="good">// Good - Case folding is really case insensitive</p> -<blockquote><pre> +<div class="codebox"><pre> if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) { echo '$string1 and $string2 are equal or differ in case'; } -</pre></blockquote> +</pre></div> -<h3>Confusables Detection</h3> +<h4>Confusables Detection</h4> <p>phpBB offers a special method <code>utf8_clean_string</code> which can be used to make sure string identifiers are unique. This method uses Normalization Form Compatibility Composition (NFKC) instead of NFC and replaces similarly looking characters with a particular representative of the equivalence class. This method is currently used for usernames and group names to avoid confusion with similarly looking names.</p> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> -<a name="translation"></a><h1>6. Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</h1> + <span class="corners-bottom"><span></span></span></div> + </div> + + <hr /> + +<a name="translation"></a><h2>6. Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</h2> - <a name="standardisation"></a><b>6.i. Standardisation</b> - <br /><br /> <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> + + <a name="standardisation"></a><h3>6.i. Standardisation</h3> - <h3>Reason:</h3> + <h4>Reason:</h4> <p>phpBB is one of the most translated open-source projects, with the current stable version being available in over 60 localisations. Whilst the ad hoc approach to the naming of language packs has worked, for phpBB3 and beyond we hope to make this process saner which will allow for better interoperation with current and future web browsers.</p> - <h3>Encoding:</h3> + <h4>Encoding:</h4> <p>With phpBB3, the output encoding for the forum in now UTF-8, a Universal Character Encoding by the Unicode Consortium that is by design a superset to US-ASCII and ISO-8859-1. By using one character set which simultaenously supports all scripts which previously would have required different encodings (eg: ISO-8859-1 to ISO-8859-15 (Latin, Greek, Cyrillic, Thai, Hebrew, Arabic); GB2312 (Simplified Chinese); Big5 (Traditional Chinese), EUC-JP (Japanese), EUC-KR (Korean), VISCII (Vietnamese); et cetera), this removes the need to convert between encodings and improves the accessibility of multilingual forums.</p> <p>The impact is that the language files for phpBB must now also be encoded as UTF-8, with a caveat that the files must <strong>not contain</strong> a <acronym title="Byte-Order-Mark">BOM</acronym> for compatibility reasons with non-Unicode aware versions of PHP. For those with forums using the Latin character set (ie: most European languages), this change is transparent since UTF-8 is superset to US-ASCII and ISO-8859-1.</p> - <h3>Language Tag:</h3> + <h4>Language Tag:</h4> <p>The <abbr title="Internet Engineering Task Force">IETF</abbr> recently published <a href="http://tools.ietf.org/html/rfc4646">RFC 4646</a> for tags used to identify languages, which in combination with <a href="http://tools.ietf.org/html/rfc4647">RFC 4647</a> obseletes the older <a href="http://tools.ietf.org/html/rfc3066">RFC 3006</a> and older-still <a href="http://tools.ietf.org/html/rfc1766">RFC 1766</a>. <a href="http://tools.ietf.org/html/rfc4646">RFC 4646</a> uses <a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO 639-1/ISO 639-2</a>, <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a>, <a href="http://www.unicode.org/iso15924/iso15924-codes.html">ISO 15924</a> and <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a> to define a language tag. Each complete tag is composed of subtags which are not case sensitive and can also be empty.</p> @@ -1888,7 +1740,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) </tbody> </table> - <h3>Macro-languages & Topolects:</h3> + <h4>Macro-languages & Topolects:</h4> <p><a href="http://tools.ietf.org/html/rfc4646">RFC 4646</a> anticipates features which shall be available in (currently draft) <a href="http://www.sil.org/iso639-3/">ISO 639-3</a> which aims to provide as complete enumeration of languages as possible, including living, extinct, ancient and constructed languages, whether majour, minor or unwritten. A new feature of <a href="http://www.sil.org/iso639-3/">ISO 639-3</a> compared to the previous two revisions is the concept of <a href="http://www.sil.org/iso639-3/macrolanguages.asp">macrolanguages</a> where Arabic and Chinese are two such examples. In such cases, their respective codes of <code>ar</code> and <code>zh</code> is very vague as to which dialect/topolect is used or perhaps some terse classical variant which may be difficult for all but very educated users. For such macrolanguages, it is recommended that the sub-language tag is used as a suffix to the macrolanguage tag, eg:</p> @@ -1930,15 +1782,9 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) </tbody> </table> - </div> - <a href="#top">Top</a> - <br /><br /> + <a name="otherconsiderations"></a><h3>6.ii. Other considerations</h3> - <a name="otherconsiderations"></a><b>6.ii. Other considerations</b> - <br /><br /> - <div class="paragraph"> - - <h3>Normalisation of language tags for phpBB:</h3> + <h4>Normalisation of language tags for phpBB:</h4> <p>For phpBB, the language tags are <strong>not</strong> used in their raw form and instead converted to all lower-case and have the hyphen <code>-</code> replaced with an underscore <code>_</code> where appropriate, with some examples below:</p> @@ -1980,11 +1826,11 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) </tbody> </table> - <h3>How to use <code>iso.txt</code>:</h3> + <h4>How to use <code>iso.txt</code>:</h4> <p>The <code>iso.txt</code> file is a small UTF-8 encoded plain-text file which consists of three lines:</p> - <ol class="menu"> + <ol> <li><code>Language's English name</code></li> <li><code>Language's local name</code></li> <li><code>Authors information</code></li> @@ -2042,7 +1888,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <p>For the localised language description, just translate the English version though use whatever appropriate punctuation typical for your own locale, assuming the language uses punctuation at all.</p> - <h3>Unicode bi-directional considerations:</h3> + <h4>Unicode bi-directional considerations:</h4> <p>Because phpBB is now UTF-8, all translators must take into account that certain strings may be shown when the directionality of the document is either opposite to normal or is ambiguous.</p> @@ -2162,183 +2008,183 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <p>Within some cases, there may be mixed scripts of a left-to-right and right-to-left direction, so using <code>LRE</code> & <code>RLE</code> with <code>PDF</code> may be more appropriate. Lastly, in very rare instances where directionality must be forced, then use <code>LRO</code> & <code>RLO</code> with <code>PDF</code>.</p> <p>For further information on authoring techniques of bi-directional text, please see the W3C tutorial on <a href="http://www.w3.org/International/tutorials/bidi-xhtml/">authoring techniques for XHTML pages with bi-directional text</a>.</p> - <h3>Working with placeholders:</h3> + <h4>Working with placeholders:</h4> <p>As phpBB is translated into languages with different ordering rules to that of English, it is possible to show specific values in any order deemed appropriate. Take for example the extremely simple "Page <em>X</em> of <em>Y</em>", whilst in English this could just be coded as:</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'PAGE_OF' => 'Page %s of %s', /* Just grabbing the replacements as they come and hope they are in the right order */ ... - </pre></blockquote> + </pre></div> <p>… a clearer way to show explicit replacement ordering is to do:</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'PAGE_OF' => 'Page %1$s of %2$s', /* Explicit ordering of the replacements, even if they are the same order as English */ ... - </pre></blockquote> + </pre></div> <p>Why bother at all? Because some languages, the string transliterated back to English might read something like:</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'PAGE_OF' => 'Total of %2$s pages, currently on page %1$s', /* Explicit ordering of the replacements, reversed compared to English as the total comes first */ ... - </pre></blockquote> + </pre></div> - </div> - <a href="#top">Top</a> - <br /><br /> - - <a name="writingstyle"></a><b>6.iii. Writing Style</b> - <br /><br /> - <div class="paragraph"> + <a name="writingstyle"></a><h3>6.iii. Writing Style</h3> - <h3>Miscellaneous tips & hints:</h3> + <h4>Miscellaneous tips & hints:</h4> <p>As the language files are PHP files, where the various strings for phpBB are stored within an array which in turn are used for display within an HTML page, rules of syntax for both must be considered. Potentially problematic characters are: <code>'</code> (straight quote/apostrophe), <code>"</code> (straight double quote), <code><</code> (less-than sign), <code>></code> (greater-than sign) and <code>&</code> (ampersand).</p> <p class="bad">// Bad - The un-escapsed straight-quote/apostrophe will throw a PHP parse error</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'CONV_ERROR_NO_AVATAR_PATH' => 'Note to developer: you must specify $convertor['avatar_path'] to use %s.', ... - </pre></blockquote> + </pre></div> <p class="good">// Good - Literal straight quotes should be escaped with a backslash, ie: \</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'CONV_ERROR_NO_AVATAR_PATH' => 'Note to developer: you must specify $convertor[\'avatar_path\'] to use %s.', ... - </pre></blockquote> + </pre></div> <p>However, because phpBB3 now uses UTF-8 as its sole encoding, we can actually use this to our advantage and not have to remember to escape a straight quote when we don't have to:</p> <p class="bad">// Bad - The un-escapsed straight-quote/apostrophe will throw a PHP parse error</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'USE_PERMISSIONS' => 'Test out user's permissions', ... - </pre></blockquote> + </pre></div> <p class="good">// Okay - However, non-programmers wouldn't type "user\'s" automatically</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'USE_PERMISSIONS' => 'Test out user\'s permissions', ... - </pre></blockquote> + </pre></div> <p class="good">// Best - Use the Unicode Right-Single-Quotation-Mark character</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'USE_PERMISSIONS' => 'Test out user’s permissions', ... - </pre></blockquote> + </pre></div> <p>The <code>"</code> (straight double quote), <code><</code> (less-than sign) and <code>></code> (greater-than sign) characters can all be used as displayed glyphs or as part of HTML markup, for example:</p> <p class="bad">// Bad - Invalid HTML, as segments not part of elements are not entitised</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'FOO_BAR' => 'PHP version < 4.3.3.<br /> Visit "Downloads" at <a href="http://www.php.net/">www.php.net</a>.', ... - </pre></blockquote> + </pre></div> <p class="good">// Okay - No more invalid HTML, but "&quot;" is rather clumsy</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'FOO_BAR' => 'PHP version &lt; 4.3.3.<br /> Visit &quot;Downloads&quot; at <a href="http://www.php.net/">www.php.net</a>.', ... - </pre></blockquote> + </pre></div> <p class="good">// Best - No more invalid HTML, and usage of correct typographical quotation marks</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'FOO_BAR' => 'PHP version &lt; 4.3.3.<br /> Visit “Downloads” at <a href="http://www.php.net/">www.php.net</a>.', ... - </pre></blockquote> + </pre></div> <p>Lastly, the <code>&</code> (ampersand) must always be entitised regardless of where it is used:</p> <p class="bad">// Bad - Invalid HTML, none of the ampersands are entitised</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'FOO_BAR' => '<a href="http://somedomain.tld/?foo=1&bar=2">Foo & Bar</a>.', ... - </pre></blockquote> + </pre></div> <p class="good">// Good - Valid HTML, amperands are correctly entitised in all cases</p> - <blockquote><pre> + <div class="codebox"><pre> ... 'FOO_BAR' => '<a href="http://somedomain.tld/?foo=1&amp;bar=2">Foo &amp; Bar</a>.', ... - </pre></blockquote> + </pre></div> <p>As for how these charcters are entered depends very much on choice of Operating System, current language locale/keyboard configuration and native abilities of the text editor used to edit phpBB language files. Please see <a href="http://en.wikipedia.org/wiki/Unicode#Input_methods">http://en.wikipedia.org/wiki/Unicode#Input_methods</a> for more information.</p> - <h3>Spelling, punctuation, grammar, et cetera:</h3> + <h4>Spelling, punctuation, grammar, et cetera:</h4> <p>The default language pack bundled with phpBB is <strong>British English</strong> using <a href="http://www.cambridge.org/">Cambridge University Press</a> spelling and is assigned the language code <code>en</code>. The style and tone of writing tends towards formal and translations <strong>should</strong> emulate this style, at least for the variant using the most compact language code. Less formal translations or those with colloquialisms <strong>must</strong> be denoted as such via either an <code>extension</code> or <code>privateuse</code> tag within its language code.</p> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> </div> -<a href="#top">Top</a> -<br /><br /> -<hr /> + <hr /> + +<a name="changes"></a><h2>7. Guidelines Changelog</h2> + <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> -<a name="changes"></a><h1>7. Guidelines Changelog</h1> -<div class="paragraph"> + <div class="content"> -<h2>Revision 1.24</h2> +<h3>Revision 1.24</h3> -<ul class="menu"> +<ul> <li>Added <a href="#translation">5. Character Sets and Encodings</a> section to explain the recommended treatment of strings in phpBB.</li> </ul> -<h2>Revision 1.16</h2> +<h3>Revision 1.16</h3> -<ul class="menu"> +<ul> <li>Added <a href="#translation">6. Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</a> section to explain expected format and authoring considerations for language packs that are to be created for phpBB.</li> </ul> -<h2>Revision 1.11-1.15</h2> +<h3>Revision 1.11-1.15</h3> -<ul class="menu"> +<ul> <li>Various document formatting, spelling, punctuation, grammar bugs.</li> </ul> -<h2>Revision 1.9-1.10</h2> +<h3>Revision 1.9-1.10</h3> -<ul class="menu"> +<ul> <li>Added sql_query_limit to <a href="#sql">2.iii. SQL/SQL Layout</a>.</li> </ul> -<h2>Revision 1.8</h2> +<h3>Revision 1.8</h3> -<ul class="menu"> +<ul> <li>Some adjustements to wordings</li> <li>Updated paragraph <a href="#locations">1.iii. File Locations</a> to reflect recent changes</li> <li>Extended paragraph <a href="#codelayout">2.ii. Code Layout</a>.</li> @@ -2347,35 +2193,48 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2)) <li>Updated paragraph <a href="#templating">4. Templating</a> to explain loop checking, loop breaking and other changes we recently made.</li> </ul> -<h2>Revision 1.5</h2> +<h3>Revision 1.5</h3> -<ul class="menu"> +<ul> <li>Changed General function usage paragraph in <a href="#general">2.v. General Guidelines</a></li> </ul> -</div> -<a href="#top">Top</a> -<br /><br /> + </div> -<hr /> + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> -<a name="disclaimer"></a><h1>8. Copyright and disclaimer</h1> + <hr /> + +<a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2> <div class="paragraph"> + <div class="inner"><span class="corners-top"><span></span></span> + + <div class="content"> <p>This application is opensource software released under the <a href="http://opensource.org/licenses/gpl-license.php">GPL</a>. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) 2000, 2002, 2005, 2007 <a href="http://www.phpbb.com/">phpBB Group</a>, All Rights Reserved.</p> -</div> -<a href="#top">Top</a> + </div> + + <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> + + <span class="corners-bottom"><span></span></span></div> + </div> <!-- END DOCUMENT --> -</div> + <div id="page-footer"> + <div class="version"> $Id$ </div> + </div> +</div></div> -<div id="footer"> $Id$ -<br /><br /> +<div> + <a id="bottom" name="bottom" accesskey="z"></a> </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/phpBB/docs/corners_left.gif b/phpBB/docs/corners_left.gif Binary files differnew file mode 100644 index 0000000000..206e50368d --- /dev/null +++ b/phpBB/docs/corners_left.gif diff --git a/phpBB/docs/corners_left.png b/phpBB/docs/corners_left.png Binary files differnew file mode 100644 index 0000000000..256bde3daa --- /dev/null +++ b/phpBB/docs/corners_left.png diff --git a/phpBB/docs/corners_right.gif b/phpBB/docs/corners_right.gif Binary files differnew file mode 100644 index 0000000000..0ba66d50b2 --- /dev/null +++ b/phpBB/docs/corners_right.gif diff --git a/phpBB/docs/corners_right.png b/phpBB/docs/corners_right.png Binary files differnew file mode 100644 index 0000000000..df41823b4c --- /dev/null +++ b/phpBB/docs/corners_right.png diff --git a/phpBB/docs/header_bg.jpg b/phpBB/docs/header_bg.jpg Binary files differdeleted file mode 100644 index 5ecec5360b..0000000000 --- a/phpBB/docs/header_bg.jpg +++ /dev/null diff --git a/phpBB/docs/header_left.jpg b/phpBB/docs/header_left.jpg Binary files differdeleted file mode 100644 index aaebf33c7a..0000000000 --- a/phpBB/docs/header_left.jpg +++ /dev/null diff --git a/phpBB/docs/site_logo.gif b/phpBB/docs/site_logo.gif Binary files differnew file mode 100644 index 0000000000..909114c377 --- /dev/null +++ b/phpBB/docs/site_logo.gif diff --git a/phpBB/docs/stylesheet.css b/phpBB/docs/stylesheet.css new file mode 100644 index 0000000000..6b8f5994c0 --- /dev/null +++ b/phpBB/docs/stylesheet.css @@ -0,0 +1,352 @@ +/* + The original "prosilver" theme for phpBB3 + Created by subBlue design :: http://www.subBlue.com +*/ + +* { margin: 0; padding: 0; } + +html { font-size: 100%; height: 100%; margin-bottom: 1px; } + +body { + font-family: Verdana, Helvetica, Arial, sans-serif; + color: #828282; + background-color: #FFFFFF; + font-size: 12px; + margin: 0; + padding: 12px 0; +} + +img { border-width: 0; } + +p { + line-height: 1.3em; + font-size: 1.1em; + margin-bottom: 1.5em; +} + +hr { + border: 0 none #FFFFFF; + border-top: 1px solid #CCCCCC; + height: 1px; + margin: 5px 0; + display: block; + clear: both; +} + +html, body { + color: #536482; + background-color: #FFFFFF; +} + +#doc-description h1 { + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + margin-right: 200px; + color: #FFFFFF; + margin-top: 15px; + font-weight: bold; + font-size: 2em; + color: #fff; +} + +h1 { + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + font-weight: normal; + color: #000; + font-size: 2em; + margin: 0.8em 0 0.2em 0; +} + +h2 { + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + font-weight: normal; + color: #28313F; + font-size: 1.5em; + margin: 0.8em 0 0.2em 0; +} + +h3 { + font-family: Arial, Helvetica, sans-serif; + font-weight: bold; + border-bottom: 1px solid #CCCCCC; + margin-bottom: 3px; + padding-bottom: 2px; + font-size: 1.05em; + color: #115098; + margin-top: 20px; +} + +h4 { + font-family: Arial, Helvetica, sans-serif; + font-weight: bold; + margin-bottom: 3px; + padding-bottom: 2px; + font-size: 1.05em; + color: #115098; + margin-top: 20px; +} + +.good { color: green; } +.bad { color: red; } + +.version { + margin-top: 20px; + text-align: left; + font-size: 70%; + color: #006600; + 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 { + padding: 0 20px; + min-width: 650px; +} + +#simple-wrap { + padding: 6px 10px; +} + +#page-body { + margin: 4px 0; + clear: both; +} + +#page-footer { + clear: both; +} + +#logo { + float: left; + width: auto; + padding: 10px 13px 0 10px; +} + +a#logo:hover { + text-decoration: none; +} + +#doc-description { + float: left; + width: 70%; +} + +#doc-description h1 { + margin-right: 0; +} + +.headerbar { + background: #ebebeb none repeat-x 0 0; + color: #FFFFFF; + margin-bottom: 4px; + padding: 0 5px; +} + +span.corners-top, span.corners-bottom, span.corners-top span, span.corners-bottom span { + font-size: 1px; + line-height: 1px; + display: block; + height: 5px; + background-repeat: no-repeat; +} + +span.corners-top { + background-image: none; + background-position: 0 0; + margin: 0 -5px; +} + +span.corners-top span { + background-image: none; + background-position: 100% 0; +} + +span.corners-bottom { + background-image: none; + background-position: 0 100%; + margin: 0 -5px; + clear: both; +} + +span.corners-bottom span { + background-image: none; + background-position: 100% 100%; +} + +.paragraph { + padding: 0 10px; + margin-bottom: 4px; + background-repeat: no-repeat; + background-position: 100% 0; + background-color: #ECF3F7; +} + +.paragraph:target .content { + color: #000000; +} + +.paragraph:target h3 a { + color: #000000; +} + +.content { + color: #333333; +} + +.content h2, .panel h2 { + color: #115098; + border-bottom-color: #CCCCCC; +} + +a:link { color: #898989; text-decoration: none; } +a:visited { color: #898989; text-decoration: none; } +a:hover { color: #d3d3d3; text-decoration: underline; } +a:active { color: #d2d2d2; text-decoration: none; } + +hr { + border-color: #FFFFFF; + border-top-color: #CCCCCC; +} + +.menu { + background-color: #cadceb; +} + +.headerbar { + background-color: #12A3EB; + background-image: url("bg_header.gif"); + color: #FFFFFF; +} + +.panel { + background-color: #ECF1F3; + color: #28313F; +} + + +span.corners-top { + background-image: url("corners_left.png"); +} + +span.corners-top span { + background-image: url("corners_right.png"); +} + +span.corners-bottom { + background-image: url("corners_left.png"); +} + +span.corners-bottom span { + background-image: url("corners_right.png"); +} + +.error { + color: #BC2A4D; +} + +a:link { color: #105289; } +a:visited { color: #105289; } +a:hover { color: #D31141; } +a:active { color: #368AD2; } + +.paragraph span.corners-top, .paragraph span.corners-bottom { + margin: 0 -10px; +} + +.content { + padding: 0; + line-height: 1.48em; + color: #333333; +} + +.content h2, .panel h2 { + color: #115098; + border-bottom-color: #CCCCCC; +} + +.notice { + border-top-color: #CCCCCC; +} + +.codebox { + padding: 3px; + background-color: #FFFFFF; + border: 1px solid #C9D2D8; + font-size: 1em; + margin-bottom: 10px; + display: block; + font: 0.9em Monaco, "Andale Mono","Courier New", Courier, mono; + line-height: 1.3em; +} + +* html hr { margin: 0; } +* html span.corners-top, * html span.corners-bottom { background-image: url("corners_left.gif"); } +* html span.corners-top span, * html span.corners-bottom span { background-image: url("corners_right.gif"); } + +.back2top { + clear: both; + height: 11px; + text-align: right; +} + +.content ol, .content ul { + margin-left: 25px; + margin-top: 0; +} + +.content ul + p, .content ul + div { + margin-top: 20px; +} + +.comment { + color: green; +} + +.indent { + margin-left: 20px; +} + +.paragraph table { + font-size: 8pt; + border-collapse: collapse; + border: 1px solid #cfcfcf; + margin-bottom: 20px; +} + +.paragraph table caption { + display: none; +} + +.paragraph table thead { + background-color: #cadceb; + color: #000; +} + +.paragraph table td, .paragraph table th { + border: 1px solid #006699; + padding: 0.5em; + background-color: #e1ebf2; +} + +.paragraph table th { + background-color: #cadceb; +} + +.paragraph table td dl { + margin: 0; + padding: 0; +} + +.paragraph table td dl dt { + float: left; + clear: both; + margin-right: 1em; +} |