diff options
Diffstat (limited to 'phpBB/docs/coding-guidelines.html')
| -rw-r--r-- | phpBB/docs/coding-guidelines.html | 310 | 
1 files changed, 243 insertions, 67 deletions
| diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index dd0ee0a82f..e73c563d5b 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -1,16 +1,9 @@ -<!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"> +<!DOCTYPE html> +<html dir="ltr" lang="en">  <head> - -<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="phpBB Group" /> +<meta charset="utf-8">  <meta name="keywords" content="" /> -<meta name="description" content="Olympus coding guidelines document" /> +<meta name="description" content="Ascraeus coding guidelines document" />  <title>phpBB3 • Coding Guidelines</title>  <link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" /> @@ -28,7 +21,7 @@  			<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>Ascraeus coding guidelines document</p>  				<p style="display: none;"><a href="#start_here">Skip</a></p>  			</div> @@ -42,7 +35,7 @@  <!-- BEGIN DOCUMENT --> -<p>These are the phpBB Coding Guidelines for Olympus, all attempts should be made to follow them as closely as possible.</p> +<p>These are the phpBB Coding Guidelines for Ascraeus, all attempts should be made to follow them as closely as possible.</p>  <h1>Coding Guidelines</h1> @@ -62,11 +55,12 @@  	</li>  	<li><a href="#code">Code Layout/Guidelines</a>  	<ol style="list-style-type: lower-roman;"> -		<li><a href="#namingvars">Variable/Function Naming</a></li> +		<li><a href="#namingvars">Variable/Function/Class Naming</a></li>  		<li><a href="#codelayout">Code Layout</a></li>  		<li><a href="#sql">SQL/SQL Layout</a></li>  		<li><a href="#optimizing">Optimizations</a></li>  		<li><a href="#general">General Guidelines</a></li> -rw-r--r-- | perl-install/Xconfig/FILES | 6 | ||||
| -rw-r--r-- | perl-install/Xconfig/card.pm | 635 | ||||
| -rw-r--r-- | perl-install/Xconfig/default.pm | 45 | ||||
| -rw-r--r-- | perl-install/Xconfig/main.pm | 262 | ||||
| -rw-r--r-- | perl-install/Xconfig/monitor.pm | 275 | ||||
| -rw-r--r-- | perl-install/Xconfig/parse.pm | 205 | ||||
| -rw-r--r-- | perl-install/Xconfig/proprietary.pm | 35 | ||||
| -rw-r--r-- | perl-install/Xconfig/resolution_and_depth.pm | 386 | ||||
| -rw-r--r-- | perl-install/Xconfig/screen.pm | 29 | ||||
| -rw-r--r-- | perl-install/Xconfig/test.pm | 140 | ||||
| -rw-r--r-- | perl-install/Xconfig/various.pm | 178 | ||||
| -rw-r--r-- | perl-install/Xconfig/xfree.pm | 742 | 
12 files changed, 0 insertions, 2938 deletions
| diff --git a/perl-install/Xconfig/FILES b/perl-install/Xconfig/FILES deleted file mode 100644 index f6352dedf..000000000 --- a/perl-install/Xconfig/FILES +++ /dev/null @@ -1,6 +0,0 @@ -        -parse --- xfree ---- default ------------------ main  -                \--- card -------------------/  test -                 \-- monitor ---------------/   various -                  \- screen ---------------/    proprietary -                   \ resolution_and_depth-/ diff --git a/perl-install/Xconfig/card.pm b/perl-install/Xconfig/card.pm deleted file mode 100644 index 686957ddb..000000000 --- a/perl-install/Xconfig/card.pm +++ /dev/null @@ -1,635 +0,0 @@ -package Xconfig::card; # $Id$ - -use diagnostics; -use strict; - -use detect_devices; -use modules; -use common; -use log; - - -my %VideoRams = ( -     256 => N_("256 kB"), -     512 => N_("512 kB"), -    1024 => N_("1 MB"), -    2048 => N_("2 MB"), -    4096 => N_("4 MB"), -    8192 => N_("8 MB"), -   16384 => N_("16 MB"), -   32768 => N_("32 MB"), -   65536 => N_("64 MB or more"), -); - -my $lib = arch() =~ /x86_64/ ? "lib64" : "lib"; -  -my @xfree4_Drivers = ((arch() =~ /^sparc/ ? qw(sunbw2 suncg14 suncg3 suncg6 sunffb sunleo suntcx) : -		    qw(apm ark chips cirrus cyrix glide i128 i740 i810 imstt  -                       mga neomagic newport nv rendition r128 radeon vesa -                       s3 s3virge savage siliconmotion sis tdfx tga trident tseng vmware)),  -		    qw(ati glint vga fbdev)); - -sub from_raw_X { -    my ($raw_X) = @_; - -    my $device = $raw_X->get_device or die "no card configured"; - -    my $card = { -	use_DRI_GLX  => eval { any { /dri/ } $raw_X->get_modules }, -	%$device, -    }; -    add_to_card__using_Cards($card, $card->{BoardName}); -    $card; -} - -sub to_raw_X { -    my ($card, $raw_X) = @_; - -    my @cards = ($card, @{$card->{cards} || []}); - -    foreach (@cards) { -	#- Specific ATI fglrx driver default options -	if ($_->{Driver} eq 'fglrx') { -	    # $default_ATI_fglrx_config need to be move in proprietary ? -	    $_->{raw_LINES} ||= default_ATI_fglrx_config(); -	} -	if (arch() =~ /ppc/ && ($_->{Driver} eq 'r128' || $_->{Driver} eq 'radeon')) { -	    $_->{UseFBDev} = 1; -	} -    } - -    $raw_X->set_devices(@cards); - -    $raw_X->get_ServerLayout->{Xinerama} = { commented => !$card->{Xinerama}, Option => 1 } -      if defined $card->{Xinerama}; - -    # cleanup previous special nvidia libglx -    $raw_X->remove_load_module($_) foreach @{$card->{REMOVE_GLX} || []}; - -    if ($card->{DRI_GLX_SPECIAL}) { -        $raw_X->remove_load_module('glx'); # this doesn't duplicate the above glx line -        # This loads the NVIDIA GLX extension module. -        # IT IS IMPORTANT TO KEEP NAME AS FULL PATH TO libglx.so ELSE -        # IT WILL LOAD XFree86 glx module and the server will crash. -        $raw_X->add_load_module($card->{DRI_GLX_SPECIAL}); -    } else { -        $raw_X->set_load_module('glx', $card->{Driver} ne 'fbdev'); #- glx for everyone, except proprietary nvidia and fbdev -        $raw_X->set_load_module('dri', $card->{use_DRI_GLX}); -    } - -    $raw_X->remove_Section('DRI'); - -    $raw_X->remove_load_module('v4l') if $card->{use_DRI_GLX} && $card->{Driver} eq 'r128'; -} - -sub default_ATI_fglrx_config() { our $default_ATI_fglrx_config } - -sub probe() { -#-for Pixel tests -#-    my @c = { driver => 'Card:Matrox Millennium G400 DualHead', description => 'Matrox|Millennium G400 Dual HeadCard' }; -    my @c = detect_devices::matching_driver__regexp('^(Card|Server|Driver):'); - -    my @cards = map { -	my @l = $_->{description} =~ /(.*?)\|(.*)/; -	my $card = {  -	    description => $_->{description}, -	    VendorName => $l[0], BoardName => $l[1], -	    BusID => "PCI:$_->{pci_bus}:$_->{pci_device}:$_->{pci_function}", -	}; -	if    ($_->{driver} =~ /Card:(.*)/)   { $card->{BoardName} = $1; add_to_card__using_Cards($card, $1) } -	elsif ($_->{driver} =~ /Driver:(.*)/) { $card->{Driver} = $1 } -	else { internal_error() } - -	$card; -    } @c; - -    if (@cards >= 2 && $cards[0]{card_name} eq $cards[1]{card_name} && $cards[0]{card_name} eq 'Intel 830') { -	shift @cards; -    } -    #- take a default on sparc if nothing has been found. -    if (arch() =~ /^sparc/ && !@cards) { -        log::l("Using probe with /proc/fb as nothing has been found!"); -	my $s = cat_("/proc/fb"); -	@cards = { server => $s =~ /Mach64/ ? "Mach64" : $s =~ /Permedia2/ ? "3DLabs" : "Sun24" }; -    } - -    #- disabling MULTI_HEAD when not available -    foreach (@cards) {  -	$_->{MULTI_HEAD} && $_->{card_name} =~ /G[24]00/ or next; -	if ($ENV{MATROX_HAL}) { -	    $_->{need_MATROX_HAL} = 1; -	} else { -	    delete $_->{MULTI_HEAD}; -	} -    } - -    #- in case of only one cards, remove all BusID reference, this will avoid -    #- need of change of it if the card is moved. -    #- on many PPC machines, card is on-board, BusID is important, leave? -    if (@cards == 1 && !$cards[0]{MULTI_HEAD} && arch() !~ /ppc/) { -	delete $cards[0]{BusID}; -    } - -    @cards; -} - -sub card_config__not_listed { -    my ($in, $card, $options) = @_; - -    my $vendors_regexp = join '|', map { quotemeta } ( -        '3Dlabs', -        'AOpen', 'ASUS', 'ATI', 'Ark Logic', 'Avance Logic', -        'Cardex', 'Chaintech', 'Chips & Technologies', 'Cirrus Logic', 'Compaq', 'Creative Labs', -        'Dell', 'Diamond', 'Digital', -        'ET', 'Elsa', -        'Genoa', 'Guillemot', 'Hercules', 'Intel', 'Leadtek', -        'Matrox', 'Miro', 'NVIDIA', 'NeoMagic', 'Number Nine', -        'Oak', 'Orchid', -        'RIVA', 'Rendition Verite', -        'S3', 'Silicon Motion', 'STB', 'SiS', 'Sun', -        'Toshiba', 'Trident', -        'VideoLogic', -    ); -    my $cards = readCardsDB("$ENV{SHARE_PATH}/ldetect-lst/Cards+"); - -    my @xf4 = grep { $options->{allowFB} || $::isStandalone || $_ ne 'fbdev' } @xfree4_Drivers; -    my @list = ( -	(map { 'Vendor|' . $_ } keys %$cards), -	(map { 'Xorg|' . $_ } @xf4), -    ); - -    my $r = exists $cards->{$card->{BoardName}} ? "Vendor|$card->{BoardName}" : 'Xorg|vesa'; -    $in->ask_from_({ title => N("X server"),  -		     messages => N("Choose an X server"), -		     interactive_help_id => 'configureX_card_list', -		   }, -		   [ { val => \$r, separator => '|', list => \@list, sort => 1, -		       format => sub { $_[0] =~ /^Vendor\|($vendors_regexp)\s*-?(.*)/ ? "Vendor|$1|$2" :  -				       $_[0] =~ /^Vendor\|(.*)/ ? "Vendor|Other|$1" : $_[0] } } ]) or return; - -    log::explanations("Xconfig::card: $r manually chosen"); - -    $r eq "Vendor|$card->{BoardName}" and return 1; #- it is unchanged, do not modify $card - -    my ($kind, $s) = $r =~ /(.*?)\|(.*)/; - -    %$card = (); -    if ($kind eq 'Vendor') { -	add_to_card__using_Cards($card, $s); -    } else { -	$card->{Driver} = $s; -    } -    $card->{manually_chosen} = 1; -    1; -} - -sub multi_head_choose { -    my ($in, $auto, @cards) = @_; - -    my @choices = multi_head_choices('', @cards); - -    my $tc = $choices[0]; -    if ($auto) { -	@choices == 1 or return; -    } else { -	$tc = $in->ask_from_listf(N("Multi-head configuration"), -				  N("Your system supports multiple head configuration. -What do you want to do?"), sub { $_[0]{text} }, \@choices) or return; -    } -    $tc->{code} or die internal_error(); -    return $tc->{code}(); -} - -sub configure_auto_install { -    my ($raw_X, code>private</code> and <code>protected</code> for all properties instead of <code>var</code>. + +	<p>Place the <code>static</code> qualifier before the visibility qualifiers.</p> + +	<p class="bad">//Wrong </p> +	<div class="codebox"><pre> +var $x; +private static function f() +	</pre></div> + +	<p class="good">// Right </p> +	<div class="codebox"><pre> +public $x; +static private function f() +	</pre></div> + +	<h4>Constants</h4> +	<p>Prefer class constants over global constants created with <code>define()</code>.</p> +  	<a name="sql"></a><h3>2.iii. SQL/SQL Layout</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 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 (8.3+), Firebird, SQLite, Oracle8, ODBC (generalised if possible)).</p>  	<p>All SQL commands should utilise the DataBase Abstraction Layer (DBAL)</p>  	<h4>SQL code layout:</h4> @@ -1042,6 +1146,22 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;  	<p>Your page should either call <code>page_footer()</code> in the end to trigger output through the template engine and terminate the script, or alternatively at least call the <code>exit_handler()</code>. That call is necessary because it provides a method for external applications embedding phpBB to be called at the end of the script.</p> +	<a name="phprestrictions"></a><h3>2.vi. Restrictions on the Use of PHP</h3> + +	<h4>Dynamic code execution:</h4> + +	<p>Never execute dynamic PHP code (generated or in a constant string) using any of the following PHP functions:</p> + +	<ul> +		<li><strong>eval</strong></li> +		<li><strong>create_function</strong></li> +		<li><strong>preg_replace</strong> with the <strong>e</strong> modifier in the pattern</li> +	</ul> + +	<p>If absolutely necessary a file should be created, and a mechanism for creating this file prior to running phpBB should be provided as a setup process.</p> + +	<p>The <strong>e</strong> modifier in <strong>preg_replace</strong> can be replaced by <strong>preg_replace_callback</strong> and objects to encapsulate state that is needed in the callback code.</p> +  		</div>  		<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> @@ -1057,15 +1177,19 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;  		<div class="content">  	<a name="cfgfiles"></a><h3>3.i. Style Config Files</h3> -	<p>Style cfg files are simple name-value lists with the information necessary for installing a style. Similar cfg files exist for templates, themes and imagesets. These follow the same principle and will not be introduced individually. Styles can use installed components by using the required_theme/required_template/required_imageset entries. The important part of the style configuration file is assigning an unique name.</p> +	<p>Style cfg files are simple name-value lists with the information necessary for installing a style. The important part of the style configuration file is assigning an unique name.</p>  	<div class="codebox"><pre> -        # General Information about this style -        name = prosilver_duplicate -        copyright = © phpBB Group, 2007 -        version = 3.0.3 -        required_template = prosilver -        required_theme = prosilver -        required_imageset = prosilver +# General Information about this style +name = prosilver_duplicate +copyright = © phpBB Group, 2007 +version = 3.1.0 + +# Defining a different template bitfield +# template_bitfield = lNg= + +# Parent style +# Set value to empty or to this style's name if this style does not have a parent style +parent = prosilver  	</pre></div>  	<a name="genstyling"></a><h3>3.2. General Styling Rules</h3>  <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 indentation and coding guidelines also apply to templates where possible.</p> @@ -1088,7 +1212,7 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;  <p>Row colours/classes are now defined by the template, use an <code>IF S_ROW_COUNT</code> switch, see viewtopic or viewforum for an example.</p> -<p>Remember block level ordering is important ... while not all pages validate as XHTML 1.0 Strict compliant it is something we're trying to work on.</p> +<p>Remember block level ordering is important.</p>  <p>Use a standard cellpadding of 2 and cellspacing of 0 on outer tables. Inner tables can vary from 0 to 3 or even 4 depending on the need.</p> @@ -1156,13 +1280,13 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;  <p>A bit later loops will be explained further. To not irritate you we will explain conditionals as well as other statements first.</p>  <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> +<p>Something that existed in 2.0.x which no longer exists in 3.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>  <div class="codebox"><pre>  <span class="comment"><!-- INCLUDE filename --></span>  </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> +<p>You will note in the 3.x 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.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>  <p>Added in <strong>3.0.6</strong> is the ability to include a file using a template variable to specify the file, this functionality only works for root variables (i.e. not block variables).</p>  <div class="codebox"><pre> @@ -1194,7 +1318,7 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;  <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>  <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> +<p>The most significant addition to 3.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>  <div class="codebox"><pre>  <span class="comment"><!-- IF expr --></span> @@ -1265,7 +1389,7 @@ div  <span class="comment"><!-- ENDIF --></span>  </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> +<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.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>  <div class="codebox"><pre>  <table> @@ -1536,26 +1660,78 @@ div  </form>  		</pre></div><br /> -	<a name="inheritance"></a><h3>4.ii. Template Inheritance</h3> -		<p>When basing a new style on an existing one, it is not necessary to provide all the template files. By declaring the base style name in the <strong>inherit_from</strong> field in the template configuration file, the style can be set to inherit template files from the base style. The limitation on this is that the base style has to be installed and complete, meaning that it is not itself inheriting.</p> +	<a name="stylestree"></a><h3>4.ii. Styles Tree</h3> +		<p>When basing a new style on an existing one, it is not necessary to provide all the template files. By declaring the base style name in the <strong>parent</strong> field in the style configuration file, the style can be set to reuse template files from the parent style.</p> -		<p>The effect of doing so is that the template engine will use the template files in the new style where they exist, but fall back to files in the base style otherwise. Declaring a style to inherit from another also causes it to use some of the configuration settings of the base style, notably database storage.</p> +		<p>The effect of doing so is that the template engine will use the template files in the new style where they exist, but fall back to files in the parent style otherwise.</p> -		<p>We strongly encourage the use of inheritance for styles based on the bundled styles, as it will ease the update procedure.</p> +		<p>We strongly encourage the use of parent styles for styles based on the bundled styles, as it will ease the update procedure.</p>  		<div class="codebox"><pre> -        # General Information about this template -        name = inherits -        copyright = © phpBB Group, 2007 -        version = 3.0.3 +# General Information about this style +name = Custom Style +copyright = &copy; phpBB Group, 2007 +version = 3.1.0 -        # Defining a different template bitfield -        template_bitfield = lNg= +# Defining a different template bitfield +# template_bitfield = lNg= -        # Are we inheriting? -        inherit_from = prosilver +# Parent style +# Set value to empty or to this style's name if this style does not have a parent style +parent = prosilver  		</pre></div> +		<a name="template-events"></a><h3>4.iii. Template Events</h3> +		<p>Template events must follow this format: <code><!-- EVENT event_name --></code></p> +		<p>Using the above example, files named <code>event_name.html</code> located within extensions will be injected into the location of the event.</p> + +		<h4>Template event naming guidelines:</h4> +		<ul> +			<li>An event name must be all lowercase, with each word separated by an underscore.</li> +			<li>An event name must briefly describe the location and purpose of the event.</li> +			<li>An event name must end with one of the following suffixes:</li> +			<ul> +				<li><code>_prepend</code> - This event adds an item to the beginning of a block of related items, or adds to the beginning of individual items in a block.</li> +				<li><code>_append</code> - This event adds an item to the end of a block of related items, or adds to the end of individual items in a block.</li> +				<li><code>_before</code> - This event adds content directly before the specified block</li> +				<li><code>_after</code> - This event adds content directly after the specified block</li> +			</ul> +		</ul> + +		<h4>Template event documentation</h4> +		<p>Events must be documented in <code>phpBB/docs/events.md</code> in alphabetical order based on the event name. The format is as follows:</p> + +		<ul><li>An event found in only one template file: +		<div class="codebox"><pre>event_name +=== +* Location: styles/<style_name>/template/filename.html +* Purpose: A brief description of what this event should be used for. +This may span multiple lines. +</pre></div></li> +		<li>An event found in multiple template files: +		<div class="codebox"><pre>event_name +=== +* Locations: +    + first/file/path.html +    + second/file/path.html +* Purpose: Same as above. +</pre></div> +		<li>An event that is found multiple times in a file should have the number of instances in parenthesis next to the filename. +		<div class="codebox"><pre>event_name +=== +* Locations: +    + first/file/path.html (2) +    + second/file/path.html +* Purpose: Same as above. +</pre></div></li> +		<li>An actual example event documentation: +		<div class="codebox"><pre>forumlist_body_last_post_title_prepend +==== +* Locations: +    + styles/prosilver/template/forumlist_body.html +    + styles/subsilver2/template/forumlist_body.html +* Purpose: Add content before the post title of the latest post in a forum on the forum list.</pre></div></ul><br /> +  		</div>  		<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> @@ -1668,7 +1844,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<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), we remove 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> +	<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 <abbr title="Byte-Order-Mark">BOM</abbr> 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>  	<h4>Language Tag:</h4> @@ -1678,8 +1854,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<p>Most language tags consist of a two- or three-letter language subtag (from <a href="http://www.loc.gov/standards/iso639-2/php/English_list.php">ISO 639-1/ISO 639-2</a>). Sometimes, this is followed by a two-letter or three-digit region subtag (from <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> or <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a>). Some examples are:</p> -	<table summary="Examples of various possible language tags as described by RFC 4646 and RFC 4647"> -	<caption>Language tag examples</caption> +	<table> +	<caption>Examples of various possible language tags as described by RFC 4646 and RFC 4647</caption>  	<thead>  	<tr>  		<th scope="col">Language tag</th> @@ -1730,8 +1906,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<p>Next is the <a href="http://www.unicode.org/iso15924/iso15924-codes.html">ISO 15924</a> language script code and when one should or shouldn't use it. For example, whilst <code>en-Latn</code> is syntaxically correct for describing English written with Latin script, real world English writing is <strong>more-or-less exclusively in the Latin script</strong>. For such languages like English that are written in a single script, the <a href="http://www.iana.org/assignments/language-subtag-registry"><abbr title="Internet Assigned Numbers Authority">IANA</abbr> Language Subtag Registry</a> has a "Suppress-Script" field meaning the script code <strong>should be ommitted</strong> unless a specific language tag requires a specific script code. Some languages are <strong>written in more than one script</strong> and in such cases, the script code <strong>is encouraged</strong> since an end-user may be able to read their language in one script, but not the other. Some examples are:</p> -	<table summary="Examples of using a language subtag in combination with a script subtag"> -	<caption>Language subtag + script subtag examples</caption> +	<table> +	<caption>Examples of using a language subtag in combination with a script subtag</caption>  	<thead>  	<tr>  		<th scope="col">Language tag</th> @@ -1797,8 +1973,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<p>Examples of English using marco-geographical regions:</p> -	<table summary="Examples for English of ISO 3166-1 alpha-2 vs. UN M.49 code"> -	<caption>Coding for English using macro-geographical regions</caption> +	<table> +	<caption>Coding for English using macro-geographical regions (examples for English of ISO 3166-1 alpha-2 vs. UN M.49 code)</caption>  	<thead>  	<tr>  		<th scope="col">ISO 639-1/ISO 639-2 + ISO 3166-1 alpha-2</th> @@ -1823,8 +1999,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<p>Examples of Spanish using marco-geographical regions:</p> -	<table summary="Examples for Spanish of ISO 3166-1 alpha-2 vs. UN M.49 code"> -	<caption>Coding for Spanish macro-geographical regions</caption> +	<table> +	<caption>Coding for Spanish macro-geographical regions (examples for Spanish of ISO 3166-1 alpha-2 vs. UN M.49 code)</caption>  	<thead>  	<tr>  		<th scope="col">ISO 639-1/ISO 639-2 + ISO 3166-1 alpha-2</th> @@ -1852,7 +2028,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<p>Example of where the <a href="http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html">ISO 3166-1 alpha-2</a> is ambiguous and why <a href="http://unstats.un.org/unsd/methods/m49/m49.htm">UN M.49</a> might be preferred:</p> -	<table summary="Example where the ISO 3166-1 alpha-2 is ambiguous"> +	<table>  	<caption>Coding for ambiguous ISO 3166-1 alpha-2 regions</caption>  	<thead>  	<tr> @@ -1908,7 +2084,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<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> -	<table summary="Examples of macrolanguages used with sub-language subtags"> +	<table>  	<caption>Macrolanguage subtag + sub-language subtag examples</caption>  	<thead>  	<tr> @@ -1952,7 +2128,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<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> -	<table summary="Normalisation of language tags for usage in phpBB"> +	<table>  	<caption>Language tag normalisation examples</caption>  	<thead>  	<tr> @@ -2006,7 +2182,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<p>For the English language description, the language name is always first and any additional attributes required to describe the subtags within the language code are then listed in order separated with commas and enclosed within parentheses, eg:</p> -	<table summary="English language description examples of iso.txt for usage in phpBB"> +	<table>  	<caption>English language description examples for iso.txt</caption>  	<thead>  	<tr> @@ -2058,7 +2234,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<p>The various Unicode control characters for bi-directional text and their HTML enquivalents where appropriate are as follows:</p> -	<table summary="Table of the various Unicode bidirectional control characters"> +	<table>  	<caption>Unicode bidirectional control characters & HTML elements/entities</caption>  	<thead>  	<tr> @@ -2124,7 +2300,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<p>For <code>iso.txt</code>, the directionality of the text can be explicitly set using special Unicode characters via any of the three methods provided by left-to-right/right-to-left markers/embeds/overrides, as without them, the ordering of characters will be incorrect, eg:</p> -	<table summary="Effect of using Unicode bidirectional control characters within iso.txt"> +	<table>  	<caption>Unicode bidirectional control characters iso.txt</caption>  	<thead>  	<tr> @@ -2260,7 +2436,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<div class="codebox"><pre>  	... -'FOO_BAR'	=>	'PHP version < 4.3.3.<br /> +'FOO_BAR'	=>	'PHP version < 5.3.3.<br />  	Visit "Downloads" at <a href="http://www.php.net/">www.php.net</a>.',  	...  	</pre></div> @@ -2269,7 +2445,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<div class="codebox"><pre>  	... -'FOO_BAR'	=>	'PHP version &lt; 4.3.3.<br /> +'FOO_BAR'	=>	'PHP version &lt; 5.3.3.<br />  	Visit &quot;Downloads&quot; at <a href="http://www.php.net/">www.php.net</a>.',  	...  	</pre></div> @@ -2278,7 +2454,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))  	<div class="codebox"><pre>  	... -'FOO_BAR'	=>	'PHP version &lt; 4.3.3.<br /> +'FOO_BAR'	=>	'PHP version &lt; 5.3.3.<br />  	Visit “Downloads” at <a href="http://www.php.net/">www.php.net</a>.',  	...  	</pre></div> | 
