Merge remote-tracking branch 'upstream/develop' into ticket/10734

Conflicts:
	phpBB/styles/prosilver/theme/tweaks.css
This commit is contained in:
Shibu Lijack 2012-04-10 21:46:14 +05:30
commit fd55c8664a
125 changed files with 3795 additions and 5220 deletions

View file

@ -12,8 +12,17 @@
# ln -s ../../git-tools/hooks/pre-commit \\ # ln -s ../../git-tools/hooks/pre-commit \\
# .git/hooks/pre-commit # .git/hooks/pre-commit
# NOTE: this is run through /usr/bin/env if [ -z "$PHP_BIN" ]
PHP_BIN=php then
PHP_BIN=php
fi
if [ "$(echo -e test)" = test ]
then
echo_e="echo -e"
else
echo_e="echo"
fi
# necessary check for initial commit # necessary check for initial commit
if git rev-parse --verify HEAD >/dev/null 2>&1 if git rev-parse --verify HEAD >/dev/null 2>&1
@ -27,7 +36,7 @@ fi
error=0 error=0
errors="" errors=""
if ! which $PHP_BIN >/dev/null 2>&1 if ! which "$PHP_BIN" >/dev/null 2>&1
then then
echo "PHP Syntax check failed:" echo "PHP Syntax check failed:"
echo "PHP binary does not exist or is not in path: $PHP_BIN" echo "PHP binary does not exist or is not in path: $PHP_BIN"
@ -64,7 +73,13 @@ do
# check the staged file content for syntax errors # check the staged file content for syntax errors
# using php -l (lint) # using php -l (lint)
result=$(git cat-file -p $sha | /usr/bin/env $PHP_BIN -l 2>/dev/null) # note: if display_errors=stderr in php.ini,
# parse errors are printed on stderr; otherwise
# they are printed on stdout.
# we filter everything other than parse errors
# with a grep below, therefore it should be safe
# to combine stdout and stderr in all circumstances
result=$(git cat-file -p $sha | "$PHP_BIN" -l 2>&1)
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
error=1 error=1
@ -76,7 +91,45 @@ unset IFS
if [ $error -eq 1 ] if [ $error -eq 1 ]
then then
echo -e "PHP Syntax check failed:"; echo "PHP Syntax check failed:"
echo -e "$errors" | grep "^Parse error:" # php "display errors" (display_errors php.ini value)
# and "log errors" (log_errors php.ini value).
# these are independent settings - see main/main.c in php source.
# the "log errors" setting produces output which
# starts with "PHP Parse error:"; the "display errors"
# setting produces output starting with "Parse error:".
# if both are turned on php dumps the parse error twice.
# therefore here we try to grep for one version and
# if that yields no results grep for the other version.
#
# other fun php facts:
#
# 1. in cli, display_errors and log_errors have different
# destinations by default. display_errors prints to
# standard output and log_errors prints to standard error.
# whether these destinations make sense is left
# as an exercise for the reader.
# 2. as mentioned above, with all output turned on
# php will print parse errors twice, one time on stdout
# and one time on stderr.
# 3. it is possible to set both display_errors and log_errors
# to off. if this is done php will print the text
# "Errors parsing <file>" but will not say what
# the errors are. useful behavior, this.
# 4. on my system display_errors defaults to on and
# log_errors defaults to off, therefore providing
# by default one copy of messages. your mileage may vary.
# 5. by setting display_errors=stderr and log_errors=on,
# both sets of messages will be printed on stderr.
# 6. php-cgi binary, given display_errors=stderr and
# log_errors=on, still prints both sets of messages
# on stderr, but formats one set as an html fragment.
# 7. your entry here? ;)
$echo_e "$errors" | grep "^Parse error:"
if [ $? -ne 0 ]
then
# match failed
$echo_e "$errors" | grep "^PHP Parse error:"
fi
exit 1 exit 1
fi fi

View file

@ -50,9 +50,9 @@ $file_uploads = (@ini_get('file_uploads') == '1' || strtolower(@ini_get('file_up
$module_id = request_var('i', ''); $module_id = request_var('i', '');
$mode = request_var('mode', ''); $mode = request_var('mode', '');
// Set custom template for admin area // Set custom style for admin area
$template->set_ext_dir_prefix('adm/'); $phpbb_style->set_ext_dir_prefix('adm/');
$template->set_custom_template($phpbb_admin_path . 'style', 'admin'); $phpbb_style->set_custom_style('admin', $phpbb_admin_path . 'style', '');
$template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets'); $template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets');
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style'); $template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');

View file

@ -2,377 +2,60 @@
<a id="maincontent"></a> <a id="maincontent"></a>
<!-- IF S_DELETE --> <!-- IF S_CONFIRM_ACTION -->
<form id="confirm" method="post" action="{S_CONFIRM_ACTION}">
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a> <fieldset>
<h1>{MESSAGE_TITLE}</h1>
<h1>{L_TITLE}</h1> <p>{MESSAGE_TEXT}</p>
<!-- IF S_CONFIRM_DELETE -->
<p>{L_EXPLAIN}</p> <label><input type="checkbox" class="checkbox" name="confirm_delete_files" /> {L_DELETE_FROM_FS}</label>
<form id="acp_styles" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_TITLE}</legend>
<dl>
<dt><label>{L_NAME}:</label></dt>
<dd><strong>{NAME}</strong></dd>
</dl>
<dl>
<dt><label for="new_id">{L_REPLACE}:</label><br /><span>{L_REPLACE_EXPLAIN}</span></dt>
<dd><select id="new_id" name="new_id">{S_REPLACE_OPTIONS}</select></dd>
</dl>
<!-- IF S_DELETE_STYLE -->
<hr />
<dl>
<dt><label for="new_template_id">{L_DELETE_TEMPLATE}:</label><br /><span>{L_REPLACE_TEMPLATE_EXPLAIN}</span></dt>
<dd><select id="new_template_id" name="new_template_id">{S_REPLACE_TEMPLATE_OPTIONS}</select></dd>
</dl>
<dl>
<dt><label for="new_theme_id">{L_DELETE_THEME}:</label><br /><span>{L_REPLACE_THEME_EXPLAIN}</span></dt>
<dd><select id="new_theme_id" name="new_theme_id">{S_REPLACE_THEME_OPTIONS}</select></dd>
</dl>
<!-- ENDIF --> <!-- ENDIF -->
<p class="quick">
<input class="button1" type="submit" name="update" value="{L_DELETE}" />
{S_FORM_TOKEN}
</p>
</fieldset>
</form>
<!-- ELSEIF S_EDIT_TEMPLATE or S_EDIT_THEME -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
<h1>{L_EDIT}</h1>
<p>{L_EDIT_EXPLAIN}</p>
<p>{L_SELECTED}: <strong>{SELECTED_TEMPLATE}</strong></p>
<form id="acp_styles" method="post" action="{U_ACTION}">
<!-- IF S_EDIT_TEMPLATE or (S_EDIT_THEME and not S_THEME_IN_DB) -->
<fieldset>
<legend>{L_SELECT}</legend>
<dl>
<dt><label for="template_file">{L_FILE}:</label></dt>
<dd><select id="template_file" name="template_file" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_TEMPLATES}</select> <input class="button2" type="submit" value="{L_SELECT}" /></dd>
</dl>
{S_FORM_TOKEN}
</fieldset>
<!-- ENDIF -->
</form>
<!-- IF TEMPLATE_FILE or (S_EDIT_THEME and S_THEME_IN_DB) -->
<script type="text/javascript" defer="defer">
// <![CDATA[
function change_editor_height(height)
{
height = Number(height);
if (isNaN(height))
{
return;
}
editor = document.getElementById('template_data');
editor.rows = Math.max(5, Math.min(height, 999));
append_text_rows('acp_styles', height);
append_text_rows('acp_template', height);
}
function append_text_rows(form_name, value)
{
value = Number(value);
if (isNaN(value))
{
return;
}
url = document.getElementById(form_name).action;
// Make sure &amp; is actually... &
url = url.replace(/&amp;/g, '&');
var_start = url.indexOf('&text_rows=');
if (var_start == -1)
{
document.getElementById(form_name).action = url + "&text_rows=" + value;
}
else
{
url_start = url.substring(0, var_start + 1);
var_end = url.substring(var_start + 1).indexOf('&');
if (var_end == -1)
{
document.getElementById(form_name).action = url_start + "text_rows=" + value;
}
else
{
document.getElementById(form_name).action = url_start + url.substring(var_end + var_start + 2) + "&text_rows=" + value;
}
}
}
// ]]>
</script>
<form id="acp_template" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_EDITOR}</legend>
<!-- IF S_EDIT_TEMPLATE or (S_EDIT_THEME and not S_THEME_IN_DB) -->
<dl>
<dt><label>{L_SELECTED_FILE}:</label></dt>
<dd>{TEMPLATE_FILE}</dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="text_rows">{L_EDITOR_HEIGHT}:</label></dt>
<dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="button2" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd>
</dl>
<textarea id="template_data" name="template_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{TEMPLATE_DATA}</textarea>
</fieldset>
<fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
{S_HIDDEN_FIELDS} {S_HIDDEN_FIELDS}
{S_FORM_TOKEN}
<input class="button1" id="save" type="submit" name="save" value="{L_SUBMIT}" />
</fieldset>
</form>
<!-- ENDIF -->
<!-- ELSEIF S_CACHE --> <div style="text-align: center;">
<input type="submit" name="confirm" value="{L_YES}" class="button2" />&nbsp;
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a> <input type="submit" name="cancel" value="{L_NO}" class="button2" />
<h1>{L_TEMPLATE_CACHE}</h1>
<p>{L_TEMPLATE_CACHE_EXPLAIN}</p>
<form id="acp_styles" method="post" action="{U_ACTION}">
<fieldset class="tabulated">
<legend>{L_TEMPLATE_CACHE}</legend>
<table cellspacing="1">
<thead>
<tr>
<th>{L_CACHE_FILENAME}</th>
<th>{L_CACHE_FILESIZE}</th>
<th>{L_CACHE_CACHED}</th>
<th>{L_CACHE_MODIFIED}</th>
<th>{L_MARK}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN file -->
<!-- IF file.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
<td><a href="{file.U_VIEWSOURCE}" onclick="popup(this.href, 750, 550, '_source'); return false;">{file.FILENAME_PATH}</a></td>
<td>{file.FILESIZE}</td>
<td>{file.CACHED}</td>
<td>{file.MODIFIED}</td>
<td><input type="checkbox" class="radio" name="delete[]" value="{file.FILENAME}" /></td>
</tr>
<!-- BEGINELSE -->
<tr class="row1">
<td colspan="5">{L_TEMPLATE_CACHE_EMPTY}</td>
</tr>
<!-- END file -->
</tbody>
</table>
<p class="quick">
<span class="small"><a href="#" onclick="marklist('acp_styles', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('acp_styles', 'delete', false); return false;">{L_UNMARK_ALL}</a></span><br />
{S_FORM_TOKEN}
<input class="button1" type="submit" id="submit" name="submit" value="{L_DELETE_MARKED}" />
</p>
</fieldset>
</form>
<!-- ELSEIF S_EXPORT -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
<h1>{L_TITLE}</h1>
<p>{L_EXPLAIN}</p>
<!-- IF S_ERROR_MSG -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p>
</div> </div>
<!-- ENDIF -->
<form id="acp_styles" method="post" action="{U_ACTION}"> </fieldset>
</form>
<!-- ELSE -->
<!-- IF L_TITLE --><h1>{L_TITLE}</h1><!-- ENDIF -->
<!-- IF L_EXPLAIN --><p>{L_EXPLAIN}</p><!-- ENDIF -->
<form id="acp_styles" method="post" action="{U_ACTION}">
{S_HIDDEN_FIELDS}
{S_FORM_TOKEN}
<!-- IF S_STYLE_DETAILS -->
<input type="hidden" name="id" value="{STYLE_ID}" />
<fieldset> <fieldset>
<legend>{L_TITLE}</legend>
<dl> <dl>
<dt><label>{L_NAME}:</label></dt> <dt><label for="name">{L_STYLE_NAME}:</label></dt>
<dd><strong>{NAME}</strong></dd> <dd><input type="text" id="name" name="style_name" value="{STYLE_NAME}" /></dd>
</dl>
<!-- IF S_STYLE -->
<dl>
<dt><label for="inc_template">{L_INCLUDE_TEMPLATE}:</label></dt>
<dd><label><input type="radio" class="radio" id="inc_template" name="inc_template" value="1" checked="checked" /> {L_YES}</label>
<label><input type="radio" class="radio" name="inc_template" value="0" /> {L_NO}</label></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="inc_theme">{L_INCLUDE_THEME}:</label></dt> <dt><label>{L_STYLE_PATH}</label></dt>
<dd><label><input type="radio" class="radio" id="inc_theme" name="inc_theme" value="1" checked="checked" /> {L_YES}</label> <dd><strong>{STYLE_PATH}</strong></dd>
<label><input type="radio" class="radio" name="inc_theme" value="0" /> {L_NO}</label></dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="store">{L_DOWNLOAD_STORE}:</label><br /><span>{L_DOWNLOAD_STORE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" id="store" name="store" value="1" checked="checked" /> {L_EXPORT_STORE}</label>
<label><input type="radio" class="radio" name="store" value="0" /> {L_EXPORT_DOWNLOAD}</label></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="format">{L_ARCHIVE_FORMAT}:</label></dt> <dt><label for="name">{L_COPYRIGHT}:</label></dt>
<dd>{FORMAT_BUTTONS}</dd> <dd><strong>{STYLE_COPYRIGHT}</strong></dd>
</dl>
<p class="quick">
{S_FORM_TOKEN}
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
</p>
</fieldset>
</form>
<!-- ELSEIF S_FRONTEND -->
<h1>{L_TITLE}</h1>
<p>{L_EXPLAIN}</p>
<!-- IF S_STYLE --> <!-- DEFINE $COLSPAN = 5 --> <!-- ELSE --> <!-- DEFINE $COLSPAN = 4 --> <!-- ENDIF -->
<table cellspacing="1">
<col class="row1" /><!-- IF S_STYLE --><col class="row1" /><!-- ENDIF --><col class="row2" /><col class="row2" />
<thead>
<tr>
<th>{L_NAME}</th>
<!-- IF S_STYLE --><th>{L_STYLE_USED_BY}</th><!-- ENDIF -->
<th>{L_OPTIONS}</th>
<th>{L_ACTIONS}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="row3" colspan="{$COLSPAN}"><strong>{L_INSTALLED}</strong></td>
</tr>
<!-- BEGIN installed -->
<!-- IF installed.S_INACTIVE and not $INACTIVE_STYLES -->
<!-- DEFINE $INACTIVE_STYLES = 1 -->
<tr>
<td class="row3" colspan="{$COLSPAN}"><strong>{L_INACTIVE_STYLES}</strong></td>
</tr>
<!-- ENDIF -->
<tr>
<td><strong>{installed.NAME}</strong><!-- IF installed.S_DEFAULT_STYLE --> *<!-- ENDIF --></td>
<!-- IF S_STYLE -->
<td style="text-align: center;">{installed.STYLE_COUNT}</td>
<!-- ENDIF -->
<td style="text-align: center;">
{installed.S_OPTIONS}
</td>
<td style="text-align: center;">
<!-- IF S_STYLE -->
<a href="{installed.U_STYLE_ACT_DEACT}" data-ajax="activate_deactivate">{installed.L_STYLE_ACT_DEACT}</a> |
<!-- ENDIF -->
{installed.S_ACTIONS}
<!-- IF S_STYLE -->
| <a href="{installed.U_PREVIEW}">{L_PREVIEW}</a>
<!-- ENDIF -->
</td>
</tr>
<!-- END installed -->
<tr>
<td class="row3" colspan="{$COLSPAN}"><strong>{L_UNINSTALLED}</strong></td>
</tr>
<!-- IF not .uninstalled -->
<tr>
<td class="row1" colspan="{$COLSPAN}" style="text-align: center;">{L_NO_UNINSTALLED}</td>
</tr>
<!-- ENDIF -->
<!-- BEGIN uninstalled -->
<tr>
<td<!-- IF S_STYLE --> colspan="2"<!-- ENDIF -->><strong>{uninstalled.NAME}</strong><br /><span>{L_COPYRIGHT}: {uninstalled.COPYRIGHT}</span></td>
<td style="text-align: center;" colspan="2"><a href="{uninstalled.U_INSTALL}">{L_INSTALL}</a></td>
</tr>
<!-- END uninstalled -->
</tbody>
</table>
<!-- IF S_STYLE -->
<form id="acp_styles" method="post" action="{U_ACTION}">
<fieldset class="quick">
<legend>{L_CREATE}</legend>
{L_CREATE}: <input type="text" name="name" value="" /> {L_FROM} <select name="basis">{S_BASIS_OPTIONS}</select> <input class="button2" type="submit" name="add" value="{L_SUBMIT}" />
</fieldset>
</form>
<!-- ENDIF -->
<!-- ELSEIF S_DETAILS -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
<h1>{L_TITLE}</h1>
<p>{L_EXPLAIN}</p>
<!-- IF S_ERROR_MSG -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{ERROR_MSG}</p>
</div>
<!-- ENDIF -->
<form id="acp_styles" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_TITLE}</legend>
<dl>
<dt><label for="name">{L_NAME}:</label></dt>
<dd><!-- IF S_INSTALL --><strong id="name">{NAME}</strong><!-- ELSE --><input type="text" id="name" name="name" value="{NAME}" /><!-- ENDIF --></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="copyright">{L_COPYRIGHT}:</label></dt> <dt><label for="style_parent">{L_INHERITING_FROM}:</label></dt>
<dd><!-- IF S_INSTALL --><strong id="copyright">{COPYRIGHT}</strong><!-- ELSE --><input type="text" id="copyright" name="copyright" value="{COPYRIGHT}" /><!-- ENDIF --></dd> <dd><select id="style_parent" name="style_parent">
<option value=""<!-- IF STYLE_PARENT == 0 --> selected="selected"<!-- ENDIF -->> - </option>
<!-- BEGIN parent_styles -->
<option value="{parent_styles.STYLE_ID}"<!-- IF parent_styles.STYLE_ID == STYLE_PARENT --> selected="selected"<!-- ENDIF -->>{parent_styles.SPACER}{parent_styles.STYLE_NAME}</option>
<!-- END parent_styles -->
</select></dd>
</dl> </dl>
<!-- IF S_SUPERTEMPLATE -->
<dl>
<dt><label for="inheriting">{L_INHERITING_FROM}:</label></dt>
<dd><strong id="inheriting">{S_SUPERTEMPLATE}</strong></dd>
</dl>
<!-- ENDIF -->
<!-- IF S_STYLE and not S_BASIS -->
<dl>
<dt><label for="template_id">{L_STYLE_TEMPLATE}:</label></dt>
<dd><!-- IF S_INSTALL --><strong id="template_id">{TEMPLATE_NAME}</strong><!-- ELSE --><select id="template_id" name="template_id">{S_TEMPLATE_OPTIONS}</select><!-- ENDIF --></dd>
</dl>
<dl>
<dt><label for="theme_id">{L_STYLE_THEME}:</label></dt>
<dd><!-- IF S_INSTALL --><strong id="theme_id">{THEME_NAME}</strong><!-- ELSE --><select id="theme_id" name="theme_id">{S_THEME_OPTIONS}</select><!-- ENDIF --></dd>
</dl>
<!-- ENDIF -->
<!-- IF S_STYLE -->
</fieldset>
<fieldset>
<legend>{L_OPTIONS}</legend>
<dl> <dl>
<dt><label for="style_active">{L_STYLE_ACTIVE}:</label></dt> <dt><label for="style_active">{L_STYLE_ACTIVE}:</label></dt>
<dd><label><input type="radio" class="radio" name="style_active" value="1"<!-- IF S_STYLE_ACTIVE --> id="style_active" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <dd><label><input type="radio" class="radio" name="style_active" value="1"<!-- IF S_STYLE_ACTIVE --> id="style_active" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
@ -385,16 +68,101 @@
<label><input type="radio" class="radio" id="style_default" name="style_default" value="0" checked="checked" /> {L_NO}</label></dd> <label><input type="radio" class="radio" id="style_default" name="style_default" value="0" checked="checked" /> {L_NO}</label></dd>
</dl> </dl>
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF -->
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend> <legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
<a href="{U_ACTION}" class="button2">{L_BACK}</a>
{S_FORM_TOKEN} {S_FORM_TOKEN}
</fieldset> </fieldset>
<!-- ENDIF -->
</form> <!-- IF .styles_list -->
<table cellspacing="1">
<thead>
<tr>
<th>{L_STYLE_NAME}</th>
<!-- IF not STYLES_LIST_HIDE_COUNT --><th width="10%" style="white-space: nowrap; text-align: center;">{L_STYLE_USED_BY}</th><!-- ENDIF -->
<th width="25%" style="white-space: nowrap; text-align: center;">{L_ACTIONS}</th>
{STYLES_LIST_EXTRA}
<th>&nbsp;</th>
</tr>
</thead>
<!-- BEGIN styles_list -->
<tbody id="styles-list-{styles_list.S_ROW_COUNT}">
<tr<!-- IF styles_list.STYLE_ID and not styles_list.STYLE_ACTIVE --> class="row-inactive"<!-- ENDIF -->>
<!-- IF styles_list.LEVEL is odd -->
<!-- IF $ROW_CLASS == 'row1a' --><!-- DEFINE $ROW_CLASS = 'row1b' --><!-- ELSE --><!-- DEFINE $ROW_CLASS = 'row1a' --><!-- ENDIF -->
<!-- ELSE -->
<!-- IF $ROW_CLASS == 'row2a' --><!-- DEFINE $ROW_CLASS = 'row2b' --><!-- ELSE --><!-- DEFINE $ROW_CLASS = 'row2a' --><!-- ENDIF -->
<!-- ENDIF -->
<td class="{$ROW_CLASS}" style="padding-left: {styles_list.PADDING}px;">
<!-- IF styles_list.STYLE_ID and styles_list.COMMENT == '' and styles_list.STYLE_ACTIVE -->
<div class="default-style" style="display: none; float: right;">
<input class="radio" type="radio" name="default" value="{styles_list.STYLE_ID}"<!-- IF styles_list.DEFAULT --> checked="checked"<!-- ELSE --><!-- DEFINE $S_DEFAULT = 1 --><!-- ENDIF --> title="{L_STYLE_DEFAULT}" />
</div>
<!-- ENDIF -->
<!-- IF styles_list.DEFAULT or styles_list.SHOW_COPYRIGHT -->
<strong>{styles_list.STYLE_NAME}</strong>
<!-- IF styles_list.SHOW_COPYRIGHT and styles_list.COMMENT == '' --><span><br />{styles_list.STYLE_COPYRIGHT}</span><!-- ENDIF -->
<!-- ELSE -->
<span>{styles_list.STYLE_NAME}</span>
<!-- ENDIF -->
<!-- IF styles_list.COMMENT != '' -->
<span class="error"><br />{styles_list.COMMENT}</span>
<!-- ENDIF -->
<!-- IF not styles_list.STYLE_ID and styles_list.COMMENT == '' -->
<span class="style-path"><br />{L_STYLE_PATH} {styles_list.STYLE_PATH_FULL}</span>
<!-- ENDIF -->
</td>
<!-- IF not STYLES_LIST_HIDE_COUNT -->
<td class="{$ROW_CLASS}" style="text-align: center;">{styles_list.USERS}</td>
<!-- ENDIF -->
<td class="{$ROW_CLASS}" style="text-align: center;">
<!-- BEGIN actions -->
<!-- IF styles_list.actions.S_ROW_COUNT > 0 --> | <!-- ENDIF -->
<!-- IF styles_list.actions.U_ACTION -->
<a href="{styles_list.actions.U_ACTION}"{styles_list.actions.U_ACTION_ATTR}>{styles_list.actions.L_ACTION}</a>
<!-- ENDIF -->
{styles_list.actions.HTML}
<!-- END actions -->
</td>
{styles_list.EXTRA}
<td class="{$ROW_CLASS}" width="20" style="text-align: center;">
<!-- IF styles_list.STYLE_ID -->
<input class="checkbox" type="checkbox" name="ids[]" value="{styles_list.STYLE_ID}" />
<!-- ELSE -->
<!-- IF styles_list.COMMENT != '' -->
&nbsp;
<!-- ELSE -->
<input class="checkbox" type="checkbox" name="dirs[]" value="{styles_list.STYLE_PATH}" />
<!-- ENDIF -->
<!-- ENDIF -->
</td>
</tr>
</tbody>
<!-- END styles_list -->
</table>
<!-- ENDIF -->
<!-- IF .extra_actions -->
<fieldset class="quick">
<!-- BEGIN extra_actions -->
<input type="submit" name="{extra_actions.ACTION_NAME}" class="button2" value="{extra_actions.L_ACTION}" />
<!-- END extra_actions -->
</fieldset>
<!-- ENDIF -->
<!-- IF .extra_links -->
<fieldset class="quick">
<!-- BEGIN extra_links -->
<a class="button2" href="{extra_links.U_ACTION}">{extra_links.L_ACTION}</a>
<!-- END extra_links -->
</fieldset>
<!-- ENDIF -->
</form>
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -630,12 +630,29 @@ td.name {
.col1 { background-color: #DCEBFE; } .col1 { background-color: #DCEBFE; }
.col2 { background-color: #F9F9F9; } .col2 { background-color: #F9F9F9; }
/* 4 row background colours for trees */
.row1a { background-color: #F9F9F9; }
.row1b { background-color: #F6F6F6; }
.row2a { background-color: #E7EEF4; }
.row2b { background-color: #E3EBF2; }
.spacer { .spacer {
background-color: #DBDFE2; background-color: #DBDFE2;
height: 1px; height: 1px;
line-height: 1px; line-height: 1px;
} }
/* Deactivated row */
.row-inactive {
color: #999;
}
.row-inactive a, .row-inactive strong {
color: #888;
}
.row-inactive a:hover {
color: #BC2A4D;
}
/* General form styles /* General form styles
----------------------------------------*/ ----------------------------------------*/
fieldset { fieldset {

View file

@ -9,7 +9,7 @@
<div id="page-footer"> <div id="page-footer">
<!-- IF S_COPYRIGHT_HTML --> <!-- IF S_COPYRIGHT_HTML -->
Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group {CREDIT_LINE}
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF --> <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
@ -39,7 +39,8 @@
<script type="text/javascript" src="{T_JQUERY_LINK}"></script> <script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> <!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js"></script> <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js"></script>
<script type="text/javascript" src="style/ajax.js"></script> <!-- INCLUDEJS ajax.js -->
{SCRIPTS}
</body> </body>
</html> </html>

View file

@ -5,7 +5,7 @@
<div id="page-footer"> <div id="page-footer">
<!-- IF S_COPYRIGHT_HTML --> <!-- IF S_COPYRIGHT_HTML -->
<br />Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group <br />{CREDIT_LINE}
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF --> <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -74,8 +74,6 @@ if (!empty($load_extensions) && function_exists('dl'))
// Include files // Include files
require($phpbb_root_path . 'includes/class_loader.' . $phpEx); require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
require($phpbb_root_path . 'includes/session.' . $phpEx);
require($phpbb_root_path . 'includes/auth.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx); require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
@ -102,8 +100,8 @@ $phpbb_class_loader->set_cache($cache->get_driver());
// Instantiate some basic classes // Instantiate some basic classes
$phpbb_dispatcher = new phpbb_event_dispatcher(); $phpbb_dispatcher = new phpbb_event_dispatcher();
$request = new phpbb_request(); $request = new phpbb_request();
$user = new user(); $user = new phpbb_user();
$auth = new auth(); $auth = new phpbb_auth();
$db = new $sql_db(); $db = new $sql_db();
// make sure request_var uses this request instance // make sure request_var uses this request instance
@ -123,9 +121,11 @@ set_config_count(null, null, null, $config);
// load extensions // load extensions
$phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx", $cache->get_driver()); $phpbb_extension_manager = new phpbb_extension_manager($db, EXT_TABLE, $phpbb_root_path, ".$phpEx", $cache->get_driver());
$phpbb_template_locator = new phpbb_template_locator(); // Initialize style
$phpbb_template_path_provider = new phpbb_template_extension_path_provider($phpbb_extension_manager, new phpbb_template_path_provider()); $phpbb_style_resource_locator = new phpbb_style_resource_locator();
$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_template_locator, $phpbb_template_path_provider); $phpbb_style_path_provider = new phpbb_style_extension_path_provider($phpbb_extension_manager, new phpbb_style_path_provider());
$template = new phpbb_style_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider);
$phpbb_style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider, $template);
$phpbb_subscriber_loader = new phpbb_event_extension_subscriber_loader($phpbb_dispatcher, $phpbb_extension_manager); $phpbb_subscriber_loader = new phpbb_event_extension_subscriber_loader($phpbb_dispatcher, $phpbb_extension_manager);
$phpbb_subscriber_loader->load(); $phpbb_subscriber_loader->load();

View file

@ -1655,43 +1655,14 @@ function get_schema_struct()
'style_name' => array('VCHAR_UNI:255', ''), 'style_name' => array('VCHAR_UNI:255', ''),
'style_copyright' => array('VCHAR_UNI', ''), 'style_copyright' => array('VCHAR_UNI', ''),
'style_active' => array('BOOL', 1), 'style_active' => array('BOOL', 1),
'template_id' => array('UINT', 0), 'style_path' => array('VCHAR:100', ''),
'theme_id' => array('UINT', 0), 'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
'style_parent_id' => array('UINT:4', 0),
'style_parent_tree' => array('TEXT', ''),
), ),
'PRIMARY_KEY' => 'style_id', 'PRIMARY_KEY' => 'style_id',
'KEYS' => array( 'KEYS' => array(
'style_name' => array('UNIQUE', 'style_name'), 'style_name' => array('UNIQUE', 'style_name'),
'template_id' => array('INDEX', 'template_id'),
'theme_id' => array('INDEX', 'theme_id'),
),
);
$schema_data['phpbb_styles_template'] = array(
'COLUMNS' => array(
'template_id' => array('UINT', NULL, 'auto_increment'),
'template_name' => array('VCHAR_UNI:255', ''),
'template_copyright' => array('VCHAR_UNI', ''),
'template_path' => array('VCHAR:100', ''),
'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
'template_inherits_id' => array('UINT:4', 0),
'template_inherit_path' => array('VCHAR', ''),
),
'PRIMARY_KEY' => 'template_id',
'KEYS' => array(
'tmplte_nm' => array('UNIQUE', 'template_name'),
),
);
$schema_data['phpbb_styles_theme'] = array(
'COLUMNS' => array(
'theme_id' => array('UINT', NULL, 'auto_increment'),
'theme_name' => array('VCHAR_UNI:255', ''),
'theme_copyright' => array('VCHAR_UNI', ''),
'theme_path' => array('VCHAR:100', ''),
),
'PRIMARY_KEY' => 'theme_id',
'KEYS' => array(
'theme_name' => array('UNIQUE', 'theme_name'),
), ),
); );

View file

@ -1091,61 +1091,14 @@ function get_schema_struct()
'style_name' => array('VCHAR_UNI:255', ''), 'style_name' => array('VCHAR_UNI:255', ''),
'style_copyright' => array('VCHAR_UNI', ''), 'style_copyright' => array('VCHAR_UNI', ''),
'style_active' => array('BOOL', 1), 'style_active' => array('BOOL', 1),
'template_id' => array('UINT', 0), 'style_path' => array('VCHAR:100', ''),
'theme_id' => array('UINT', 0), 'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
'style_parent_id' => array('UINT:4', 0),
'style_parent_tree' => array('TEXT', ''),
), ),
'PRIMARY_KEY' => 'style_id', 'PRIMARY_KEY' => 'style_id',
'KEYS' => array( 'KEYS' => array(
'style_name' => array('UNIQUE', 'style_name'), 'style_name' => array('UNIQUE', 'style_name'),
'template_id' => array('INDEX', 'template_id'),
'theme_id' => array('INDEX', 'theme_id'),
),
);
$schema_data['phpbb_styles_template'] = array(
'COLUMNS' => array(
'template_id' => array('UINT', NULL, 'auto_increment'),
'template_name' => array('VCHAR_UNI:255', ''),
'template_copyright' => array('VCHAR_UNI', ''),
'template_path' => array('VCHAR:100', ''),
'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
'template_storedb' => array('BOOL', 0),
'template_inherits_id' => array('UINT:4', 0),
'template_inherit_path' => array('VCHAR', ''),
),
'PRIMARY_KEY' => 'template_id',
'KEYS' => array(
'tmplte_nm' => array('UNIQUE', 'template_name'),
),
);
$schema_data['phpbb_styles_template_data'] = array(
'COLUMNS' => array(
'template_id' => array('UINT', 0),
'template_filename' => array('VCHAR:100', ''),
'template_included' => array('TEXT', ''),
'template_mtime' => array('TIMESTAMP', 0),
'template_data' => array('MTEXT_UNI', ''),
),
'KEYS' => array(
'tid' => array('INDEX', 'template_id'),
'tfn' => array('INDEX', 'template_filename'),
),
);
$schema_data['phpbb_styles_theme'] = array(
'COLUMNS' => array(
'theme_id' => array('UINT', NULL, 'auto_increment'),
'theme_name' => array('VCHAR_UNI:255', ''),
'theme_copyright' => array('VCHAR_UNI', ''),
'theme_path' => array('VCHAR:100', ''),
'theme_storedb' => array('BOOL', 0),
'theme_mtime' => array('TIMESTAMP', 0),
'theme_data' => array('MTEXT_UNI', ''),
),
'PRIMARY_KEY' => 'theme_id',
'KEYS' => array(
'theme_name' => array('UNIQUE', 'theme_name'),
), ),
); );

View file

@ -86,7 +86,7 @@
<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> <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>
<div class="codebox"><pre> <div class="codebox"><pre>
$auth = new auth(); $auth = new phpbb_auth();
</pre></div> </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> <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>

View file

@ -71,7 +71,7 @@
<li><a href="#templating">Templating</a> <li><a href="#templating">Templating</a>
<ol style="list-style-type: lower-roman;"> <ol style="list-style-type: lower-roman;">
<li><a href="#templates">General Templating</a></li> <li><a href="#templates">General Templating</a></li>
<li><a href="#inheritance">Template Inheritance</a></li> <li><a href="#stylestree">Styles Tree</a></li>
</ol></li> </ol></li>
<li><a href="#charsets">Character Sets and Encodings</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> <li><a href="#translation">Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</a>
@ -248,7 +248,7 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p> <p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p>
<ul> <ul>
<li>/includes/session.php - user::img()</li> <li>/includes/user.php - phpbb_user::img()</li>
<li>/includes/functions_content.php - smiley_text()</li> <li>/includes/functions_content.php - smiley_text()</li>
</ul> </ul>
@ -1144,15 +1144,19 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<div class="content"> <div class="content">
<a name="cfgfiles"></a><h3>3.i. Style Config Files</h3> <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> <div class="codebox"><pre>
# General Information about this style # General Information about this style
name = prosilver_duplicate name = prosilver_duplicate
copyright = &copy; phpBB Group, 2007 copyright = &copy; phpBB Group, 2007
version = 3.0.3 version = 3.1.0
required_template = prosilver
required_theme = prosilver # Defining a different template bitfield
required_imageset = prosilver # 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> </pre></div>
<a name="genstyling"></a><h3>3.2. General Styling Rules</h3> <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> <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>
@ -1175,7 +1179,7 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;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>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> <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>
@ -1243,13 +1247,13 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;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> <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> <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> <div class="codebox"><pre>
<span class="comment">&lt;!-- INCLUDE filename --&gt;</span> <span class="comment">&lt;!-- INCLUDE filename --&gt;</span>
</pre></div> </pre></div>
<p>You will note in the 3.0 templates the major sources start with <code>&lt;!-- INCLUDE overall_header.html --&gt;</code> or <code>&lt;!-- INCLUDE simple_header.html --&gt;</code>, etc. In 2.0.x control of &quot;which&quot; 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 &quot;menu&quot; 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>&lt;!-- INCLUDE overall_header.html --&gt;</code> or <code>&lt;!-- INCLUDE simple_header.html --&gt;</code>, etc. In 2.0.x control of &quot;which&quot; 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 &quot;menu&quot; 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> <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> <div class="codebox"><pre>
@ -1281,7 +1285,7 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;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> <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> <h4>Conditionals/Control structures</h4>
<p>The most significant addition to 3.0.x are conditions or control structures, &quot;if something then do this else do that&quot;. 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, &quot;if something then do this else do that&quot;. 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> <div class="codebox"><pre>
<span class="comment">&lt;!-- IF expr --&gt;</span> <span class="comment">&lt;!-- IF expr --&gt;</span>
@ -1352,7 +1356,7 @@ div
<span class="comment">&lt;!-- ENDIF --&gt;</span> <span class="comment">&lt;!-- ENDIF --&gt;</span>
</pre></div> </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 &quot;everything else&quot;.<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 &quot;everything else&quot;.<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> <div class="codebox"><pre>
&lt;table&gt; &lt;table&gt;
@ -1623,24 +1627,25 @@ div
&lt;/form&gt; &lt;/form&gt;
</pre></div><br /> </pre></div><br />
<a name="inheritance"></a><h3>4.ii. Template Inheritance</h3> <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>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> <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> <div class="codebox"><pre>
# General Information about this template # General Information about this style
name = inherits name = Custom Style
copyright = &copy; phpBB Group, 2007 copyright = &amp;copy; phpBB Group, 2007
version = 3.0.3 version = 3.1.0
# Defining a different template bitfield # Defining a different template bitfield
template_bitfield = lNg= # template_bitfield = lNg=
# Are we inheriting? # Parent style
inherit_from = prosilver # Set value to empty or to this style's name if this style does not have a parent style
parent = prosilver
</pre></div> </pre></div>
</div> </div>

View file

@ -368,7 +368,7 @@ a:active { color: #368AD2; }
<p>In phpBB3 there are four functions you are able to hook into with your custom functions:</p> <p>In phpBB3 there are four functions you are able to hook into with your custom functions:</p>
<p><code>phpbb_user_session_handler();</code> which is called within user::setup after the session and the user object is correctly initialized.<br /> <p><code>phpbb_user_session_handler();</code> which is called within phpbb_user::setup after the session and the user object is correctly initialized.<br />
<code>append_sid($url, $params = false, $is_amp = true, $session_id = false);</code> which is called for building urls (appending the session id)<br /> <code>append_sid($url, $params = false, $is_amp = true, $session_id = false);</code> which is called for building urls (appending the session id)<br />
<code>$template-&gt;display($handle, $template);</code> which is called directly before outputting the (not-yet-compiled) template.<br /> <code>$template-&gt;display($handle, $template);</code> which is called directly before outputting the (not-yet-compiled) template.<br />
<code>exit_handler();</code> which is called at the very end of phpBB3's execution.</p> <code>exit_handler();</code> which is called at the very end of phpBB3's execution.</p>
@ -388,7 +388,7 @@ PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of $p
<p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p> <p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p>
<ul> <ul>
<li>/includes/session.php - user::img()</li> <li>/includes/user.php - phpbb_user::img()</li>
<li>/includes/functions_content.php - smiley_text()</li> <li>/includes/functions_content.php - smiley_text()</li>
</ul> </ul>

View file

@ -1105,7 +1105,7 @@ class acp_permissions
{ {
if ($user_id != $user->data['user_id']) if ($user_id != $user->data['user_id'])
{ {
$auth2 = new auth(); $auth2 = new phpbb_auth();
$auth2->acl($userdata); $auth2->acl($userdata);
$auth_setting = $auth2->acl_get($permission); $auth_setting = $auth2->acl_get($permission);
} }

File diff suppressed because it is too large Load diff

View file

@ -1554,7 +1554,7 @@ class acp_users
|| $user_row['user_allow_viewonline'] && !$sql_ary['user_allow_viewonline']) || $user_row['user_allow_viewonline'] && !$sql_ary['user_allow_viewonline'])
{ {
// We also need to check if the user has the permission to cloak. // We also need to check if the user has the permission to cloak.
$user_auth = new auth(); $user_auth = new phpbb_auth();
$user_auth->acl($user_row); $user_auth->acl($user_row);
$session_sql_ary = array( $session_sql_ary = array(

View file

@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
* ACP Permission/Auth class * ACP Permission/Auth class
* @package phpBB3 * @package phpBB3
*/ */
class auth_admin extends auth class auth_admin extends phpbb_auth
{ {
/** /**
* Init auth settings * Init auth settings
@ -130,7 +130,7 @@ class auth_admin extends auth
{ {
if ($user->data['user_id'] != $userdata['user_id']) if ($user->data['user_id'] != $userdata['user_id'])
{ {
$auth2 = new auth(); $auth2 = new phpbb_auth();
$auth2->acl($userdata); $auth2->acl($userdata);
} }
else else

View file

@ -17,11 +17,11 @@ class acp_styles_info
return array( return array(
'filename' => 'acp_styles', 'filename' => 'acp_styles',
'title' => 'ACP_CAT_STYLES', 'title' => 'ACP_CAT_STYLES',
'version' => '1.0.0', 'version' => '2.0.0',
'modes' => array( 'modes' => array(
'style' => array('title' => 'ACP_STYLES', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')), 'style' => array('title' => 'ACP_STYLES', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
'template' => array('title' => 'ACP_TEMPLATES', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_COMPONENTS')), 'install' => array('title' => 'ACP_STYLES_INSTALL', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
'theme' => array('title' => 'ACP_THEMES', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_COMPONENTS')), 'cache' => array('title' => 'ACP_STYLES_CACHE', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
), ),
); );
} }

View file

@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
* Permission/Auth class * Permission/Auth class
* @package phpBB3 * @package phpBB3
*/ */
class auth class phpbb_auth
{ {
var $acl = array(); var $acl = array();
var $cache = array(); var $cache = array();

View file

@ -132,12 +132,13 @@ class bbcode
{ {
$this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']); $this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
$template_locator = new phpbb_template_locator(); $style_resource_locator = new phpbb_style_resource_locator();
$template_path_provider = new phpbb_template_extension_path_provider($phpbb_extension_manager, new phpbb_template_path_provider()); $style_path_provider = new phpbb_style_extension_path_provider($phpbb_extension_manager, new phpbb_style_path_provider());
$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $template_locator, $template_path_provider); $template = new phpbb_style_template($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, $style_path_provider);
$template->set_template(); $style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, $style_path_provider, $template);
$template_locator->set_filenames(array('bbcode.html' => 'bbcode.html')); $style->set_style();
$this->template_filename = $template_locator->get_source_file_for_handle('bbcode.html'); $template->set_filenames(array('bbcode.html' => 'bbcode.html'));
$this->template_filename = $style_resource_locator->get_source_file_for_handle('bbcode.html');
} }
$bbcode_ids = $rowset = $sql = array(); $bbcode_ids = $rowset = $sql = array();

View file

@ -25,7 +25,7 @@ class phpbb_captcha_factory
/** /**
* return an instance of class $name in file $name_plugin.php * return an instance of class $name in file $name_plugin.php
*/ */
function get_instance($name) public static function get_instance($name)
{ {
global $phpbb_root_path, $phpEx; global $phpbb_root_path, $phpEx;

View file

@ -49,7 +49,7 @@ class phpbb_captcha_gd extends phpbb_default_captcha
} }
} }
function get_instance() public static function get_instance()
{ {
$instance = new phpbb_captcha_gd(); $instance = new phpbb_captcha_gd();
return $instance; return $instance;

View file

@ -39,7 +39,7 @@ class phpbb_captcha_gd_wave extends phpbb_default_captcha
} }
} }
function get_instance() public static function get_instance()
{ {
return new phpbb_captcha_gd_wave(); return new phpbb_captcha_gd_wave();
} }

View file

@ -39,7 +39,7 @@ class phpbb_captcha_nogd extends phpbb_default_captcha
} }
} }
function get_instance() public static function get_instance()
{ {
$instance = new phpbb_captcha_nogd(); $instance = new phpbb_captcha_nogd();
return $instance; return $instance;

View file

@ -98,7 +98,7 @@ class phpbb_captcha_qa
/** /**
* API function * API function
*/ */
function get_instance() public static function get_instance()
{ {
$instance = new phpbb_captcha_qa(); $instance = new phpbb_captcha_qa();

View file

@ -54,7 +54,7 @@ class phpbb_recaptcha extends phpbb_default_captcha
$this->response = request_var('recaptcha_response_field', ''); $this->response = request_var('recaptcha_response_field', '');
} }
function get_instance() public static function get_instance()
{ {
$instance = new phpbb_recaptcha(); $instance = new phpbb_recaptcha();
return $instance; return $instance;

View file

@ -2114,7 +2114,7 @@ class phpbb_db_tools
case 'mysql_40': case 'mysql_40':
case 'mysql_41': case 'mysql_41':
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD UNIQUE INDEX (' . implode(', ', $column) . ')'; $statements[] = 'ALTER TABLE ' . $table_name . ' ADD UNIQUE INDEX ' . $index_name . '(' . implode(', ', $column) . ')';
break; break;
case 'mssql': case 'mssql':

View file

@ -270,11 +270,12 @@ class phpbb_extension_finder
* Finds all directories matching the configured options * Finds all directories matching the configured options
* *
* @param bool $cache Whether the result should be cached * @param bool $cache Whether the result should be cached
* @param bool $extension_keys Whether the result should have extension name as array key
* @return array An array of paths to found directories * @return array An array of paths to found directories
*/ */
public function get_directories($cache = true) public function get_directories($cache = true, $extension_keys = false)
{ {
return $this->find_with_root_path($cache, true); return $this->find_with_root_path($cache, true, $extension_keys);
} }
/** /**
@ -294,17 +295,26 @@ class phpbb_extension_finder
* @param bool $cache Whether the result should be cached * @param bool $cache Whether the result should be cached
* @param bool $is_dir Directories will be returned when true, only files * @param bool $is_dir Directories will be returned when true, only files
* otherwise * otherwise
* @param bool $extension_keys If true, result will be associative array
* with extension name as key
* @return array An array of paths to found items * @return array An array of paths to found items
*/ */
protected function find_with_root_path($cache = true, $is_dir = false) protected function find_with_root_path($cache = true, $is_dir = false, $extension_keys = false)
{ {
$items = $this->find($cache, $is_dir); $items = $this->find($cache, $is_dir);
$result = array(); $result = array();
foreach ($items as $item => $ext_name) foreach ($items as $item => $ext_name)
{
if ($extension_keys)
{
$result[$ext_name] = $this->phpbb_root_path . $item;
}
else
{ {
$result[] = $this->phpbb_root_path . $item; $result[] = $this->phpbb_root_path . $item;
} }
}
return $result; return $result;
} }

View file

@ -3117,9 +3117,9 @@ function parse_cfg_file($filename, $lines = false)
$parsed_items[$key] = $value; $parsed_items[$key] = $value;
} }
if (isset($parsed_items['inherit_from']) && isset($parsed_items['name']) && $parsed_items['inherit_from'] == $parsed_items['name']) if (isset($parsed_items['parent']) && isset($parsed_items['name']) && $parsed_items['parent'] == $parsed_items['name'])
{ {
unset($parsed_items['inherit_from']); unset($parsed_items['parent']);
} }
return $parsed_items; return $parsed_items;
@ -4768,9 +4768,9 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields), 'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),
'T_ASSETS_PATH' => "{$web_path}assets", 'T_ASSETS_PATH' => "{$web_path}assets",
'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['theme_path']) . '/theme', 'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme',
'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['template_path']) . '/template', 'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/template',
'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . rawurlencode($user->theme['template_inherit_path']) . '/template' : "{$web_path}styles/" . rawurlencode($user->theme['template_path']) . '/template', 'T_SUPER_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/template',
'T_IMAGES_PATH' => "{$web_path}images/", 'T_IMAGES_PATH' => "{$web_path}images/",
'T_SMILIES_PATH' => "{$web_path}{$config['smilies_path']}/", 'T_SMILIES_PATH' => "{$web_path}{$config['smilies_path']}/",
'T_AVATAR_PATH' => "{$web_path}{$config['avatar_path']}/", 'T_AVATAR_PATH' => "{$web_path}{$config['avatar_path']}/",
@ -4778,16 +4778,16 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0
'T_ICONS_PATH' => "{$web_path}{$config['icons_path']}/", 'T_ICONS_PATH' => "{$web_path}{$config['icons_path']}/",
'T_RANKS_PATH' => "{$web_path}{$config['ranks_path']}/", 'T_RANKS_PATH' => "{$web_path}{$config['ranks_path']}/",
'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/", 'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/",
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->theme['theme_path']) . '/theme/stylesheet.css', 'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme/stylesheet.css',
'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . rawurlencode($user->theme['theme_path']) . '/theme/' . $user->lang_name . '/stylesheet.css', 'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . rawurlencode($user->theme['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css',
'T_STYLESHEET_NAME' => $user->theme['theme_name'], 'T_STYLESHEET_NAME' => $user->theme['style_name'],
'T_JQUERY_LINK' => ($config['load_jquery_cdn'] && !empty($config['load_jquery_url'])) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.js", 'T_JQUERY_LINK' => ($config['load_jquery_cdn'] && !empty($config['load_jquery_url'])) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.js",
'S_JQUERY_FALLBACK' => ($config['load_jquery_cdn']) ? true : false, 'S_JQUERY_FALLBACK' => ($config['load_jquery_cdn']) ? true : false,
'T_THEME_NAME' => rawurlencode($user->theme['theme_path']), 'T_THEME_NAME' => rawurlencode($user->theme['style_path']),
'T_THEME_LANG_NAME' => $user->data['user_lang'], 'T_THEME_LANG_NAME' => $user->data['user_lang'],
'T_TEMPLATE_NAME' => $user->theme['template_path'], 'T_TEMPLATE_NAME' => $user->theme['style_path'],
'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? $user->theme['template_inherit_path'] : $user->theme['template_path']), 'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->theme['style_parent_tree']) && $user->theme['style_parent_tree']) ? $user->theme['style_parent_tree'] : $user->theme['style_path']),
'T_IMAGES' => 'images', 'T_IMAGES' => 'images',
'T_SMILIES' => $config['smilies_path'], 'T_SMILIES' => $config['smilies_path'],
'T_AVATAR' => $config['avatar_path'], 'T_AVATAR' => $config['avatar_path'],
@ -4860,6 +4860,7 @@ function page_footer($run_cron = true)
$template->assign_vars(array( $template->assign_vars(array(
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group'),
'U_ACP' => ($auth->acl_get('a_') && !empty($user->data['is_registered'])) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", false, true, $user->session_id) : '') 'U_ACP' => ($auth->acl_get('a_') && !empty($user->data['is_registered'])) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", false, true, $user->session_id) : '')
); );
@ -4949,7 +4950,7 @@ function exit_handler()
} }
/** /**
* Handler for init calls in phpBB. This function is called in user::setup(); * Handler for init calls in phpBB. This function is called in phpbb_user::setup();
* This function supports hooks. * This function supports hooks.
*/ */
function phpbb_user_session_handler() function phpbb_user_session_handler()

View file

@ -131,6 +131,7 @@ function adm_page_footer($copyright_html = true)
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '', 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
'S_COPYRIGHT_HTML' => $copyright_html, 'S_COPYRIGHT_HTML' => $copyright_html,
'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group'),
'T_JQUERY_LINK' => ($config['load_jquery_cdn'] && !empty($config['load_jquery_url'])) ? $config['load_jquery_url'] : "{$phpbb_root_path}assets/javascript/jquery.js", 'T_JQUERY_LINK' => ($config['load_jquery_cdn'] && !empty($config['load_jquery_url'])) ? $config['load_jquery_url'] : "{$phpbb_root_path}assets/javascript/jquery.js",
'S_JQUERY_FALLBACK' => ($config['load_jquery_cdn']) ? true : false, 'S_JQUERY_FALLBACK' => ($config['load_jquery_cdn']) ? true : false,
'VERSION' => $config['version']) 'VERSION' => $config['version'])

View file

@ -739,7 +739,7 @@ function smiley_text($text, $force_option = false)
else else
{ {
$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path; $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img src="' . $root_path . $config['smilies_path'] . '/\2 />', $text); return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img class="smilies" src="' . $root_path . $config['smilies_path'] . '/\2 />', $text);
} }
} }

View file

@ -201,17 +201,18 @@ class messenger
{ {
// fall back to board default language if the user's language is // fall back to board default language if the user's language is
// missing $template_file. If this does not exist either, // missing $template_file. If this does not exist either,
// $tpl->set_custom_template will do a trigger_error // $tpl->set_filenames will do a trigger_error
$template_lang = basename($config['default_lang']); $template_lang = basename($config['default_lang']);
} }
// tpl_msg now holds a template object we can use to parse the template file // tpl_msg now holds a template object we can use to parse the template file
if (!isset($this->tpl_msg[$template_lang . $template_file])) if (!isset($this->tpl_msg[$template_lang . $template_file]))
{ {
$template_locator = new phpbb_template_locator(); $style_resource_locator = new phpbb_style_resource_locator();
$template_path_provider = new phpbb_template_extension_path_provider($phpbb_extension_manager, new phpbb_template_path_provider()); $style_path_provider = new phpbb_style_extension_path_provider($phpbb_extension_manager, new phpbb_style_path_provider());
$this->tpl_msg[$template_lang . $template_file] = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $template_locator, $template_path_provider); $tpl = new phpbb_style_template($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, $style_path_provider);
$tpl = &$this->tpl_msg[$template_lang . $template_file]; $style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $style_resource_locator, $style_path_provider, $tpl);
$this->tpl_msg[$template_lang . $template_file] = $tpl;
$fallback_template_path = false; $fallback_template_path = false;
@ -229,7 +230,7 @@ class messenger
} }
} }
$tpl->set_custom_template($template_path, $template_lang . '_email', $fallback_template_path); $style->set_custom_style($template_lang . '_email', array($template_path, $fallback_template_path), '');
$tpl->set_filenames(array( $tpl->set_filenames(array(
'body' => $template_file . '.txt', 'body' => $template_file . '.txt',

View file

@ -495,8 +495,15 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
if ($free_space = @disk_free_space($phpbb_root_path . $config['upload_path'])) if ($free_space = @disk_free_space($phpbb_root_path . $config['upload_path']))
{ {
if ($free_space <= $file->get('filesize')) if ($free_space <= $file->get('filesize'))
{
if ($auth->acl_get('a_'))
{
$filedata['error'][] = $user->lang['ATTACH_DISK_FULL'];
}
else
{ {
$filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED'];
}
$filedata['post_attach'] = false; $filedata['post_attach'] = false;
$file->remove(); $file->remove();

View file

@ -343,7 +343,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
$userdata = $db->sql_fetchrow($result); $userdata = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
$auth2 = new auth(); $auth2 = new phpbb_auth();
$auth2->acl($userdata); $auth2->acl($userdata);
if (!$auth2->acl_get('a_') && !$auth2->acl_get('m_') && !$auth2->acl_getf_global('m_')) if (!$auth2->acl_get('a_') && !$auth2->acl_get('m_') && !$auth2->acl_getf_global('m_'))

View file

@ -555,7 +555,7 @@ class custom_profile
{ {
global $user; global $user;
// Date should display as the same date for every user regardless of timezone, so remove offset // Date should display as the same date for every user regardless of timezone, so remove offset
// to compensate for the offset added by user::format_date() // to compensate for the offset added by phpbb_user::format_date()
return $user->format_date(gmmktime(0, 0, 0, $month, $day, $year) - ($user->timezone + $user->dst), $user->lang['DATE_FORMAT'], true); return $user->format_date(gmmktime(0, 0, 0, $month, $day, $year) - ($user->timezone + $user->dst), $user->lang['DATE_FORMAT'], true);
} }

View file

@ -1947,6 +1947,27 @@ function validate_jabber($jid)
return false; return false;
} }
/**
* Verifies whether a style ID corresponds to an active style.
*
* @param int $style_id The style_id of a style which should be checked if activated or not.
* @return boolean
*/
function phpbb_style_is_active($style_id)
{
global $db;
$sql = 'SELECT style_active
FROM ' . STYLES_TABLE . '
WHERE style_id = '. (int) $style_id;
$result = $db->sql_query($sql);
$style_is_active = (bool) $db->sql_fetchfield('style_active');
$db->sql_freeresult($result);
return $style_is_active;
}
/** /**
* Remove avatar * Remove avatar
*/ */

View file

@ -251,7 +251,7 @@ class mcp_warn
// Check if can send a notification // Check if can send a notification
if ($config['allow_privmsg']) if ($config['allow_privmsg'])
{ {
$auth2 = new auth(); $auth2 = new phpbb_auth();
$auth2->acl($user_row); $auth2->acl($user_row);
$s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false; $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
unset($auth2); unset($auth2);
@ -374,7 +374,7 @@ class mcp_warn
// Check if can send a notification // Check if can send a notification
if ($config['allow_privmsg']) if ($config['allow_privmsg'])
{ {
$auth2 = new auth(); $auth2 = new phpbb_auth();
$auth2->acl($user_row); $auth2->acl($user_row);
$s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false; $s_can_notify = ($auth2->acl_get('u_readpm')) ? true : false;
unset($auth2); unset($auth2);

View file

@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
* Session class * Session class
* @package phpBB3 * @package phpBB3
*/ */
class session class phpbb_session
{ {
var $cookie_data = array(); var $cookie_data = array();
var $page = array(); var $page = array();
@ -1511,843 +1511,3 @@ class session
$db->sql_query($sql); $db->sql_query($sql);
} }
} }
/**
* Base user class
*
* This is the overarching class which contains (through session extend)
* all methods utilised for user functionality during a session.
*
* @package phpBB3
*/
class user extends session
{
var $lang = array();
var $help = array();
var $theme = array();
var $date_format;
var $timezone;
var $dst;
var $lang_name = false;
var $lang_id = false;
var $lang_path;
var $img_lang;
var $img_array = array();
// Able to add new options (up to id 31)
var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);
/**
* Constructor to set the lang path
*/
function user()
{
global $phpbb_root_path;
$this->lang_path = $phpbb_root_path . 'language/';
}
/**
* Function to set custom language path (able to use directory outside of phpBB)
*
* @param string $lang_path New language path used.
* @access public
*/
function set_custom_lang_path($lang_path)
{
$this->lang_path = $lang_path;
if (substr($this->lang_path, -1) != '/')
{
$this->lang_path .= '/';
}
}
/**
* Setup basic user-specific items (style, language, ...)
*/
function setup($lang_set = false, $style = false)
{
global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
if ($this->data['user_id'] != ANONYMOUS)
{
$this->lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
$this->date_format = $this->data['user_dateformat'];
$this->timezone = $this->data['user_timezone'] * 3600;
$this->dst = $this->data['user_dst'] * 3600;
}
else
{
$this->lang_name = basename($config['default_lang']);
$this->date_format = $config['default_dateformat'];
$this->timezone = $config['board_timezone'] * 3600;
$this->dst = $config['board_dst'] * 3600;
/**
* If a guest user is surfing, we try to guess his/her language first by obtaining the browser language
* If re-enabled we need to make sure only those languages installed are checked
* Commented out so we do not loose the code.
if ($request->header('Accept-Language'))
{
$accept_lang_ary = explode(',', $request->header('Accept-Language'));
foreach ($accept_lang_ary as $accept_lang)
{
// Set correct format ... guess full xx_YY form
$accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2));
$accept_lang = basename($accept_lang);
if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx"))
{
$this->lang_name = $config['default_lang'] = $accept_lang;
break;
}
else
{
// No match on xx_YY so try xx
$accept_lang = substr($accept_lang, 0, 2);
$accept_lang = basename($accept_lang);
if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx"))
{
$this->lang_name = $config['default_lang'] = $accept_lang;
break;
}
}
}
}
*/
}
// We include common language file here to not load it every time a custom language file is included
$lang = &$this->lang;
// Do not suppress error if in DEBUG_EXTRA mode
$include_result = (defined('DEBUG_EXTRA')) ? (include $this->lang_path . $this->lang_name . "/common.$phpEx") : (@include $this->lang_path . $this->lang_name . "/common.$phpEx");
if ($include_result === false)
{
die('Language file ' . $this->lang_path . $this->lang_name . "/common.$phpEx" . " couldn't be opened.");
}
$this->add_lang($lang_set);
unset($lang_set);
$style_request = request_var('style', 0);
if ($style_request && $auth->acl_get('a_styles') && !defined('ADMIN_START'))
{
global $SID, $_EXTRA_URL;
$style = $style_request;
$SID .= '&amp;style=' . $style;
$_EXTRA_URL = array('style=' . $style);
}
else
{
// Set up style
$style = ($style) ? $style : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);
}
$sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_name, c.theme_id
FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . " c
WHERE s.style_id = $style
AND t.template_id = s.template_id
AND c.theme_id = s.theme_id";
$result = $db->sql_query($sql, 3600);
$this->theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// User has wrong style
if (!$this->theme && $style == $this->data['user_style'])
{
$style = $this->data['user_style'] = $config['default_style'];
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_style = $style
WHERE user_id = {$this->data['user_id']}";
$db->sql_query($sql);
$sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_id
FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . " c
WHERE s.style_id = $style
AND t.template_id = s.template_id
AND c.theme_id = s.theme_id";
$result = $db->sql_query($sql, 3600);
$this->theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
}
if (!$this->theme)
{
trigger_error('Could not get style data', E_USER_ERROR);
}
// Now parse the cfg file and cache it
$parsed_items = $cache->obtain_cfg_items($this->theme);
// We are only interested in the theme configuration for now
$parsed_items = $parsed_items['theme'];
$check_for = array(
'pagination_sep' => (string) ', '
);
foreach ($check_for as $key => $default_value)
{
$this->theme[$key] = (isset($parsed_items[$key])) ? $parsed_items[$key] : $default_value;
settype($this->theme[$key], gettype($default_value));
if (is_string($default_value))
{
$this->theme[$key] = htmlspecialchars($this->theme[$key]);
}
}
$template->set_template();
$this->img_lang = $this->lang_name;
// Call phpbb_user_session_handler() in case external application want to "bend" some variables or replace classes...
// After calling it we continue script execution...
phpbb_user_session_handler();
// If this function got called from the error handler we are finished here.
if (defined('IN_ERROR_HANDLER'))
{
return;
}
// Disable board if the install/ directory is still present
// For the brave development army we do not care about this, else we need to comment out this everytime we develop locally
if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
{
// Adjust the message slightly according to the permissions
if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))
{
$message = 'REMOVE_INSTALL';
}
else
{
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
}
trigger_error($message);
}
// Is board disabled and user not an admin or moderator?
if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
{
if ($this->data['is_bot'])
{
send_status_line(503, 'Service Unavailable');
}
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
trigger_error($message);
}
// Is load exceeded?
if ($config['limit_load'] && $this->load !== false)
{
if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !defined('IN_ADMIN'))
{
// Set board disabled to true to let the admins/mods get the proper notification
$config['board_disable'] = '1';
if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
{
if ($this->data['is_bot'])
{
send_status_line(503, 'Service Unavailable');
}
trigger_error('BOARD_UNAVAILABLE');
}
}
}
if (isset($this->data['session_viewonline']))
{
// Make sure the user is able to hide his session
if (!$this->data['session_viewonline'])
{
// Reset online status if not allowed to hide the session...
if (!$auth->acl_get('u_hideonline'))
{
$sql = 'UPDATE ' . SESSIONS_TABLE . '
SET session_viewonline = 1
WHERE session_user_id = ' . $this->data['user_id'];
$db->sql_query($sql);
$this->data['session_viewonline'] = 1;
}
}
else if (!$this->data['user_allow_viewonline'])
{
// the user wants to hide and is allowed to -> cloaking device on.
if ($auth->acl_get('u_hideonline'))
{
$sql = 'UPDATE ' . SESSIONS_TABLE . '
SET session_viewonline = 0
WHERE session_user_id = ' . $this->data['user_id'];
$db->sql_query($sql);
$this->data['session_viewonline'] = 0;
}
}
}
// Does the user need to change their password? If so, redirect to the
// ucp profile reg_details page ... of course do not redirect if we're already in the ucp
if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && !empty($this->data['is_registered']) && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
{
if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != "ucp.$phpEx")
{
redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=reg_details'));
}
}
return;
}
/**
* More advanced language substitution
* Function to mimic sprintf() with the possibility of using phpBB's language system to substitute nullar/singular/plural forms.
* Params are the language key and the parameters to be substituted.
* This function/functionality is inspired by SHS` and Ashe.
*
* Example call: <samp>$user->lang('NUM_POSTS_IN_QUEUE', 1);</samp>
*
* If the first parameter is an array, the elements are used as keys and subkeys to get the language entry:
* Example: <samp>$user->lang(array('datetime', 'AGO'), 1)</samp> uses $user->lang['datetime']['AGO'] as language entry.
*/
function lang()
{
$args = func_get_args();
$key = $args[0];
if (is_array($key))
{
$lang = &$this->lang[array_shift($key)];
foreach ($key as $_key)
{
$lang = &$lang[$_key];
}
}
else
{
$lang = &$this->lang[$key];
}
// Return if language string does not exist
if (!isset($lang) || (!is_string($lang) && !is_array($lang)))
{
return $key;
}
// If the language entry is a string, we simply mimic sprintf() behaviour
if (is_string($lang))
{
if (sizeof($args) == 1)
{
return $lang;
}
// Replace key with language entry and simply pass along...
$args[0] = $lang;
return call_user_func_array('sprintf', $args);
}
else if (sizeof($lang) == 0)
{
// If the language entry is an empty array, we just return the language key
return $args[0];
}
// It is an array... now handle different nullar/singular/plural forms
$key_found = false;
// We now get the first number passed and will select the key based upon this number
for ($i = 1, $num_args = sizeof($args); $i < $num_args; $i++)
{
if (is_int($args[$i]) || is_float($args[$i]))
{
if ($args[$i] == 0 && isset($lang[0]))
{
// We allow each translation using plural forms to specify a version for the case of 0 things,
// so that "0 users" may be displayed as "No users".
$key_found = 0;
break;
}
else
{
$use_plural_form = $this->get_plural_form($args[$i]);
if (isset($lang[$use_plural_form]))
{
// The key we should use exists, so we use it.
$key_found = $use_plural_form;
}
else
{
// If the key we need to use does not exist, we fall back to the previous one.
$numbers = array_keys($lang);
foreach ($numbers as $num)
{
if ($num > $use_plural_form)
{
break;
}
$key_found = $num;
}
}
break;
}
}
}
// Ok, let's check if the key was found, else use the last entry (because it is mostly the plural form)
if ($key_found === false)
{
$numbers = array_keys($lang);
$key_found = end($numbers);
}
// Use the language string we determined and pass it to sprintf()
$args[0] = $lang[$key_found];
return call_user_func_array('sprintf', $args);
}
/**
* Determine which plural form we should use.
* For some languages this is not as simple as for English.
*
* @param $number int|float The number we want to get the plural case for. Float numbers are floored.
* @param $force_rule mixed False to use the plural rule of the language package
* or an integer to force a certain plural rule
* @return int The plural-case we need to use for the number plural-rule combination
*/
function get_plural_form($number, $force_rule = false)
{
$number = (int) $number;
// Default to English system
$plural_rule = ($force_rule !== false) ? $force_rule : ((isset($this->lang['PLURAL_RULE'])) ? $this->lang['PLURAL_RULE'] : 1);
return phpbb_get_plural_form($plural_rule, $number);
}
/**
* Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion)
*
* @param mixed $lang_set specifies the language entries to include
* @param bool $use_db internal variable for recursion, do not use
* @param bool $use_help internal variable for recursion, do not use
* @param string $ext_name The extension to load language from, or empty for core files
*
* Examples:
* <code>
* $lang_set = array('posting', 'help' => 'faq');
* $lang_set = array('posting', 'viewtopic', 'help' => array('bbcode', 'faq'))
* $lang_set = array(array('posting', 'viewtopic'), 'help' => array('bbcode', 'faq'))
* $lang_set = 'posting'
* $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting'))
* </code>
*/
function add_lang($lang_set, $use_db = false, $use_help = false, $ext_name = '')
{
global $phpEx;
if (is_array($lang_set))
{
foreach ($lang_set as $key => $lang_file)
{
// Please do not delete this line.
// We have to force the type here, else [array] language inclusion will not work
$key = (string) $key;
if ($key == 'db')
{
$this->add_lang($lang_file, true, $use_help, $ext_name);
}
else if ($key == 'help')
{
$this->add_lang($lang_file, $use_db, true, $ext_name);
}
else if (!is_array($lang_file))
{
$this->set_lang($this->lang, $this->help, $lang_file, $use_db, $use_help, $ext_name);
}
else
{
$this->add_lang($lang_file, $use_db, $use_help, $ext_name);
}
}
unset($lang_set);
}
else if ($lang_set)
{
$this->set_lang($this->lang, $this->help, $lang_set, $use_db, $use_help, $ext_name);
}
}
/**
* Add Language Items from an extension - use_db and use_help are assigned where needed (only use them to force inclusion)
*
* @param string $ext_name The extension to load language from, or empty for core files
* @param mixed $lang_set specifies the language entries to include
* @param bool $use_db internal variable for recursion, do not use
* @param bool $use_help internal variable for recursion, do not use
*/
function add_lang_ext($ext_name, $lang_set, $use_db = false, $use_help = false)
{
if ($ext_name === '/')
{
$ext_name = '';
}
$this->add_lang($lang_set, $use_db, $use_help, $ext_name);
}
/**
* Set language entry (called by add_lang)
* @access private
*/
function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false, $ext_name = '')
{
global $phpbb_root_path, $phpEx;
// Make sure the language name is set (if the user setup did not happen it is not set)
if (!$this->lang_name)
{
global $config;
$this->lang_name = basename($config['default_lang']);
}
// $lang == $this->lang
// $help == $this->help
// - add appropriate variables here, name them as they are used within the language file...
if (!$use_db)
{
if ($use_help && strpos($lang_file, '/') !== false)
{
$filename = dirname($lang_file) . '/help_' . basename($lang_file);
}
else
{
$filename = (($use_help) ? 'help_' : '') . $lang_file;
}
if ($ext_name)
{
global $phpbb_extension_manager;
$ext_path = $phpbb_extension_manager->get_extension_path($ext_name, true);
$lang_path = $ext_path . 'language/';
}
else
{
$lang_path = $this->lang_path;
}
if (strpos($phpbb_root_path . $filename, $lang_path . $this->lang_name . '/') === 0)
{
$language_filename = $phpbb_root_path . $filename;
}
else
{
$language_filename = $lang_path . $this->lang_name . '/' . $filename . '.' . $phpEx;
}
if (!file_exists($language_filename))
{
global $config;
if ($this->lang_name == 'en')
{
// The user's selected language is missing the file, the board default's language is missing the file, and the file doesn't exist in /en.
$language_filename = str_replace($lang_path . 'en', $lang_path . $this->data['user_lang'], $language_filename);
trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
}
else if ($this->lang_name == basename($config['default_lang']))
{
// Fall back to the English Language
$this->lang_name = 'en';
$this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name);
}
else if ($this->lang_name == $this->data['user_lang'])
{
// Fall back to the board default language
$this->lang_name = basename($config['default_lang']);
$this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name);
}
// Reset the lang name
$this->lang_name = (file_exists($lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
return;
}
// Do not suppress error if in DEBUG_EXTRA mode
$include_result = (defined('DEBUG_EXTRA')) ? (include $language_filename) : (@include $language_filename);
if ($include_result === false)
{
trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
}
}
else if ($use_db)
{
// Get Database Language Strings
// Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed
// For example: help:faq, posting
}
}
/**
* Format user date
*
* @param int $gmepoch unix timestamp
* @param string $format date format in date() notation. | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i.
* @param bool $forcedate force non-relative date format.
*
* @return mixed translated date
*/
function format_date($gmepoch, $format = false, $forcedate = false)
{
static $midnight;
static $date_cache;
$format = (!$format) ? $this->date_format : $format;
$now = time();
$delta = $now - $gmepoch;
if (!isset($date_cache[$format]))
{
// Is the user requesting a friendly date format (i.e. 'Today 12:42')?
$date_cache[$format] = array(
'is_short' => strpos($format, '|'),
'format_short' => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1),
'format_long' => str_replace('|', '', $format),
'lang' => $this->lang['datetime'],
);
// Short representation of month in format? Some languages use different terms for the long and short format of May
if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false))
{
$date_cache[$format]['lang']['May'] = $this->lang['datetime']['May_short'];
}
}
// Zone offset
$zone_offset = $this->timezone + $this->dst;
// Show date < 1 hour ago as 'xx min ago' but not greater than 60 seconds in the future
// A small tolerence is given for times in the future but in the same minute are displayed as '< than a minute ago'
if ($delta < 3600 && $delta > -60 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
{
return $this->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60)));
}
if (!$midnight)
{
list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $zone_offset));
$midnight = gmmktime(0, 0, 0, $m, $d, $y) - $zone_offset;
}
if ($date_cache[$format]['is_short'] !== false && !$forcedate && !($gmepoch < $midnight - 86400 || $gmepoch > $midnight + 172800))
{
$day = false;
if ($gmepoch > $midnight + 86400)
{
$day = 'TOMORROW';
}
else if ($gmepoch > $midnight)
{
$day = 'TODAY';
}
else if ($gmepoch > $midnight - 86400)
{
$day = 'YESTERDAY';
}
if ($day !== false)
{
return str_replace('||', $this->lang['datetime'][$day], strtr(@gmdate($date_cache[$format]['format_short'], $gmepoch + $zone_offset), $date_cache[$format]['lang']));
}
}
return strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $zone_offset), $date_cache[$format]['lang']);
}
/**
* Get language id currently used by the user
*/
function get_iso_lang_id()
{
global $config, $db;
if (!empty($this->lang_id))
{
return $this->lang_id;
}
if (!$this->lang_name)
{
$this->lang_name = $config['default_lang'];
}
$sql = 'SELECT lang_id
FROM ' . LANG_TABLE . "
WHERE lang_iso = '" . $db->sql_escape($this->lang_name) . "'";
$result = $db->sql_query($sql);
$this->lang_id = (int) $db->sql_fetchfield('lang_id');
$db->sql_freeresult($result);
return $this->lang_id;
}
/**
* Get users profile fields
*/
function get_profile_fields($user_id)
{
global $db;
if (isset($this->profile_fields))
{
return;
}
$sql = 'SELECT *
FROM ' . PROFILE_FIELDS_DATA_TABLE . "
WHERE user_id = $user_id";
$result = $db->sql_query_limit($sql, 1);
$this->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row;
$db->sql_freeresult($result);
}
/**
* Specify/Get image
*/
function img($img, $alt = '')
{
$alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt;
return '<span class="imageset ' . $img . '">' . $alt . '</span>';
}
/**
* Get option bit field from user options.
*
* @param int $key option key, as defined in $keyoptions property.
* @param int $data bit field value to use, or false to use $this->data['user_options']
* @return bool true if the option is set in the bit field, false otherwise
*/
function optionget($key, $data = false)
{
$var = ($data !== false) ? $data : $this->data['user_options'];
return phpbb_optionget($this->keyoptions[$key], $var);
}
/**
* Set option bit field for user options.
*
* @param int $key Option key, as defined in $keyoptions property.
* @param bool $value True to set the option, false to clear the option.
* @param int $data Current bit field value, or false to use $this->data['user_options']
* @return int|bool If $data is false, the bit field is modified and
* written back to $this->data['user_options'], and
* return value is true if the bit field changed and
* false otherwise. If $data is not false, the new
* bitfield value is returned.
*/
function optionset($key, $value, $data = false)
{
$var = ($data !== false) ? $data : $this->data['user_options'];
$new_var = phpbb_optionset($this->keyoptions[$key], $value, $var);
if ($data === false)
{
if ($new_var != $var)
{
$this->data['user_options'] = $new_var;
return true;
}
else
{
return false;
}
}
else
{
return $new_var;
}
}
/**
* Funtion to make the user leave the NEWLY_REGISTERED system group.
* @access public
*/
function leave_newly_registered()
{
global $db;
if (empty($this->data['user_new']))
{
return false;
}
if (!function_exists('remove_newly_registered'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
if ($group = remove_newly_registered($this->data['user_id'], $this->data))
{
$this->data['group_id'] = $group;
}
$this->data['user_permissions'] = '';
$this->data['user_new'] = 0;
return true;
}
/**
* Returns all password protected forum ids the user is currently NOT authenticated for.
*
* @return array Array of forum ids
* @access public
*/
function get_passworded_forums()
{
global $db;
$sql = 'SELECT f.forum_id, fa.user_id
FROM ' . FORUMS_TABLE . ' f
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa
ON (fa.forum_id = f.forum_id
AND fa.session_id = '" . $db->sql_escape($this->session_id) . "')
WHERE f.forum_password <> ''";
$result = $db->sql_query($sql);
$forum_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$forum_id = (int) $row['forum_id'];
if ($row['user_id'] != $this->data['user_id'])
{
$forum_ids[$forum_id] = $forum_id;
}
}
$db->sql_freeresult($result);
return $forum_ids;
}
}

View file

@ -0,0 +1,119 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Provides a style resource locator with core style paths and extension style paths
*
* Finds installed style paths and makes them available to the resource locator.
*
* @package phpBB3
*/
class phpbb_style_extension_path_provider extends phpbb_extension_provider implements phpbb_style_path_provider_interface
{
/**
* Optional prefix for style paths searched within extensions.
*
* Empty by default. Relative to the extension directory. As an example, it
* could be adm/ for admin style.
*
* @var string
*/
protected $ext_dir_prefix = '';
/**
* A provider of paths to be searched for styles
* @var phpbb_style_path_provider
*/
protected $base_path_provider;
/**
* Constructor stores extension manager
*
* @param phpbb_extension_manager $extension_manager phpBB extension manager
* @param phpbb_style_path_provider $base_path_provider A simple path provider
* to provide paths to be located in extensions
*/
public function __construct(phpbb_extension_manager $extension_manager, phpbb_style_path_provider $base_path_provider)
{
parent::__construct($extension_manager);
$this->base_path_provider = $base_path_provider;
}
/**
* Sets a prefix for style paths searched within extensions.
*
* The prefix is inserted between the extension's path e.g. ext/foo/ and
* the looked up style path, e.g. styles/bar/. So it should not have a
* leading slash, but should have a trailing slash.
*
* @param string $ext_dir_prefix The prefix including trailing slash
* @return null
*/
public function set_ext_dir_prefix($ext_dir_prefix)
{
$this->ext_dir_prefix = $ext_dir_prefix;
}
/**
* Finds style paths using the extension manager
*
* Locates a path (e.g. styles/prosilver/) in all active extensions.
* Then appends the core style paths based in the current working
* directory.
*
* @return array List of style paths
*/
public function find()
{
$directories = array();
$finder = $this->extension_manager->get_finder();
foreach ($this->base_path_provider as $key => $paths)
{
if ($key == 'style')
{
foreach ($paths as $path)
{
$directories['style'][] = $path;
if ($path && !phpbb_is_absolute($path))
{
$result = $finder->directory('/' . $this->ext_dir_prefix . $path)
->get_directories(true, true);
foreach ($result as $ext => $ext_path)
{
$directories[$ext][] = $ext_path;
}
}
}
}
}
return $directories;
}
/**
* Overwrites the current style paths
*
* @param array $styles An array of style paths. The first element is the main style.
* @return null
*/
public function set_styles(array $styles)
{
$this->base_path_provider->set_styles($styles);
$this->items = null;
}
}

View file

@ -0,0 +1,62 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Provides a style resource locator with paths
*
* Finds installed style paths and makes them available to the resource locator.
*
* @package phpBB3
*/
class phpbb_style_path_provider implements IteratorAggregate, phpbb_style_path_provider_interface
{
protected $paths = array();
/**
* Ignores the extension dir prefix
*
* @param string $ext_dir_prefix The prefix including trailing slash
* @return null
*/
public function set_ext_dir_prefix($ext_dir_prefix)
{
}
/**
* Overwrites the current style paths
*
* The first element of the passed styles map, is considered the main
* style.
*
* @param array $styles An array of style paths. The first element is the main style.
* @return null
*/
public function set_styles(array $styles)
{
$this->paths = array('style' => $styles);
}
/**
* Retrieve an iterator over all style paths
*
* @return ArrayIterator An iterator for the array of style paths
*/
public function getIterator()
{
return new ArrayIterator($this->paths);
}
}

View file

@ -0,0 +1,42 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Provides a style resource locator with paths
*
* Finds installed style paths and makes them available to the resource locator.
*
* @package phpBB3
*/
interface phpbb_style_path_provider_interface extends Traversable
{
/**
* Defines a prefix to use for style paths in extensions
*
* @param string $ext_dir_prefix The prefix including trailing slash
* @return null
*/
public function set_ext_dir_prefix($ext_dir_prefix);
/**
* Overwrites the current style paths
*
* @param array $styles An array of style paths. The first element is the main style.
* @return null
*/
public function set_styles(array $styles);
}

View file

@ -0,0 +1,291 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Style resource locator.
* Maintains mapping from template handles to source template file paths.
* Locates style files: resources (such as .js and .css files) and templates.
*
* Style resource locator is aware of styles tree, and can return actual
* filesystem paths (i.e., the "child" style or the "parent" styles)
* depending on what files exist.
*
* Root paths stored in locator are paths to style directories. Templates are
* stored in subdirectory that $template_path points to.
*
* @package phpBB3
*/
class phpbb_style_resource_locator
{
/**
* Paths to style directories.
* @var array
*/
private $roots = array();
/**
* Location of templates directory within style directories.
* Must have trailing slash. Empty if templates are stored in root
* style directory, such as admin control panel templates.
* @var string
*/
public $template_path = 'template/';
/**
* Map from root index to handles to source template file paths.
* Normally it only contains paths for handles that are used
* (or are likely to be used) by the page being rendered and not
* all templates that exist on the filesystem.
* @var array
*/
private $files = array();
/**
* Map from handles to source template file names.
* Covers the same data as $files property but maps to basenames
* instead of paths.
* @var array
*/
private $filenames = array();
/**
* Sets the list of style paths
*
* These paths will be searched for style files in the provided order.
* Paths may be outside of phpBB, but templates loaded from these paths
* will still be cached.
*
* @param array $style_paths An array of paths to style directories
* @return null
*/
public function set_paths($style_paths)
{
$this->roots = array();
$this->files = array();
$this->filenames = array();
foreach ($style_paths as $key => $paths)
{
foreach ($paths as $path)
{
// Make sure $path has no ending slash
if (substr($path, -1) === '/')
{
$path = substr($path, 0, -1);
}
$this->roots[$key][] = $path;
}
}
}
/**
* Sets the template filenames for handles. $filename_array
* should be a hash of handle => filename pairs.
*
* @param array $filname_array Should be a hash of handle => filename pairs.
*/
public function set_filenames(array $filename_array)
{
foreach ($filename_array as $handle => $filename)
{
if (empty($filename))
{
trigger_error("style resource locator: set_filenames: Empty filename specified for $handle", E_USER_ERROR);
}
$this->filename[$handle] = $filename;
foreach ($this->roots as $root_key => $root_paths)
{
foreach ($root_paths as $root_index => $root)
{
$this->files[$root_key][$root_index][$handle] = $root . '/' . $this->template_path . $filename;
}
}
}
}
/**
* Determines the filename for a template handle.
*
* The filename comes from array used in a set_filenames call,
* which should have been performed prior to invoking this function.
* Return value is a file basename (without path).
*
* @param $handle string Template handle
* @return string Filename corresponding to the template handle
*/
public function get_filename_for_handle($handle)
{
if (!isset($this->filename[$handle]))
{
trigger_error("style resource locator: get_filename_for_handle: No file specified for handle $handle", E_USER_ERROR);
}
return $this->filename[$handle];
}
/**
* Determines the source file path for a template handle without
* regard for styles tree.
*
* This function returns the path in "primary" style directory
* corresponding to the given template handle. That path may or
* may not actually exist on the filesystem. Because this function
* does not perform stat calls to determine whether the path it
* returns actually exists, it is faster than get_source_file_for_handle.
*
* Use get_source_file_for_handle to obtain the actual path that is
* guaranteed to exist (which might come from the parent style
* directory if primary style has parent styles).
*
* This function will trigger an error if the handle was never
* associated with a template file via set_filenames.
*
* @param $handle string Template handle
* @return string Path to source file path in primary style directory
*/
public function get_virtual_source_file_for_handle($handle)
{
// If we don't have a file assigned to this handle, die.
if (!isset($this->files['style'][0][$handle]))
{
trigger_error("style resource locator: No file specified for handle $handle", E_USER_ERROR);
}
$source_file = $this->files['style'][0][$handle];
return $source_file;
}
/**
* Determines the source file path for a template handle, accounting
* for styles tree and verifying that the path exists.
*
* This function returns the actual path that may be compiled for
* the specified template handle. It will trigger an error if
* the template handle was never associated with a template path
* via set_filenames or if the template file does not exist on the
* filesystem.
*
* Use get_virtual_source_file_for_handle to just resolve a template
* handle to a path without any filesystem or styles tree checks.
*
* @param string $handle Template handle (i.e. "friendly" template name)
* @param bool $find_all If true, each root path will be checked and function
* will return array of files instead of string and will not
* trigger a error if template does not exist
* @return string Source file path
*/
public function get_source_file_for_handle($handle, $find_all = false)
{
// If we don't have a file assigned to this handle, die.
if (!isset($this->files['style'][0][$handle]))
{
trigger_error("style resource locator: No file specified for handle $handle", E_USER_ERROR);
}
// locate a source file that exists
$source_file = $this->files['style'][0][$handle];
$tried = $source_file;
$found = false;
$found_all = array();
foreach ($this->roots as $root_key => $root_paths)
{
foreach ($root_paths as $root_index => $root)
{
$source_file = $this->files[$root_key][$root_index][$handle];
$tried .= ', ' . $source_file;
if (file_exists($source_file))
{
$found = true;
break;
}
}
if ($found)
{
if ($find_all)
{
$found_all[] = $source_file;
$found = false;
}
else
{
break;
}
}
}
// search failed
if (!$found && !$find_all)
{
trigger_error("style resource locator: File for handle $handle does not exist. Could not find: $tried", E_USER_ERROR);
}
return ($find_all) ? $found_all : $source_file;
}
/**
* Locates source file path, accounting for styles tree and verifying that
* the path exists.
*
* Unlike previous functions, this function works without template handle
* and it can search for more than one file. If more than one file name is
* specified, it will return location of file that it finds first.
*
* @param array $files List of files to locate.
* @param bool $return_default Determines what to return if file does not
* exist. If true, function will return location where file is
* supposed to be. If false, function will return false.
* @param bool $return_full_path If true, function will return full path
* to file. If false, function will return file name. This
* parameter can be used to check which one of set of files
* is available.
* @return string or boolean Source file path if file exists or $return_default is
* true. False if file does not exist and $return_default is false
*/
public function get_first_file_location($files, $return_default = false, $return_full_path = true)
{
// set default value
$default_result = false;
// check all available paths
foreach ($this->roots as $root_paths)
{
foreach ($root_paths as $path)
{
// check all files
foreach ($files as $filename)
{
$source_file = $path . '/' . $filename;
if (file_exists($source_file))
{
return ($return_full_path) ? $source_file : $filename;
}
// assign first file as result if $return_default is true
if ($return_default && $default_result === false)
{
$default_result = $source_file;
}
}
}
}
// search failed
return $default_result;
}
}

View file

@ -0,0 +1,181 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Base Style class.
* @package phpBB3
*/
class phpbb_style
{
/**
* @var phpbb_style_template Template class.
* Handles everything related to templates.
*/
private $template;
/**
* @var string phpBB root path
*/
private $phpbb_root_path;
/**
* @var phpEx PHP file extension
*/
private $phpEx;
/**
* @var phpbb_config phpBB config instance
*/
private $config;
/**
* @var user current user
*/
private $user;
/**
* Style resource locator
* @var phpbb_style_resource_locator
*/
private $locator;
/**
* Style path provider
* @var phpbb_style_path_provider
*/
private $provider;
/**
* Constructor.
*
* @param string $phpbb_root_path phpBB root path
* @param user $user current user
* @param phpbb_style_resource_locator $locator style resource locator
* @param phpbb_style_path_provider $provider style path provider
* @param phpbb_style_template $template template
*/
public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_style_resource_locator $locator, phpbb_style_path_provider_interface $provider, phpbb_style_template $template)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->phpEx = $phpEx;
$this->config = $config;
$this->user = $user;
$this->locator = $locator;
$this->provider = $provider;
$this->template = $template;
}
/**
* Set style location based on (current) user's chosen style.
*/
public function set_style()
{
$style_name = $this->user->theme['style_path'];
$style_dirs = ($this->user->theme['style_parent_id']) ? array_reverse(explode('/', $this->user->theme['style_parent_tree'])) : array();
$paths = array($this->get_style_path($style_name));
foreach ($style_dirs as $dir)
{
$paths[] = $this->get_style_path($dir);
}
// Add 'all' path, used as last fallback path by hooks and extensions
$paths[] = $this->get_style_path('all');
return $this->set_custom_style($style_name, $paths);
}
/**
* Set custom style location (able to use directory outside of phpBB).
*
* Note: Templates are still compiled to phpBB's cache directory.
*
* @param string $name Name of style, used for cache prefix. Examples: "admin", "prosilver"
* @param array or string $paths Array of style paths, relative to current root directory
* @param string $template_path Path to templates, relative to style directory. False if path should not be changed.
*/
public function set_custom_style($name, $paths, $template_path = false)
{
if (is_string($paths))
{
$paths = array($paths);
}
$this->provider->set_styles($paths);
$this->locator->set_paths($this->provider);
$this->template->cachepath = $this->phpbb_root_path . 'cache/tpl_' . str_replace('_', '-', $name) . '_';
$this->template->context = new phpbb_style_template_context();
if ($template_path !== false)
{
$this->template->template_path = $this->locator->template_path = $template_path;
}
return true;
}
/**
* Get location of style directory for specific style_path
*
* @param string $path Style path, such as "prosilver"
* @return string Path to style directory, relative to current path
*/
public function get_style_path($path)
{
return $this->phpbb_root_path . 'styles/' . $path;
}
/**
* Defines a prefix to use for style paths in extensions
*
* @param string $ext_dir_prefix The prefix including trailing slash
* @return null
*/
public function set_ext_dir_prefix($ext_dir_prefix)
{
$this->provider->set_ext_dir_prefix($ext_dir_prefix);
}
/**
* Locates source file path, accounting for styles tree and verifying that
* the path exists.
*
* @param string or array $files List of files to locate. If there is only
* one file, $files can be a string to make code easier to read.
* @param bool $return_default Determines what to return if file does not
* exist. If true, function will return location where file is
* supposed to be. If false, function will return false.
* @param bool $return_full_path If true, function will return full path
* to file. If false, function will return file name. This
* parameter can be used to check which one of set of files
* is available.
* @return string or boolean Source file path if file exists or $return_default is
* true. False if file does not exist and $return_default is false
*/
public function locate($files, $return_default = false, $return_full_path = true)
{
// convert string to array
if (is_string($files))
{
$files = array($files);
}
// use resource locator to find files
return $this->locator->get_first_file_location($files, $return_default, $return_full_path);
}
}

View file

@ -29,13 +29,13 @@ if (!defined('IN_PHPBB'))
* Base Template class. * Base Template class.
* @package phpBB3 * @package phpBB3
*/ */
class phpbb_template class phpbb_style_template
{ {
/** /**
* @var phpbb_template_context Template context. * @var phpbb_style_template_context Template context.
* Stores template data used during template rendering. * Stores template data used during template rendering.
*/ */
private $context; public $context;
/** /**
* @var string Path of the cache directory for the template * @var string Path of the cache directory for the template
@ -63,87 +63,42 @@ class phpbb_template
private $user; private $user;
/** /**
* Template locator * Style resource locator
* @var phpbb_template_locator * @var phpbb_style_resource_locator
*/ */
private $locator; private $locator;
/** /**
* Template path provider * Template path provider
* @var phpbb_template_path_provider * @var phpbb_style_path_provider
*/ */
private $provider; private $provider;
/**
* Location of templates directory within style directories
* @var string
*/
public $template_path = 'template/';
/** /**
* Constructor. * Constructor.
* *
* @param string $phpbb_root_path phpBB root path * @param string $phpbb_root_path phpBB root path
* @param user $user current user * @param user $user current user
* @param phpbb_template_locator $locator template locator * @param phpbb_style_resource_locator $locator style resource locator
* @param phpbb_template_path_provider $provider template path provider * @param phpbb_style_path_provider $provider style path provider
*/ */
public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_template_locator $locator, phpbb_template_path_provider_interface $provider) public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_style_resource_locator $locator, phpbb_style_path_provider_interface $provider)
{ {
$this->phpbb_root_path = $phpbb_root_path; $this->phpbb_root_path = $phpbb_root_path;
$this->phpEx = $phpEx; $this->phpEx = $phpEx;
$this->config = $config; $this->config = $config;
$this->user = $user; $this->user = $user;
$this->locator = $locator; $this->locator = $locator;
$this->template_path = $this->locator->template_path;
$this->provider = $provider; $this->provider = $provider;
} }
/**
* Set template location based on (current) user's chosen style.
*/
public function set_template()
{
$template_name = $this->user->theme['template_path'];
$fallback_name = ($this->user->theme['template_inherits_id']) ? $this->user->theme['template_inherit_path'] : false;
return $this->set_custom_template(false, $template_name, false, $fallback_name);
}
/**
* Defines a prefix to use for template paths in extensions
*
* @param string $ext_dir_prefix The prefix including trailing slash
* @return null
*/
public function set_ext_dir_prefix($ext_dir_prefix)
{
$this->provider->set_ext_dir_prefix($ext_dir_prefix);
}
/**
* Set custom template location (able to use directory outside of phpBB).
*
* Note: Templates are still compiled to phpBB's cache directory.
*
* @param string $template_path Path to template directory
* @param string $template_name Name of template
* @param string $fallback_template_path Path to fallback template
* @param string $fallback_template_name Name of fallback template
*/
public function set_custom_template($template_path, $template_name, $fallback_template_path = false, $fallback_template_name = false)
{
$templates = array($template_name => $template_path);
if ($fallback_template_name !== false)
{
$templates[$fallback_template_name] = $fallback_template_path;
}
$this->provider->set_templates($templates, $this->phpbb_root_path);
$this->locator->set_paths($this->provider);
$this->locator->set_main_template($this->provider->get_main_template_path());
$this->cachepath = $this->phpbb_root_path . 'cache/tpl_' . str_replace('_', '-', $template_name) . '_';
$this->context = new phpbb_template_context();
return true;
}
/** /**
* Sets the template filenames for handles. * Sets the template filenames for handles.
* *
@ -298,15 +253,15 @@ class phpbb_template
* configuration setting may be used to force templates to be always * configuration setting may be used to force templates to be always
* recompiled. * recompiled.
* *
* Returns an object implementing phpbb_template_renderer, or null * Returns an object implementing phpbb_style_template_renderer, or null
* if template loading or compilation failed. Call render() on the * if template loading or compilation failed. Call render() on the
* renderer to display the template. This will result in template * renderer to display the template. This will result in template
* contents sent to the output stream (unless, of course, output * contents sent to the output stream (unless, of course, output
* buffering is in effect). * buffering is in effect).
* *
* @param string $handle Handle of the template to load * @param string $handle Handle of the template to load
* @return phpbb_template_renderer Template renderer object, or null on failure * @return phpbb_style_template_renderer Template renderer object, or null on failure
* @uses phpbb_template_compile is used to compile template source * @uses phpbb_style_template_compile is used to compile template source
*/ */
private function _tpl_load($handle) private function _tpl_load($handle)
{ {
@ -330,18 +285,18 @@ class phpbb_template
// Recompile page if the original template is newer, otherwise load the compiled version // Recompile page if the original template is newer, otherwise load the compiled version
if (!$recompile) if (!$recompile)
{ {
return new phpbb_template_renderer_include($output_file, $this); return new phpbb_style_template_renderer_include($output_file, $this);
} }
$compile = new phpbb_template_compile($this->config['tpl_allow_php']); $compile = new phpbb_style_template_compile($this->config['tpl_allow_php'], $this->locator, $this->phpbb_root_path);
if ($compile->compile_file_to_file($source_file, $output_file) !== false) if ($compile->compile_file_to_file($source_file, $output_file) !== false)
{ {
$renderer = new phpbb_template_renderer_include($output_file, $this); $renderer = new phpbb_style_template_renderer_include($output_file, $this);
} }
else if (($code = $compile->compile_file($source_file)) !== false) else if (($code = $compile->compile_file($source_file)) !== false)
{ {
$renderer = new phpbb_template_renderer_eval($code, $this); $renderer = new phpbb_style_template_renderer_eval($code, $this);
} }
else else
{ {
@ -403,7 +358,7 @@ class phpbb_template
$this->context->append_var($varname, $varval); $this->context->append_var($varname, $varval);
} }
// Docstring is copied from phpbb_template_context method with the same name. // Docstring is copied from phpbb_style_template_context method with the same name.
/** /**
* Assign key variable pairs from an array to a specified block * Assign key variable pairs from an array to a specified block
* @param string $blockname Name of block to assign $vararray to * @param string $blockname Name of block to assign $vararray to
@ -414,7 +369,7 @@ class phpbb_template
return $this->context->assign_block_vars($blockname, $vararray); return $this->context->assign_block_vars($blockname, $vararray);
} }
// Docstring is copied from phpbb_template_context method with the same name. // Docstring is copied from phpbb_style_template_context method with the same name.
/** /**
* Change already assigned key variable pair (one-dimensional - single loop entry) * Change already assigned key variable pair (one-dimensional - single loop entry)
* *
@ -501,4 +456,59 @@ class phpbb_template
} }
include($file); include($file);
} }
/**
* Locates source template path, accounting for styles tree and verifying that
* the path exists.
*
* @param string or array $files List of templates to locate. If there is only
* one template, $files can be a string to make code easier to read.
* @param bool $return_default Determines what to return if template does not
* exist. If true, function will return location where template is
* supposed to be. If false, function will return false.
* @param bool $return_full_path If true, function will return full path
* to template. If false, function will return template file name.
* This parameter can be used to check which one of set of template
* files is available.
* @return string or boolean Source template path if template exists or $return_default is
* true. False if template does not exist and $return_default is false
*/
public function locate($files, $return_default = false, $return_full_path = true)
{
// add tempalte path prefix
$templates = array();
if (is_string($files))
{
$templates[] = $this->template_path . $files;
}
else
{
foreach ($files as $file)
{
$templates[] = $this->template_path . $file;
}
}
// use resource locator to find files
return $this->locator->get_first_file_location($templates, $return_default, $return_full_path);
}
/**
* Include JS file
*
* @param string $file file name
* @param bool $locate True if file needs to be located
*/
public function _js_include($file, $locate = false)
{
// Locate file
if ($locate)
{
$file = $this->locator->get_first_file_location(array($file), true, true);
}
// Add HTML code
$code = '<script src="' . htmlspecialchars($file) . '"></script>';
$this->context->append_var('SCRIPTS', $code);
}
} }

View file

@ -15,7 +15,7 @@ if (!defined('IN_PHPBB'))
exit; exit;
} }
stream_filter_register('phpbb_template', 'phpbb_template_filter'); stream_filter_register('phpbb_template', 'phpbb_style_template_filter');
/** /**
* Extension of template class - Functions needed for compiling templates only. * Extension of template class - Functions needed for compiling templates only.
@ -23,23 +23,29 @@ stream_filter_register('phpbb_template', 'phpbb_template_filter');
* @package phpBB3 * @package phpBB3
* @uses template_filter As a PHP stream filter to perform compilation of templates * @uses template_filter As a PHP stream filter to perform compilation of templates
*/ */
class phpbb_template_compile class phpbb_style_template_compile
{ {
/** /**
* Whether <!-- PHP --> tags are allowed * Array of parameters to forward to template filter
* *
* @var bool * @var array
*/ */
private $allow_php; private $filter_params;
/** /**
* Constructor. * Constructor.
* *
* @param bool @allow_php Whether PHP code will be allowed in templates (inline PHP code, PHP tag and INCLUDEPHP tag) * @param bool @allow_php Whether PHP code will be allowed in templates (inline PHP code, PHP tag and INCLUDEPHP tag)
* @param phpbb_style_resource_locator $locator Resource locator
* @param string $phpbb_root_path Path to phpBB root directory
*/ */
public function __construct($allow_php) public function __construct($allow_php, $locator, $phpbb_root_path)
{ {
$this->allow_php = $allow_php; $this->filter_params = array(
'allow_php' => $allow_php,
'locator' => $locator,
'phpbb_root_path' => $phpbb_root_path
);
} }
/** /**
@ -116,7 +122,7 @@ class phpbb_template_compile
*/ */
private function compile_stream_to_stream($source_stream, $dest_stream) private function compile_stream_to_stream($source_stream, $dest_stream)
{ {
stream_filter_append($source_stream, 'phpbb_template', null, array('allow_php' => $this->allow_php)); stream_filter_append($source_stream, 'phpbb_template', null, $this->filter_params);
stream_copy_to_stream($source_stream, $dest_stream); stream_copy_to_stream($source_stream, $dest_stream);
} }
} }

View file

@ -20,7 +20,7 @@ if (!defined('IN_PHPBB'))
* *
* @package phpBB3 * @package phpBB3
*/ */
class phpbb_template_context class phpbb_style_template_context
{ {
/** /**
* variable that holds all the data we'll be substituting into * variable that holds all the data we'll be substituting into
@ -86,7 +86,7 @@ class phpbb_template_context
* Returns a reference to template data array. * Returns a reference to template data array.
* *
* This function is public so that template renderer may invoke it. * This function is public so that template renderer may invoke it.
* Users should alter template variables via functions in phpbb_template. * Users should alter template variables via functions in phpbb_style_template.
* *
* Note: modifying returned array will affect data stored in the context. * Note: modifying returned array will affect data stored in the context.
* *

View file

@ -35,7 +35,7 @@ if (!defined('IN_PHPBB'))
* @see template_compile * @see template_compile
* @package phpBB3 * @package phpBB3
*/ */
class phpbb_template_filter extends php_user_filter class phpbb_style_template_filter extends php_user_filter
{ {
const REGEX_NS = '[a-z_][a-z_0-9]+'; const REGEX_NS = '[a-z_][a-z_0-9]+';
@ -75,6 +75,18 @@ class phpbb_template_filter extends php_user_filter
*/ */
private $allow_php; private $allow_php;
/**
* Resource locator.
*
* @var phpbb_template_locator
*/
private $locator;
/**
* @var string phpBB root path
*/
private $phpbb_root_path;
/** /**
* Stream filter * Stream filter
* *
@ -126,14 +138,16 @@ class phpbb_template_filter extends php_user_filter
/** /**
* Initializer, called on creation. * Initializer, called on creation.
* *
* Get the allow_php option from params, which is passed * Get the allow_php option, root directory and locator from params,
* to stream_filter_append. * which are passed to stream_filter_append.
*/ */
public function onCreate() public function onCreate()
{ {
$this->chunk = ''; $this->chunk = '';
$this->in_php = false; $this->in_php = false;
$this->allow_php = $this->params['allow_php']; $this->allow_php = $this->params['allow_php'];
$this->locator = $this->params['locator'];
$this->phpbb_root_path = $this->params['phpbb_root_path'];
return true; return true;
} }
@ -281,6 +295,10 @@ class phpbb_template_filter extends php_user_filter
return ($this->allow_php) ? '<?php ' . $this->compile_tag_include_php($matches[2]) . ' ?>' : ''; return ($this->allow_php) ? '<?php ' . $this->compile_tag_include_php($matches[2]) . ' ?>' : '';
break; break;
case 'INCLUDEJS':
return '<?php ' . $this->compile_tag_include_js($matches[2]) . ' ?>';
break;
case 'PHP': case 'PHP':
if ($this->allow_php) if ($this->allow_php)
{ {
@ -856,6 +874,45 @@ class phpbb_template_filter extends php_user_filter
return $tokens; return $tokens;
} }
/**
* Compile INCLUDEJS tag
*
* @param string $tag_args Expression given with INCLUDEJS in source template
* @return string compiled template code
*/
private function compile_tag_include_js($tag_args)
{
// Process dynamic includes
if ($tag_args[0] == '{')
{
$var = $this->get_varref($tag_args, $is_expr);
if (!$is_expr)
{
return " \$_template->_js_include($var, true);";
}
return '';
}
// Locate file
$filename = $this->locator->get_first_file_location(array($tag_args), false, true);
if ($filename === false)
{
// File does not exist, find it during run time
return ' $_template->_js_include(\'' . addslashes($tag_args) . '\', true); ';
}
if (substr($filename, 0, strlen($this->phpbb_root_path)) != $this->phpbb_root_path)
{
// Absolute path, include as is
return ' $_template->_js_include(\'' . addslashes($filename) . '\', false); ';
}
// Relative path, remove root path from it
$filename = substr($filename, strlen($this->phpbb_root_path));
return ' global $phpbb_root_path; $_template->_js_include($phpbb_root_path . \'' . addslashes($filename) . '\', false); ';
}
/** /**
* Generates a reference to the given variable inside the given (possibly nested) * Generates a reference to the given variable inside the given (possibly nested)
* block namespace. This is a string of the form: * block namespace. This is a string of the form:

View file

@ -23,12 +23,12 @@ if (!defined('IN_PHPBB'))
* *
* @package phpBB3 * @package phpBB3
*/ */
interface phpbb_template_renderer interface phpbb_style_template_renderer
{ {
/** /**
* Displays the template managed by this renderer. * Displays the template managed by this renderer.
* *
* @param phpbb_template_context $context Template context to use * @param phpbb_style_template_context $context Template context to use
* @param array $lang Language entries to use * @param array $lang Language entries to use
*/ */
public function render($context, $lang); public function render($context, $lang);

View file

@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
* *
* @package phpBB3 * @package phpBB3
*/ */
class phpbb_template_renderer_eval implements phpbb_template_renderer class phpbb_style_template_renderer_eval implements phpbb_style_template_renderer
{ {
/** /**
* Template code to be eval'ed. * Template code to be eval'ed.
@ -33,7 +33,7 @@ class phpbb_template_renderer_eval implements phpbb_template_renderer
* Template includes are delegated to template object $template. * Template includes are delegated to template object $template.
* *
* @param string $code php code of the template * @param string $code php code of the template
* @param phpbb_template $template template object * @param phpbb_style_template $template template object
*/ */
public function __construct($code, $template) public function __construct($code, $template)
{ {
@ -45,7 +45,7 @@ class phpbb_template_renderer_eval implements phpbb_template_renderer
* Displays the template managed by this renderer by eval'ing php code * Displays the template managed by this renderer by eval'ing php code
* of the template. * of the template.
* *
* @param phpbb_template_context $context Template context to use * @param phpbb_style_template_context $context Template context to use
* @param array $lang Language entries to use * @param array $lang Language entries to use
*/ */
public function render($context, $lang) public function render($context, $lang)

View file

@ -22,7 +22,7 @@ if (!defined('IN_PHPBB'))
* *
* @package phpBB3 * @package phpBB3
*/ */
class phpbb_template_renderer_include implements phpbb_template_renderer class phpbb_style_template_renderer_include implements phpbb_style_template_renderer
{ {
/** /**
* Template path to be included. * Template path to be included.
@ -45,7 +45,7 @@ class phpbb_template_renderer_include implements phpbb_template_renderer
* Displays the template managed by this renderer by including * Displays the template managed by this renderer by including
* the php file containing the template. * the php file containing the template.
* *
* @param phpbb_template_context $context Template context to use * @param phpbb_style_template_context $context Template context to use
* @param array $lang Language entries to use * @param array $lang Language entries to use
*/ */
public function render($context, $lang) public function render($context, $lang)

View file

@ -1,130 +0,0 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Provides a template locator with core template paths and extension template paths
*
* Finds installed template paths and makes them available to the locator.
*
* @package phpBB3
*/
class phpbb_template_extension_path_provider extends phpbb_extension_provider implements phpbb_template_path_provider_interface
{
/**
* Optional prefix for template paths searched within extensions.
*
* Empty by default. Relative to the extension directory. As an example, it
* could be adm/ for admin templates.
*
* @var string
*/
protected $ext_dir_prefix = '';
/**
* A provider of paths to be searched for templates
* @var phpbb_template_path_provider
*/
protected $base_path_provider;
/**
* Constructor stores extension manager
*
* @param phpbb_extension_manager $extension_manager phpBB extension manager
* @param phpbb_template_path_provider $base_path_provider A simple path provider
* to provide paths to be located in extensions
*/
public function __construct(phpbb_extension_manager $extension_manager, phpbb_template_path_provider $base_path_provider)
{
parent::__construct($extension_manager);
$this->base_path_provider = $base_path_provider;
}
/**
* Sets a prefix for template paths searched within extensions.
*
* The prefix is inserted between the extension's path e.g. ext/foo/ and
* the looked up template path, e.g. styles/bar/template/some.html. So it
* should not have a leading slash, but should have a trailing slash.
*
* @param string $ext_dir_prefix The prefix including trailing slash
* @return null
*/
public function set_ext_dir_prefix($ext_dir_prefix)
{
$this->ext_dir_prefix = $ext_dir_prefix;
}
/**
* Finds template paths using the extension manager
*
* Locates a path (e.g. styles/prosilver/template/) in all active extensions.
* Then appends the core template paths based in the current working
* directory.
*
* @return array List of template paths
*/
public function find()
{
$directories = array();
$finder = $this->extension_manager->get_finder();
foreach ($this->base_path_provider as $path)
{
if ($path && !phpbb_is_absolute($path))
{
$directories = array_merge($directories, $finder
->directory('/' . $this->ext_dir_prefix . $path)
->get_directories()
);
}
}
foreach ($this->base_path_provider as $path)
{
$directories[] = $path;
}
return $directories;
}
/**
* Overwrites the current template names and paths
*
* @param array $templates An associative map from template names to paths.
* The first element is the main template.
* If the path is false, it will be generated from
* the supplied name.
* @param string $style_root_path The root directory for styles identified
* by name only.
* @return null
*/
public function set_templates(array $templates, $style_root_path)
{
$this->base_path_provider->set_templates($templates, $style_root_path);
$this->items = null;
}
/**
* Retrieves the path to the main template passed into set_templates()
*
* @return string Main template path
*/
public function get_main_template_path()
{
return $this->base_path_provider->get_main_template_path();
}
}

View file

@ -1,214 +0,0 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Template locator. Maintains mapping from template handles to source paths.
*
* Template locator is aware of template inheritance, and can return actual
* filesystem paths (i.e., the "primary" template or the "parent" template)
* depending on what files exist.
*
* @package phpBB3
*/
class phpbb_template_locator
{
/**
* Paths to directories that templates are stored in.
* @var array
*/
private $roots = array();
/**
* Index of the main template in the roots array
* @var int
*/
private $main_root_id = 0;
/**
* Map from root index to handles to source template file paths.
* Normally it only contains paths for handles that are used
* (or are likely to be used) by the page being rendered and not
* all templates that exist on the filesystem.
* @var array
*/
private $files = array();
/**
* Map from handles to source template file names.
* Covers the same data as $files property but maps to basenames
* instead of paths.
* @var array
*/
private $filenames = array();
/**
* Set main template location (must have been added through set_paths first).
*
* @param string $template_path Path to template directory
* @return null
*/
public function set_main_template($template)
{
$this->main_root_id = array_search($template, $this->roots, true);
}
/**
* Sets the list of template paths
*
* These paths will be searched for template files in the provided order.
* Paths may be outside of phpBB, but templates loaded from these paths
* will still be cached.
*
* @param array $template_paths An array of paths to template directories
* @return null
*/
public function set_paths($template_paths)
{
$this->roots = array();
$this->files = array();
$this->filenames = array();
$this->main_root_id = 0;
foreach ($template_paths as $path)
{
// Make sure $path has no ending slash
if (substr($path, -1) === '/')
{
$path = substr($path, 0, -1);
}
$this->roots[] = $path;
}
}
/**
* Sets the template filenames for handles. $filename_array
* should be a hash of handle => filename pairs.
*
* @param array $filname_array Should be a hash of handle => filename pairs.
*/
public function set_filenames(array $filename_array)
{
foreach ($filename_array as $handle => $filename)
{
if (empty($filename))
{
trigger_error("template locator: set_filenames: Empty filename specified for $handle", E_USER_ERROR);
}
$this->filename[$handle] = $filename;
foreach ($this->roots as $root_index => $root)
{
$this->files[$root_index][$handle] = $root . '/' . $filename;
}
}
}
/**
* Determines the filename for a template handle.
*
* The filename comes from array used in a set_filenames call,
* which should have been performed prior to invoking this function.
* Return value is a file basename (without path).
*
* @param $handle string Template handle
* @return string Filename corresponding to the template handle
*/
public function get_filename_for_handle($handle)
{
if (!isset($this->filename[$handle]))
{
trigger_error("template locator: get_filename_for_handle: No file specified for handle $handle", E_USER_ERROR);
}
return $this->filename[$handle];
}
/**
* Determines the source file path for a template handle without
* regard for template inheritance.
*
* This function returns the path in "primary" template directory
* corresponding to the given template handle. That path may or
* may not actually exist on the filesystem. Because this function
* does not perform stat calls to determine whether the path it
* returns actually exists, it is faster than get_source_file_for_handle.
*
* Use get_source_file_for_handle to obtain the actual path that is
* guaranteed to exist (which might come from the parent/fallback
* template directory if template inheritance is used).
*
* This function will trigger an error if the handle was never
* associated with a template file via set_filenames.
*
* @param $handle string Template handle
* @return string Path to source file path in primary template directory
*/
public function get_virtual_source_file_for_handle($handle)
{
// If we don't have a file assigned to this handle, die.
if (!isset($this->files[$this->main_root_id][$handle]))
{
trigger_error("template locator: No file specified for handle $handle", E_USER_ERROR);
}
$source_file = $this->files[$this->main_root_id][$handle];
return $source_file;
}
/**
* Determines the source file path for a template handle, accounting
* for template inheritance and verifying that the path exists.
*
* This function returns the actual path that may be compiled for
* the specified template handle. It will trigger an error if
* the template handle was never associated with a template path
* via set_filenames or if the template file does not exist on the
* filesystem.
*
* Use get_virtual_source_file_for_handle to just resolve a template
* handle to a path without any filesystem or inheritance checks.
*
* @param string $handle Template handle (i.e. "friendly" template name)
* @return string Source file path
*/
public function get_source_file_for_handle($handle)
{
// If we don't have a file assigned to this handle, die.
if (!isset($this->files[$this->main_root_id][$handle]))
{
trigger_error("template locator: No file specified for handle $handle", E_USER_ERROR);
}
// locate a source file that exists
$source_file = $this->files[0][$handle];
$tried = $source_file;
for ($i = 1, $n = count($this->roots); $i < $n && !file_exists($source_file); $i++)
{
$source_file = $this->files[$i][$handle];
$tried .= ', ' . $source_file;
}
// search failed
if (!file_exists($source_file))
{
trigger_error("template locator: File for handle $handle does not exist. Could not find: $tried", E_USER_ERROR);
}
return $source_file;
}
}

View file

@ -1,102 +0,0 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Provides a template locator with paths
*
* Finds installed template paths and makes them available to the locator.
*
* @package phpBB3
*/
class phpbb_template_path_provider implements IteratorAggregate, phpbb_template_path_provider_interface
{
protected $main_template_name = '';
protected $paths = array();
/**
* Ignores the extension dir prefix
*
* @param string $ext_dir_prefix The prefix including trailing slash
* @return null
*/
public function set_ext_dir_prefix($ext_dir_prefix)
{
}
/**
* Overwrites the current template names and paths
*
* The first element of the passed templates map, is considered the main
* template and can be retrieved through get_main_template_path().
*
* @param array $templates An associative map from template names to paths.
* The first element is the main template.
* If the path is false, it will be generated from
* the supplied name.
* @param string $style_root_path The root directory for styles identified
* by name only.
* @return null
*/
public function set_templates(array $templates, $style_root_path)
{
$this->paths = array();
foreach ($templates as $name => $path)
{
if (!$path)
{
$path = $style_root_path . $this->template_root_for_style($name);
}
$this->paths[] = $path;
}
$this->main_template_path = $this->paths[0];
}
/**
* Retrieves the path to the main template passed into set_templates()
*
* @return string Main template path
*/
public function get_main_template_path()
{
return $this->main_template_path;
}
/**
* Converts a style name to relative (to board root or extension) path to
* the style's template files.
*
* @param $style_name string Style name
* @return string Path to style template files
*/
private function template_root_for_style($style_name)
{
return 'styles/' . $style_name . '/template';
}
/**
* Retrieve an iterator over all template paths
*
* @return ArrayIterator An iterator for the array of template paths
*/
public function getIterator()
{
return new ArrayIterator($this->paths);
}
}

View file

@ -1,54 +0,0 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Provides a template locator with paths
*
* Finds installed template paths and makes them available to the locator.
*
* @package phpBB3
*/
interface phpbb_template_path_provider_interface extends Traversable
{
/**
* Defines a prefix to use for template paths in extensions
*
* @param string $ext_dir_prefix The prefix including trailing slash
* @return null
*/
public function set_ext_dir_prefix($ext_dir_prefix);
/**
* Overwrites the current template names and paths
*
* @param array $templates An associative map from template names to paths.
* The first element is the main template.
* If the path is false, it will be generated from
* the supplied name.
* @param string $style_root_path The root directory for styles identified
* by name only.
* @return null
*/
public function set_templates(array $templates, $style_root_path);
/**
* Retrieves the path to the main template passed into set_templates()
*
* @return string Main template path
*/
public function get_main_template_path();
}

View file

@ -60,7 +60,14 @@ class ucp_prefs
if ($submit) if ($submit)
{ {
$data['style'] = ($config['override_user_style']) ? $config['default_style'] : $data['style']; if ($config['override_user_style'])
{
$data['style'] = (int) $config['default_style'];
}
else if (!phpbb_style_is_active($data['style']))
{
$data['style'] = (int) $user->data['user_style'];
}
$error = validate_data($data, array( $error = validate_data($data, array(
'dateformat' => array('string', false, 1, 30), 'dateformat' => array('string', false, 1, 30),

View file

@ -66,7 +66,7 @@ class ucp_remind
} }
// Check users permissions // Check users permissions
$auth2 = new auth(); $auth2 = new phpbb_auth();
$auth2->acl($user_row); $auth2->acl($user_row);
if (!$auth2->acl_get('u_chgpasswd')) if (!$auth2->acl_get('u_chgpasswd'))

851
phpBB/includes/user.php Normal file
View file

@ -0,0 +1,851 @@
<?php
/**
*
* @package phpBB3
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Base user class
*
* This is the overarching class which contains (through session extend)
* all methods utilised for user functionality during a session.
*
* @package phpBB3
*/
class phpbb_user extends phpbb_session
{
var $lang = array();
var $help = array();
var $theme = array();
var $date_format;
var $timezone;
var $dst;
var $lang_name = false;
var $lang_id = false;
var $lang_path;
var $img_lang;
var $img_array = array();
// Able to add new options (up to id 31)
var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);
/**
* Constructor to set the lang path
*/
function __construct()
{
global $phpbb_root_path;
$this->lang_path = $phpbb_root_path . 'language/';
}
/**
* Function to set custom language path (able to use directory outside of phpBB)
*
* @param string $lang_path New language path used.
* @access public
*/
function set_custom_lang_path($lang_path)
{
$this->lang_path = $lang_path;
if (substr($this->lang_path, -1) != '/')
{
$this->lang_path .= '/';
}
}
/**
* Setup basic user-specific items (style, language, ...)
*/
function setup($lang_set = false, $style_id = false)
{
global $db, $phpbb_style, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
if ($this->data['user_id'] != ANONYMOUS)
{
$this->lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
$this->date_format = $this->data['user_dateformat'];
$this->timezone = $this->data['user_timezone'] * 3600;
$this->dst = $this->data['user_dst'] * 3600;
}
else
{
$this->lang_name = basename($config['default_lang']);
$this->date_format = $config['default_dateformat'];
$this->timezone = $config['board_timezone'] * 3600;
$this->dst = $config['board_dst'] * 3600;
/**
* If a guest user is surfing, we try to guess his/her language first by obtaining the browser language
* If re-enabled we need to make sure only those languages installed are checked
* Commented out so we do not loose the code.
if ($request->header('Accept-Language'))
{
$accept_lang_ary = explode(',', $request->header('Accept-Language'));
foreach ($accept_lang_ary as $accept_lang)
{
// Set correct format ... guess full xx_YY form
$accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2));
$accept_lang = basename($accept_lang);
if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx"))
{
$this->lang_name = $config['default_lang'] = $accept_lang;
break;
}
else
{
// No match on xx_YY so try xx
$accept_lang = substr($accept_lang, 0, 2);
$accept_lang = basename($accept_lang);
if (file_exists($this->lang_path . $accept_lang . "/common.$phpEx"))
{
$this->lang_name = $config['default_lang'] = $accept_lang;
break;
}
}
}
}
*/
}
// We include common language file here to not load it every time a custom language file is included
$lang = &$this->lang;
// Do not suppress error if in DEBUG_EXTRA mode
$include_result = (defined('DEBUG_EXTRA')) ? (include $this->lang_path . $this->lang_name . "/common.$phpEx") : (@include $this->lang_path . $this->lang_name . "/common.$phpEx");
if ($include_result === false)
{
die('Language file ' . $this->lang_path . $this->lang_name . "/common.$phpEx" . " couldn't be opened.");
}
$this->add_lang($lang_set);
unset($lang_set);
$style_request = request_var('style', 0);
if ($style_request && $auth->acl_get('a_styles') && !defined('ADMIN_START'))
{
global $SID, $_EXTRA_URL;
$style_id = $style_request;
$SID .= '&amp;style=' . $style_id;
$_EXTRA_URL = array('style=' . $style_id);
}
else
{
// Set up style
$style_id = ($style_id) ? $style_id : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);
}
$sql = 'SELECT *
FROM ' . STYLES_TABLE . " s
WHERE s.style_id = $style_id";
$result = $db->sql_query($sql, 3600);
$this->theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// User has wrong style
if (!$this->theme && $style_id == $this->data['user_style'])
{
$style_id = $this->data['user_style'] = $config['default_style'];
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_style = $style_id
WHERE user_id = {$this->data['user_id']}";
$db->sql_query($sql);
$sql = 'SELECT *
FROM ' . STYLES_TABLE . " s
WHERE s.style_id = $style_id";
$result = $db->sql_query($sql, 3600);
$this->theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
}
if (!$this->theme)
{
trigger_error('Could not get style data', E_USER_ERROR);
}
// Now parse the cfg file and cache it
$parsed_items = $cache->obtain_cfg_items($this->theme);
// We are only interested in the theme configuration for now
$parsed_items = $parsed_items['theme'];
$check_for = array(
'pagination_sep' => (string) ', '
);
foreach ($check_for as $key => $default_value)
{
$this->theme[$key] = (isset($parsed_items[$key])) ? $parsed_items[$key] : $default_value;
settype($this->theme[$key], gettype($default_value));
if (is_string($default_value))
{
$this->theme[$key] = htmlspecialchars($this->theme[$key]);
}
}
$phpbb_style->set_style();
$this->img_lang = $this->lang_name;
// Call phpbb_user_session_handler() in case external application want to "bend" some variables or replace classes...
// After calling it we continue script execution...
phpbb_user_session_handler();
// If this function got called from the error handler we are finished here.
if (defined('IN_ERROR_HANDLER'))
{
return;
}
// Disable board if the install/ directory is still present
// For the brave development army we do not care about this, else we need to comment out this everytime we develop locally
if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
{
// Adjust the message slightly according to the permissions
if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))
{
$message = 'REMOVE_INSTALL';
}
else
{
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
}
trigger_error($message);
}
// Is board disabled and user not an admin or moderator?
if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
{
if ($this->data['is_bot'])
{
send_status_line(503, 'Service Unavailable');
}
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
trigger_error($message);
}
// Is load exceeded?
if ($config['limit_load'] && $this->load !== false)
{
if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !defined('IN_ADMIN'))
{
// Set board disabled to true to let the admins/mods get the proper notification
$config['board_disable'] = '1';
if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
{
if ($this->data['is_bot'])
{
send_status_line(503, 'Service Unavailable');
}
trigger_error('BOARD_UNAVAILABLE');
}
}
}
if (isset($this->data['session_viewonline']))
{
// Make sure the user is able to hide his session
if (!$this->data['session_viewonline'])
{
// Reset online status if not allowed to hide the session...
if (!$auth->acl_get('u_hideonline'))
{
$sql = 'UPDATE ' . SESSIONS_TABLE . '
SET session_viewonline = 1
WHERE session_user_id = ' . $this->data['user_id'];
$db->sql_query($sql);
$this->data['session_viewonline'] = 1;
}
}
else if (!$this->data['user_allow_viewonline'])
{
// the user wants to hide and is allowed to -> cloaking device on.
if ($auth->acl_get('u_hideonline'))
{
$sql = 'UPDATE ' . SESSIONS_TABLE . '
SET session_viewonline = 0
WHERE session_user_id = ' . $this->data['user_id'];
$db->sql_query($sql);
$this->data['session_viewonline'] = 0;
}
}
}
// Does the user need to change their password? If so, redirect to the
// ucp profile reg_details page ... of course do not redirect if we're already in the ucp
if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && !empty($this->data['is_registered']) && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
{
if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != "ucp.$phpEx")
{
redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=reg_details'));
}
}
return;
}
/**
* More advanced language substitution
* Function to mimic sprintf() with the possibility of using phpBB's language system to substitute nullar/singular/plural forms.
* Params are the language key and the parameters to be substituted.
* This function/functionality is inspired by SHS` and Ashe.
*
* Example call: <samp>$user->lang('NUM_POSTS_IN_QUEUE', 1);</samp>
*
* If the first parameter is an array, the elements are used as keys and subkeys to get the language entry:
* Example: <samp>$user->lang(array('datetime', 'AGO'), 1)</samp> uses $user->lang['datetime']['AGO'] as language entry.
*/
function lang()
{
$args = func_get_args();
$key = $args[0];
if (is_array($key))
{
$lang = &$this->lang[array_shift($key)];
foreach ($key as $_key)
{
$lang = &$lang[$_key];
}
}
else
{
$lang = &$this->lang[$key];
}
// Return if language string does not exist
if (!isset($lang) || (!is_string($lang) && !is_array($lang)))
{
return $key;
}
// If the language entry is a string, we simply mimic sprintf() behaviour
if (is_string($lang))
{
if (sizeof($args) == 1)
{
return $lang;
}
// Replace key with language entry and simply pass along...
$args[0] = $lang;
return call_user_func_array('sprintf', $args);
}
else if (sizeof($lang) == 0)
{
// If the language entry is an empty array, we just return the language key
return $args[0];
}
// It is an array... now handle different nullar/singular/plural forms
$key_found = false;
// We now get the first number passed and will select the key based upon this number
for ($i = 1, $num_args = sizeof($args); $i < $num_args; $i++)
{
if (is_int($args[$i]) || is_float($args[$i]))
{
if ($args[$i] == 0 && isset($lang[0]))
{
// We allow each translation using plural forms to specify a version for the case of 0 things,
// so that "0 users" may be displayed as "No users".
$key_found = 0;
break;
}
else
{
$use_plural_form = $this->get_plural_form($args[$i]);
if (isset($lang[$use_plural_form]))
{
// The key we should use exists, so we use it.
$key_found = $use_plural_form;
}
else
{
// If the key we need to use does not exist, we fall back to the previous one.
$numbers = array_keys($lang);
foreach ($numbers as $num)
{
if ($num > $use_plural_form)
{
break;
}
$key_found = $num;
}
}
break;
}
}
}
// Ok, let's check if the key was found, else use the last entry (because it is mostly the plural form)
if ($key_found === false)
{
$numbers = array_keys($lang);
$key_found = end($numbers);
}
// Use the language string we determined and pass it to sprintf()
$args[0] = $lang[$key_found];
return call_user_func_array('sprintf', $args);
}
/**
* Determine which plural form we should use.
* For some languages this is not as simple as for English.
*
* @param $number int|float The number we want to get the plural case for. Float numbers are floored.
* @param $force_rule mixed False to use the plural rule of the language package
* or an integer to force a certain plural rule
* @return int The plural-case we need to use for the number plural-rule combination
*/
function get_plural_form($number, $force_rule = false)
{
$number = (int) $number;
// Default to English system
$plural_rule = ($force_rule !== false) ? $force_rule : ((isset($this->lang['PLURAL_RULE'])) ? $this->lang['PLURAL_RULE'] : 1);
return phpbb_get_plural_form($plural_rule, $number);
}
/**
* Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion)
*
* @param mixed $lang_set specifies the language entries to include
* @param bool $use_db internal variable for recursion, do not use
* @param bool $use_help internal variable for recursion, do not use
* @param string $ext_name The extension to load language from, or empty for core files
*
* Examples:
* <code>
* $lang_set = array('posting', 'help' => 'faq');
* $lang_set = array('posting', 'viewtopic', 'help' => array('bbcode', 'faq'))
* $lang_set = array(array('posting', 'viewtopic'), 'help' => array('bbcode', 'faq'))
* $lang_set = 'posting'
* $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting'))
* </code>
*/
function add_lang($lang_set, $use_db = false, $use_help = false, $ext_name = '')
{
global $phpEx;
if (is_array($lang_set))
{
foreach ($lang_set as $key => $lang_file)
{
// Please do not delete this line.
// We have to force the type here, else [array] language inclusion will not work
$key = (string) $key;
if ($key == 'db')
{
$this->add_lang($lang_file, true, $use_help, $ext_name);
}
else if ($key == 'help')
{
$this->add_lang($lang_file, $use_db, true, $ext_name);
}
else if (!is_array($lang_file))
{
$this->set_lang($this->lang, $this->help, $lang_file, $use_db, $use_help, $ext_name);
}
else
{
$this->add_lang($lang_file, $use_db, $use_help, $ext_name);
}
}
unset($lang_set);
}
else if ($lang_set)
{
$this->set_lang($this->lang, $this->help, $lang_set, $use_db, $use_help, $ext_name);
}
}
/**
* Add Language Items from an extension - use_db and use_help are assigned where needed (only use them to force inclusion)
*
* @param string $ext_name The extension to load language from, or empty for core files
* @param mixed $lang_set specifies the language entries to include
* @param bool $use_db internal variable for recursion, do not use
* @param bool $use_help internal variable for recursion, do not use
*/
function add_lang_ext($ext_name, $lang_set, $use_db = false, $use_help = false)
{
if ($ext_name === '/')
{
$ext_name = '';
}
$this->add_lang($lang_set, $use_db, $use_help, $ext_name);
}
/**
* Set language entry (called by add_lang)
* @access private
*/
function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false, $ext_name = '')
{
global $phpbb_root_path, $phpEx;
// Make sure the language name is set (if the user setup did not happen it is not set)
if (!$this->lang_name)
{
global $config;
$this->lang_name = basename($config['default_lang']);
}
// $lang == $this->lang
// $help == $this->help
// - add appropriate variables here, name them as they are used within the language file...
if (!$use_db)
{
if ($use_help && strpos($lang_file, '/') !== false)
{
$filename = dirname($lang_file) . '/help_' . basename($lang_file);
}
else
{
$filename = (($use_help) ? 'help_' : '') . $lang_file;
}
if ($ext_name)
{
global $phpbb_extension_manager;
$ext_path = $phpbb_extension_manager->get_extension_path($ext_name, true);
$lang_path = $ext_path . 'language/';
}
else
{
$lang_path = $this->lang_path;
}
if (strpos($phpbb_root_path . $filename, $lang_path . $this->lang_name . '/') === 0)
{
$language_filename = $phpbb_root_path . $filename;
}
else
{
$language_filename = $lang_path . $this->lang_name . '/' . $filename . '.' . $phpEx;
}
if (!file_exists($language_filename))
{
global $config;
if ($this->lang_name == 'en')
{
// The user's selected language is missing the file, the board default's language is missing the file, and the file doesn't exist in /en.
$language_filename = str_replace($lang_path . 'en', $lang_path . $this->data['user_lang'], $language_filename);
trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
}
else if ($this->lang_name == basename($config['default_lang']))
{
// Fall back to the English Language
$this->lang_name = 'en';
$this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name);
}
else if ($this->lang_name == $this->data['user_lang'])
{
// Fall back to the board default language
$this->lang_name = basename($config['default_lang']);
$this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name);
}
// Reset the lang name
$this->lang_name = (file_exists($lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
return;
}
// Do not suppress error if in DEBUG_EXTRA mode
$include_result = (defined('DEBUG_EXTRA')) ? (include $language_filename) : (@include $language_filename);
if ($include_result === false)
{
trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
}
}
else if ($use_db)
{
// Get Database Language Strings
// Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed
// For example: help:faq, posting
}
}
/**
* Format user date
*
* @param int $gmepoch unix timestamp
* @param string $format date format in date() notation. | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i.
* @param bool $forcedate force non-relative date format.
*
* @return mixed translated date
*/
function format_date($gmepoch, $format = false, $forcedate = false)
{
static $midnight;
static $date_cache;
$format = (!$format) ? $this->date_format : $format;
$now = time();
$delta = $now - $gmepoch;
if (!isset($date_cache[$format]))
{
// Is the user requesting a friendly date format (i.e. 'Today 12:42')?
$date_cache[$format] = array(
'is_short' => strpos($format, '|'),
'format_short' => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1),
'format_long' => str_replace('|', '', $format),
'lang' => $this->lang['datetime'],
);
// Short representation of month in format? Some languages use different terms for the long and short format of May
if ((strpos($format, '\M') === false && strpos($format, 'M') !== false) || (strpos($format, '\r') === false && strpos($format, 'r') !== false))
{
$date_cache[$format]['lang']['May'] = $this->lang['datetime']['May_short'];
}
}
// Zone offset
$zone_offset = $this->timezone + $this->dst;
// Show date < 1 hour ago as 'xx min ago' but not greater than 60 seconds in the future
// A small tolerence is given for times in the future but in the same minute are displayed as '< than a minute ago'
if ($delta < 3600 && $delta > -60 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
{
return $this->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60)));
}
if (!$midnight)
{
list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $zone_offset));
$midnight = gmmktime(0, 0, 0, $m, $d, $y) - $zone_offset;
}
if ($date_cache[$format]['is_short'] !== false && !$forcedate && !($gmepoch < $midnight - 86400 || $gmepoch > $midnight + 172800))
{
$day = false;
if ($gmepoch > $midnight + 86400)
{
$day = 'TOMORROW';
}
else if ($gmepoch > $midnight)
{
$day = 'TODAY';
}
else if ($gmepoch > $midnight - 86400)
{
$day = 'YESTERDAY';
}
if ($day !== false)
{
return str_replace('||', $this->lang['datetime'][$day], strtr(@gmdate($date_cache[$format]['format_short'], $gmepoch + $zone_offset), $date_cache[$format]['lang']));
}
}
return strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $zone_offset), $date_cache[$format]['lang']);
}
/**
* Get language id currently used by the user
*/
function get_iso_lang_id()
{
global $config, $db;
if (!empty($this->lang_id))
{
return $this->lang_id;
}
if (!$this->lang_name)
{
$this->lang_name = $config['default_lang'];
}
$sql = 'SELECT lang_id
FROM ' . LANG_TABLE . "
WHERE lang_iso = '" . $db->sql_escape($this->lang_name) . "'";
$result = $db->sql_query($sql);
$this->lang_id = (int) $db->sql_fetchfield('lang_id');
$db->sql_freeresult($result);
return $this->lang_id;
}
/**
* Get users profile fields
*/
function get_profile_fields($user_id)
{
global $db;
if (isset($this->profile_fields))
{
return;
}
$sql = 'SELECT *
FROM ' . PROFILE_FIELDS_DATA_TABLE . "
WHERE user_id = $user_id";
$result = $db->sql_query_limit($sql, 1);
$this->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row;
$db->sql_freeresult($result);
}
/**
* Specify/Get image
*/
function img($img, $alt = '')
{
$alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt;
return '<span class="imageset ' . $img . '">' . $alt . '</span>';
}
/**
* Get option bit field from user options.
*
* @param int $key option key, as defined in $keyoptions property.
* @param int $data bit field value to use, or false to use $this->data['user_options']
* @return bool true if the option is set in the bit field, false otherwise
*/
function optionget($key, $data = false)
{
$var = ($data !== false) ? $data : $this->data['user_options'];
return phpbb_optionget($this->keyoptions[$key], $var);
}
/**
* Set option bit field for user options.
*
* @param int $key Option key, as defined in $keyoptions property.
* @param bool $value True to set the option, false to clear the option.
* @param int $data Current bit field value, or false to use $this->data['user_options']
* @return int|bool If $data is false, the bit field is modified and
* written back to $this->data['user_options'], and
* return value is true if the bit field changed and
* false otherwise. If $data is not false, the new
* bitfield value is returned.
*/
function optionset($key, $value, $data = false)
{
$var = ($data !== false) ? $data : $this->data['user_options'];
$new_var = phpbb_optionset($this->keyoptions[$key], $value, $var);
if ($data === false)
{
if ($new_var != $var)
{
$this->data['user_options'] = $new_var;
return true;
}
else
{
return false;
}
}
else
{
return $new_var;
}
}
/**
* Funtion to make the user leave the NEWLY_REGISTERED system group.
* @access public
*/
function leave_newly_registered()
{
global $db;
if (empty($this->data['user_new']))
{
return false;
}
if (!function_exists('remove_newly_registered'))
{
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
if ($group = remove_newly_registered($this->data['user_id'], $this->data))
{
$this->data['group_id'] = $group;
}
$this->data['user_permissions'] = '';
$this->data['user_new'] = 0;
return true;
}
/**
* Returns all password protected forum ids the user is currently NOT authenticated for.
*
* @return array Array of forum ids
* @access public
*/
function get_passworded_forums()
{
global $db;
$sql = 'SELECT f.forum_id, fa.user_id
FROM ' . FORUMS_TABLE . ' f
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa
ON (fa.forum_id = f.forum_id
AND fa.session_id = '" . $db->sql_escape($this->session_id) . "')
WHERE f.forum_password <> ''";
$result = $db->sql_query($sql);
$forum_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$forum_id = (int) $row['forum_id'];
if ($row['user_id'] != $this->data['user_id'])
{
$forum_ids[$forum_id] = $forum_id;
}
}
$db->sql_freeresult($result);
return $forum_ids;
}
}

View file

@ -84,8 +84,6 @@ if (!empty($load_extensions) && function_exists('dl'))
// Include files // Include files
require($phpbb_root_path . 'includes/class_loader.' . $phpEx); require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
require($phpbb_root_path . 'includes/session.' . $phpEx);
require($phpbb_root_path . 'includes/auth.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx);
@ -122,7 +120,7 @@ $phpbb_class_loader->set_cache($cache->get_driver());
$phpbb_dispatcher = new phpbb_event_dispatcher(); $phpbb_dispatcher = new phpbb_event_dispatcher();
$request = new phpbb_request(); $request = new phpbb_request();
$user = new user(); $user = new phpbb_user();
$db = new $sql_db(); $db = new $sql_db();
// make sure request_var uses this request instance // make sure request_var uses this request instance
@ -1065,6 +1063,8 @@ function database_update_info()
'3.0.10-RC2' => array(), '3.0.10-RC2' => array(),
// No changes from 3.0.10-RC3 to 3.0.10 // No changes from 3.0.10-RC3 to 3.0.10
'3.0.10-RC3' => array(), '3.0.10-RC3' => array(),
// No changes from 3.0.10 to 3.0.11-RC1
'3.0.10' => array(),
/** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.11-RC1 */ /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.11-RC1 */
@ -1089,6 +1089,12 @@ function database_update_info()
PROFILE_FIELDS_TABLE => array( PROFILE_FIELDS_TABLE => array(
'field_show_on_pm' => array('BOOL', 0), 'field_show_on_pm' => array('BOOL', 0),
), ),
STYLES_TABLE => array(
'style_path' => array('VCHAR:100', ''),
'bbcode_bitfield' => array('VCHAR:255', 'kNg='),
'style_parent_id' => array('UINT:4', 0),
'style_parent_tree' => array('TEXT', ''),
),
REPORTS_TABLE => array( REPORTS_TABLE => array(
'reported_post_text' => array('MTEXT_UNI', ''), 'reported_post_text' => array('MTEXT_UNI', ''),
), ),
@ -1101,20 +1107,16 @@ function database_update_info()
'drop_columns' => array( 'drop_columns' => array(
STYLES_TABLE => array( STYLES_TABLE => array(
'imageset_id', 'imageset_id',
), 'template_id',
STYLES_TEMPLATE_TABLE => array( 'theme_id',
'template_storedb',
),
STYLES_THEME_TABLE => array(
'theme_storedb',
'theme_mtime',
'theme_data',
), ),
), ),
'drop_tables' => array( 'drop_tables' => array(
STYLES_IMAGESET_TABLE, STYLES_IMAGESET_TABLE,
STYLES_IMAGESET_DATA_TABLE, STYLES_IMAGESET_DATA_TABLE,
STYLES_TEMPLATE_TABLE,
STYLES_TEMPLATE_DATA_TABLE, STYLES_TEMPLATE_DATA_TABLE,
STYLES_THEME_TABLE,
), ),
), ),
); );
@ -2147,6 +2149,32 @@ function change_database_data(&$no_updates, $version)
case '3.0.10-RC3': case '3.0.10-RC3':
break; break;
// Changes from 3.0.10 to 3.0.11-RC1
case '3.0.10':
// Updates users having current style a deactivated one
$sql = 'SELECT style_id
FROM ' . STYLES_TABLE . '
WHERE style_active = 0';
$result = $db->sql_query($sql);
$deactivated_style_ids = array();
while ($style_id = $db->sql_fetchfield('style_id', false, $result))
{
$deactivated_style_ids[] = (int) $style_id;
}
$db->sql_freeresult($result);
if (!empty($deactivated_style_ids))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_style = ' . (int) $config['default_style'] .'
WHERE ' . $db->sql_in_set('user_style', $deactivated_style_ids);
_sql($sql, $errored, $error_ary);
}
$no_updates = false;
break;
// Changes from 3.1.0-dev to 3.1.0-A1 // Changes from 3.1.0-dev to 3.1.0-A1
case '3.1.0-dev': case '3.1.0-dev':
@ -2271,12 +2299,33 @@ function change_database_data(&$no_updates, $version)
'auth' => 'acl_a_attach', 'auth' => 'acl_a_attach',
'cat' => 'ACP_ATTACHMENTS', 'cat' => 'ACP_ATTACHMENTS',
), ),
'install' => array(
'base' => 'acp_styles',
'class' => 'acp',
'title' => 'ACP_STYLES_INSTALL',
'auth' => 'acl_a_styles',
'cat' => 'ACP_STYLE_MANAGEMENT',
),
'edit' => array(
'base' => 'acp_styles',
'class' => 'acp',
'title' => 'ACP_STYLES_EDIT',
'auth' => 'acl_a_styles',
'cat' => 'ACP_STYLE_MANAGEMENT',
),
'cache' => array(
'base' => 'acp_styles',
'class' => 'acp',
'title' => 'ACP_STYLES_CACHE',
'auth' => 'acl_a_styles',
'cat' => 'ACP_STYLE_MANAGEMENT',
),
); );
_add_modules($modules_to_install); _add_modules($modules_to_install);
$sql = 'DELETE FROM ' . MODULES_TABLE . " $sql = 'DELETE FROM ' . MODULES_TABLE . "
WHERE module_basename = 'styles' AND module_mode = 'imageset'"; WHERE (module_basename = 'styles' OR module_basename = 'acp_styles') AND (module_mode = 'imageset' OR module_mode = 'theme' OR module_mode = 'template')";
_sql($sql, $errored, $error_ary); _sql($sql, $errored, $error_ary);
// Localise Global Announcements // Localise Global Announcements
@ -2367,6 +2416,12 @@ function change_database_data(&$no_updates, $version)
set_config('teampage_memberships', '1'); set_config('teampage_memberships', '1');
} }
// Clear styles table and add prosilver entry
_sql('DELETE FROM ' . STYLES_TABLE, $errored, $error_ary);
$sql = 'INSERT INTO ' . STYLES_TABLE . " (style_name, style_copyright, style_active, style_path, bbcode_bitfield, style_parent_id, style_parent_tree) VALUES ('prosilver', '&copy; phpBB Group', 1, 'prosilver', 'kNg=', 0, '')";
_sql($sql, $errored, $error_ary);
$no_updates = false; $no_updates = false;
break; break;

View file

@ -75,8 +75,6 @@ require($phpbb_root_path . 'includes/functions.' . $phpEx);
phpbb_require_updated('includes/functions_content.' . $phpEx, true); phpbb_require_updated('includes/functions_content.' . $phpEx, true);
include($phpbb_root_path . 'includes/auth.' . $phpEx);
include($phpbb_root_path . 'includes/session.' . $phpEx);
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
require($phpbb_root_path . 'includes/functions_install.' . $phpEx); require($phpbb_root_path . 'includes/functions_install.' . $phpEx);
@ -178,8 +176,8 @@ $sub = request_var('sub', '');
// Set PHP error handler to ours // Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
$user = new user(); $user = new phpbb_user();
$auth = new auth(); $auth = new phpbb_auth();
// Add own hook handler, if present. :o // Add own hook handler, if present. :o
if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx)) if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
@ -202,11 +200,12 @@ $config = new phpbb_config(array(
'load_tplcompile' => '1' 'load_tplcompile' => '1'
)); ));
$phpbb_template_locator = new phpbb_template_locator(); $phpbb_style_resource_locator = new phpbb_style_resource_locator();
$phpbb_template_path_provider = new phpbb_template_path_provider(); $phpbb_style_path_provider = new phpbb_style_path_provider();
$template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_template_locator, $phpbb_template_path_provider); $template = new phpbb_style_template($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider);
$template->set_ext_dir_prefix('adm/'); $phpbb_style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider, $template);
$template->set_custom_template('../adm/style', 'admin'); $phpbb_style->set_ext_dir_prefix('adm/');
$phpbb_style->set_custom_style('admin', '../adm/style', '');
$template->assign_var('T_ASSETS_PATH', '../assets'); $template->assign_var('T_ASSETS_PATH', '../assets');
$template->assign_var('T_TEMPLATE_PATH', '../adm/style'); $template->assign_var('T_TEMPLATE_PATH', '../adm/style');

View file

@ -1804,6 +1804,9 @@ class install_install extends module
$this->page_title = $lang['STAGE_FINAL']; $this->page_title = $lang['STAGE_FINAL'];
// Obtain any submitted data
$data = $this->get_submitted_data();
// We need to fill the config to let internal functions correctly work // We need to fill the config to let internal functions correctly work
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE); $config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
set_config(null, null, null, $config); set_config(null, null, null, $config);

View file

@ -71,7 +71,7 @@ class install_update extends module
function main($mode, $sub) function main($mode, $sub)
{ {
global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language; global $style, $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language;
global $request; global $request;
$this->tpl_name = 'install_update'; $this->tpl_name = 'install_update';
@ -131,7 +131,7 @@ class install_update extends module
} }
// Set custom template again. ;) // Set custom template again. ;)
$template->set_custom_template('../adm/style', 'admin'); $phpbb_style->set_custom_style('admin', '../adm/style', '');
$template->assign_vars(array( $template->assign_vars(array(
'S_USER_LANG' => $user->lang['USER_LANG'], 'S_USER_LANG' => $user->lang['USER_LANG'],
@ -504,56 +504,6 @@ class install_update extends module
// Add database update to log // Add database update to log
add_log('admin', 'LOG_UPDATE_PHPBB', $this->current_version, $this->update_to_version); add_log('admin', 'LOG_UPDATE_PHPBB', $this->current_version, $this->update_to_version);
// Refresh prosilver css data - this may cause some unhappy users, but
$sql = 'SELECT *
FROM ' . STYLES_THEME_TABLE . "
WHERE LOWER(theme_name) = 'prosilver'";
$result = $db->sql_query($sql);
$theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($theme)
{
$recache = (empty($theme['theme_data'])) ? true : false;
$update_time = time();
// We test for stylesheet.css because it is faster and most likely the only file changed on common themes
if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
{
$recache = true;
$update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css');
}
else if (!$recache)
{
$last_change = $theme['theme_mtime'];
$dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme");
if ($dir)
{
while (($entry = readdir($dir)) !== false)
{
if (substr(strrchr($entry, '.'), 1) == 'css' && $last_change < @filemtime("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/{$entry}"))
{
$recache = true;
break;
}
}
closedir($dir);
}
}
if ($recache)
{
// Instead of re-caching here, we simply remove theme_data... HAR HAR HAR (think about a carribean pirate)
$sql = 'UPDATE ' . STYLES_THEME_TABLE . " SET theme_data = ''
WHERE theme_id = " . $theme['theme_id'];
$db->sql_query($sql);
$cache->destroy('sql', STYLES_THEME_TABLE);
$cache->destroy('sql', STYLES_TABLE);
}
}
$db->sql_return_on_error(true); $db->sql_return_on_error(true);
$db->sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'"); $db->sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'");
$db->sql_return_on_error(false); $db->sql_return_on_error(false);
@ -1694,9 +1644,9 @@ class install_update extends module
$info['custom'] = array(); $info['custom'] = array();
/* /*
// Get custom installed styles... // Get custom installed styles...
$sql = 'SELECT template_name, template_path $sql = 'SELECT style_name, style_path
FROM ' . STYLES_TEMPLATE_TABLE . " FROM ' . STYLES_TABLE . "
WHERE LOWER(template_name) NOT IN ('subsilver2', 'prosilver')"; WHERE LOWER(style_name) NOT IN ('subsilver2', 'prosilver')";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$templates = array(); $templates = array();
@ -1715,7 +1665,7 @@ class install_update extends module
{ {
foreach ($templates as $row) foreach ($templates as $row)
{ {
$info['custom'][$filename][] = str_replace('/prosilver/', '/' . $row['template_path'] . '/', $filename); $info['custom'][$filename][] = str_replace('/prosilver/', '/' . $row['style_path'] . '/', $filename);
} }
} }
} }

View file

@ -1087,15 +1087,15 @@ CREATE TABLE phpbb_styles (
style_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, style_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
style_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, style_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
style_active INTEGER DEFAULT 1 NOT NULL, style_active INTEGER DEFAULT 1 NOT NULL,
template_id INTEGER DEFAULT 0 NOT NULL, style_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
theme_id INTEGER DEFAULT 0 NOT NULL bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT 'kNg=' NOT NULL,
style_parent_id INTEGER DEFAULT 0 NOT NULL,
style_parent_tree BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL
);; );;
ALTER TABLE phpbb_styles ADD PRIMARY KEY (style_id);; ALTER TABLE phpbb_styles ADD PRIMARY KEY (style_id);;
CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles(style_name);; CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles(style_name);;
CREATE INDEX phpbb_styles_template_id ON phpbb_styles(template_id);;
CREATE INDEX phpbb_styles_theme_id ON phpbb_styles(theme_id);;
CREATE GENERATOR phpbb_styles_gen;; CREATE GENERATOR phpbb_styles_gen;;
SET GENERATOR phpbb_styles_gen TO 0;; SET GENERATOR phpbb_styles_gen TO 0;;
@ -1108,55 +1108,6 @@ BEGIN
END;; END;;
# Table: 'phpbb_styles_template'
CREATE TABLE phpbb_styles_template (
template_id INTEGER NOT NULL,
template_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
template_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
template_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL,
bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT 'kNg=' NOT NULL,
template_inherits_id INTEGER DEFAULT 0 NOT NULL,
template_inherit_path VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
);;
ALTER TABLE phpbb_styles_template ADD PRIMARY KEY (template_id);;
CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template(template_name);;
CREATE GENERATOR phpbb_styles_template_gen;;
SET GENERATOR phpbb_styles_template_gen TO 0;;
CREATE TRIGGER t_phpbb_styles_template FOR phpbb_styles_template
BEFORE INSERT
AS
BEGIN
NEW.template_id = GEN_ID(phpbb_styles_template_gen, 1);
END;;
# Table: 'phpbb_styles_theme'
CREATE TABLE phpbb_styles_theme (
theme_id INTEGER NOT NULL,
theme_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
theme_copyright VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
theme_path VARCHAR(100) CHARACTER SET NONE DEFAULT '' NOT NULL
);;
ALTER TABLE phpbb_styles_theme ADD PRIMARY KEY (theme_id);;
CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme(theme_name);;
CREATE GENERATOR phpbb_styles_theme_gen;;
SET GENERATOR phpbb_styles_theme_gen TO 0;;
CREATE TRIGGER t_phpbb_styles_theme FOR phpbb_styles_theme
BEFORE INSERT
AS
BEGIN
NEW.theme_id = GEN_ID(phpbb_styles_theme_gen, 1);
END;;
# Table: 'phpbb_topics' # Table: 'phpbb_topics'
CREATE TABLE phpbb_topics ( CREATE TABLE phpbb_topics (
topic_id INTEGER NOT NULL, topic_id INTEGER NOT NULL,

View file

@ -1323,8 +1323,10 @@ CREATE TABLE [phpbb_styles] (
[style_name] [varchar] (255) DEFAULT ('') NOT NULL , [style_name] [varchar] (255) DEFAULT ('') NOT NULL ,
[style_copyright] [varchar] (255) DEFAULT ('') NOT NULL , [style_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
[style_active] [int] DEFAULT (1) NOT NULL , [style_active] [int] DEFAULT (1) NOT NULL ,
[template_id] [int] DEFAULT (0) NOT NULL , [style_path] [varchar] (100) DEFAULT ('') NOT NULL ,
[theme_id] [int] DEFAULT (0) NOT NULL [bbcode_bitfield] [varchar] (255) DEFAULT ('kNg=') NOT NULL ,
[style_parent_id] [int] DEFAULT (0) NOT NULL ,
[style_parent_tree] [varchar] (8000) DEFAULT ('') NOT NULL
) ON [PRIMARY] ) ON [PRIMARY]
GO GO
@ -1338,59 +1340,6 @@ GO
CREATE UNIQUE INDEX [style_name] ON [phpbb_styles]([style_name]) ON [PRIMARY] CREATE UNIQUE INDEX [style_name] ON [phpbb_styles]([style_name]) ON [PRIMARY]
GO GO
CREATE INDEX [template_id] ON [phpbb_styles]([template_id]) ON [PRIMARY]
GO
CREATE INDEX [theme_id] ON [phpbb_styles]([theme_id]) ON [PRIMARY]
GO
/*
Table: 'phpbb_styles_template'
*/
CREATE TABLE [phpbb_styles_template] (
[template_id] [int] IDENTITY (1, 1) NOT NULL ,
[template_name] [varchar] (255) DEFAULT ('') NOT NULL ,
[template_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
[template_path] [varchar] (100) DEFAULT ('') NOT NULL ,
[bbcode_bitfield] [varchar] (255) DEFAULT ('kNg=') NOT NULL ,
[template_inherits_id] [int] DEFAULT (0) NOT NULL ,
[template_inherit_path] [varchar] (255) DEFAULT ('') NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [phpbb_styles_template] WITH NOCHECK ADD
CONSTRAINT [PK_phpbb_styles_template] PRIMARY KEY CLUSTERED
(
[template_id]
) ON [PRIMARY]
GO
CREATE UNIQUE INDEX [tmplte_nm] ON [phpbb_styles_template]([template_name]) ON [PRIMARY]
GO
/*
Table: 'phpbb_styles_theme'
*/
CREATE TABLE [phpbb_styles_theme] (
[theme_id] [int] IDENTITY (1, 1) NOT NULL ,
[theme_name] [varchar] (255) DEFAULT ('') NOT NULL ,
[theme_copyright] [varchar] (255) DEFAULT ('') NOT NULL ,
[theme_path] [varchar] (100) DEFAULT ('') NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [phpbb_styles_theme] WITH NOCHECK ADD
CONSTRAINT [PK_phpbb_styles_theme] PRIMARY KEY CLUSTERED
(
[theme_id]
) ON [PRIMARY]
GO
CREATE UNIQUE INDEX [theme_name] ON [phpbb_styles_theme]([theme_name]) ON [PRIMARY]
GO
/* /*
Table: 'phpbb_topics' Table: 'phpbb_topics'

View file

@ -761,37 +761,12 @@ CREATE TABLE phpbb_styles (
style_name blob NOT NULL, style_name blob NOT NULL,
style_copyright blob NOT NULL, style_copyright blob NOT NULL,
style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
template_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, style_path varbinary(100) DEFAULT '' NOT NULL,
theme_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (style_id),
UNIQUE style_name (style_name(255)),
KEY template_id (template_id),
KEY theme_id (theme_id)
);
# Table: 'phpbb_styles_template'
CREATE TABLE phpbb_styles_template (
template_id mediumint(8) UNSIGNED NOT NULL auto_increment,
template_name blob NOT NULL,
template_copyright blob NOT NULL,
template_path varbinary(100) DEFAULT '' NOT NULL,
bbcode_bitfield varbinary(255) DEFAULT 'kNg=' NOT NULL, bbcode_bitfield varbinary(255) DEFAULT 'kNg=' NOT NULL,
template_inherits_id int(4) UNSIGNED DEFAULT '0' NOT NULL, style_parent_id int(4) UNSIGNED DEFAULT '0' NOT NULL,
template_inherit_path varbinary(255) DEFAULT '' NOT NULL, style_parent_tree blob NOT NULL,
PRIMARY KEY (template_id), PRIMARY KEY (style_id),
UNIQUE tmplte_nm (template_name(255)) UNIQUE style_name (style_name(255))
);
# Table: 'phpbb_styles_theme'
CREATE TABLE phpbb_styles_theme (
theme_id mediumint(8) UNSIGNED NOT NULL auto_increment,
theme_name blob NOT NULL,
theme_copyright blob NOT NULL,
theme_path varbinary(100) DEFAULT '' NOT NULL,
PRIMARY KEY (theme_id),
UNIQUE theme_name (theme_name(255))
); );

View file

@ -761,37 +761,12 @@ CREATE TABLE phpbb_styles (
style_name varchar(255) DEFAULT '' NOT NULL, style_name varchar(255) DEFAULT '' NOT NULL,
style_copyright varchar(255) DEFAULT '' NOT NULL, style_copyright varchar(255) DEFAULT '' NOT NULL,
style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, style_active tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
template_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, style_path varchar(100) DEFAULT '' NOT NULL,
theme_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (style_id),
UNIQUE style_name (style_name),
KEY template_id (template_id),
KEY theme_id (theme_id)
) CHARACTER SET `utf8` COLLATE `utf8_bin`;
# Table: 'phpbb_styles_template'
CREATE TABLE phpbb_styles_template (
template_id mediumint(8) UNSIGNED NOT NULL auto_increment,
template_name varchar(255) DEFAULT '' NOT NULL,
template_copyright varchar(255) DEFAULT '' NOT NULL,
template_path varchar(100) DEFAULT '' NOT NULL,
bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL, bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL,
template_inherits_id int(4) UNSIGNED DEFAULT '0' NOT NULL, style_parent_id int(4) UNSIGNED DEFAULT '0' NOT NULL,
template_inherit_path varchar(255) DEFAULT '' NOT NULL, style_parent_tree text NOT NULL,
PRIMARY KEY (template_id), PRIMARY KEY (style_id),
UNIQUE tmplte_nm (template_name) UNIQUE style_name (style_name)
) CHARACTER SET `utf8` COLLATE `utf8_bin`;
# Table: 'phpbb_styles_theme'
CREATE TABLE phpbb_styles_theme (
theme_id mediumint(8) UNSIGNED NOT NULL auto_increment,
theme_name varchar(255) DEFAULT '' NOT NULL,
theme_copyright varchar(255) DEFAULT '' NOT NULL,
theme_path varchar(100) DEFAULT '' NOT NULL,
PRIMARY KEY (theme_id),
UNIQUE theme_name (theme_name)
) CHARACTER SET `utf8` COLLATE `utf8_bin`; ) CHARACTER SET `utf8` COLLATE `utf8_bin`;

View file

@ -1445,17 +1445,15 @@ CREATE TABLE phpbb_styles (
style_name varchar2(765) DEFAULT '' , style_name varchar2(765) DEFAULT '' ,
style_copyright varchar2(765) DEFAULT '' , style_copyright varchar2(765) DEFAULT '' ,
style_active number(1) DEFAULT '1' NOT NULL, style_active number(1) DEFAULT '1' NOT NULL,
template_id number(8) DEFAULT '0' NOT NULL, style_path varchar2(100) DEFAULT '' ,
theme_id number(8) DEFAULT '0' NOT NULL, bbcode_bitfield varchar2(255) DEFAULT 'kNg=' NOT NULL,
style_parent_id number(4) DEFAULT '0' NOT NULL,
style_parent_tree clob DEFAULT '' ,
CONSTRAINT pk_phpbb_styles PRIMARY KEY (style_id), CONSTRAINT pk_phpbb_styles PRIMARY KEY (style_id),
CONSTRAINT u_phpbb_style_name UNIQUE (style_name) CONSTRAINT u_phpbb_style_name UNIQUE (style_name)
) )
/ /
CREATE INDEX phpbb_styles_template_id ON phpbb_styles (template_id)
/
CREATE INDEX phpbb_styles_theme_id ON phpbb_styles (theme_id)
/
CREATE SEQUENCE phpbb_styles_seq CREATE SEQUENCE phpbb_styles_seq
/ /
@ -1473,69 +1471,6 @@ END;
/ /
/*
Table: 'phpbb_styles_template'
*/
CREATE TABLE phpbb_styles_template (
template_id number(8) NOT NULL,
template_name varchar2(765) DEFAULT '' ,
template_copyright varchar2(765) DEFAULT '' ,
template_path varchar2(100) DEFAULT '' ,
bbcode_bitfield varchar2(255) DEFAULT 'kNg=' NOT NULL,
template_inherits_id number(4) DEFAULT '0' NOT NULL,
template_inherit_path varchar2(255) DEFAULT '' ,
CONSTRAINT pk_phpbb_styles_template PRIMARY KEY (template_id),
CONSTRAINT u_phpbb_tmplte_nm UNIQUE (template_name)
)
/
CREATE SEQUENCE phpbb_styles_template_seq
/
CREATE OR REPLACE TRIGGER t_phpbb_styles_template
BEFORE INSERT ON phpbb_styles_template
FOR EACH ROW WHEN (
new.template_id IS NULL OR new.template_id = 0
)
BEGIN
SELECT phpbb_styles_template_seq.nextval
INTO :new.template_id
FROM dual;
END;
/
/*
Table: 'phpbb_styles_theme'
*/
CREATE TABLE phpbb_styles_theme (
theme_id number(8) NOT NULL,
theme_name varchar2(765) DEFAULT '' ,
theme_copyright varchar2(765) DEFAULT '' ,
theme_path varchar2(100) DEFAULT '' ,
CONSTRAINT pk_phpbb_styles_theme PRIMARY KEY (theme_id),
CONSTRAINT u_phpbb_theme_name UNIQUE (theme_name)
)
/
CREATE SEQUENCE phpbb_styles_theme_seq
/
CREATE OR REPLACE TRIGGER t_phpbb_styles_theme
BEFORE INSERT ON phpbb_styles_theme
FOR EACH ROW WHEN (
new.theme_id IS NULL OR new.theme_id = 0
)
BEGIN
SELECT phpbb_styles_theme_seq.nextval
INTO :new.theme_id
FROM dual;
END;
/
/* /*
Table: 'phpbb_topics' Table: 'phpbb_topics'
*/ */

View file

@ -995,47 +995,14 @@ CREATE TABLE phpbb_styles (
style_name varchar(255) DEFAULT '' NOT NULL, style_name varchar(255) DEFAULT '' NOT NULL,
style_copyright varchar(255) DEFAULT '' NOT NULL, style_copyright varchar(255) DEFAULT '' NOT NULL,
style_active INT2 DEFAULT '1' NOT NULL CHECK (style_active >= 0), style_active INT2 DEFAULT '1' NOT NULL CHECK (style_active >= 0),
template_id INT4 DEFAULT '0' NOT NULL CHECK (template_id >= 0), style_path varchar(100) DEFAULT '' NOT NULL,
theme_id INT4 DEFAULT '0' NOT NULL CHECK (theme_id >= 0), bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL,
style_parent_id INT4 DEFAULT '0' NOT NULL CHECK (style_parent_id >= 0),
style_parent_tree varchar(8000) DEFAULT '' NOT NULL,
PRIMARY KEY (style_id) PRIMARY KEY (style_id)
); );
CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name); CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name);
CREATE INDEX phpbb_styles_template_id ON phpbb_styles (template_id);
CREATE INDEX phpbb_styles_theme_id ON phpbb_styles (theme_id);
/*
Table: 'phpbb_styles_template'
*/
CREATE SEQUENCE phpbb_styles_template_seq;
CREATE TABLE phpbb_styles_template (
template_id INT4 DEFAULT nextval('phpbb_styles_template_seq'),
template_name varchar(255) DEFAULT '' NOT NULL,
template_copyright varchar(255) DEFAULT '' NOT NULL,
template_path varchar(100) DEFAULT '' NOT NULL,
bbcode_bitfield varchar(255) DEFAULT 'kNg=' NOT NULL,
template_inherits_id INT4 DEFAULT '0' NOT NULL CHECK (template_inherits_id >= 0),
template_inherit_path varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (template_id)
);
CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template (template_name);
/*
Table: 'phpbb_styles_theme'
*/
CREATE SEQUENCE phpbb_styles_theme_seq;
CREATE TABLE phpbb_styles_theme (
theme_id INT4 DEFAULT nextval('phpbb_styles_theme_seq'),
theme_name varchar(255) DEFAULT '' NOT NULL,
theme_copyright varchar(255) DEFAULT '' NOT NULL,
theme_path varchar(100) DEFAULT '' NOT NULL,
PRIMARY KEY (theme_id)
);
CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme (theme_name);
/* /*
Table: 'phpbb_topics' Table: 'phpbb_topics'

View file

@ -437,13 +437,7 @@ INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order)
INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NEW_MEMBER', 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER', 'f_', 10); INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NEW_MEMBER', 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER', 'f_', 10);
# -- phpbb_styles # -- phpbb_styles
INSERT INTO phpbb_styles (style_name, style_copyright, style_active, template_id, theme_id) VALUES ('prosilver', '&copy; phpBB Group', 1, 1, 1); INSERT INTO phpbb_styles (style_name, style_copyright, style_active, style_path, bbcode_bitfield, style_parent_id, style_parent_tree) VALUES ('prosilver', '&copy; phpBB Group', 1, 'prosilver', 'kNg=', 0, '');
# -- phpbb_styles_template
INSERT INTO phpbb_styles_template (template_name, template_copyright, template_path, bbcode_bitfield) VALUES ('prosilver', '&copy; phpBB Group', 'prosilver', 'lNg=');
# -- phpbb_styles_theme
INSERT INTO phpbb_styles_theme (theme_name, theme_copyright, theme_path) VALUES ('prosilver', '&copy; phpBB Group', 'prosilver');
# -- Forums # -- Forums
INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents) VALUES ('{L_FORUMS_FIRST_CATEGORY}', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', 'AA0000', 972086460, '', '', '', '', '', '', '', 0, 0, ''); INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents) VALUES ('{L_FORUMS_FIRST_CATEGORY}', '', 1, 4, 0, 0, 1, 1, 1, 1, 2, 'Admin', 'AA0000', 972086460, '', '', '', '', '', '', '', 0, 0, '');

View file

@ -737,36 +737,13 @@ CREATE TABLE phpbb_styles (
style_name varchar(255) NOT NULL DEFAULT '', style_name varchar(255) NOT NULL DEFAULT '',
style_copyright varchar(255) NOT NULL DEFAULT '', style_copyright varchar(255) NOT NULL DEFAULT '',
style_active INTEGER UNSIGNED NOT NULL DEFAULT '1', style_active INTEGER UNSIGNED NOT NULL DEFAULT '1',
template_id INTEGER UNSIGNED NOT NULL DEFAULT '0', style_path varchar(100) NOT NULL DEFAULT '',
theme_id INTEGER UNSIGNED NOT NULL DEFAULT '0' bbcode_bitfield varchar(255) NOT NULL DEFAULT 'kNg=',
style_parent_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
style_parent_tree text(65535) NOT NULL DEFAULT ''
); );
CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name); CREATE UNIQUE INDEX phpbb_styles_style_name ON phpbb_styles (style_name);
CREATE INDEX phpbb_styles_template_id ON phpbb_styles (template_id);
CREATE INDEX phpbb_styles_theme_id ON phpbb_styles (theme_id);
# Table: 'phpbb_styles_template'
CREATE TABLE phpbb_styles_template (
template_id INTEGER PRIMARY KEY NOT NULL ,
template_name varchar(255) NOT NULL DEFAULT '',
template_copyright varchar(255) NOT NULL DEFAULT '',
template_path varchar(100) NOT NULL DEFAULT '',
bbcode_bitfield varchar(255) NOT NULL DEFAULT 'kNg=',
template_inherits_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
template_inherit_path varchar(255) NOT NULL DEFAULT ''
);
CREATE UNIQUE INDEX phpbb_styles_template_tmplte_nm ON phpbb_styles_template (template_name);
# Table: 'phpbb_styles_theme'
CREATE TABLE phpbb_styles_theme (
theme_id INTEGER PRIMARY KEY NOT NULL ,
theme_name varchar(255) NOT NULL DEFAULT '',
theme_copyright varchar(255) NOT NULL DEFAULT '',
theme_path varchar(100) NOT NULL DEFAULT ''
);
CREATE UNIQUE INDEX phpbb_styles_theme_theme_name ON phpbb_styles_theme (theme_name);
# Table: 'phpbb_topics' # Table: 'phpbb_topics'
CREATE TABLE phpbb_topics ( CREATE TABLE phpbb_topics (

View file

@ -168,6 +168,8 @@ $lang = array_merge($lang, array(
'ACP_STYLE_COMPONENTS' => 'Style components', 'ACP_STYLE_COMPONENTS' => 'Style components',
'ACP_STYLE_MANAGEMENT' => 'Style management', 'ACP_STYLE_MANAGEMENT' => 'Style management',
'ACP_STYLES' => 'Styles', 'ACP_STYLES' => 'Styles',
'ACP_STYLES_CACHE' => 'Purge Cache',
'ACP_STYLES_INSTALL' => 'Install Styles',
'ACP_SUBMIT_CHANGES' => 'Submit changes', 'ACP_SUBMIT_CHANGES' => 'Submit changes',

View file

@ -35,15 +35,9 @@ if (empty($lang) || !is_array($lang))
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array( $lang = array_merge($lang, array(
'ACP_STYLES_EXPLAIN' => 'Here you can manage the available styles on your board. A style consists of a template and theme. You may alter existing styles, delete, deactivate, reactivate, create or import new ones. You can also see what a style will look like using the preview function. The current default style is noted by the presence of an asterisk (*). Also listed is the total user count for each style, note that overriding user styles will not be reflected here.', 'ACP_STYLES_EXPLAIN' => 'Here you can manage the available styles on your board. You may alter existing styles, delete, deactivate, reactivate, install new ones. You can also see what a style will look like using the preview function. Also listed is the total user count for each style, note that overriding user styles will not be reflected here.',
'ACP_TEMPLATES_EXPLAIN' => 'A template set comprises all the markup used to generate the layout of your board. Here you can edit existing template sets, delete, export, import and preview sets. You can also modify the templating code used to generate BBCode.',
'ACP_THEMES_EXPLAIN' => 'From here you can create, install, edit, delete and export themes. A theme is the combination of colours and images that are applied to your templates to define the basic look of your board. The range of options open to you depends on the configuration of your server and phpBB installation, see the manual for further details. Please note that when creating new themes the use of an existing theme as a basis is optional.',
'ADD_STYLE' => 'Create style',
'ADD_STYLE_EXPLAIN' => 'Here you can create a new style. Depending on your server configuration and file permissions you may have additional options. For example you may be able to base this style on an existing one. You may also be able to upload or import (from the store directory) a style archive. If you upload or import an archive the style name will be determined automatically.',
'ADD_TEMPLATE' => 'Create template', 'ADD_TEMPLATE' => 'Create template',
'ADD_TEMPLATE_EXPLAIN' => 'Here you can add a new template. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this template set on an existing one. You may also be able to upload or import (from the store directory) a template archive. If you upload or import an archive the template name can be optionally taken from the archive name (to do this leave the template name blank).', 'ADD_TEMPLATE_EXPLAIN' => 'Here you can add a new template. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this template set on an existing one. You may also be able to upload or import (from the store directory) a template archive. If you upload or import an archive the template name can be optionally taken from the archive name (to do this leave the template name blank).',
'ADD_THEME' => 'Create theme',
'ADD_THEME_EXPLAIN' => 'Here you can add a new theme. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this theme on an existing one. You may also be able to upload or import (from the store directory) a theme archive. If you upload or import an archive the theme name can be optionally taken from the archive name (to do this leave the theme name blank).',
'ARCHIVE_FORMAT' => 'Archive file type', 'ARCHIVE_FORMAT' => 'Archive file type',
'AUTOMATIC_EXPLAIN' => 'Leave blank to attempt automatic detection.', 'AUTOMATIC_EXPLAIN' => 'Leave blank to attempt automatic detection.',
@ -58,7 +52,10 @@ $lang = array_merge($lang, array(
'CACHE_FILENAME' => 'Template file', 'CACHE_FILENAME' => 'Template file',
'CACHE_FILESIZE' => 'File size', 'CACHE_FILESIZE' => 'File size',
'CACHE_MODIFIED' => 'Modified', 'CACHE_MODIFIED' => 'Modified',
'CANNOT_BE_INSTALLED' => 'Cannot be installed',
'CONFIRM_TEMPLATE_CLEAR_CACHE' => 'Are you sure you wish to clear all cached versions of your template files?', 'CONFIRM_TEMPLATE_CLEAR_CACHE' => 'Are you sure you wish to clear all cached versions of your template files?',
'CONFIRM_DELETE_STYLES' => 'Are you sure you wish to delete selected styles?',
'CONFIRM_UNINSTALL_STYLES' => 'Are you sure you wish to uninstall selected styles?',
'COPYRIGHT' => 'Copyright', 'COPYRIGHT' => 'Copyright',
'CREATE_STYLE' => 'Create new style', 'CREATE_STYLE' => 'Create new style',
'CREATE_TEMPLATE' => 'Create new template set', 'CREATE_TEMPLATE' => 'Create new template set',
@ -69,10 +66,10 @@ $lang = array_merge($lang, array(
'DELETE_FROM_FS' => 'Delete from filesystem', 'DELETE_FROM_FS' => 'Delete from filesystem',
'DELETE_STYLE' => 'Delete style', 'DELETE_STYLE' => 'Delete style',
'DELETE_STYLE_EXPLAIN' => 'Here you can remove the selected style. Take care in deleting styles, there is no undo capability.', 'DELETE_STYLE_EXPLAIN' => 'Here you can remove the selected style. Take care in deleting styles, there is no undo capability.',
'DELETE_STYLE_FILES_FAILED' => 'Error deleting files for style "%s".',
'DELETE_STYLE_FILES_SUCCESS' => 'Files for style "%s" have been deleted.',
'DELETE_TEMPLATE' => 'Delete template', 'DELETE_TEMPLATE' => 'Delete template',
'DELETE_TEMPLATE_EXPLAIN' => 'Here you can remove the selected template set from the database. Please note that there is no undo capability. It is recommended that you first export your set for possible future use.', 'DELETE_TEMPLATE_EXPLAIN' => 'Here you can remove the selected template set from the database. Please note that there is no undo capability. It is recommended that you first export your set for possible future use.',
'DELETE_THEME' => 'Delete theme',
'DELETE_THEME_EXPLAIN' => 'Here you can remove the selected theme from the database. Please note that there is no undo capability. It is recommended that you first export your theme for possible future use.',
'DETAILS' => 'Details', 'DETAILS' => 'Details',
'DIMENSIONS_EXPLAIN' => 'Selecting yes here will include width/height parameters.', 'DIMENSIONS_EXPLAIN' => 'Selecting yes here will include width/height parameters.',
@ -239,17 +236,10 @@ $lang = array_merge($lang, array(
'INCLUDE_THEME' => 'Include theme', 'INCLUDE_THEME' => 'Include theme',
'INHERITING_FROM' => 'Inherits from', 'INHERITING_FROM' => 'Inherits from',
'INSTALL_STYLE' => 'Install style', 'INSTALL_STYLE' => 'Install style',
'INSTALL_STYLE_EXPLAIN' => 'Here you can install a new style and if appropriate the corresponding style elements. If you already have the relevant style elements installed they will not be overwritten. Some styles require existing style elements to already be installed. If you try installing such a style and do not have the required elements you will be notified.', 'INSTALL_STYLES' => 'Install styles',
'INSTALL_TEMPLATE' => 'Install Template', 'INSTALL_STYLES_EXPLAIN' => 'Here you can install new styles.<br />If you cannot find a specific style in list below, check to make sure style is already installed. If it is not installed, check if it was uploaded correctly.',
'INSTALL_TEMPLATE_EXPLAIN' => 'Here you can install a new template set. Depending on your server configuration you may have a number of options here.',
'INSTALL_THEME' => 'Install theme',
'INSTALL_THEME_EXPLAIN' => 'Here you can install your selected theme. You can edit certain details if you wish or use the installation defaults.',
'INSTALLED_STYLE' => 'Installed styles', 'INSTALLED_STYLE' => 'Installed styles',
'INSTALLED_TEMPLATE' => 'Installed templates', 'INVALID_STYLE_ID' => 'Invalid style ID.',
'INSTALLED_THEME' => 'Installed themes',
'KEEP_TEMPLATE' => 'Keep “%s” template',
'KEEP_THEME' => 'Keep “%s” theme',
'LINE_SPACING' => 'Line spacing', 'LINE_SPACING' => 'Line spacing',
'LOCALISED_IMAGES' => 'Localised', 'LOCALISED_IMAGES' => 'Localised',
@ -257,18 +247,17 @@ $lang = array_merge($lang, array(
'NO_CLASS' => 'Cannot find class in stylesheet.', 'NO_CLASS' => 'Cannot find class in stylesheet.',
'NO_IMAGE' => 'No image', 'NO_IMAGE' => 'No image',
'NO_IMAGE_ERROR' => 'Cannot find image on filesystem.', 'NO_IMAGE_ERROR' => 'Cannot find image on filesystem.',
'NO_MATCHING_STYLES_FOUND' => 'No styles match your query.',
'NO_STYLE' => 'Cannot find style on filesystem.', 'NO_STYLE' => 'Cannot find style on filesystem.',
'NO_TEMPLATE' => 'Cannot find template on filesystem.', 'NO_TEMPLATE' => 'Cannot find template on filesystem.',
'NO_THEME' => 'Cannot find theme on filesystem.', 'NO_THEME' => 'Cannot find theme on filesystem.',
'NO_UNINSTALLED_STYLE' => 'No uninstalled styles detected.', 'NO_UNINSTALLED_STYLE' => 'No uninstalled styles detected.',
'NO_UNINSTALLED_TEMPLATE' => 'No uninstalled templates detected.',
'NO_UNINSTALLED_THEME' => 'No uninstalled themes detected.',
'NO_UNIT' => 'None', 'NO_UNIT' => 'None',
'ONLY_STYLE' => 'This is the only remaining style, you cannot delete it.', 'ONLY_STYLE' => 'This is the only remaining style, you cannot delete it.',
'ONLY_TEMPLATE' => 'This is the only remaining template set, you cannot delete it.',
'ONLY_THEME' => 'This is the only remaining theme, you cannot delete it.', 'PARENT_STYLE_NOT_FOUND' => 'Parent style was not found. This style may not work correctly. Please uninstall it.',
'OPTIONAL_BASIS' => 'Optional basis', 'PURGED_CACHE' => 'Cache was purged.',
'REFRESH' => 'Refresh', 'REFRESH' => 'Refresh',
'REPEAT_NO' => 'None', 'REPEAT_NO' => 'None',
@ -282,8 +271,7 @@ $lang = array_merge($lang, array(
'REPLACE_THEME' => 'Replace theme with', 'REPLACE_THEME' => 'Replace theme with',
'REPLACE_THEME_EXPLAIN' => 'This theme will replace the one you are deleting in any styles that use it.', 'REPLACE_THEME_EXPLAIN' => 'This theme will replace the one you are deleting in any styles that use it.',
'REPLACE_WITH_OPTION' => 'Replace with “%s”', 'REPLACE_WITH_OPTION' => 'Replace with “%s”',
'REQUIRES_TEMPLATE' => 'This style requires the %s template set to be installed.', 'REQUIRES_STYLE' => 'This style requires the style "%s" to be installed.',
'REQUIRES_THEME' => 'This style requires the %s theme to be installed.',
'SELECT_IMAGE' => 'Select image', 'SELECT_IMAGE' => 'Select image',
'SELECT_TEMPLATE' => 'Select template file', 'SELECT_TEMPLATE' => 'Select template file',
@ -301,23 +289,35 @@ $lang = array_merge($lang, array(
'STYLE_DEACTIVATE' => 'Deactivate', 'STYLE_DEACTIVATE' => 'Deactivate',
'STYLE_DEACTIVATED' => 'Style deactivated successfully', 'STYLE_DEACTIVATED' => 'Style deactivated successfully',
'STYLE_DEFAULT' => 'Make default style', 'STYLE_DEFAULT' => 'Make default style',
'STYLE_DELETED' => 'Style deleted successfully.', 'STYLE_DEFAULT_CHANGE' => 'Change default style',
'STYLE_DEFAULT_CHANGE_INACTIVE' => 'You must activate style before making it default style.',
'STYLE_DELETED' => 'Style "%s" deleted successfully.',
'STYLE_DETAILS_UPDATED' => 'Style edited successfully.', 'STYLE_DETAILS_UPDATED' => 'Style edited successfully.',
'STYLE_ERR_ARCHIVE' => 'Please select an archive method.', 'STYLE_ERR_ARCHIVE' => 'Please select an archive method.',
'STYLE_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.', 'STYLE_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.',
'STYLE_ERR_INVALID_PARENT' => 'Invalid parent style.',
'STYLE_ERR_MORE_ELEMENTS' => 'You must select at least one style element.', 'STYLE_ERR_MORE_ELEMENTS' => 'You must select at least one style element.',
'STYLE_ERR_NAME_CHARS' => 'The style name can only contain alphanumeric characters, -, +, _ and space.', 'STYLE_ERR_NAME_CHARS' => 'The style name can only contain alphanumeric characters, -, +, _ and space.',
'STYLE_ERR_NAME_EXIST' => 'A style with that name already exists.', 'STYLE_ERR_NAME_EXIST' => 'A style with that name already exists.',
'STYLE_ERR_NAME_LONG' => 'The style name can be no longer than 30 characters.', 'STYLE_ERR_NAME_LONG' => 'The style name can be no longer than 30 characters.',
'STYLE_ERR_NO_IDS' => 'You must select a template and theme for this style.',
'STYLE_ERR_NOT_STYLE' => 'The imported or uploaded file did not contain a valid style archive.', 'STYLE_ERR_NOT_STYLE' => 'The imported or uploaded file did not contain a valid style archive.',
'STYLE_ERR_STYLE_NAME' => 'You must supply a name for this style.', 'STYLE_ERR_STYLE_NAME' => 'You must supply a name for this style.',
'STYLE_EXPORT' => 'Export style', 'STYLE_EXPORT' => 'Export style',
'STYLE_EXPORT_EXPLAIN' => 'Here you can export a style in the form of an archive. A style does not need to contain all elements but it must contain at least one. For example if you have created a new theme for a commonly used template you could simply export the theme and omit the template. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.', 'STYLE_EXPORT_EXPLAIN' => 'Here you can export a style in the form of an archive. A style does not need to contain all elements but it must contain at least one. For example if you have created a new theme for a commonly used template you could simply export the theme and omit the template. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.',
'STYLE_EXPORTED' => 'Style exported successfully and stored in %s.', 'STYLE_EXPORTED' => 'Style exported successfully and stored in %s.',
'STYLE_INSTALLED' => 'Style "%s" has been installed.',
'STYLE_INSTALLED_EDIT_DETAILS' => '<a href="%s">Click here</a> to edit style details or to change default style.',
'STYLE_INSTALLED_RETURN_STYLES' => '<a href="%s">Click here</a> to return to installed styles list.',
'STYLE_INSTALLED_RETURN_UNINSTALLED' => '<a href="%s">Click here</a> to install more styles.',
'STYLE_NAME' => 'Style name', 'STYLE_NAME' => 'Style name',
'STYLE_NOT_INSTALLED' => 'Style "%s" was not installed.',
'STYLE_PATH' => 'Style path:',
'STYLE_PARENT' => 'Parent style:',
'STYLE_TEMPLATE' => 'Template', 'STYLE_TEMPLATE' => 'Template',
'STYLE_THEME' => 'Theme', 'STYLE_THEME' => 'Theme',
'STYLE_UNINSTALL' => 'Uninstall',
'STYLE_UNINSTALL_DEPENDENT' => 'Style "%s" cannot be uninstalled because it has one or more child styles.',
'STYLE_UNINSTALLED' => 'Style "%s" uninstalled successfully.',
'STYLE_USED_BY' => 'Used by (including robots)', 'STYLE_USED_BY' => 'Used by (including robots)',
'TEMPLATE_ADDED' => 'Template set added.', 'TEMPLATE_ADDED' => 'Template set added.',
@ -325,8 +325,6 @@ $lang = array_merge($lang, array(
'TEMPLATE_CACHE_EXPLAIN' => 'By default phpBB caches the compiled version of its templates. This decreases the load on the server each time a page is viewed and thus may reduce the page generation time. Here you can view the cache status of each file and delete individual files or the entire cache.', 'TEMPLATE_CACHE_EXPLAIN' => 'By default phpBB caches the compiled version of its templates. This decreases the load on the server each time a page is viewed and thus may reduce the page generation time. Here you can view the cache status of each file and delete individual files or the entire cache.',
'TEMPLATE_CACHE_CLEARED' => 'Template cache cleared successfully.', 'TEMPLATE_CACHE_CLEARED' => 'Template cache cleared successfully.',
'TEMPLATE_CACHE_EMPTY' => 'There are no cached templates.', 'TEMPLATE_CACHE_EMPTY' => 'There are no cached templates.',
'TEMPLATE_DELETED' => 'Template set deleted successfully.',
'TEMPLATE_DELETE_DEPENDENT' => 'The template set cannot be deleted as there are one or more other template sets inheriting from it:',
'TEMPLATE_DELETED_FS' => 'Template set removed from database but files remain on the filesystem.', 'TEMPLATE_DELETED_FS' => 'Template set removed from database but files remain on the filesystem.',
'TEMPLATE_DETAILS_UPDATED' => 'Template details successfully updated.', 'TEMPLATE_DETAILS_UPDATED' => 'Template details successfully updated.',
'TEMPLATE_EDITOR' => 'Raw HTML template editor', 'TEMPLATE_EDITOR' => 'Raw HTML template editor',
@ -335,17 +333,12 @@ $lang = array_merge($lang, array(
'TEMPLATE_ERR_CACHE_READ' => 'The cache directory used to store cached versions of template files could not be opened.', 'TEMPLATE_ERR_CACHE_READ' => 'The cache directory used to store cached versions of template files could not be opened.',
'TEMPLATE_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.', 'TEMPLATE_ERR_COPY_LONG' => 'The copyright can be no longer than 60 characters.',
'TEMPLATE_ERR_NAME_CHARS' => 'The template name can only contain alphanumeric characters, -, +, _ and space.', 'TEMPLATE_ERR_NAME_CHARS' => 'The template name can only contain alphanumeric characters, -, +, _ and space.',
'TEMPLATE_ERR_NAME_EXIST' => 'A template set with that name already exists.',
'TEMPLATE_ERR_NAME_LONG' => 'The template name can be no longer than 30 characters.', 'TEMPLATE_ERR_NAME_LONG' => 'The template name can be no longer than 30 characters.',
'TEMPLATE_ERR_NOT_TEMPLATE' => 'The archive you specified does not contain a valid template set.',
'TEMPLATE_ERR_REQUIRED_OR_INCOMPLETE' => 'The new template set requires the template %s to be installed and not inheriting itself.',
'TEMPLATE_ERR_STYLE_NAME' => 'You must supply a name for this template.', 'TEMPLATE_ERR_STYLE_NAME' => 'You must supply a name for this template.',
'TEMPLATE_EXPORT' => 'Export templates',
'TEMPLATE_EXPORT_EXPLAIN' => 'Here you can export a template set in the form of an archive. This archive will contain all the files necessary to install the templates on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.', 'TEMPLATE_EXPORT_EXPLAIN' => 'Here you can export a template set in the form of an archive. This archive will contain all the files necessary to install the templates on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.',
'TEMPLATE_EXPORTED' => 'Templates exported successfully and stored in %s.', 'TEMPLATE_EXPORTED' => 'Templates exported successfully and stored in %s.',
'TEMPLATE_FILE' => 'Template file', 'TEMPLATE_FILE' => 'Template file',
'TEMPLATE_FILE_UPDATED' => 'Template file updated successfully.', 'TEMPLATE_FILE_UPDATED' => 'Template file updated successfully.',
'TEMPLATE_INHERITS' => 'This template sets inherits from %s and thus cannot have a different storage setting than its super template.',
'TEMPLATE_NAME' => 'Template name', 'TEMPLATE_NAME' => 'Template name',
'TEMPLATE_FILE_NOT_WRITABLE'=> 'Unable to write to template file %s. Please check the permissions for the directory and the files.', 'TEMPLATE_FILE_NOT_WRITABLE'=> 'Unable to write to template file %s. Please check the permissions for the directory and the files.',
@ -373,9 +366,7 @@ $lang = array_merge($lang, array(
'THEME_UPDATED' => 'Theme updated successfully.', 'THEME_UPDATED' => 'Theme updated successfully.',
'UNDERLINE' => 'Underline', 'UNDERLINE' => 'Underline',
'UNINSTALLED_STYLE' => 'Uninstalled styles', 'UNINSTALL_DEFAULT' => 'You cannot uninstall the default style.',
'UNINSTALLED_TEMPLATE' => 'Uninstalled templates',
'UNINSTALLED_THEME' => 'Uninstalled themes',
'UNSET' => 'Undefined', 'UNSET' => 'Undefined',
)); ));

View file

@ -207,7 +207,7 @@ $lang = array_merge($lang, array(
'FORM_INVALID' => 'The submitted form was invalid. Try submitting again.', 'FORM_INVALID' => 'The submitted form was invalid. Try submitting again.',
'FORUM' => 'Forum', 'FORUM' => 'Forum',
'FORUMS' => 'Forums', 'FORUMS' => 'Forums',
'FORUMS_MARKED' => 'The selected forums have been marked read.', 'FORUMS_MARKED' => 'Forums have been marked read.',
'FORUM_CAT' => 'Forum category', 'FORUM_CAT' => 'Forum category',
'FORUM_INDEX' => 'Board index', 'FORUM_INDEX' => 'Board index',
'FORUM_LINK' => 'Forum link', 'FORUM_LINK' => 'Forum link',
@ -482,6 +482,7 @@ $lang = array_merge($lang, array(
'POST_TIME' => 'Post time', 'POST_TIME' => 'Post time',
'POST_TOPIC' => 'Post a new topic', 'POST_TOPIC' => 'Post a new topic',
'POST_UNAPPROVED' => 'Post awaiting approval:', 'POST_UNAPPROVED' => 'Post awaiting approval:',
'POWERED_BY' => 'Powered by %s',
'PREVIEW' => 'Preview', 'PREVIEW' => 'Preview',
'PREVIOUS' => 'Previous', // Used in pagination 'PREVIOUS' => 'Previous', // Used in pagination
'PREVIOUS_STEP' => 'Previous', 'PREVIOUS_STEP' => 'Previous',

View file

@ -332,7 +332,7 @@ $help = array(
), ),
array( array(
0 => 'Why isnt X feature available?', 0 => 'Why isnt X feature available?',
1 => 'This software was written by and licensed through phpBB Group. If you believe a feature needs to be added, please visit the phpbb.com website and see what phpBB Group have to say. Please do not post feature requests to the board at phpbb.com, the group uses SourceForge to handle tasking of new features. Please read through the forums and see what, if any, our position may already be for a feature and then follow the procedure given there.' 1 => 'This software was written by and licensed through phpBB Group. If you believe a feature needs to be added, or you want to report a bug, please visit the phpBB <a href="http://area51.phpbb.com/">Area51</a> website, where you will find resources to do so.'
), ),
array( array(
0 => 'Who do I contact about abusive and/or legal matters related to this board?', 0 => 'Who do I contact about abusive and/or legal matters related to this board?',

View file

@ -389,7 +389,7 @@ $lang = array_merge($lang, array(
'WARNING_PM_BODY' => 'The following is a warning which has been issued to you by an administrator or moderator of this site.[quote]%s[/quote]', 'WARNING_PM_BODY' => 'The following is a warning which has been issued to you by an administrator or moderator of this site.[quote]%s[/quote]',
'WARNING_PM_SUBJECT' => 'Board warning issued', 'WARNING_PM_SUBJECT' => 'Board warning issued',
'WARNING_POST_DEFAULT' => 'This is a warning regarding the following post made by you: %s .', 'WARNING_POST_DEFAULT' => 'This is a warning regarding the following post made by you: %s .',
'WARNINGS_ZERO_TOTAL' => 'No warnings exist.', 'NO_WARNINGS' => 'No warnings exist.',
'YOU_SELECTED_TOPIC' => 'You selected topic number %d: %s.', 'YOU_SELECTED_TOPIC' => 'You selected topic number %d: %s.',

View file

@ -41,6 +41,7 @@ $lang = array_merge($lang, array(
'ADD_POLL' => 'Poll creation', 'ADD_POLL' => 'Poll creation',
'ADD_POLL_EXPLAIN' => 'If you do not want to add a poll to your topic leave the fields blank.', 'ADD_POLL_EXPLAIN' => 'If you do not want to add a poll to your topic leave the fields blank.',
'ALREADY_DELETED' => 'Sorry but this message is already deleted.', 'ALREADY_DELETED' => 'Sorry but this message is already deleted.',
'ATTACH_DISK_FULL' => 'There is not enough free disk space to post this attachment.',
'ATTACH_QUOTA_REACHED' => 'Sorry, the board attachment quota has been reached.', 'ATTACH_QUOTA_REACHED' => 'Sorry, the board attachment quota has been reached.',
'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)', 'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)',

View file

@ -62,7 +62,7 @@ $lang = array_merge($lang, array(
'FILE_NOT_FOUND_404' => 'The file <strong>%s</strong> does not exist.', 'FILE_NOT_FOUND_404' => 'The file <strong>%s</strong> does not exist.',
'FORK_TOPIC' => 'Copy topic', 'FORK_TOPIC' => 'Copy topic',
'FULL_EDITOR' => 'Full Editor', 'FULL_EDITOR' => 'Full Editor &amp; Preview',
'LINKAGE_FORBIDDEN' => 'You are not authorised to view, download or link from/to this site.', 'LINKAGE_FORBIDDEN' => 'You are not authorised to view, download or link from/to this site.',
'LOGIN_NOTIFY_TOPIC' => 'You have been notified about this topic, please login to view it.', 'LOGIN_NOTIFY_TOPIC' => 'You have been notified about this topic, please login to view it.',

View file

@ -61,11 +61,6 @@ $default_key = 'c';
$sort_key = request_var('sk', $default_key); $sort_key = request_var('sk', $default_key);
$sort_dir = request_var('sd', 'a'); $sort_dir = request_var('sd', 'a');
// Grab rank information for later
$ranks = $cache->obtain_ranks();
// What do you want to do today? ... oops, I think that line is taken ... // What do you want to do today? ... oops, I think that line is taken ...
switch ($mode) switch ($mode)
{ {
@ -1222,21 +1217,16 @@ switch ($mode)
// Misusing the avatar function for displaying group avatars... // Misusing the avatar function for displaying group avatars...
$avatar_img = get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR'); $avatar_img = get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR');
// ... same for group rank
$rank_title = $rank_img = $rank_img_src = ''; $rank_title = $rank_img = $rank_img_src = '';
if ($group_row['group_rank']) if ($group_row['group_rank'])
{ {
if (isset($ranks['special'][$group_row['group_rank']])) get_user_rank($group_row['group_rank'], false, $rank_title, $rank_img, $rank_img_src);
if ($rank_img)
{ {
$rank_title = $ranks['special'][$group_row['group_rank']]['rank_title']; $rank_img .= '<br />';
} }
$rank_img = (!empty($ranks['special'][$group_row['group_rank']]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$group_row['group_rank']]['rank_image'] . '" alt="' . $ranks['special'][$group_row['group_rank']]['rank_title'] . '" title="' . $ranks['special'][$group_row['group_rank']]['rank_title'] . '" /><br />' : '';
$rank_img_src = (!empty($ranks['special'][$group_row['group_rank']]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$group_row['group_rank']]['rank_image'] : '';
}
else
{
$rank_title = '';
$rank_img = '';
$rank_img_src = '';
} }
$template->assign_vars(array( $template->assign_vars(array(

View file

@ -38,7 +38,7 @@ $load = (isset($_POST['load'])) ? true : false;
$delete = (isset($_POST['delete'])) ? true : false; $delete = (isset($_POST['delete'])) ? true : false;
$cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false; $cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false;
$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['full_editor']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false; $refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['cancel_unglobalise']) || $save || $load || $preview) ? true : false;
$mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', ''); $mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', '');
$error = $post_data = array(); $error = $post_data = array();
@ -1198,8 +1198,8 @@ if (!sizeof($error) && $preview)
'PREVIEW_MESSAGE' => $preview_message, 'PREVIEW_MESSAGE' => $preview_message,
'PREVIEW_SIGNATURE' => $preview_signature, 'PREVIEW_SIGNATURE' => $preview_signature,
'S_DISPLAY_PREVIEW' => true) 'S_DISPLAY_PREVIEW' => !empty($preview_message),
); ));
} }
} }

View file

@ -8,7 +8,6 @@
# #
# At the left is the name, please do not change this # At the left is the name, please do not change this
# At the right the value is entered # At the right the value is entered
# For on/off options the valid values are on, off, 1, 0, true and false
# #
# Values get trimmed, if you want to add a space in front or at the end of # Values get trimmed, if you want to add a space in front or at the end of
# the value, then enclose the value with single or double quotes. # the value, then enclose the value with single or double quotes.
@ -20,3 +19,10 @@
name = prosilver name = prosilver
copyright = &copy; phpBB Group, 2007 copyright = &copy; phpBB Group, 2007
version = 3.1.0-dev version = 3.1.0-dev
# 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

View file

@ -66,6 +66,17 @@ $('[data-ajax]').each(function() {
}); });
/**
* This simply appends #preview to the action of the
* QR action when you click the Full Editor & Preview button
*/
$('#qr_full_editor').click(function() {
$('#qr_postform').attr('action', function(i, val) {
return val + '#preview';
});
});
/** /**
* This AJAXifies the quick-mod tools. The reason it cannot be a standard * This AJAXifies the quick-mod tools. The reason it cannot be a standard

View file

@ -219,7 +219,7 @@ function addquote(post_id, username, l_wrote)
// Get text selection - not only the post content :( // Get text selection - not only the post content :(
// IE9 must use the document.selection method but has the *.getSelection so we just force no IE // IE9 must use the document.selection method but has the *.getSelection so we just force no IE
if (window.getSelection && !is_ie) if (window.getSelection && !is_ie && !window.opera)
{ {
theSelection = window.getSelection().toString(); theSelection = window.getSelection().toString();
} }

View file

@ -1,5 +1,6 @@
<!-- INCLUDE mcp_header.html --> <!-- INCLUDE mcp_header.html -->
<div class="tabs-container">
<h2><a href="{U_VIEW_TOPIC}">{L_TOPIC}: {TOPIC_TITLE}</a></h2> <h2><a href="{U_VIEW_TOPIC}">{L_TOPIC}: {TOPIC_TITLE}</a></h2>
<script type="text/javascript"> <script type="text/javascript">
@ -34,6 +35,7 @@ onload_functions.push('subPanels()');
</li> </li>
</ul> </ul>
</div> </div>
</div>
<form id="mcp" method="post" action="{S_MCP_ACTION}"> <form id="mcp" method="post" action="{S_MCP_ACTION}">

View file

@ -55,7 +55,7 @@
</tbody> </tbody>
</table> </table>
<!-- ELSE --> <!-- ELSE -->
<p><strong>{L_WARNINGS_ZERO_TOTAL}</strong></p> <p><strong>{L_NO_WARNINGS}</strong></p>
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>
@ -88,7 +88,7 @@
</tbody> </tbody>
</table> </table>
<!-- ELSE --> <!-- ELSE -->
<p><strong>{L_WARNINGS_ZERO_TOTAL}</strong></p> <p><strong>{L_NO_WARNINGS}</strong></p>
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>

View file

@ -53,7 +53,7 @@
</li> </li>
</ul> </ul>
<!-- ELSE --> <!-- ELSE -->
<p><strong>{L_WARNINGS_ZERO_TOTAL}</strong></p> <p><strong>{L_NO_WARNINGS}</strong></p>
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>

View file

@ -19,7 +19,7 @@
</div> </div>
</div> </div>
<div class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group <div class="copyright">{CREDIT_LINE}
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF --> <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- IF DEBUG_OUTPUT --><br />{DEBUG_OUTPUT}<!-- ENDIF --> <!-- IF DEBUG_OUTPUT --><br />{DEBUG_OUTPUT}<!-- ENDIF -->
<!-- IF U_ACP --><br /><strong><a href="{U_ACP}">{L_ACP}</a></strong><!-- ENDIF --> <!-- IF U_ACP --><br /><strong><a href="{U_ACP}">{L_ACP}</a></strong><!-- ENDIF -->
@ -52,7 +52,8 @@
<script type="text/javascript" src="{T_JQUERY_LINK}"></script> <script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> <!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js"></script> <script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js"></script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/ajax.js"></script> <!-- INCLUDEJS template/ajax.js -->
{SCRIPTS}
</body> </body>
</html> </html>

View file

@ -22,10 +22,6 @@
Based on style: prosilver (this is the default phpBB3 style) Based on style: prosilver (this is the default phpBB3 style)
Original author: Tom Beddard ( http://www.subBlue.com/ ) Original author: Tom Beddard ( http://www.subBlue.com/ )
Modified by: Modified by:
NOTE: This page was generated by phpBB, the free open-source bulletin board package.
The phpBB Group is not responsible for the content of this page and forum. For more information
about phpBB please visit http://www.phpbb.com
--> -->
<script type="text/javascript"> <script type="text/javascript">

View file

@ -1,4 +1,4 @@
<form method="post" action="{U_QR_ACTION}"> <form method="post" action="{U_QR_ACTION}" id="qr_postform">
<div class="panel"> <div class="panel">
<div class="inner"> <div class="inner">
<h2>{L_QUICKREPLY}</h2> <h2>{L_QUICKREPLY}</h2>
@ -14,8 +14,8 @@
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
{S_FORM_TOKEN} {S_FORM_TOKEN}
{QR_HIDDEN_FIELDS} {QR_HIDDEN_FIELDS}
<input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp; <input type="submit" accesskey="f" tabindex="6" name="preview" value="{L_FULL_EDITOR}" class="button2" data-ajax="false" id="qr_full_editor" />&nbsp;
<input type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" class="button2" data-ajax="false" />&nbsp; <input type="submit" accesskey="s" tabindex="7" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
</fieldset> </fieldset>
</div> </div>
</div> </div>

View file

@ -1,6 +1,6 @@
</div> </div>
<div class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group <div class="copyright">{CREDIT_LINE}
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF --> <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- IF DEBUG_OUTPUT --><br />{DEBUG_OUTPUT}<!-- ENDIF --> <!-- IF DEBUG_OUTPUT --><br />{DEBUG_OUTPUT}<!-- ENDIF -->
</div> </div>
@ -8,6 +8,7 @@
<script type="text/javascript" src="{T_JQUERY_LINK}"></script> <script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> <!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
{SCRIPTS}
</body> </body>
</html> </html>

View file

@ -1,30 +0,0 @@
#
# phpBB Template Configuration File
#
# @package phpBB3
# @copyright (c) 2006 phpBB Group
# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
#
#
# At the left is the name, please do not change this
# At the right the value is entered
# For on/off options the valid values are on, off, 1, 0, true and false
#
# Values get trimmed, if you want to add a space in front or at the end of
# the value, then enclose the value with single or double quotes.
# Single and double quotes do not need to be escaped.
#
#
# General Information about this template
name = prosilver
copyright = &copy; phpBB Group, 2007
version = 3.1.0-dev
# Defining a different template bitfield
template_bitfield = lNg=
# Template inheritance
# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/
# Set value to empty to ignore template inheritance
inherit_from = prosilver

View file

@ -355,7 +355,7 @@ ul.rightside {
/* Table styles /* Table styles
----------------------------------------*/ ----------------------------------------*/
table.table1 { table.table1 {
/* See tweaks.css */ width: 100%;
} }
#ucp-main table.table1 { #ucp-main table.table1 {
@ -548,7 +548,7 @@ li.pagination {
border: 1px solid transparent; border: 1px solid transparent;
position: fixed; position: fixed;
display: none; display: none;
top: 100px; top: 40%;
left: 35%; left: 35%;
width: 30%; width: 30%;
z-index: 50; z-index: 50;
@ -667,3 +667,7 @@ p.rules a {
.hidden { .hidden {
display: none; display: none;
} }
.smilies {
vertical-align: text-bottom;
}

View file

@ -97,6 +97,22 @@ ul.cplist {
width: 100%; width: 100%;
} }
.tabs-container h2 {
float: left;
margin-bottom: 0px;
}
.tabs-container #minitabs {
float: right;
margin-top: 19px;
}
.tabs-container:after {
display: block;
clear: both;
content: '';
}
/* CP tabbed menu /* CP tabbed menu
----------------------------------------*/ ----------------------------------------*/
#tabs { #tabs {

View file

@ -1,21 +0,0 @@
#
# phpBB Theme Configuration File
#
# @package phpBB3
# @copyright (c) 2006 phpBB Group
# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
#
#
# At the left is the name, please do not change this
# At the right the value is entered
# For on/off options the valid values are on, off, 1, 0, true and false
#
# Values get trimmed, if you want to add a space in front or at the end of
# the value, then enclose the value with single or double quotes.
# Single and double quotes do not need to be escaped.
#
# General Information about this theme
name = prosilver
copyright = &copy; phpBB Group, 2007
version = 3.1.0-dev

View file

@ -4,8 +4,9 @@ These style definitions are IE 7 and 8 specific
tweaks required due to its poor CSS support. tweaks required due to its poor CSS support.
-------------------------------------------------*/ -------------------------------------------------*/
table.table1 { /* Clear float fix for IE7 */
width: 100%; .inner {
zoom: 1;
} }
/* Align checkboxes/radio buttons nicely */ /* Align checkboxes/radio buttons nicely */
@ -29,8 +30,3 @@ dl.details dd {
#site-description p { #site-description p {
*margin-bottom: 1.0em; *margin-bottom: 1.0em;
} }
/* Clear float fix for IE7 */
.inner {
zoom: 1;
}

View file

@ -8,7 +8,6 @@
# #
# At the left is the name, please do not change this # At the left is the name, please do not change this
# At the right the value is entered # At the right the value is entered
# For on/off options the valid values are on, off, 1, 0, true and false
# #
# Values get trimmed, if you want to add a space in front or at the end of # Values get trimmed, if you want to add a space in front or at the end of
# the value, then enclose the value with single or double quotes. # the value, then enclose the value with single or double quotes.
@ -20,3 +19,10 @@
name = subsilver2 name = subsilver2
copyright = &copy; 2005 phpBB Group copyright = &copy; 2005 phpBB Group
version = 3.1.0-dev version = 3.1.0-dev
# 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 = subsilver2

View file

@ -221,7 +221,7 @@ function addquote(post_id, username, l_wrote)
// Get text selection - not only the post content :( // Get text selection - not only the post content :(
// IE9 must use the document.selection method but has the *.getSelection so we just force no IE // IE9 must use the document.selection method but has the *.getSelection so we just force no IE
if (window.getSelection && !is_ie) if (window.getSelection && !is_ie && !window.opera)
{ {
theSelection = window.getSelection().toString(); theSelection = window.getSelection().toString();
} }

View file

@ -38,7 +38,7 @@
</tr> </tr>
<!-- BEGINELSE --> <!-- BEGINELSE -->
<tr> <tr>
<td class="row1" colspan="4" align="center"><span class="gen">{L_WARNINGS_ZERO_TOTAL}</span></td> <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
</tr> </tr>
<!-- END highest --> <!-- END highest -->
</table> </table>
@ -64,7 +64,7 @@
</tr> </tr>
<!-- BEGINELSE --> <!-- BEGINELSE -->
<tr> <tr>
<td class="row1" colspan="4" align="center"><span class="gen">{L_WARNINGS_ZERO_TOTAL}</span></td> <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
</tr> </tr>
<!-- END latest --> <!-- END latest -->
</table> </table>

View file

@ -21,7 +21,7 @@
</tr> </tr>
<!-- BEGINELSE --> <!-- BEGINELSE -->
<tr> <tr>
<td class="row1" colspan="4" align="center"><span class="gen">{L_WARNINGS_ZERO_TOTAL}</span></td> <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
</tr> </tr>
<!-- END user --> <!-- END user -->
<tr align="center"> <tr align="center">

View file

@ -3,13 +3,14 @@
<div id="wrapfooter"> <div id="wrapfooter">
<!-- IF U_ACP --><span class="gensmall">[ <a href="{U_ACP}">{L_ACP}</a> ]</span><br /><br /><!-- ENDIF --> <!-- IF U_ACP --><span class="gensmall">[ <a href="{U_ACP}">{L_ACP}</a> ]</span><br /><br /><!-- ENDIF -->
<span class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group <span class="copyright">{CREDIT_LINE}
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF --> <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- IF DEBUG_OUTPUT --><br /><bdo dir="ltr">[ {DEBUG_OUTPUT} ]</bdo><!-- ENDIF --></span> <!-- IF DEBUG_OUTPUT --><br /><bdo dir="ltr">[ {DEBUG_OUTPUT} ]</bdo><!-- ENDIF --></span>
</div> </div>
<script type="text/javascript" src="{T_JQUERY_LINK}"></script> <script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> <!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
{SCRIPTS}
</body> </body>
</html> </html>

View file

@ -14,8 +14,8 @@
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center"> <td class="cat" colspan="2" align="center">
<input class="btnmain" type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" />&nbsp; <input class="btnlite" type="submit" accesskey="f" tabindex="6" name="preview" value="{L_FULL_EDITOR}" />&nbsp;
<input class="btnlite" type="submit" accesskey="f" tabindex="7" name="full_editor" value="{L_FULL_EDITOR}" /> <input class="btnmain" type="submit" accesskey="s" tabindex="7" name="post" value="{L_SUBMIT}" />
{S_FORM_TOKEN} {S_FORM_TOKEN}
{QR_HIDDEN_FIELDS} {QR_HIDDEN_FIELDS}

View file

@ -2,11 +2,12 @@
</div> </div>
<div id="wrapfooter"> <div id="wrapfooter">
<span class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group</span> <span class="copyright">{CREDIT_LINE}
</div> </div>
<script type="text/javascript" src="{T_JQUERY_LINK}"></script> <script type="text/javascript" src="{T_JQUERY_LINK}"></script>
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> <!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
{SCRIPTS}
</body> </body>
</html> </html>

View file

@ -1,27 +0,0 @@
#
# phpBB Template Configuration File
#
# @package phpBB3
# @copyright (c) 2005 phpBB Group
# @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
#
#
# At the left is the name, please do not change this
# At the right the value is entered
# For on/off options the valid values are on, off, 1, 0, true and false
#
# Values get trimmed, if you want to add a space in front or at the end of
# the value, then enclose the value with single or double quotes.
# Single and double quotes do not need to be escaped.
#
#
# General Information about this template
name = subsilver2
copyright = &copy; phpBB Group, 2003
version = 3.1.0-dev
# Template inheritance
# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/
# Set value to empty to ignore template inheritance
inherit_from = subsilver2

Some files were not shown because too many files have changed in this diff Show more