leadrs_side
Código: Selecionar todos
{$LR_BLOCK_H_L}<!-- IF $S_BLOCK_ICON --><img src="{$IMAGE_SRC}" width="{$IMAGE_WIDTH}" height="{$IMAGE_HEIGHT}" alt="" /> <!-- ENDIF -->{$TITLE}{$LR_BLOCK_H_R}
<strong>{L_ADMINISTRATORS}</strong><br />
<!-- BEGIN admin -->
<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;"><strong>{admin.USERNAME_FULL}</strong></span><br style="clear:both" />
<!-- BEGINELSE -->
{L_NO_ADMINISTRATORS_P}<br /><br />
<!-- END admin -->
<br style="clear:both" />
<strong>{L_MODERATORS}</strong><br />
<!-- BEGIN mod -->
<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;"><strong>{mod.USERNAME_FULL}</strong></span><br style="clear:both" />
<!-- BEGINELSE -->
{L_NO_MODERATORS_P}
<!-- END mod -->
<br style="clear:both" />
<strong>{L_COLABORADORES}</strong><br />
<!-- BEGIN col -->
<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;"><strong>{col.USERNAME_FULL}</strong></span><br style="clear:both" />
<!-- BEGINELSE -->
{L_NO_COLABORADORES_P}
<!-- END col -->
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
portal
Código: Selecionar todos
<?php
/**
*
* @package Board3 Portal v2
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
define('IN_PORTAL', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'portal/includes/constants.' . $phpEx);
$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.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/portal');
/**
* Make sure we do an isset first,
* 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'))
{
redirect(append_sid($phpbb_root_path . 'index.' . $phpEx));
}
/**
* get initial data
*/
$portal_config = obtain_portal_config();
$portal_modules = obtain_portal_modules();
/**
* set up column_count array
* with this we can hide unneeded parts of the portal
*/
$module_count = array(
'total' => 0,
'top' => 0,
'left' => 0,
'center' => 0,
'right' => 0,
'bottom' => 0,
);
/**
* start assigning block vars
*/
foreach ($portal_modules as $row)
{
if($row['module_status'] == B3_MODULE_DISABLED)
{
continue;
}
$class_name = 'portal_' . $row['module_classname'] . '_module';
if (!class_exists($class_name))
{
include("{$phpbb_root_path}{$portal_root_path}modules/portal_{$row['module_classname']}.$phpEx");
}
if (!class_exists($class_name))
{
trigger_error(sprintf($user->lang['CLASS_NOT_FOUND'], $class_name, 'portal_' . $row['module_classname']), E_USER_ERROR);
}
$module = new $class_name();
/**
* 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']) : '';
if ((is_array($group_ary) && !in_array($user->data['group_id'], $group_ary)))
{
continue;
}
if ($module->language)
{
$user->add_lang('mods/portal/' . $module->language);
}
if ($row['module_column'] == 1 && $config['board3_left_column'])
{
$template_module = $module->get_template_side($row['module_id']);
$template_column = 'left';
++$module_count['left'];
}
if ($row['module_column'] == 2)
{
$template_module = $module->get_template_center($row['module_id']);
$template_column = 'center';
++$module_count['center'];
}
if ($row['module_column'] == 3 && $config['board3_right_column'])
{
$template_module = $module->get_template_side($row['module_id']);
$template_column = 'right';
++$module_count['right'];
}
if ($row['module_column'] == 4)
{
$template_module = $module->get_template_center($row['module_id']);
++$module_count['top'];
}
if ($row['module_column'] == 5)
{
$template_module = $module->get_template_center($row['module_id']);
++$module_count['bottom'];
}
if (!isset($template_module))
{
continue;
}
// Custom Blocks that have been defined in the ACP will return an array instead of just the name of the template file
if (is_array($template_module))
{
$template->assign_block_vars('modules_' . column_num_string($row['module_column']), array(
'TEMPLATE_FILE' => 'portal/modules/' . $template_module['template'],
'IMAGE_SRC' => $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/' . $template_module['image_src'],
'TITLE' => $template_module['title'],
'CODE' => $template_module['code'],
'MODULE_ID' => $row['module_id'],
));
}
else
{
$template->assign_block_vars('modules_' . column_num_string($row['module_column']), array(
'TEMPLATE_FILE' => 'portal/modules/' . $template_module,
'IMAGE_SRC' => $phpbb_root_path . 'styles/' . $user->theme['theme_path'] . '/theme/images/portal/' . $row['module_image_src'],
'IMAGE_WIDTH' => $row['module_image_width'],
'IMAGE_HEIGHT' => $row['module_image_height'],
'MODULE_ID' => $row['module_id'],
'TITLE' => (isset($user->lang[$row['module_name']])) ? $user->lang[$row['module_name']] : utf8_normalize_nfc($row['module_name']),
));
}
unset($template_module);
}
$module_count['total'] = sizeof($portal_modules);
// Redirect to index if there are currently no active modules
if($module_count['total'] < 1)
{
redirect(append_sid($phpbb_root_path . 'index.' . $phpEx));
}
if (!class_exists('phpbb_mods_who_was_here'))
{
include($phpbb_root_path . 'includes/mods/who_was_here.' . $phpEx);
phpbb_mods_who_was_here::update_session();
}
phpbb_mods_who_was_here::display();
// Assign specific vars
$template->assign_vars(array(
// 'S_SMALL_BLOCK' => true,
'S_PORTAL_LEFT_COLUMN' => $config['board3_left_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_CENTER_COLUMN' => ($module_count['center'] > 0) ? true : false,
'S_RIGHT_COLUMN' => ($module_count['right'] > 0 && $config['board3_right_column']) ? true : false,
'S_TOP_COLUMN' => ($module_count['top'] > 0) ? true : false,
'S_BOTTOM_COLUMN' => ($module_count['bottom'] > 0) ? true : false,
'S_DISPLAY_PHPBB_MENU' => $config['board3_phpbb_menu'],
'S_DISPLAY_JUMPBOX' => $config['board3_display_jumpbox'],
));
// Output page
page_header($user->lang['PORTAL']);
$template->set_filenames(array(
'body' => 'portal/portal_body.html')
);
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
portal_leadrs_module
Código: Selecionar todos
<?php
/**
*
* @package Board3 Portal v2 - Leaders
* @copyright (c) Board3 Group ( www.board3.de )
* @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(
'NO_ADMINISTRATORS_P' => 'Sem administradores',
'NO_MODERATORS_P' => 'Sem moderadores',
'NO_COLABORADORES_P' => 'Sem colaboradores',
'NO_GROUPS_P' => 'Sem grupos',
'ACP_PORTAL_LEADERS' => 'Equipe/Líderes',
// ACP
'ACP_PORTAL_LEADERS' => 'Configurações de Equipe/Líderes',
'ACP_PORTAL_LEADERS_EXP' => 'Aqui você pode personalizar o bloco de líderes/equipe',
'PORTAL_LEADERS_EXT' => 'Extensão Líderes / Equipe',
'PORTAL_LEADERS_EXT_EXP' => 'O bloco padrão lista todos os administradores/moderadores/colaboradores, enquanto que o bloco extendido inclui todos os grupos não-ocultos com uma legenda.',
));
portal_leard
Código: Selecionar todos
<?php
/**
*
* @package Board3 Portal v2 - Leaders
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* @package Leaders
*/
class portal_leaders_module
{
/**
* Allowed columns: Just sum up your options (Exp: left + right = 10)
* top 1
* left 2
* center 4
* right 8
* bottom 16
*/
public $columns = 10;
/**
* Default modulename
*/
public $name = 'THE_TEAM';
/**
* Default module-image:
* file must be in "{T_THEME_PATH}/images/portal/"
*/
public $image_src = 'portal_team.png';
/**
* module-language file
* file must be in "language/{$user->lang}/mods/portal/"
*/
public $language = 'portal_leaders_module';
public function get_template_side($module_id)
{
global $config, $template, $user, $auth, $db, $phpEx, $phpbb_root_path;
// Display a listing of board admins, moderators, Colaboradores
$user->add_lang('groups');
if($config['board3_leaders_ext_' . $module_id])
{
$legends = array();
$groups = array();
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
$sql = 'SELECT group_id, group_name, group_colour, group_type, group_position
FROM ' . GROUPS_TABLE . '
WHERE group_legend = 1
ORDER BY group_position ASC';
}
else
{
$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_position
FROM ' . GROUPS_TABLE . ' g
LEFT JOIN ' . USER_GROUP_TABLE . ' ug
ON (
g.group_id = ug.group_id
AND ug.user_id = ' . $user->data['user_id'] . '
AND ug.user_pending = 0
)
WHERE g.group_legend = 1
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
ORDER BY g.group_position ASC';
}
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$groups[$row['group_id']] = array(
'group_name' => $row['group_name'],
'group_colour' => $row['group_colour'],
'group_type' => $row['group_type'],
'group_users' => array(),
);
$legends[] = $row['group_id'];
}
$db->sql_freeresult($result);
if(sizeof($legends))
{
$sql = 'SELECT
u.user_id AS user_id, u.username AS username, u.user_colour AS user_colour, ug.group_id AS group_id
FROM
' . USERS_TABLE . ' AS u,
' . USER_GROUP_TABLE . ' AS ug
WHERE
ug.user_id = u.user_id
AND '. $db->sql_in_set('ug.group_id', $legends) . '
ORDER BY u.username ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
$groups[$row['group_id']]['group_users'][] = array(
'user_id' => $row['user_id'],
'username' => $row['username'],
'user_colour' => $row['user_colour'],
);
}
$db->sql_freeresult($result);
}
if(sizeof($groups))
{
foreach($groups as $group_id => $group)
{
if(sizeof($group['group_users']))
{
$group_name = ($group['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group['group_name']] : $group['group_name'];
$u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $group_id);
$template->assign_block_vars('group', array(
'GROUP_NAME' => $group_name,
'GROUP_COLOUR' => $group['group_colour'],
'U_GROUP' => $u_group,
));
foreach($group['group_users'] as $group_user)
{
$template->assign_block_vars('group.member', array(
'USER_ID' => $group_user['user_id'],
'USERNAME_FULL' => get_username_string('full', $group_user['user_id'], $group_user['username'], $group_user['user_colour']),
));
}
}
}
}
return 'leaders_ext_side.html';
}
else
{
$sql = $db->sql_build_query('SELECT', array(
'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.user_colour, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id',
'FROM' => array(
USERS_TABLE => 'u',
GROUPS_TABLE => 'g'
),
'LEFT_JOIN' => array(
array(
'FROM' => array(USER_GROUP_TABLE => 'ug'),
'ON' => 'ug.group_id = g.group_id AND ug.user_pending = 0 AND ug.user_id = ' . $user->data['user_id']
)),
'WHERE' => 'u.group_id = g.group_id AND ' . $db->sql_in_set('g.group_name', array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'COLABORADORES')),
'ORDER_BY' => 'g.group_name ASC, u.username_clean ASC'
));
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
if ($row['group_name'] == 'ADMINISTRATORS')
{
$which_row = 'admin';
}
elseif ($row['group_name'] == 'GLOBAL_MODERATORS')
{
$which_row = 'mod';
}
elseif ($row['group_name'] == 'COLABORADORES')
{
$which_row = 'col';
}
if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id'])
{
$group_name = $user->lang['GROUP_UNDISCLOSED'];
$u_group = '';
}
else
{
$group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
$u_group = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']);
}
$template->assign_block_vars($which_row, array(
'USER_ID' => $row['user_id'],
'GROUP_NAME' => $group_name,
'GROUP_COLOR' => $row['group_colour'],
'U_GROUP' => $u_group,
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
));
}
$db->sql_freeresult($result);
return 'leaders_side.html';
}
}
public function get_template_acp($module_id)
{
return array(
'title' => 'ACP_PORTAL_LEADERS',
'vars' => array(
'legend1' => 'ACP_PORTAL_LEADERS',
'board3_leaders_ext_' . $module_id => array('lang' => 'PORTAL_LEADERS_EXT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
),
);
}
/**
* API functions
*/
public function install($module_id)
{
// Show normal team block by default
set_config('board3_leaders_ext_' . $module_id, 0);
return true;
}
public function uninstall($module_id)
{
global $db;
$del_config = array(
'board3_leaders_ext_' . $module_id,
);
$sql = 'DELETE FROM ' . CONFIG_TABLE . '
WHERE ' . $db->sql_in_set('config_name', $del_config);
return $db->sql_query($sql);
}
}
o que aconteceu será?
vlw fwi, Holmes