コード例 #1
0
ファイル: Profile.template.php プロジェクト: Bloc67/ShelfLife
function template_profile_above()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    echo '
	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/profile.js"></script>';
    // Prevent Chrome from auto completing fields when viewing/editing other members profiles
    if ($context['browser']['is_chrome'] && !$context['user']['is_owner']) {
        echo '
	<script type="text/javascript"><!-- // --><![CDATA[
		disableAutoComplete();
	// ]]></script>';
    }
    // If an error occurred while trying to save previously, give the user a clue!
    if (!empty($context['post_errors'])) {
        echo '
					', template_error_message();
    }
    // If the profile was update successfully, let the user know this.
    if (!empty($context['profile_updated'])) {
        echo '
					<div class="windowbg" id="profile_success">
						', $context['profile_updated'], '
					</div>';
    }
}
コード例 #2
0
ファイル: Profile.template.php プロジェクト: ahrasis/themes
function template_profile_above()
{
    global $context, $scripturl, $txt, $settings;
    echo '
	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/script.js"></script>
	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/profile.js"></script>';
    // If an error occurred while trying to save previously, give the user a clue!
    echo template_error_message();
    // If the profile was update successfully, let the user know this.
    if (!empty($context['profile_updated'])) {
        echo '
		<div class="ui-body ui-body-e">
			', $context['profile_updated'], '
		</div>';
    }
    // Profile menu
    if (allowedTo('profile_identity_any')) {
        echo '
		<div data-role="controlgroup">
			<a data-role="button" href="', $scripturl, '?action=profile;area=summary;u=', $context['member']['id'], '">', $txt['profileInfo'], '</a>';
        if (allowedTo('profile_identity_own')) {
            echo '
			<a data-role="button" href="', $scripturl, '?action=profile;area=account;u=', $context['member']['id'], '">', $txt['account'], '</a>';
        }
        if (allowedTo('profile_identity_own')) {
            echo '
			<a data-role="button" href="', $scripturl, '?action=profile;area=forumprofile;u=', $context['member']['id'], '">', $txt['profileEdit'], '</a>';
        }
        echo '
		</div><br />';
    }
}
コード例 #3
0
function template_profile_above()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    // Assuming there are actually some areas the user can visit...
    if (!empty($context['profile_areas'])) {
        echo '
		<table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-top: 1ex;">
			<tr>
				<td width="180" valign="top">
					<table border="0" cellpadding="4" cellspacing="1" class="bordercolor" width="170">';
        // Loop through every area, displaying its name as a header.
        foreach ($context['profile_areas'] as $section) {
            echo '
						<tr>
							<td class="catbg">', $section['title'], '</td>
						</tr>
						<tr class="windowbg2">
							<td class="smalltext">';
            // For every section of the area display it, and bold it if it's the current area.
            foreach ($section['areas'] as $i => $area) {
                if ($i == $context['menu_item_selected']) {
                    echo '
								<b>', $area, '</b><br />';
                } else {
                    echo '
								', $area, '<br />';
                }
            }
            echo '
								<br />
							</td>
						</tr>';
        }
        echo '
					</table>
				</td>
				<td width="100%" valign="top">';
    } else {
        echo '
		<table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-top: 1ex;">
			<tr>
				<td width="100%" valign="top">';
    }
    // If an error occurred whilst trying to save previously, give the user a clue!
    if (!empty($context['post_errors'])) {
        echo '
					<table width="85%" cellpadding="0" cellspacing="0" border="0" align="center">
						<tr>
							<td>', template_error_message(), '</td>
						</tr>
					</table>';
    }
}
コード例 #4
0
/**
 * Template for the profile header - goes before any other profile template.
 */
function template_profile_above()
{
    global $context;
    // Prevent browssers from auto completing fields when viewing/editing other members profiles
    if (!$context['user']['is_owner']) {
        addInlineJavascript('disableAutoComplete();', true);
    }
    // If an error occurred while trying to save previously, give the user a clue!
    echo '
					', template_error_message();
    // If the profile was update successfully, let the user know this.
    if (!empty($context['profile_updated'])) {
        echo '
					<div class="successbox">
						', $context['profile_updated'], '
					</div>';
    }
}