mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Changes to r9617 Fix a template compilation issue, and reshuffle the code. The added template complexity made it more of a problem to check the variables correctly, hence simplification.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9619 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e3af301523
commit
11d8d3455a
3 changed files with 32 additions and 25 deletions
|
@ -500,7 +500,29 @@ switch ($mode)
|
|||
|
||||
$poster_avatar = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']);
|
||||
|
||||
$template->assign_vars(show_profile($member));
|
||||
// We need to check if the modules 'zebra', 'notes' ('user_notes' mode) and 'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links
|
||||
$zebra_enabled = $user_notes_enabled = $warn_user_enabled = false;
|
||||
|
||||
// Only check if the user is logged in
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
if (!class_exists('p_master'))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
|
||||
}
|
||||
$module = new p_master();
|
||||
|
||||
$module->list_modules('ucp');
|
||||
$module->list_modules('mcp');
|
||||
|
||||
$user_notes_enabled = ($module->loaded('notes', 'user_notes')) ? true : false;
|
||||
$warn_user_enabled = ($module->loaded('warn', 'warn_user')) ? true : false;
|
||||
$zebra_enabled = ($module->loaded('zebra')) ? true : false;
|
||||
|
||||
unset($module);
|
||||
}
|
||||
|
||||
$template->assign_vars(show_profile($member, $user_notes_enabled, $warn_user_enabled));
|
||||
|
||||
// Custom Profile Fields
|
||||
$profile_fields = array();
|
||||
|
@ -512,23 +534,6 @@ switch ($mode)
|
|||
$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields[$user_id]) : array();
|
||||
}
|
||||
|
||||
// We need to check if the modules 'zebra', 'notes' ('user_notes' mode) and 'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links
|
||||
$zebra_enabled = $user_notes_enabled = $warn_user_enabled = false;
|
||||
|
||||
if (!class_exists('p_master'))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
|
||||
}
|
||||
$module = new p_master();
|
||||
|
||||
$module->list_modules('ucp');
|
||||
$module->list_modules('mcp');
|
||||
$user_notes_enabled = ($module->loaded('notes', 'user_notes')) ? true : false;
|
||||
$warn_user_enabled = ($module->loaded('warn', 'warn_user')) ? true : false;
|
||||
$zebra_enabled = ($module->loaded('zebra')) ? true : false;
|
||||
|
||||
unset($module);
|
||||
|
||||
// If the user has m_approve permission or a_user permission, then list then display unapproved posts
|
||||
if ($auth->acl_getf_global('m_approve') || $auth->acl_get('a_user'))
|
||||
{
|
||||
|
@ -1538,7 +1543,7 @@ page_footer();
|
|||
/**
|
||||
* Prepare profile data
|
||||
*/
|
||||
function show_profile($data)
|
||||
function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false)
|
||||
{
|
||||
global $config, $auth, $template, $user, $phpEx, $phpbb_root_path;
|
||||
|
||||
|
@ -1624,9 +1629,11 @@ function show_profile($data)
|
|||
'ICQ_STATUS_IMG' => (!empty($data['user_icq'])) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data['user_icq'] . '&img=5" width="18" height="18" />' : '',
|
||||
'S_JABBER_ENABLED' => ($config['jab_enable']) ? true : false,
|
||||
|
||||
'S_WARNINGS' => ($auth->acl_getf_global('m_') || $auth->acl_get('m_warn')) ? true : false,
|
||||
|
||||
'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&sr=posts") : '',
|
||||
'U_NOTES' => $auth->acl_getf_global('m_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '',
|
||||
'U_WARN' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $user_id, true, $user->session_id) : '',
|
||||
'U_NOTES' => ($user_notes_enabled && $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '',
|
||||
'U_WARN' => ($warn_user_enabled && $auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $user_id, true, $user->session_id) : '',
|
||||
'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($data['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $user_id) : '',
|
||||
'U_EMAIL' => $email,
|
||||
'U_WWW' => (!empty($data['user_website'])) ? $data['user_website'] : '',
|
||||
|
|
|
@ -78,9 +78,9 @@
|
|||
<dl class="details">
|
||||
<dt>{L_JOINED}:</dt> <dd>{JOINED}</dd>
|
||||
<dt>{L_VISITED}:</dt> <dd>{VISITED}</dd>
|
||||
<!-- IF U_NOTES or U_WARN -->
|
||||
<!-- IF WARNINGS -->
|
||||
<dt>{L_WARNINGS}: </dt>
|
||||
<dd><strong>{WARNINGS}</strong><!-- IF S_USER_NOTES or S_WARN_USER --> [ <!-- IF S_USER_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN and S_WARN_USER --><!-- IF S_USER_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]<!-- ENDIF --><!-- ENDIF --></dd>
|
||||
<dd><strong>{WARNINGS}</strong><!-- IF U_NOTES or U_WARN --> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]<!-- ENDIF --></dd>
|
||||
<!-- ENDIF -->
|
||||
<dt>{L_TOTAL_POSTS}:</dt>
|
||||
<dd>{POSTS} | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong>
|
||||
|
|
|
@ -66,10 +66,10 @@
|
|||
<td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_VISITED}: </td>
|
||||
<td width="100%"><b class="gen">{VISITED}</b></td>
|
||||
</tr>
|
||||
<!-- IF U_NOTES or U_WARN -->
|
||||
<!-- IF S_WARNINGS -->
|
||||
<tr>
|
||||
<td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}: </td>
|
||||
<td width="100%"><b class="gen">{WARNINGS}</b><br /><span class="genmed"><!-- IF S_USER_NOTES or S_WARN_USER --> [ <!-- IF S_USER_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN and S_WARN_USER --><!-- IF S_USER_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]<!-- ENDIF --></span></td>
|
||||
<td width="100%"><b class="gen">{WARNINGS}</b><!-- IF U_NOTES or U_WARN --><br /><span class="genmed"> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]</span><!-- ENDIF --></td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<tr>
|
||||
|
|
Loading…
Add table
Reference in a new issue