Added latest members block;
Drop-Down list when adding a module now shows the correct title of the block and not the class name; Added basic log function; Fixed incorrect EXPLAIN language strings of announcements block;
This commit is contained in:
@@ -52,7 +52,7 @@ class acp_portal
|
||||
$display_vars = array(
|
||||
'title' => 'ACP_PORTAL_GENERAL_TITLE',
|
||||
'vars' => array(
|
||||
'legend1' => 'ACP_PORTAL_GENERAL_INFO',
|
||||
'legend1' => 'ACP_PORTAL_CONFIG_INFO',
|
||||
'board3_enable' => array('lang' => 'PORTAL_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'board3_left_column' => array('lang' => 'PORTAL_LEFT_COLUMN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'board3_right_column' => array('lang' => 'PORTAL_RIGHT_COLUMN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
@@ -404,14 +404,15 @@ class acp_portal
|
||||
$c_class = new $class();
|
||||
if ($c_class->columns & column_string_const($add_module))
|
||||
{
|
||||
$fileinfo[] = substr($class, 7, -7);
|
||||
$user->add_lang('mods/portal/' . $c_class->language);
|
||||
$fileinfo[] = $user->lang[$c_class->name];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
|
||||
ksort($fileinfo);
|
||||
sort($fileinfo);
|
||||
$options = '';
|
||||
|
||||
foreach ($fileinfo as $module)
|
||||
|
||||
@@ -46,6 +46,7 @@ $lang = array_merge($lang, array(
|
||||
// general
|
||||
'ACP_PORTAL' => 'Portal',
|
||||
'ACP_PORTAL_GENERAL_INFO' => 'Allgemeine Einstellungen',
|
||||
'ACP_PORTAL_CONFIG_INFO' => 'Allgemeine Einstellungen',
|
||||
'ACP_PORTAL_GENERAL_TITLE' => 'Portal Administration',
|
||||
'ACP_PORTAL_GENERAL_TITLE_EXP' => 'Thank you for choosing Board3 Portal! This is where you can manage your portal page. The options below let you customize the various general settings.',
|
||||
'PORTAL_ENABLE' => 'Enable Portal',
|
||||
@@ -107,9 +108,8 @@ $lang = array_merge($lang, array(
|
||||
|
||||
'SELECT_LINK_ICON' => 'Select an icon…',
|
||||
|
||||
// paypal
|
||||
'PORTAL_PAY_ACC' => 'Paypal Account',
|
||||
'PORTAL_PAY_ACC_EXPLAIN' => 'Gib deine e-mail-Adresse an, die du bei Paypal benutzt, z.B. xxx@xxx.com',
|
||||
// Logs
|
||||
'LOG_PORTAL_CONFIG' => '<strong>Altered Portal settings</strong><br />» %s',
|
||||
|
||||
/**
|
||||
* A copy of Handyman` s MOD version check, to view it on the portal overview
|
||||
|
||||
@@ -50,27 +50,27 @@ $lang = array_merge($lang, array(
|
||||
|
||||
// ACP
|
||||
'ACP_PORTAL_ANNOUNCE_SETTINGS' => 'Global announcements settings',
|
||||
'ACP_PORTAL_ANNOUNCE_SETTINGS_EXPLAIN' => 'This is where you customize the global announcements block.',
|
||||
'ACP_PORTAL_ANNOUNCE_SETTINGS_EXP' => 'This is where you customize the global announcements block.',
|
||||
'PORTAL_ANNOUNCEMENTS' => 'Display global announcements',
|
||||
'PORTAL_ANNOUNCEMENTS_EXPLAIN' => 'Display this block on the portal.',
|
||||
'PORTAL_ANNOUNCEMENTS_EXP' => 'Display this block on the portal.',
|
||||
'PORTAL_ANNOUNCEMENTS_STYLE' => 'Compact global announcements block style',
|
||||
'PORTAL_ANNOUNCEMENTS_STYLE_EXPLAIN' => '"Yes" means use the compact style for for global announcements. "No" means use the large style (text view).',
|
||||
'PORTAL_ANNOUNCEMENTS_STYLE_EXP' => '"Yes" means use the compact style for for global announcements. "No" means use the large style (text view).',
|
||||
'PORTAL_NUMBER_OF_ANNOUNCEMENTS' => 'Number of announcements on the portal',
|
||||
'PORTAL_NUMBER_OF_ANNOUNCEMENTS_EXPLAIN' => '0 means infinite',
|
||||
'PORTAL_NUMBER_OF_ANNOUNCEMENTS_EXP' => '0 means infinite',
|
||||
'PORTAL_ANNOUNCEMENTS_DAY' => 'Number of days to display the announcement',
|
||||
'PORTAL_ANNOUNCEMENTS_DAY_EXPLAIN' => '0 means infinite',
|
||||
'PORTAL_ANNOUNCEMENTS_DAY_EXP' => '0 means infinite',
|
||||
'PORTAL_ANNOUNCEMENTS_LENGTH' => 'Maximum size/length of global announcements',
|
||||
'PORTAL_ANNOUNCEMENTS_LENGTH_EXPLAIN' => '0 means infinite',
|
||||
'PORTAL_ANNOUNCEMENTS_LENGTH_EXP' => '0 means infinite',
|
||||
'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' => 'Announcements forums',
|
||||
'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM_EXPLAIN' => 'Forum(s) from which we retrieve the announcements. Leave this blank to retrieve announcements from all the forums. If "Exclude forums" is set to "Yes", select the forums you want to exclude.<br />If "Exclude forums" is set to "No" select the forums you want to see.<br />Select/Deselect multiple forums by holding <samp>CTRL</samp> and clicking.',
|
||||
'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM_EXP' => 'Forum(s) from which we retrieve the announcements. Leave this blank to retrieve announcements from all the forums. If "Exclude forums" is set to "Yes", select the forums you want to exclude.<br />If "Exclude forums" is set to "No" select the forums you want to see.<br />Select/Deselect multiple forums by holding <samp>CTRL</samp> and clicking.',
|
||||
'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE' => 'Exclude forums',
|
||||
'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE_EXPLAIN'=> 'Select "Yes" if you want to exlude the selected forums from the announcements block, and "No" if you want to see only the selected forums in the announcements block.',
|
||||
'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE_EXP'=> 'Select "Yes" if you want to exlude the selected forums from the announcements block, and "No" if you want to see only the selected forums in the announcements block.',
|
||||
'PORTAL_ANNOUNCEMENTS_PERMISSIONS' => 'Enable/disable permissions',
|
||||
'PORTAL_ANNOUNCEMENTS_PERMISSIONS_EXPLAIN' => 'When displaying announcements, consider a user's forum-viewing permissions.',
|
||||
'PORTAL_ANNOUNCEMENTS_PERMISSIONS_EXP' => 'When displaying announcements, consider a user's forum-viewing permissions.',
|
||||
'PORTAL_ANNOUNCEMENTS_ARCHIVE' => 'Enable the announcements archive system',
|
||||
'PORTAL_ANNOUNCEMENTS_ARCHIVE_EXPLAIN' => 'If enabled the announcements archive system / page numbers will be displayed.',
|
||||
'PORTAL_ANNOUNCEMENTS_ARCHIVE_EXP' => 'If enabled the announcements archive system / page numbers will be displayed.',
|
||||
'PORTAL_SHOW_REPLIES_VIEWS' => 'Display the number of replies and views',
|
||||
'PORTAL_SHOW_REPLIES_VIEWS_EXPLAIN' => 'This setting pertains to the compact block.<br />When Yes, the number of replies and views are shown in 2 extra columns. When No, replies and views will be shown beside the forum name. Select No if you have problems with the display of the extra columns due to the extra width required.',
|
||||
'PORTAL_SHOW_REPLIES_VIEWS_EXP' => 'This setting pertains to the compact block.<br />When Yes, the number of replies and views are shown in 2 extra columns. When No, replies and views will be shown beside the forum name. Select No if you have problems with the display of the extra columns due to the extra width required.',
|
||||
));
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Portal - Latest Members
|
||||
* @version $Id$
|
||||
* @copyright (c) 2009, 2010 Board3 Portal Team
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*/
|
||||
|
||||
/**
|
||||
* DO NOT CHANGE
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
if (empty($lang) || !is_array($lang))
|
||||
{
|
||||
$lang = array();
|
||||
}
|
||||
|
||||
// DEVELOPERS PLEASE NOTE
|
||||
//
|
||||
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
|
||||
//
|
||||
// Placeholders can now contain order information, e.g. instead of
|
||||
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
|
||||
// translators to re-order the output of data while ensuring it remains correct
|
||||
//
|
||||
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
|
||||
// equally where a string contains only two placeholders which are used to wrap text
|
||||
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
|
||||
$lang = array_merge($lang, array(
|
||||
'LATEST_MEMBERS' => 'Newest members',
|
||||
|
||||
// ACP
|
||||
'ACP_PORTAL_MEMBERS_SETTINGS' => 'Newest members settings',
|
||||
'ACP_PORTAL_MEMBERS_SETTINGS_EXP' => 'This is where you customize the newest members block.',
|
||||
'PORTAL_MAX_LAST_MEMBER' => 'Maximum number of newest members shown',
|
||||
'PORTAL_MAX_LAST_MEMBER_EXP' => '0 means infinite',
|
||||
));
|
||||
|
||||
?>
|
||||
105
root/portal/modules/portal_latest_members.php
Normal file
105
root/portal/modules/portal_latest_members.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Portal - Latest Members
|
||||
* @version $Id$
|
||||
* @copyright (c) 2009, 2010 Board3 Portal Team
|
||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @package Modulname
|
||||
*/
|
||||
class portal_latest_members_module
|
||||
{
|
||||
/**
|
||||
* Allowed columns: Just sum up your options (Exp: left + right = 10)
|
||||
* top 1
|
||||
* left 2
|
||||
* center 4
|
||||
* right 8
|
||||
* bottom 16
|
||||
*/
|
||||
var $columns = 10;
|
||||
|
||||
/**
|
||||
* Default modulename
|
||||
*/
|
||||
var $name = 'LATEST_MEMBERS';
|
||||
|
||||
/**
|
||||
* Default module-image:
|
||||
* file must be in "{T_THEME_PATH}/images/portal/"
|
||||
*/
|
||||
var $image_src = 'portal_members.png';
|
||||
|
||||
/**
|
||||
* module-language file
|
||||
* file must be in "language/{$user->lang}/mods/portal/"
|
||||
*/
|
||||
var $language = 'portal_latest_members_module';
|
||||
|
||||
function get_template_side($module_id)
|
||||
{
|
||||
global $config, $template, $db, $user;
|
||||
|
||||
$sql = 'SELECT user_id, username, user_regdate, user_colour
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type <> ' . USER_IGNORE . '
|
||||
AND user_inactive_time = 0
|
||||
ORDER BY user_regdate DESC';
|
||||
$result = $db->sql_query_limit($sql, $config['board3_max_last_member']);
|
||||
|
||||
while(($row = $db->sql_fetchrow($result)) && ($row['username']))
|
||||
{
|
||||
$template->assign_block_vars('latest_members', array(
|
||||
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
|
||||
'JOINED' => $user->format_date($row['user_regdate'], $format = 'd M'),
|
||||
));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
return 'latest_members_side.html';
|
||||
}
|
||||
|
||||
function get_template_acp($module_id)
|
||||
{
|
||||
return array(
|
||||
'title' => 'ACP_PORTAL_MEMBERS_SETTINGS',
|
||||
'vars' => array(
|
||||
'legend1' => 'ACP_PORTAL_MEMBERS_SETTINGS',
|
||||
'board3_max_last_member' => array('lang' => 'PORTAL_MAX_LAST_MEMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* API functions
|
||||
*/
|
||||
function install($module_id)
|
||||
{
|
||||
set_config('board3_max_last_member', 8);
|
||||
return true;
|
||||
}
|
||||
|
||||
function uninstall($module_id)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$del_config = array(
|
||||
'board3_max_last_member',
|
||||
);
|
||||
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('config_name', $del_config);
|
||||
return $db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!--version $Id$ //-->
|
||||
{$LR_BLOCK_H_L}<!-- IF $S_BLOCK_ICON --><img src="{T_THEME_PATH}/images/portal/portal_members.png" width="16" height="16" alt="" /> <!-- ENDIF -->{L_LATEST_MEMBERS}{$LR_BLOCK_H_R}
|
||||
<span style="float:left;"><strong>{L_USERNAME}</strong></span>
|
||||
<span style="float:right;padding-right:10px;"><strong>{L_JOINED}</strong></span><br style="clear:both" />
|
||||
<!-- BEGIN latest_members -->
|
||||
<span style="float:left;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16" height="16" alt="" /></span><span style="float:left; padding-left:5px; padding-top:2px;">{latest_members.USERNAME_FULL}</span>
|
||||
<span style="float:right;padding-right:10px; padding-top:2px;">{latest_members.JOINED}</span><br style="clear:both" />
|
||||
<!-- END latest_members -->
|
||||
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
|
||||
BIN
root/styles/prosilver/theme/images/portal/portal_members.png
Normal file
BIN
root/styles/prosilver/theme/images/portal/portal_members.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user