示例#1
0
文件: module.php 项目: 4uva4ek/svato
function mod_usermenu($module_id, $cfg)
{
    $inCore = cmsCore::getInstance();
    $inUser = cmsUser::getInstance();
    $is_billing = $inCore->isComponentInstalled('billing');
    $is_audio = $inCore->isComponentInstalled('audio');
    $is_video = $inCore->isComponentInstalled('video');
    cmsPage::initTemplate('modules', 'mod_usermenu')->assign('avatar', $inUser->imageurl)->assign('nickname', $inUser->nickname)->assign('login', $inUser->login)->assign('id', $inUser->id)->assign('newmsg', cmsUser::getNewMessages($inUser->id))->assign('is_can_add', cmsUser::isUserCan('content/add'))->assign('is_admin', $inUser->is_admin)->assign('is_editor', cmsUser::userIsEditor())->assign('cfg', $inCore->loadModuleConfig($module_id))->assign('users_cfg', $inCore->loadComponentConfig('users'))->assign('is_billing', $is_billing)->assign('is_audio', $is_audio)->assign('is_video', $is_video)->assign('audio_count', $is_audio ? $inUser->audio_count : 0)->assign('video_count', $is_video ? $inUser->video_count : 0)->assign('balance', $is_billing ? $inUser->balance : 0)->display('mod_usermenu.tpl');
    return true;
}
示例#2
0
                            <tr>
                                <td width="230" align="left" valign="middle" style="padding-left:20px; padding-top:5px;">
                                    <a href="/admin/" style="color: #fff;">
                                        SocAto
                                    </a>
                                </td>
                                <td width="120">
                                    <div class="jdate"><?php 
echo date('d') . ' ' . $_LANG['MONTH_' . date('m')];
?>
</div>
                                    <div class="jclock">00:00:00</div>
                                </td>
                                <td>
                                    <?php 
$new_messages = cmsUser::getNewMessages($inUser->id);
if ($new_messages['total']) {
    $msg_link = '<a href="/users/' . $inUser->id . '/messages.html" style="color:yellow">' . $_LANG['AD_NEW_MSG'] . ' (' . $new_messages['total'] . ')</a>';
} else {
    $msg_link = '<span>' . $_LANG['NO'] . ' ' . $_LANG['NEW_MESSAGES'] . '</span>';
}
?>
                                    <div class="juser"><?php 
echo $_LANG['AD_YOU'];
?>
 &mdash; <a href="<?php 
echo cmsUser::getProfileURL($inUser->login);
?>
" target="_blank" title="<?php 
echo $_LANG['AD_GO_PROFILE'];
?>