A little bit of clean up

Fixed a few small XHTML validation errors
Fixed incorrect language string
Fixed empty latest bots block if no bot has visited the site
This commit is contained in:
Marc Alexander
2011-03-06 16:48:07 +01:00
parent 78fdac9161
commit 703a8e4c64
18 changed files with 92 additions and 81 deletions

View File

@@ -86,7 +86,7 @@ Weitere Sprachen kannst in unseren International Forum finden: http://www.board3
</author> </author>
</author-group> </author-group>
<mod-version>2.0.0b1</mod-version> <mod-version>2.0.0a1</mod-version>
<installation> <installation>
<level>easy</level> <level>easy</level>

View File

@@ -86,7 +86,7 @@ Weitere Sprachen kannst in unseren International Forum finden: http://www.board3
</author> </author>
</author-group> </author-group>
<mod-version>2.0.0b1</mod-version> <mod-version>2.0.0a1</mod-version>
<installation> <installation>
<level>easy</level> <level>easy</level>

View File

@@ -6,8 +6,8 @@
<header> <header>
<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license> <license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
<title lang="en">board3 Portal - German Language Update for 2.0.0-a1</title> <title lang="en">board3 Portal - German Language Update for 2.0.0a1</title>
<title lang="de">board3 Portal - Deutsche Sprache Aktualisiering für 2.0.0-a1</title> <title lang="de">board3 Portal - Deutsche Sprache Aktualisiering für 2.0.0a1</title>
<description lang="en">Adds a portal to your forum. <description lang="en">Adds a portal to your forum.
It has several boxes wich can be turned on an off in the ACP and certain settings. It has several boxes wich can be turned on an off in the ACP and certain settings.
@@ -86,7 +86,7 @@ Weitere Sprachen kannst in unseren International Forum finden: http://www.board3
</author> </author>
</author-group> </author-group>
<mod-version>2.0.0b1</mod-version> <mod-version>2.0.0a1</mod-version>
<installation> <installation>
<level>easy</level> <level>easy</level>

View File

@@ -6,8 +6,8 @@
<header> <header>
<license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license> <license>http://opensource.org/licenses/gpl-license.php GNU General Public License v2</license>
<title lang="en">board3 Portal - Update subsilver2 style for 2.0.0-a1</title> <title lang="en">board3 Portal - Update subsilver2 style for 2.0.0a1</title>
<title lang="de">board3 Portal - Aktualisiere das subsilver2 style für 2.0.0-a1</title> <title lang="de">board3 Portal - Aktualisiere das subsilver2 style für 2.0.0a1</title>
<description lang="en">Adds a portal to your forum. <description lang="en">Adds a portal to your forum.
It has several boxes wich can be turned on an off in the ACP and certain settings. It has several boxes wich can be turned on an off in the ACP and certain settings.
@@ -86,7 +86,7 @@ Weitere Sprachen kannst in unseren International Forum finden: http://www.board3
</author> </author>
</author-group> </author-group>
<mod-version>2.0.0b1</mod-version> <mod-version>2.0.0a1</mod-version>
<installation> <installation>
<level>easy</level> <level>easy</level>

View File

@@ -86,7 +86,7 @@ Weitere Sprachen kannst in unseren International Forum finden: http://www.board3
</author> </author>
</author-group> </author-group>
<mod-version>2.0.0b1</mod-version> <mod-version>2.0.0a1</mod-version>
<installation> <installation>
<level>easy</level> <level>easy</level>
@@ -97,10 +97,10 @@ Weitere Sprachen kannst in unseren International Forum finden: http://www.board3
<link-group> <link-group>
<link type="parent" lang="de" href="../../install.xml">Installations-Anleitung</link> <link type="parent" lang="de" href="../../install.xml">Installations-Anleitung</link>
<link type="parent" lang="en" href="../../install.xml">Manual</link> <link type="parent" lang="en" href="../../install.xml">Manual</link>
<link type="template" lang="en" href="contrib/subsilver2.xml">Update subsilver2 to Board3 Portal 2.0.0-a1</link> <link type="template" lang="en" href="contrib/subsilver2.xml">Update subsilver2 to Board3 Portal 2.0.0a1</link>
<link type="template" lang="de" href="contrib/subsilver2.xml">Aktualisiere subsilver2 für Board3 Portal 2.0.0-a1</link> <link type="template" lang="de" href="contrib/subsilver2.xml">Aktualisiere subsilver2 für Board3 Portal 2.0.0a1</link>
<link type="language" lang="en" href="contrib/subsilver2.xml">Update German language to Board3 Portal 2.0.0-a1</link> <link type="language" lang="en" href="contrib/subsilver2.xml">Update German language to Board3 Portal 2.0.0a1</link>
<link type="language" lang="de" href="contrib/subsilver2.xml">Aktualisiere deutsche Sprachdateien für Board3 Portal 2.0.0-a1</link> <link type="language" lang="de" href="contrib/subsilver2.xml">Aktualisiere deutsche Sprachdateien für Board3 Portal 2.0.0a1</link>
</link-group> </link-group>
</header> </header>
<action-group> <action-group>

View File

@@ -101,8 +101,8 @@ Weitere Sprachen kannst in unserem Internationalen Forum finden: http://www.boar
<link type="language" lang="de" href="contrib/de.xml">Anleitung für das deutsche Sprachpaket</link> <link type="language" lang="de" href="contrib/de.xml">Anleitung für das deutsche Sprachpaket</link>
<link type="template" lang="en" href="contrib/subsilver2.xml">Manual for subsilver2</link> <link type="template" lang="en" href="contrib/subsilver2.xml">Manual for subsilver2</link>
<link type="template" lang="de" href="contrib/subsilver2.xml">Anleitung für subsilver2</link> <link type="template" lang="de" href="contrib/subsilver2.xml">Anleitung für subsilver2</link>
<link type="contrib" lang="en" href="contrib/update_106_to_200-a1/update.xml">Manual for Updating B3P 1.0.6 to 2.0.0-a1</link> <link type="contrib" lang="en" href="contrib/update_106_to_200a1/update.xml">Manual for Updating B3P 1.0.6 to 2.0.0a1</link>
<link type="contrib" lang="de" href="contrib/update_106_to_200-a1/update.xml">Anleitung für das Aktualisieren von B3P 1.0.6 zu 2.0.0-a1</link> <link type="contrib" lang="de" href="contrib/update_106_to_200a1/update.xml">Anleitung für das Aktualisieren von B3P 1.0.6 zu 2.0.0a1</link>
</link-group> </link-group>
<history> <history>
<entry> <entry>

View File

@@ -47,7 +47,7 @@
</dl> </dl>
<dl> <dl>
<dt> <dt>
<label for="permission-setting">{L_ACP_PORTAL_MENU_PERMISSION}:</label><br /> <label for="permission-setting-menu">{L_ACP_PORTAL_MENU_PERMISSION}:</label><br />
<span>{L_ACP_PORTAL_MENU_PERMISSION_EXP}</span> <span>{L_ACP_PORTAL_MENU_PERMISSION_EXP}</span>
</dt> </dt>
<dd> <dd>

4
root/adm/style/portal/acp_portal_upload_module.html Normal file → Executable file
View File

@@ -18,10 +18,12 @@
<fieldset> <fieldset>
<legend>{L_MODULE_UPLOAD}</legend> <legend>{L_MODULE_UPLOAD}</legend>
<dl> <dl>
<p>{L_MODULE_UPLOAD_EXP}</p> <dt>{L_MODULE_UPLOAD_EXP}</dt>
<dd>
<input type="file" name="modupload" id="modupload" value="" style="width:50%" /> <input type="file" name="modupload" id="modupload" value="" style="width:50%" />
{S_FORM_TOKEN} {S_FORM_TOKEN}
<br /><br /><input type="submit" name="submit" value="{L_MODULE_UPLOAD_GO}" id="submit" class="button1" /> <br /><br /><input type="submit" name="submit" value="{L_MODULE_UPLOAD_GO}" id="submit" class="button1" />
</dd>
</dl> </dl>
</fieldset> </fieldset>
</form> </form>

View File

@@ -102,7 +102,7 @@ $lang = array_merge($lang, array(
// Upload Module // Upload Module
'ACP_PORTAL_UPLOAD' => 'Modul hochladen', 'ACP_PORTAL_UPLOAD' => 'Modul hochladen',
'MODULE_UPLOAD' => 'Lade ein Modul hoch', 'MODULE_UPLOAD' => 'Lade ein Modul hoch',
'MODULE_UPLOAD_EXP' => 'Wähle die ZIP-Datei des Moduls das du hochladen willst.', 'MODULE_UPLOAD_EXP' => 'Wähle die ZIP-Datei des Moduls das du hochladen willst:',
'MODULE_UPLOAD_GO' => 'Hochladen', 'MODULE_UPLOAD_GO' => 'Hochladen',
'NO_MODULE_UPLOAD' => 'Deine Server-Konfiguration erlaubt das Hochladen von Dateien nicht.', 'NO_MODULE_UPLOAD' => 'Deine Server-Konfiguration erlaubt das Hochladen von Dateien nicht.',
'NO_AUTOMOD_INSTALLED' => 'Du hast AutoMOD nicht installiert, AutoMOD ist für dieses Feature aber zwingend erforderlich.', 'NO_AUTOMOD_INSTALLED' => 'Du hast AutoMOD nicht installiert, AutoMOD ist für dieses Feature aber zwingend erforderlich.',

View File

@@ -42,7 +42,7 @@ $lang = array_merge($lang, array(
'POSTED_BY' => 'Autor', 'POSTED_BY' => 'Autor',
'COMMENTS' => 'Kommentare', 'COMMENTS' => 'Kommentare',
'VIEW_COMMENTS' => 'Kommentare anzeigen', 'VIEW_COMMENTS' => 'Kommentare anzeigen',
'POST_REPLY' => 'Kommentar schreiben', 'PORTAL_POST_REPLY' => 'Kommentar schreiben',
'TOPIC_VIEWS' => 'Zugriffe', 'TOPIC_VIEWS' => 'Zugriffe',
'JUMP_NEWEST' => 'Zum letzten Beitrag springen', 'JUMP_NEWEST' => 'Zum letzten Beitrag springen',
'JUMP_FIRST' => 'Zum ersten Beitrag springen', 'JUMP_FIRST' => 'Zum ersten Beitrag springen',

2
root/language/en/mods/info_acp_portal.php Normal file → Executable file
View File

@@ -103,7 +103,7 @@ $lang = array_merge($lang, array(
// Upload Module // Upload Module
'ACP_PORTAL_UPLOAD' => 'Upload module', 'ACP_PORTAL_UPLOAD' => 'Upload module',
'MODULE_UPLOAD' => 'Upload a module', 'MODULE_UPLOAD' => 'Upload a module',
'MODULE_UPLOAD_EXP' => 'Choose the zip file of the module you want to upload.', 'MODULE_UPLOAD_EXP' => 'Choose the zip file of the module you want to upload:',
'MODULE_UPLOAD_GO' => 'Upload', 'MODULE_UPLOAD_GO' => 'Upload',
'NO_MODULE_UPLOAD' => 'Your server configuration does not allow file uploads.', 'NO_MODULE_UPLOAD' => 'Your server configuration does not allow file uploads.',
'NO_AUTOMOD_INSTALLED' => 'You dont have AutoMOD installed, but AutoMOD is required for this module.', 'NO_AUTOMOD_INSTALLED' => 'You dont have AutoMOD installed, but AutoMOD is required for this module.',

View File

@@ -42,7 +42,7 @@ $lang = array_merge($lang, array(
'POSTED_BY' => 'Poster', 'POSTED_BY' => 'Poster',
'COMMENTS' => 'Comments', 'COMMENTS' => 'Comments',
'VIEW_COMMENTS' => 'View comments', 'VIEW_COMMENTS' => 'View comments',
'POST_REPLY' => 'Write comments', 'PORTAL_POST_REPLY' => 'Write comments',
'TOPIC_VIEWS' => 'Views', 'TOPIC_VIEWS' => 'Views',
'JUMP_NEWEST' => 'Jump to newest post', 'JUMP_NEWEST' => 'Jump to newest post',
'JUMP_FIRST' => 'Jump to first post', 'JUMP_FIRST' => 'Jump to first post',

View File

@@ -38,7 +38,7 @@ $lang = array_merge($lang, array(
'POSTED_BY' => 'Poster', 'POSTED_BY' => 'Poster',
'COMMENTS' => 'Comments', 'COMMENTS' => 'Comments',
'VIEW_COMMENTS' => 'View comments', 'VIEW_COMMENTS' => 'View comments',
'POST_REPLY' => 'Write comments', 'PORTAL_POST_REPLY' => 'Write comments',
'TOPIC_VIEWS' => 'Views', 'TOPIC_VIEWS' => 'Views',
'JUMP_NEWEST' => 'Jump to newest post', 'JUMP_NEWEST' => 'Jump to newest post',
'JUMP_FIRST' => 'Jump to first post', 'JUMP_FIRST' => 'Jump to first post',

32
root/portal.php Normal file → Executable file
View File

@@ -14,35 +14,38 @@ define('IN_PHPBB', true);
define('IN_PORTAL', true); define('IN_PORTAL', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1); $phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'portal/includes/constants.' . $phpEx); include($phpbb_root_path . 'portal/includes/constants.' . $phpEx);
$portal_root_path = PORTAL_ROOT_PATH; $portal_root_path = PORTAL_ROOT_PATH;
include($phpbb_root_path . $portal_root_path . 'includes/functions_modules.' . $phpEx); include($phpbb_root_path . $portal_root_path . 'includes/functions_modules.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . $portal_root_path . 'includes/functions.' . $phpEx); include($phpbb_root_path . $portal_root_path . 'includes/functions.' . $phpEx);
//include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
// Start session management // Start session management
$user->session_begin(); $user->session_begin();
$auth->acl($user->data); $auth->acl($user->data);
$user->setup('mods/portal'); $user->setup('mods/portal');
/* /**
* Make sure we do an isset first, * Make sure we do an isset first,
* else we will get errors if someone uninstalls the portal and forgets to remove portal.php * else we will get errors if someone uninstalls the portal and forgets to remove portal.php
*/ */
if (!isset($config['board3_enable']) || !$config['board3_enable'] || !$auth->acl_get('u_view_portal')) if (!isset($config['board3_enable']) || !$config['board3_enable'] || !$auth->acl_get('u_view_portal'))
{ {
redirect(reapply_sid($phpbb_root_path . 'index.' . $phpEx)); redirect(append_sid($phpbb_root_path . 'index.' . $phpEx));
} }
/**
* get initial data
*/
$portal_config = obtain_portal_config(); $portal_config = obtain_portal_config();
$portal_modules = obtain_portal_modules();
/* /**
* set up column_count array * set up column_count array
* with this we can hide unneeded parts of the portal
*/ */
$module_count = array( $module_count = array(
'total' => 0, 'total' => 0,
@@ -53,8 +56,9 @@ $module_count = array(
'bottom' => 0, 'bottom' => 0,
); );
$portal_modules = obtain_portal_modules(); /**
* start assigning block vars
*/
foreach ($portal_modules as $row) foreach ($portal_modules as $row)
{ {
$class_name = 'portal_' . $row['module_classname'] . '_module'; $class_name = 'portal_' . $row['module_classname'] . '_module';
@@ -67,10 +71,12 @@ foreach($portal_modules as $row)
trigger_error(sprintf($user->lang['CLASS_NOT_FOUND'], $class_name, 'portal_' . $row['module_classname']), E_USER_ERROR); trigger_error(sprintf($user->lang['CLASS_NOT_FOUND'], $class_name, 'portal_' . $row['module_classname']), E_USER_ERROR);
} }
$module = new $class_name(); $module = new $class_name();
// Check for permissions before loading anything /**
* Check for permissions before loading anything
* the default group of a user always defines his/her permission (KISS)
*/
$group_ary = (!empty($row['module_group_ids'])) ? explode(',', $row['module_group_ids']) : ''; $group_ary = (!empty($row['module_group_ids'])) ? explode(',', $row['module_group_ids']) : '';
if ((is_array($group_ary) && !in_array($user->data['group_id'], $group_ary))) if ((is_array($group_ary) && !in_array($user->data['group_id'], $group_ary)))
{ {
@@ -143,12 +149,12 @@ $module_count['total'] = sizeof($portal_modules);
// Redirect to index if there are currently no active modules // Redirect to index if there are currently no active modules
if($module_count['total'] < 1) if($module_count['total'] < 1)
{ {
redirect(reapply_sid($phpbb_root_path . 'index.' . $phpEx)); redirect(append_sid($phpbb_root_path . 'index.' . $phpEx));
} }
// Assign specific vars // Assign specific vars
$template->assign_vars(array( $template->assign_vars(array(
'S_SMALL_BLOCK' => true, // 'S_SMALL_BLOCK' => true,
'S_PORTAL_LEFT_COLUMN' => $config['board3_left_column_width'], 'S_PORTAL_LEFT_COLUMN' => $config['board3_left_column_width'],
'S_PORTAL_RIGHT_COLUMN' => $config['board3_right_column_width'], 'S_PORTAL_RIGHT_COLUMN' => $config['board3_right_column_width'],
'S_LEFT_COLUMN' => ($module_count['left'] > 0 && $config['board3_left_column']) ? true : false, 'S_LEFT_COLUMN' => ($module_count['left'] > 0 && $config['board3_left_column']) ? true : false,

View File

@@ -353,7 +353,7 @@ function phpbb_fetch_posts($module_id, $forum_from, $permissions, $number_of_pos
'attachments' => (!empty($attachments)) ? $attachments : array(), 'attachments' => (!empty($attachments)) ? $attachments : array(),
)); ));
$posts['global_id'] = $global_f; $posts['global_id'] = $global_f;
$i++; ++$i;
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@@ -399,7 +399,7 @@ function is_valid_bbtag($str, $bbuid)
function get_end_bbtag($tag, $bbuid) function get_end_bbtag($tag, $bbuid)
{ {
$etag = ''; $etag = '';
for($i=0;$i<strlen($tag);$i++) for ($i=0;$i<strlen($tag);++$i)
{ {
if ($tag[$i] == '[') if ($tag[$i] == '[')
{ {
@@ -436,7 +436,7 @@ function get_end_bbtag($tag, $bbuid)
function get_next_word($str) function get_next_word($str)
{ {
$ret = ''; $ret = '';
for($i=0;$i<strlen($str);$i++) for ($i=0;$i<strlen($str);++$i)
{ {
switch ($str[$i]) switch ($str[$i])
{ {
@@ -497,7 +497,7 @@ function get_sub_taged_string($str, $bbuid, $maxlen)
{ {
if (strcmp($elem[1],$sr) != 0) if (strcmp($elem[1],$sr) != 0)
{ {
$tarr[$j++] = $elem; $tarr[++$j] = $elem;
} }
} }
$arr = $tarr; $arr = $tarr;
@@ -505,7 +505,7 @@ function get_sub_taged_string($str, $bbuid, $maxlen)
else else
{ {
$arr[$i][0] = $sr; $arr[$i][0] = $sr;
$arr[$i++][1] = get_end_bbtag($sr, $bbuid); $arr[++$i][1] = get_end_bbtag($sr, $bbuid);
} }
$ret .= $sr; $ret .= $sr;
} }
@@ -586,7 +586,7 @@ function generate_portal_pagination($base_url, $num_items, $per_page, $start_ite
$page_string .= ($start_cnt > 1) ? ' ... ' : $seperator; $page_string .= ($start_cnt > 1) ? ' ... ' : $seperator;
for ($i = $start_cnt + 1; $i < $end_cnt; $i++) for ($i = $start_cnt + 1; $i < $end_cnt; ++$i)
{ {
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($i - 1) * $per_page) . $anker . '">' . $i . '</a>'; $page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($i - 1) * $per_page) . $anker . '">' . $i . '</a>';
if ($i < $end_cnt - 1) if ($i < $end_cnt - 1)
@@ -600,7 +600,7 @@ function generate_portal_pagination($base_url, $num_items, $per_page, $start_ite
{ {
$page_string .= $seperator; $page_string .= $seperator;
for ($i = 2; $i < $total_pages; $i++) for ($i = 2; $i < $total_pages; ++$i)
{ {
$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($i - 1) * $per_page) . $anker . '">' . $i . '</a>'; $page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($i - 1) * $per_page) . $anker . '">' . $i . '</a>';
if ($i < $total_pages) if ($i < $total_pages)
@@ -726,7 +726,7 @@ function get_portal_tracking_info($fetch_news)
* group everything by the forum IDs * group everything by the forum IDs
*/ */
$count = $fetch_news['topic_count']; $count = $fetch_news['topic_count'];
for ($i = 0; $i < $count; $i++) for ($i = 0; $i < $count; ++$i)
{ {
$tracking_info[$fetch_news[$i]['forum_id']][] = $fetch_news[$i]['topic_id']; $tracking_info[$fetch_news[$i]['forum_id']][] = $fetch_news[$i]['topic_id'];
} }
@@ -1082,7 +1082,7 @@ function board3_basic_install($mode = 'install', $purge_modules = true, $u_actio
} }
/* /**
* check if the entered source file actually exists * check if the entered source file actually exists
*/ */
function check_file_src($value, $key, $module_id) function check_file_src($value, $key, $module_id)

3
root/portal/modules/portal_latest_bots.php Normal file → Executable file
View File

@@ -87,8 +87,11 @@ class portal_latest_bots_module
'LAST_VISITED_BOTS' => sprintf($user->lang['LAST_VISITED_BOTS'], $config['board3_last_visited_bots_number_' . $module_id]), 'LAST_VISITED_BOTS' => sprintf($user->lang['LAST_VISITED_BOTS'], $config['board3_last_visited_bots_number_' . $module_id]),
)); ));
if(!empty($row))
{
return 'latest_bots_side.html'; return 'latest_bots_side.html';
} }
}
function get_template_acp($module_id) function get_template_acp($module_id)
{ {