Merge branch 'develop' of https://github.com/phpbb/phpbb3 into develop

This commit is contained in:
Marc Alexander 2012-12-24 14:33:05 +01:00
commit 46b3c3ecc4
54 changed files with 2298 additions and 1864 deletions

View file

@ -2,9 +2,9 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../"> <project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build --> <!-- a few settings for the build -->
<property name="newversion" value="3.0.11" /> <property name="newversion" value="3.1.0-dev" />
<property name="prevversion" value="3.0.10" /> <property name="prevversion" value="3.0.11" />
<property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9, 3.0.11-RC1, 3.0.11-RC2" /> <property name="olderversions" value="3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.7-PL1, 3.0.8, 3.0.9, 3.0.10" />
<!-- no configuration should be needed beyond this point --> <!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" /> <property name="oldversions" value="${olderversions}, ${prevversion}" />

View file

@ -241,6 +241,7 @@
<dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}{L_COLON}</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt> <dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}{L_COLON}</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt>
<dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" size="4" maxlength="4" /></dd> <dd><input type="text" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" size="4" maxlength="4" /></dd>
</dl> </dl>
<!-- EVENT acp_forums_normal_settings_append -->
</fieldset> </fieldset>
<fieldset> <fieldset>

View file

@ -76,6 +76,8 @@
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- EVENT acp_main_notice_after -->
<table cellspacing="1"> <table cellspacing="1">
<caption>{L_FORUM_STATS}</caption> <caption>{L_FORUM_STATS}</caption>
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" /> <col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />
@ -202,6 +204,8 @@
<dd><input type="hidden" name="action" value="purge_cache" /><input class="button2" type="submit" id="action_purge_cache" name="action_purge_cache" value="{L_RUN}" /></dd> <dd><input type="hidden" name="action" value="purge_cache" /><input class="button2" type="submit" id="action_purge_cache" name="action_purge_cache" value="{L_RUN}" /></dd>
</dl> </dl>
</form> </form>
<!-- EVENT acp_main_actions_append -->
</fieldset> </fieldset>
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -53,6 +53,7 @@
<dt><label for="password_confirm">{L_CONFIRM_PASSWORD}{L_COLON}</label><br /><span>{L_CONFIRM_PASSWORD_EXPLAIN}</span></dt> <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}{L_COLON}</label><br /><span>{L_CONFIRM_PASSWORD_EXPLAIN}</span></dt>
<dd><input type="password" id="password_confirm" name="password_confirm" value="" autocomplete="off" /></dd> <dd><input type="password" id="password_confirm" name="password_confirm" value="" autocomplete="off" /></dd>
</dl> </dl>
<!-- EVENT acp_users_overview_options_append -->
<p class="quick"> <p class="quick">
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />

View file

@ -42,5 +42,7 @@
<!-- INCLUDEJS ajax.js --> <!-- INCLUDEJS ajax.js -->
{SCRIPTS} {SCRIPTS}
<!-- EVENT acp_overall_footer_after -->
</body> </body>
</html> </html>

View file

@ -155,6 +155,7 @@ function switch_menu()
// ]]> // ]]>
</script> </script>
<!-- EVENT acp_overall_header_head_append -->
</head> </head>
<body class="{S_CONTENT_DIRECTION}"> <body class="{S_CONTENT_DIRECTION}">

View file

@ -18,6 +18,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?assets_version={T_ASSETS_VERSION}" 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?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
<!-- EVENT acp_simple_footer_after -->
</body> </body>
</html> </html>

View file

@ -101,6 +101,7 @@ function find_username(url)
// ]]> // ]]>
</script> </script>
<!-- EVENT acp_simple_header_head_append -->
</head> </head>
<body class="{S_CONTENT_DIRECTION}"> <body class="{S_CONTENT_DIRECTION}">

View file

@ -72,6 +72,7 @@
<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="#stylestree">Styles Tree</a></li> <li><a href="#stylestree">Styles Tree</a></li>
<li><a href="#template-events">Template Events</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>
@ -1678,6 +1679,57 @@ version = 3.1.0
parent = prosilver parent = prosilver
</pre></div> </pre></div>
<a name="template-events"></a><h3>4.iii. Template Events</h3>
<p>Template events must follow this format: <code>&lt;!-- EVENT event_name --&gt;</code></p>
<p>Using the above example, files named <code>event_name.html</code> located within extensions will be injected into the location of the event.</p>
<h4>Template event naming guidelines:</h4>
<ul>
<li>An event name must be all lowercase, with each word separated by an underscore.</li>
<li>An event name must briefly describe the location and purpose of the event.</li>
<li>An event name must end with one of the following suffixes:</li>
<ul>
<li><code>_prepend</code> - This event adds an item to the beginning of a block of related items, or adds to the beginning of individual items in a block.</li>
<li><code>_append</code> - This event adds an item to the end of a block of related items, or adds to the end of individual items in a block.</li>
<li><code>_before</code> - This event adds content directly before the specified block</li>
<li><code>_after</code> - This event adds content directly after the specified block</li>
</ul>
</ul>
<h4>Template event documentation</h4>
<p>Events must be documented in <code>phpBB/docs/events.md</code> in alphabetical order based on the event name. The format is as follows:</p>
<ul><li>An event found in only one template file:
<div class="codebox"><pre>event_name
===
* Location: styles/&lt;style_name&gt;/template/filename.html
* Purpose: A brief description of what this event should be used for.
This may span multiple lines.
</pre></div></li>
<li>An event found in multiple template files:
<div class="codebox"><pre>event_name
===
* Locations:
+ first/file/path.html
+ second/file/path.html
* Purpose: Same as above.
</pre></div>
<li>An event that is found multiple times in a file should have the number of instances in parenthesis next to the filename.
<div class="codebox"><pre>event_name
===
* Locations:
+ first/file/path.html (2)
+ second/file/path.html
* Purpose: Same as above.
</pre></div></li>
<li>An actual example event documentation:
<div class="codebox"><pre>forumlist_body_last_post_title_prepend
====
* Locations:
+ styles/prosilver/template/forumlist_body.html
+ styles/subsilver2/template/forumlist_body.html
* Purpose: Add content before the post title of the latest post in a forum on the forum list.</pre></div></ul><br />
</div> </div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>

132
phpBB/docs/events.md Normal file
View file

@ -0,0 +1,132 @@
acp_forums_normal_settings_append
===
* Location: adm/style/acp_forums.html
* Purpose: Add settings to forums
acp_main_actions_append
===
* Location: adm/style/acp_main.html
* Purpose: Add actions to the ACP main page below the cache purge action
acp_main_notice_after
===
* Location: adm/style/acp_main.html
* Purpose: Add notices or other blocks in the ACP below other configuration notices
acp_overall_footer_after
===
* Location: adm/style/overall_footer.html
* Purpose: Add content below the footer in the ACP
acp_overall_header_head_append
===
* Location: adm/style/overall_header.html
* Add assets within the `<head>` tags in the ACP
acp_simple_footer_after
===
* Location: adm/style/simple_footer.html
* Purpose: Add content below the simple footer in the ACP
acp_simple_header_head_append
===
* Location: adm/style/overall_header.html
* Add assets within the `<head>` tags in the simple header of the ACP
acp_users_overview_options_append
===
* Location: adm/style/acp_users.html
* Purpose: Add options and settings on user overview page
forumlist_body_last_post_title_prepend
====
* Locations:
+ styles/prosilver/template/forumlist_body.html
+ styles/subsilver2/template/forumlist_body.html
* Purpose: Add content before the post title of the latest post in a forum on the forum list.
index_body_stat_blocks_before
===
* Locations:
+ styles/prosilver/template/index_body.html
+ styles/subsilver2/template/index_body.html
* Purpose: Add new statistic blocks above the Who Is Online and Board Statistics blocks
overall_footer_after
===
* Locations:
+ styles/prosilver/template/overall_footer.html
+ styles/subsilver2/template/overall_footer.html
* Purpose: Add content at the end of the file, directly prior to the `</body>` tag
overall_footer_breadcrumb_append
===
* Location: styles/prosilver/template/overall_footer.html
* Purpose: Add links to the list of breadcrumbs in the footer
overall_footer_copyright_append
===
* Locations:
+ styles/prosilver/template/overall_footer.html
+ styles/subsilver2/template/overall_footer.html
* Purpose: Add content after the copyright line (no new line by default), before the ACP link
overall_footer_copyright_prepend
===
* Locations:
+ styles/prosilver/template/overall_footer.html
+ styles/subsilver2/template/overall_footer.html
* Purpose: Add content before the copyright line
overall_header_breadcrumb_append
===
* Locations:
+ styles/prosilver/template/overall_header.html
+ styles/subsilver2/template/breadcrumbs.html
* Purpose: Add links to the list of breadcrumbs in the header
overall_header_head_append
===
* Locations:
+ styles/prosilver/template/overall_header.html
+ styles/subsilver2/template/overall_header.html
* Purpose: Add asset calls directly before the `</head>` tag
overall_header_navigation_append
===
* Location: styles/prosilver/template/overall_header.html
* Purpose: Add links after the navigation links in the header
overall_header_navigation_prepend
===
* Location: styles/prosilver/template/overall_header.html
* Purpose: Add links before the navigation links in the header
posting_editor_options_prepend
===
* Locations:
+ styles/prosilver/template/posting_editor.html
+ styles/prosilver/template/posting_body.html
* Purpose: Add posting options on the posting screen
simple_footer_after
===
* Location: styles/prosilver/template/simple_footer.html
* Purpose: Add content directly prior to the `</body>` tag of the simple footer
ucp_pm_viewmessage_print_head_append
===
* Location: styles/prosilver/template/ucp_pm_viewmessage_print.html
* Purpose: Add asset calls directly before the `</head>` tag of the Print PM screen
viewtopic_print_head_append
===
* Location: styles/prosilver/template/viewtopic_print.html
* Purpose: Add asset calls directly before the `</head>` tag of the Print Topic screen
viewtopic_topic_title_prepend
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
+ styles/subsilver2/template/viewtopic_body.html
* Purpose: Add content directly before the topic title link on the View topic screen

View file

@ -10,21 +10,36 @@ source source_phpbb_{SPHINX_ID}_main
sql_query_pre = UPDATE phpbb_sphinx SET max_doc_id = MAX(post_id) WHERE counter_id = 1 sql_query_pre = UPDATE phpbb_sphinx SET max_doc_id = MAX(post_id) WHERE counter_id = 1
sql_query_range = SELECT MIN(post_id), MAX(post_id) FROM phpbb_posts sql_query_range = SELECT MIN(post_id), MAX(post_id) FROM phpbb_posts
sql_range_step = 5000 sql_range_step = 5000
sql_query = SELECT \ sql_query = SELECT
p.post_id AS id, \ \
p.forum_id, \ p.post_id AS id,
p.topic_id, \ \
p.poster_id, \ p.forum_id,
CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, \ \
p.post_time, \ p.topic_id,
p.post_subject, \ \
p.post_subject as title, \ p.poster_id,
p.post_text as data, \ \
t.topic_last_post_time, \ CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
0 as deleted \ \
FROM phpbb_posts p, phpbb_topics t \ p.post_time,
WHERE \ \
p.topic_id = t.topic_id \ p.post_subject,
\
p.post_subject as title,
\
p.post_text as data,
\
t.topic_last_post_time,
\
0 as deleted
\
FROM phpbb_posts p, phpbb_topics t
\
WHERE
\
p.topic_id = t.topic_id
\
AND p.post_id >= $start AND p.post_id <= $end AND p.post_id >= $start AND p.post_id <= $end
sql_query_post = sql_query_post =
sql_query_post_index = UPDATE phpbb_sphinx SET max_doc_id = $maxid WHERE counter_id = 1 sql_query_post_index = UPDATE phpbb_sphinx SET max_doc_id = $maxid WHERE counter_id = 1
@ -42,21 +57,36 @@ source source_phpbb_{SPHINX_ID}_delta : source_phpbb_{SPHINX_ID}_main
{ {
sql_query_range = sql_query_range =
sql_range_step = sql_range_step =
sql_query = SELECT \ sql_query = SELECT
p.post_id AS id, \ \
p.forum_id, \ p.post_id AS id,
p.topic_id, \ \
p.poster_id, \ p.forum_id,
CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, \ \
p.post_time, \ p.topic_id,
p.post_subject, \ \
p.post_subject as title, \ p.poster_id,
p.post_text as data, \ \
t.topic_last_post_time, \ CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
0 as deleted \ \
FROM phpbb_posts p, phpbb_topics t \ p.post_time,
WHERE \ \
p.topic_id = t.topic_id \ p.post_subject,
\
p.post_subject as title,
\
p.post_text as data,
\
t.topic_last_post_time,
\
0 as deleted
\
FROM phpbb_posts p, phpbb_topics t
\
WHERE
\
p.topic_id = t.topic_id
\
AND p.post_id >= ( SELECT max_doc_id FROM phpbb_sphinx WHERE counter_id=1 ) AND p.post_id >= ( SELECT max_doc_id FROM phpbb_sphinx WHERE counter_id=1 )
sql_query_pre = sql_query_pre =
} }

View file

@ -367,12 +367,10 @@ class phpbb_cache_driver_file extends phpbb_cache_driver_base
} }
/** /**
* Save sql query * {@inheritDoc}
*/ */
function sql_save($query, $query_result, $ttl) function sql_save(phpbb_db_driver $db, $query, $query_result, $ttl)
{ {
global $db;
// Remove extra spaces and tabs // Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query); $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);

View file

@ -85,6 +85,7 @@ interface phpbb_cache_driver_interface
* result to persistent storage. In other words, there is no need * result to persistent storage. In other words, there is no need
* to call save() afterwards. * to call save() afterwards.
* *
* @param phpbb_db_driver $db Database connection
* @param string $query SQL query, should be used for generating storage key * @param string $query SQL query, should be used for generating storage key
* @param mixed $query_result The result from dbal::sql_query, to be passed to * @param mixed $query_result The result from dbal::sql_query, to be passed to
* dbal::sql_fetchrow to get all rows and store them * dbal::sql_fetchrow to get all rows and store them
@ -95,7 +96,7 @@ interface phpbb_cache_driver_interface
* representing the query should be returned. Otherwise * representing the query should be returned. Otherwise
* the original $query_result should be returned. * the original $query_result should be returned.
*/ */
public function sql_save($query, $query_result, $ttl); public function sql_save(phpbb_db_driver $db, $query, $query_result, $ttl);
/** /**
* Check if result for a given SQL query exists in cache. * Check if result for a given SQL query exists in cache.

View file

@ -283,12 +283,10 @@ abstract class phpbb_cache_driver_memory extends phpbb_cache_driver_base
} }
/** /**
* Save sql query * {@inheritDoc}
*/ */
function sql_save($query, $query_result, $ttl) function sql_save(phpbb_db_driver $db, $query, $query_result, $ttl)
{ {
global $db;
// Remove extra spaces and tabs // Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query); $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
$hash = md5($query); $hash = md5($query);

View file

@ -105,9 +105,9 @@ class phpbb_cache_driver_null extends phpbb_cache_driver_base
} }
/** /**
* Save sql query * {@inheritDoc}
*/ */
function sql_save($query, $query_result, $ttl) function sql_save(phpbb_db_driver $db, $query, $query_result, $ttl)
{ {
return $query_result; return $query_result;
} }

View file

@ -270,7 +270,7 @@ class phpbb_db_driver_firebird extends phpbb_db_driver
if ($cache_ttl) if ($cache_ttl)
{ {
$this->open_queries[(int) $this->query_result] = $this->query_result; $this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
} }
else if (strpos($query, 'SELECT') === 0 && $this->query_result) else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{ {

View file

@ -168,7 +168,7 @@ class phpbb_db_driver_mssql extends phpbb_db_driver
if ($cache_ttl) if ($cache_ttl)
{ {
$this->open_queries[(int) $this->query_result] = $this->query_result; $this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
} }
else if (strpos($query, 'SELECT') === 0 && $this->query_result) else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{ {

View file

@ -197,7 +197,7 @@ class phpbb_db_driver_mssql_odbc extends phpbb_db_driver
if ($cache_ttl) if ($cache_ttl)
{ {
$this->open_queries[(int) $this->query_result] = $this->query_result; $this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
} }
else if (strpos($query, 'SELECT') === 0 && $this->query_result) else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{ {

View file

@ -337,7 +337,7 @@ class phpbb_db_driver_mssqlnative extends phpbb_db_driver
if ($cache_ttl) if ($cache_ttl)
{ {
$this->open_queries[(int) $this->query_result] = $this->query_result; $this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
} }
else if (strpos($query, 'SELECT') === 0 && $this->query_result) else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{ {

View file

@ -206,7 +206,7 @@ class phpbb_db_driver_mysql extends phpbb_db_driver
if ($cache_ttl) if ($cache_ttl)
{ {
$this->open_queries[(int) $this->query_result] = $this->query_result; $this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
} }
else if (strpos($query, 'SELECT') === 0 && $this->query_result) else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{ {

View file

@ -201,7 +201,7 @@ class phpbb_db_driver_mysqli extends phpbb_db_driver
if ($cache_ttl) if ($cache_ttl)
{ {
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
} }
} }
else if (defined('DEBUG')) else if (defined('DEBUG'))

View file

@ -446,7 +446,7 @@ class phpbb_db_driver_oracle extends phpbb_db_driver
if ($cache_ttl) if ($cache_ttl)
{ {
$this->open_queries[(int) $this->query_result] = $this->query_result; $this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
} }
else if (strpos($query, 'SELECT') === 0 && $this->query_result) else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{ {

View file

@ -211,7 +211,7 @@ class phpbb_db_driver_postgres extends phpbb_db_driver
if ($cache_ttl) if ($cache_ttl)
{ {
$this->open_queries[(int) $this->query_result] = $this->query_result; $this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
} }
else if (strpos($query, 'SELECT') === 0 && $this->query_result) else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{ {

View file

@ -152,7 +152,7 @@ class phpbb_db_driver_sqlite extends phpbb_db_driver
if ($cache_ttl) if ($cache_ttl)
{ {
$this->open_queries[(int) $this->query_result] = $this->query_result; $this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($query, $this->query_result, $cache_ttl); $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
} }
else if (strpos($query, 'SELECT') === 0 && $this->query_result) else if (strpos($query, 'SELECT') === 0 && $this->query_result)
{ {

View file

@ -61,6 +61,20 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
{ {
markread('all', false, false, request_var('mark_time', 0)); markread('all', false, false, request_var('mark_time', 0));
if ($request->is_ajax())
{
// Tell the ajax script what language vars and URL need to be replaced
$data = array(
'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'],
'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'],
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums&mark_time=' . time()) : '',
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED']
);
$json_response = new phpbb_json_response();
$json_response->send($data);
}
trigger_error( trigger_error(
$user->lang['FORUMS_MARKED'] . '<br /><br />' . $user->lang['FORUMS_MARKED'] . '<br /><br />' .
sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>') sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>')
@ -313,6 +327,20 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>'); $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
meta_refresh(3, $redirect); meta_refresh(3, $redirect);
if ($request->is_ajax())
{
// Tell the ajax script what language vars and URL need to be replaced
$data = array(
'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'],
'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'],
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums&mark_time=' . time()) : '',
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $user->lang['FORUMS_MARKED']
);
$json_response = new phpbb_json_response();
$json_response->send($data);
}
trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message); trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message);
} }
else else

View file

@ -1695,8 +1695,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// The variable name should be $post_approved, because it indicates if the post is approved or not // The variable name should be $post_approved, because it indicates if the post is approved or not
$post_approval = 1; $post_approval = 1;
// Check the permissions for post approval. Moderators are not affected. // Check the permissions for post approval.
if (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) // Moderators must go through post approval like ordinary users.
if (!$auth->acl_get('f_noapprove', $data['forum_id']))
{ {
// Post not approved, but in queue // Post not approved, but in queue
$post_approval = 0; $post_approval = 0;

File diff suppressed because it is too large Load diff

View file

@ -1210,7 +1210,7 @@ function database_update_info()
*****************************************************************************/ *****************************************************************************/
function change_database_data(&$no_updates, $version) function change_database_data(&$no_updates, $version)
{ {
global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx, $db_tools; global $db, $db_tools, $errored, $error_ary, $config, $table_prefix, $phpbb_root_path, $phpEx;
$update_helpers = new phpbb_update_helpers(); $update_helpers = new phpbb_update_helpers();
@ -1527,8 +1527,6 @@ function change_database_data(&$no_updates, $version)
), ),
); );
global $db_tools;
$statements = $db_tools->perform_schema_changes($changes); $statements = $db_tools->perform_schema_changes($changes);
foreach ($statements as $sql) foreach ($statements as $sql)
@ -2170,26 +2168,41 @@ function change_database_data(&$no_updates, $version)
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
global $db_tools, $table_prefix; /*
* Due to a bug, vanilla phpbb could not create captcha tables
// Recover from potentially broken Q&A CAPTCHA table on firebird * in 3.0.8 on firebird. It was possible for board administrators
// Q&A CAPTCHA was uninstallable, so it's safe to remove these * to adjust the code to work. If code was manually adjusted by
// without data loss * board administrators, index names would not be the same as
* what 3.0.9 and newer expect. This code fragment drops captcha
* tables, destroying all entered Q&A captcha configuration, such
* that when Q&A is configured next the respective tables will be
* created with correct index names.
*
* If you wish to preserve your Q&A captcha configuration, you can
* manually rename indexes to the currently expected name:
* phpbb_captcha_questions_lang_iso => phpbb_captcha_questions_lang
* phpbb_captcha_answers_question_id => phpbb_captcha_answers_qid
*
* Again, this needs to be done only if a board was manually modified
* to fix broken captcha code.
*
if ($db_tools->sql_layer == 'firebird') if ($db_tools->sql_layer == 'firebird')
{ {
$tables = array( $changes = array(
$table_prefix . 'captcha_questions', 'drop_tables' => array(
$table_prefix . 'captcha_answers', $table_prefix . 'captcha_questions',
$table_prefix . 'qa_confirm', $table_prefix . 'captcha_answers',
$table_prefix . 'qa_confirm',
),
); );
foreach ($tables as $table) $statements = $db_tools->perform_schema_changes($changes);
foreach ($statements as $sql)
{ {
if ($db_tools->sql_table_exists($table)) _sql($sql, $errored, $error_ary);
{
$db_tools->sql_table_drop($table);
}
} }
} }
*/
$no_updates = false; $no_updates = false;
break; break;
@ -2885,7 +2898,11 @@ function change_database_data(&$no_updates, $version)
set_config('board_timezone', $update_helpers->convert_phpbb30_timezone($config['board_timezone'], $config['board_dst'])); set_config('board_timezone', $update_helpers->convert_phpbb30_timezone($config['board_timezone'], $config['board_dst']));
// After we have calculated the timezones we can delete user_dst column from user table. // After we have calculated the timezones we can delete user_dst column from user table.
$db_tools->sql_column_remove(USERS_TABLE, 'user_dst'); $statements = $db_tools->sql_column_remove(USERS_TABLE, 'user_dst');
foreach ($statements as $sql)
{
_sql($sql, $errored, $error_ary);
}
} }
if (!isset($config['site_home_url'])) if (!isset($config['site_home_url']))

View file

@ -1116,8 +1116,9 @@ if ($submit || $preview || $refresh)
$captcha->reset(); $captcha->reset();
} }
// Check the permissions for post approval. Moderators are not affected. // Check the permissions for post approval.
if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id']) && empty($data['force_approved_state'])) || (isset($data['force_approved_state']) && !$data['force_approved_state'])) // Moderators must go through post approval like ordinary users.
if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && empty($data['force_approved_state'])) || (isset($data['force_approved_state']) && !$data['force_approved_state']))
{ {
meta_refresh(10, $redirect_url); meta_refresh(10, $redirect_url);
$message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD']; $message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD'];

View file

@ -2,6 +2,94 @@
"use strict"; "use strict";
/**
* Close popup alert after a specified delay
*
* @param int Delay in ms until darkenwrapper's click event is triggered
*/
phpbb.closeDarkenWrapper = function(delay) {
setTimeout(function() {
$('#darkenwrapper').trigger('click');
}, delay);
};
// This callback will mark all forum icons read
phpbb.add_ajax_callback('mark_forums_read', function(res) {
var readTitle = res.NO_UNREAD_POSTS;
var unreadTitle = res.UNREAD_POSTS;
var iconsArray = {
'forum_unread': 'forum_read',
'forum_unread_subforum': 'forum_read_subforum',
'forum_unread_locked': 'forum_read_locked',
};
$('li.row').find('dl[class*="forum_unread"]').each(function() {
var $this = $(this);
$.each(iconsArray, function(unreadClass, readClass) {
if ($this.hasClass(unreadClass)) {
$this.removeClass(unreadClass).addClass(readClass);
}
});
$this.children('dt[title="' + unreadTitle + '"]').attr('title', readTitle);
});
// Mark subforums read
$('a.subforum[class*="unread"]').removeClass('unread').addClass('read');
// Update mark forums read links
$('[data-ajax="mark_forums_read"]').attr('href', res.U_MARK_FORUMS);
phpbb.closeDarkenWrapper(3000);
});
// This callback will mark all topic icons read
phpbb.add_ajax_callback('mark_topics_read', function(res) {
var readTitle = res.NO_UNREAD_POSTS;
var unreadTitle = res.UNREAD_POSTS;
var iconsArray = {
'global_unread': 'global_read',
'announce_unread': 'announce_read',
'sticky_unread': 'sticky_read',
'topic_unread': 'topic_read'
};
var iconsState = ['', '_hot', '_hot_mine', '_locked', '_locked_mine', '_mine'];
var unreadClassSelectors = '';
var classMap = {};
var classNames = [];
$.each(iconsArray, function(unreadClass, readClass) {
$.each(iconsState, function(key, value) {
// Only topics can be hot
if ((value == '_hot' || value == '_hot_mine') && unreadClass != 'topic_unread') {
return true;
}
classMap[unreadClass + value] = readClass + value;
classNames.push(unreadClass + value);
});
});
unreadClassSelectors = '.' + classNames.join(',.');
$('li.row').find(unreadClassSelectors).each(function() {
var $this = $(this);
$.each(classMap, function(unreadClass, readClass) {
if ($this.hasClass(unreadClass)) {
$this.removeClass(unreadClass).addClass(readClass);
}
});
$this.children('dt[title="' + unreadTitle + '"]').attr('title', readTitle);
});
// Remove link to first unread post
$('a').has('span.icon_topic_newest').remove();
// Update mark topics read links
$('[data-ajax="mark_topics_read"]').attr('href', res.U_MARK_TOPICS);
phpbb.closeDarkenWrapper(3000);
});
// This callback finds the post from the delete link, and removes it. // This callback finds the post from the delete link, and removes it.
phpbb.add_ajax_callback('post_delete', function() { phpbb.add_ajax_callback('post_delete', function() {
var el = $(this), var el = $(this),

View file

@ -51,6 +51,7 @@
<!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a><!-- ENDIF --> <!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a><!-- ENDIF -->
<!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn> <!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn>
<!-- IF forumrow.S_DISPLAY_SUBJECT --> <!-- IF forumrow.S_DISPLAY_SUBJECT -->
<!-- EVENT forumlist_body_last_post_title_prepend -->
<a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}" class="lastsubject">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a> <br /> <a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}" class="lastsubject">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a> <br />
<!-- ENDIF --> <!-- ENDIF -->
{L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}

View file

@ -8,7 +8,7 @@
<!-- IF S_DISPLAY_SEARCH --> <!-- IF S_DISPLAY_SEARCH -->
<li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_LOAD_UNREADS --> &bull; <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li> <li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_LOAD_UNREADS --> &bull; <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m" data-ajax="true">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF --> <!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m" data-ajax="mark_forums_read" data-overlay="false">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF -->
</ul> </ul>
<!-- ENDIF --> <!-- ENDIF -->
@ -29,6 +29,8 @@
</form> </form>
<!-- ENDIF --> <!-- ENDIF -->
<!-- EVENT index_body_stat_blocks_before -->
<!-- IF S_DISPLAY_ONLINE_LIST --> <!-- IF S_DISPLAY_ONLINE_LIST -->
<!-- IF U_VIEWONLINE --><h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3><!-- ELSE --><h3>{L_WHO_IS_ONLINE}</h3><!-- ENDIF --> <!-- IF U_VIEWONLINE --><h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3><!-- ELSE --><h3>{L_WHO_IS_ONLINE}</h3><!-- ENDIF -->
<p>{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /> <br />{LOGGED_IN_USER_LIST} <p>{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /> <br />{LOGGED_IN_USER_LIST}

View file

@ -6,7 +6,8 @@
<div class="inner"> <div class="inner">
<ul class="linklist"> <ul class="linklist">
<li class="icon-home"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}">{L_SITE_HOME}</a> <strong>&#8249;</strong> <!-- ENDIF --><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a></li> <li class="icon-home"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}">{L_SITE_HOME}</a> <strong>&#8249;</strong> <!-- ENDIF --><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a>
<!-- EVENT overall_footer_breadcrumb_append --></li>
<!-- IF not S_IS_BOT --> <!-- IF not S_IS_BOT -->
<!-- IF U_WATCH_FORUM_LINK --><li <!-- IF S_WATCHING_FORUM -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="toggle_link" data-toggle-class="icon-<!-- IF not S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_FORUM_TOGGLE}" data-toggle-url="{U_WATCH_FORUM_TOGGLE}">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF --> <!-- IF U_WATCH_FORUM_LINK --><li <!-- IF S_WATCHING_FORUM -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="toggle_link" data-toggle-class="icon-<!-- IF not S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_FORUM_TOGGLE}" data-toggle-url="{U_WATCH_FORUM_TOGGLE}">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF -->
<!-- IF U_WATCH_TOPIC --><li <!-- IF S_WATCHING_TOPIC -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{U_WATCH_TOPIC}" title="{S_WATCH_TOPIC_TITLE}" data-ajax="toggle_link" data-toggle-class="<!-- IF not S_WATCHING_TOPIC -->icon-unsubscribe<!-- ELSE -->icon-subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_TOPIC_TOGGLE}" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}">{S_WATCH_TOPIC_TITLE}</a></li><!-- ENDIF --> <!-- IF U_WATCH_TOPIC --><li <!-- IF S_WATCHING_TOPIC -->class="icon-unsubscribe"<!-- ELSE -->class="icon-subscribe"<!-- ENDIF -->><a href="{U_WATCH_TOPIC}" title="{S_WATCH_TOPIC_TITLE}" data-ajax="toggle_link" data-toggle-class="<!-- IF not S_WATCHING_TOPIC -->icon-unsubscribe<!-- ELSE -->icon-subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_TOPIC_TOGGLE}" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}">{S_WATCH_TOPIC_TITLE}</a></li><!-- ENDIF -->
@ -19,8 +20,11 @@
</div> </div>
</div> </div>
<div class="copyright">{CREDIT_LINE} <div class="copyright">
<!-- EVENT overall_footer_copyright_prepend -->
{CREDIT_LINE}
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF --> <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- EVENT overall_footer_copyright_append -->
<!-- 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 -->
</div> </div>
@ -55,5 +59,6 @@
<!-- INCLUDEJS template/ajax.js --> <!-- INCLUDEJS template/ajax.js -->
{SCRIPTS} {SCRIPTS}
<!-- EVENT overall_footer_after -->
</body> </body>
</html> </html>

View file

@ -84,8 +84,9 @@
<link href="{T_THEME_PATH}/tweaks.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="screen, projection" /> <link href="{T_THEME_PATH}/tweaks.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" type="text/css" media="screen, projection" />
<![endif]--> <![endif]-->
</head> <!-- EVENT overall_header_head_append -->
</head>
<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}"> <body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">
<div id="wrap"> <div id="wrap">
@ -121,7 +122,11 @@
<ul class="linklist navlinks"> <ul class="linklist navlinks">
<!-- DEFINE $MICRODATA = ' itemtype="http://data-vocabulary.org/Breadcrumb" itemscope=""' --> <!-- DEFINE $MICRODATA = ' itemtype="http://data-vocabulary.org/Breadcrumb" itemscope=""' -->
<li class="icon-home"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}"{$MICRODATA}>{L_SITE_HOME}</a> <strong>&#8249;</strong> <!-- ENDIF --><a href="{U_INDEX}" accesskey="h"{$MICRODATA}>{L_INDEX}</a> <!-- BEGIN navlinks --> <strong>&#8249;</strong> <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a><!-- END navlinks --></li> <li class="icon-home"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}"{$MICRODATA}>{L_SITE_HOME}</a> <strong>&#8249;</strong> <!-- ENDIF -->
<a href="{U_INDEX}" accesskey="h"{$MICRODATA}>{L_INDEX}</a>
<!-- BEGIN navlinks --> <strong>&#8249;</strong> <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a><!-- END navlinks -->
<!-- EVENT overall_header_breadcrumb_append -->
</li>
<!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF --> <!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
<!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF --> <!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF -->
@ -145,12 +150,14 @@
<!-- ENDIF --> <!-- ENDIF -->
<ul class="linklist rightside"> <ul class="linklist rightside">
<!-- EVENT overall_header_navigation_prepend -->
<li class="icon-faq"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li> <li class="icon-faq"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li>
<!-- IF not S_IS_BOT --> <!-- IF not S_IS_BOT -->
<!-- IF S_DISPLAY_MEMBERLIST --><li class="icon-members"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF --> <!-- IF S_DISPLAY_MEMBERLIST --><li class="icon-members"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF -->
<!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --><li class="icon-register"><a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF --> <!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --><li class="icon-register"><a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF -->
<li class="icon-logout"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x">{L_LOGIN_LOGOUT}</a></li> <li class="icon-logout"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x">{L_LOGIN_LOGOUT}</a></li>
<!-- ENDIF --> <!-- ENDIF -->
<!-- EVENT overall_header_navigation_append -->
</ul> </ul>
</div> </div>

View file

@ -213,6 +213,7 @@
<div class="inner"> <div class="inner">
<fieldset class="fields1"> <fieldset class="fields1">
<!-- EVENT posting_editor_options_prepend -->
<!-- IF S_BBCODE_ALLOWED --> <!-- IF S_BBCODE_ALLOWED -->
<div><label for="disable_bbcode"><input type="checkbox" name="disable_bbcode" id="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE}</label></div> <div><label for="disable_bbcode"><input type="checkbox" name="disable_bbcode" id="disable_bbcode"{S_BBCODE_CHECKED} /> {L_DISABLE_BBCODE}</label></div>
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -10,5 +10,6 @@
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" 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?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
{SCRIPTS} {SCRIPTS}
<!-- EVENT simple_footer_after -->
</body> </body>
</html> </html>

View file

@ -9,8 +9,8 @@
<title>{SITENAME} &bull; {PAGE_TITLE}</title> <title>{SITENAME} &bull; {PAGE_TITLE}</title>
<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" /> <link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" />
<!-- EVENT ucp_pm_viewmessage_print_head_append -->
</head> </head>
<body id="phpbb"> <body id="phpbb">
<div id="wrap"> <div id="wrap">
<a id="top" accesskey="t"></a> <a id="top" accesskey="t"></a>

View file

@ -28,7 +28,7 @@
<!-- IF S_HAS_SUBFORUM --> <!-- IF S_HAS_SUBFORUM -->
<!-- IF not S_IS_BOT and U_MARK_FORUMS --> <!-- IF not S_IS_BOT and U_MARK_FORUMS -->
<ul class="linklist"> <ul class="linklist">
<li class="rightside"><a href="{U_MARK_FORUMS}">{L_MARK_SUBFORUMS_READ}</a></li> <li class="rightside"><a href="{U_MARK_FORUMS}" data-ajax="mark_forums_read" data-overlay="false">{L_MARK_SUBFORUMS_READ}</a></li>
</ul> </ul>
<!-- ENDIF --> <!-- ENDIF -->
<!-- INCLUDE forumlist_body.html --> <!-- INCLUDE forumlist_body.html -->
@ -57,7 +57,7 @@
<!-- IF .pagination or TOTAL_POSTS or TOTAL_TOPICS --> <!-- IF .pagination or TOTAL_POSTS or TOTAL_TOPICS -->
<div class="pagination"> <div class="pagination">
<!-- IF not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}" accesskey="m" data-ajax="true">{L_MARK_TOPICS_READ}</a> &bull; <!-- ENDIF --> <!-- IF not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}" accesskey="m" data-ajax="mark_topics_read" data-overlay="false">{L_MARK_TOPICS_READ}</a> &bull; <!-- ENDIF -->
<!-- IF TOTAL_TOPICS -->{TOTAL_TOPICS} &bull; <!-- ENDIF --> <!-- IF TOTAL_TOPICS -->{TOTAL_TOPICS} &bull; <!-- ENDIF -->
<!-- IF .pagination --> <!-- IF .pagination -->
<!-- INCLUDE pagination.html --> <!-- INCLUDE pagination.html -->
@ -211,7 +211,7 @@
<!-- IF PAGE_NUMBER or TOTAL_POSTS or TOTAL_TOPICS --> <!-- IF PAGE_NUMBER or TOTAL_POSTS or TOTAL_TOPICS -->
<div class="pagination"> <div class="pagination">
<!-- IF TOTAL_TOPICS and not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}">{L_MARK_TOPICS_READ}</a> &bull; <!-- ENDIF --> <!-- IF TOTAL_TOPICS and not S_IS_BOT and U_MARK_TOPICS --><a href="{U_MARK_TOPICS}" data-ajax="mark_topics_read" data-overlay="false">{L_MARK_TOPICS_READ}</a> &bull; <!-- ENDIF -->
<!-- IF TOTAL_POSTS and not NEWEST_USER --> {TOTAL_POSTS}<!-- ELSEIF TOTAL_TOPICS and not NEWEST_USER --> {TOTAL_TOPICS} &bull; <!-- ENDIF --> <!-- IF TOTAL_POSTS and not NEWEST_USER --> {TOTAL_POSTS}<!-- ELSEIF TOTAL_TOPICS and not NEWEST_USER --> {TOTAL_TOPICS} &bull; <!-- ENDIF -->
<!-- IF TOTAL_USERS -->{TOTAL_USERS} &bull; <!-- ENDIF --> <!-- IF TOTAL_USERS -->{TOTAL_USERS} &bull; <!-- ENDIF -->
<!-- IF .pagination --> <!-- IF .pagination -->

View file

@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<!-- IF U_MCP --><p>[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ENDIF --> <!-- IF U_MCP --><p>[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ENDIF -->
<h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2> <h2><!-- EVENT viewtopic_topic_title_prepend --><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
<!-- NOTE: remove the style="display: none" when you want to have the forum description on the topic body --> <!-- NOTE: remove the style="display: none" when you want to have the forum description on the topic body -->
<!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF --> <!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF -->

View file

@ -9,8 +9,8 @@
<title>{SITENAME} &bull; {PAGE_TITLE}</title> <title>{SITENAME} &bull; {PAGE_TITLE}</title>
<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" /> <link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" />
<!-- EVENT viewtopic_print_head_append -->
</head> </head>
<body id="phpbb"> <body id="phpbb">
<div id="wrap"> <div id="wrap">
<a id="top" accesskey="t"></a> <a id="top" accesskey="t"></a>

View file

@ -2,7 +2,8 @@
<table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;"> <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;">
<tr> <tr>
<td class="row1"> <td class="row1">
<p class="breadcrumbs"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}"{$MICRODATA}>{L_SITE_HOME}</a> <strong>&#187;</strong> <!-- ENDIF --><a href="{U_INDEX}"{$MICRODATA}>{L_INDEX}</a><!-- BEGIN navlinks --> &#187; <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a><!-- END navlinks --></p> <p class="breadcrumbs"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}"{$MICRODATA}>{L_SITE_HOME}</a> <strong>&#187;</strong> <!-- ENDIF --><a href="{U_INDEX}"{$MICRODATA}>{L_INDEX}</a><!-- BEGIN navlinks --> &#187; <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a><!-- END navlinks -->
<!-- EVENT overall_header_breadcrumb_append --></p>
<p class="datetime">{S_TIMEZONE}</p> <p class="datetime">{S_TIMEZONE}</p>
</td> </td>
</tr> </tr>

View file

@ -61,6 +61,7 @@
<td class="row2" align="center" nowrap="nowrap"> <td class="row2" align="center" nowrap="nowrap">
<!-- IF forumrow.LAST_POST_TIME --> <!-- IF forumrow.LAST_POST_TIME -->
<!-- IF forumrow.S_DISPLAY_SUBJECT --> <!-- IF forumrow.S_DISPLAY_SUBJECT -->
<!-- EVENT forumlist_body_last_post_title_prepend -->
<p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}" class="lastsubject">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a></p> <p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}" class="lastsubject">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a></p>
<!-- ENDIF --> <!-- ENDIF -->
<p class="topicdetails"><!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}" class="imageset">{UNAPPROVED_IMG}</a>&nbsp;<!-- ENDIF -->{forumrow.LAST_POST_TIME}</p> <p class="topicdetails"><!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}" class="imageset">{UNAPPROVED_IMG}</a>&nbsp;<!-- ENDIF -->{forumrow.LAST_POST_TIME}</p>

View file

@ -18,6 +18,8 @@
<!-- INCLUDE breadcrumbs.html --> <!-- INCLUDE breadcrumbs.html -->
<!-- EVENT index_body_stat_blocks_before -->
<!-- IF S_DISPLAY_ONLINE_LIST --> <!-- IF S_DISPLAY_ONLINE_LIST -->
<br clear="all" /> <br clear="all" />

View file

@ -3,8 +3,11 @@
<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">{CREDIT_LINE} <span class="copyright">
<!-- EVENT overall_footer_copyright_prepend -->
{CREDIT_LINE}
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF --> <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- EVENT overall_footer_copyright_append -->
<!-- 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>
@ -12,5 +15,6 @@
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" 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?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
{SCRIPTS} {SCRIPTS}
<!-- EVENT overall_footer_after -->
</body> </body>
</html> </html>

View file

@ -129,6 +129,9 @@ function marklist(id, name, state)
// ]]> // ]]>
</script> </script>
<!-- EVENT overall_header_head_append -->
</head> </head>
<body class="{S_CONTENT_DIRECTION}"> <body class="{S_CONTENT_DIRECTION}">

View file

@ -257,6 +257,7 @@
</td> </td>
<td class="row2"> <td class="row2">
<table cellpadding="1"> <table cellpadding="1">
<!-- EVENT posting_editor_options_prepend -->
<!-- IF S_BBCODE_ALLOWED --> <!-- IF S_BBCODE_ALLOWED -->
<tr> <tr>
<td><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} /></td> <td><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} /></td>

View file

@ -9,5 +9,6 @@
<!-- IF S_JQUERY_FALLBACK --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" 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?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
{SCRIPTS} {SCRIPTS}
<!-- EVENT simple_footer_after -->
</body> </body>
</html> </html>

View file

@ -15,7 +15,7 @@
<!-- ENDIF --> <!-- ENDIF -->
<div id="pageheader"> <div id="pageheader">
<h2><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2> <h2><!-- EVENT viewtopic_topic_title_prepend --><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
<!-- IF MODERATORS --> <!-- IF MODERATORS -->
<p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON} {MODERATORS}</p> <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON} {MODERATORS}</p>

View file

@ -181,6 +181,20 @@ if ($mark_read == 'topics')
$redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
meta_refresh(3, $redirect_url); meta_refresh(3, $redirect_url);
if ($request->is_ajax())
{
// Tell the ajax script what language vars and URL need to be replaced
$data = array(
'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'],
'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'],
'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&f=$forum_id&mark=topics&mark_time=" . time()) : '',
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $user->lang['TOPICS_MARKED']
);
$json_response = new phpbb_json_response();
$json_response->send($data);
}
trigger_error($user->lang['TOPICS_MARKED'] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>')); trigger_error($user->lang['TOPICS_MARKED'] . '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect_url . '">', '</a>'));
} }

View file

@ -38,10 +38,16 @@ class phpbb_compress_test extends phpbb_test_case
$phpbb_root_path = ''; $phpbb_root_path = '';
$this->path = dirname(__FILE__) . '/fixtures/'; $this->path = dirname(__FILE__) . '/fixtures/';
}
if (!@extension_loaded('zlib') || !@extension_loaded('bz2')) protected function check_extensions($extensions)
{
foreach ($extensions as $extension)
{ {
$this->markTestSkipped('PHP needs to be compiled with --with-zlib and --with-bz2 in order to run these tests'); if (!@extension_loaded($extension))
{
$this->markTestSkipped("$extension extension is not loaded");
}
} }
} }
@ -114,17 +120,18 @@ class phpbb_compress_test extends phpbb_test_case
public function tar_archive_list() public function tar_archive_list()
{ {
return array( return array(
array('archive.tar', '.tar'), array('archive.tar', '.tar', array()),
array('archive.tar.gz', '.tar.gz'), array('archive.tar.gz', '.tar.gz', array('zlib')),
array('archive.tar.bz2', '.tar.bz2'), array('archive.tar.bz2', '.tar.bz2', array('bz2')),
); );
} }
/** /**
* @dataProvider tar_archive_list * @dataProvider tar_archive_list
*/ */
public function test_extract_tar($filename, $type) public function test_extract_tar($filename, $type, $extensions)
{ {
$this->check_extensions($extensions);
$compress = new compress_tar('r', $this->path . $filename); $compress = new compress_tar('r', $this->path . $filename);
$compress->extract('tests/compress/' . self::EXTRACT_DIR); $compress->extract('tests/compress/' . self::EXTRACT_DIR);
$this->valid_extraction(); $this->valid_extraction();
@ -141,8 +148,10 @@ class phpbb_compress_test extends phpbb_test_case
* @depends test_extract_tar * @depends test_extract_tar
* @dataProvider tar_archive_list * @dataProvider tar_archive_list
*/ */
public function test_compress_tar($filename, $type) public function test_compress_tar($filename, $type, $extensions)
{ {
$this->check_extensions($extensions);
$tar = dirname(__FILE__) . self::ARCHIVE_DIR . $filename; $tar = dirname(__FILE__) . self::ARCHIVE_DIR . $filename;
$compress = new compress_tar('w', $tar); $compress = new compress_tar('w', $tar);
$this->archive_files($compress); $this->archive_files($compress);
@ -160,6 +169,8 @@ class phpbb_compress_test extends phpbb_test_case
*/ */
public function test_compress_zip() public function test_compress_zip()
{ {
$this->check_extensions(array('zlib'));
$zip = dirname(__FILE__) . self::ARCHIVE_DIR . 'archive.zip'; $zip = dirname(__FILE__) . self::ARCHIVE_DIR . 'archive.zip';
$compress = new compress_zip('w', $zip); $compress = new compress_zip('w', $zip);
$this->archive_files($compress); $this->archive_files($compress);

View file

@ -44,8 +44,9 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
public function test_empty_file() public function test_empty_file()
{ {
$this->markTestIncomplete('Test fails intermittently.');
$crawler = $this->upload_file('empty.png', 'image/png'); $crawler = $this->upload_file('empty.png', 'image/png');
$this->assertEquals($this->lang('ATTACHED_IMAGE_NOT_IMAGE'), $crawler->filter('div#message p')->text()); $this->assertEquals($this->lang('ATTACHED_IMAGE_NOT_IMAGE'), $this->assert_filter($crawler, 'div#message p')->text());
} }
public function test_invalid_extension() public function test_invalid_extension()
@ -63,6 +64,7 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
public function test_valid_file() public function test_valid_file()
{ {
$this->markTestIncomplete('Test fails intermittently.');
$crawler = $this->upload_file('valid.jpg', 'image/jpeg'); $crawler = $this->upload_file('valid.jpg', 'image/jpeg');
$this->assert_response_success(); $this->assert_response_success();
// ensure there was no error message rendered // ensure there was no error message rendered

View file

@ -121,7 +121,11 @@ class phpbb_mock_cache implements phpbb_cache_driver_interface
public function sql_load($query) public function sql_load($query)
{ {
} }
public function sql_save($query, $query_result, $ttl)
/**
* {@inheritDoc}
*/
public function sql_save(phpbb_db_driver $db, $query, $query_result, $ttl)
{ {
return $query_result; return $query_result;
} }

View file

@ -1,54 +1,54 @@
<?php <?php
/** /**
* *
* @package testing * @package testing
* @copyright (c) 2011 phpBB Group * @copyright (c) 2011 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_session_append_sid_test extends phpbb_test_case class phpbb_session_append_sid_test extends phpbb_test_case
{ {
public function append_sid_data() public function append_sid_data()
{ {
return array( return array(
array('viewtopic.php?t=1&amp;f=2', false, true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in url-argument'), array('viewtopic.php?t=1&amp;f=2', false, true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in url-argument'),
array('viewtopic.php', 't=1&amp;f=2', true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in params-argument using amp'), array('viewtopic.php', 't=1&amp;f=2', true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in params-argument using amp'),
array('viewtopic.php', 't=1&f=2', false, false, 'viewtopic.php?t=1&f=2', 'parameters in params-argument using &'), array('viewtopic.php', 't=1&f=2', false, false, 'viewtopic.php?t=1&f=2', 'parameters in params-argument using &'),
array('viewtopic.php', array('t' => 1, 'f' => 2), true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in params-argument as array'), array('viewtopic.php', array('t' => 1, 'f' => 2), true, false, 'viewtopic.php?t=1&amp;f=2', 'parameters in params-argument as array'),
// Custom sid parameter // Custom sid parameter
array('viewtopic.php', 't=1&amp;f=2', true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid', 'using session_id'), array('viewtopic.php', 't=1&amp;f=2', true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid', 'using session_id'),
// Testing anchors // Testing anchors
array('viewtopic.php?t=1&amp;f=2#anchor', false, true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in url-argument'), array('viewtopic.php?t=1&amp;f=2#anchor', false, true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in url-argument'),
array('viewtopic.php', 't=1&amp;f=2#anchor', true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in params-argument'), array('viewtopic.php', 't=1&amp;f=2#anchor', true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in params-argument'),
array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'), array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'viewtopic.php?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid // Anchors and custom sid
array('viewtopic.php?t=1&amp;f=2#anchor', false, true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in url-argument using session_id'), array('viewtopic.php?t=1&amp;f=2#anchor', false, true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in url-argument using session_id'),
array('viewtopic.php', 't=1&amp;f=2#anchor', true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument using session_id'), array('viewtopic.php', 't=1&amp;f=2#anchor', true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument using session_id'),
array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'), array('viewtopic.php', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'viewtopic.php?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the ? // Empty parameters should not append the ?
array('viewtopic.php', false, true, false, 'viewtopic.php', 'no params using bool false'), array('viewtopic.php', false, true, false, 'viewtopic.php', 'no params using bool false'),
array('viewtopic.php', '', true, false, 'viewtopic.php', 'no params using empty string'), array('viewtopic.php', '', true, false, 'viewtopic.php', 'no params using empty string'),
array('viewtopic.php', array(), true, false, 'viewtopic.php', 'no params using empty array'), array('viewtopic.php', array(), true, false, 'viewtopic.php', 'no params using empty array'),
); );
} }
/** /**
* @dataProvider append_sid_data * @dataProvider append_sid_data
*/ */
public function test_append_sid($url, $params, $is_amp, $session_id, $expected, $description) public function test_append_sid($url, $params, $is_amp, $session_id, $expected, $description)
{ {
global $phpbb_dispatcher; global $phpbb_dispatcher;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher; $phpbb_dispatcher = new phpbb_mock_event_dispatcher;
$this->assertEquals($expected, append_sid($url, $params, $is_amp, $session_id)); $this->assertEquals($expected, append_sid($url, $params, $is_amp, $session_id));
} }
} }

View file

@ -424,4 +424,20 @@ class phpbb_functional_test_case extends phpbb_test_case
$content = $this->client->getResponse()->getContent(); $content = $this->client->getResponse()->getContent();
$this->assertNotContains('Fatal error:', $content); $this->assertNotContains('Fatal error:', $content);
} }
public function assert_filter($crawler, $expr, $msg = null)
{
$nodes = $crawler->filter($expr);
if ($msg)
{
$msg .= "\n";
}
else
{
$msg = '';
}
$msg .= "`$expr` not found in DOM.";
$this->assertGreaterThan(0, count($nodes), $msg);
return $nodes;
}
} }