当前位置: 首页>>代码示例>>PHP>>正文


PHP XoopsUser::name方法代码示例

本文整理汇总了PHP中XoopsUser::name方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsUser::name方法的具体用法?PHP XoopsUser::name怎么用?PHP XoopsUser::name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XoopsUser的用法示例。


在下文中一共展示了XoopsUser::name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: XoopsUser

 function get_submitter_info($uid)
 {
     if ($uid <= 0) {
         return _GUESTS;
     }
     $poster = new XoopsUser($uid);
     // check if invalid uid
     if ($poster->uname() == '') {
         return '';
     }
     if ($this->nameoruname == 'uname') {
         $name = $poster->uname();
     } else {
         $name = trim($poster->name());
         if ($name == "") {
             $name = $poster->uname();
         }
     }
     return "<a href='" . XOOPS_URL . "/userinfo.php?uid={$uid}'>{$name}</a>";
 }
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:20,代码来源:piCal_xoops.php

示例2: dt_delete_items

/**
* desc Elimina de la base de datos los elementos
**/
function dt_delete_items()
{
    global $xoopsModuleConfig, $xoopsConfig, $xoopsModule, $xoopsSecurity, $rmc_config, $xoopsUser;
    $ids = rmc_server_var($_POST, 'ids', array());
    $page = rmc_server_var($_POST, 'page', 1);
    $search = rmc_server_var($_POST, 'search', '');
    $sort = rmc_server_var($_POST, 'sort', 'id_soft');
    $mode = rmc_server_var($_POST, 'mode', 1);
    $cat = rmc_server_var($_POST, 'cat', 0);
    $type = rmc_server_var($_POST, 'type', '');
    $params = '?pag=' . $page . '&search=' . $search . '&sort=' . $sort . '&mode=' . $mode . '&cat=' . $cat . '&type=' . $type;
    //Verificamos que el software sea válido
    if (!is_array($ids) && $ids <= 0) {
        redirectMsg('items.php' . $params, __('You must select at least one download item to delete!', 'dtransport'), RMMSG_WARN);
    }
    if (!is_array($ids)) {
        $ids = array($ids);
    }
    if (!$xoopsSecurity->check()) {
        redirectMsg('items.php' . $params, __('Session token expired!', 'dtransport'), RMMSG_ERROR);
    }
    $errors = '';
    $mailer = new RMMailer('text/html');
    $etpl = DT_PATH . '/lang/deletion_' . $rmc_config['lang'] . '.php';
    if (!file_exists($etpl)) {
        $etpl = DT_PATH . '/lang/deletion_en.php';
    }
    $mailer->template($etpl);
    $mailer->assign('siteurl', XOOPS_URL);
    $mailer->assign('dturl', $xoopsModuleConfig['permalinks'] ? XOOPS_URL . '/' . trim($xoopsModuleConfig['htbase'], '/') : DT_URL);
    $mailer->assign('downcp', $xoopsModuleConfig['permalinks'] ? XOOPS_URL . '/' . trim($xoopsModuleConfig['htbase'], '/') . '/cp/' : DT_URL . '/?p=cpanel');
    $mailer->assign('dtname', $xoopsModule->name());
    $mailer->assign('sitename', $xoopsConfig['sitename']);
    foreach ($ids as $id) {
        $sw = new DTSoftware($id);
        if ($sw->isNew()) {
            continue;
        }
        if (!$sw->delete()) {
            $errors .= $sw->errors();
            continue;
        }
        $xu = new XoopsUser($sw->getVar('uid'));
        $mailer->add_users(array($xu));
        $mailer->assign('uname', $xu->name() != '' ? $xu->name() : $xu->uname());
        $mailer->assign('download', $sw->getVar('name'));
        $mailer->assign('email', $xu->getVar('email'));
        $mailer->assign('method', $xu->getVar('notify_method'));
        $mailer->set_subject(sprintf(__('Your download %s has been deleted!', 'dtransport'), $sw->getVar('name')));
        if ($xu->getVar('notify_method') == 1) {
            $mailer->set_from_xuser($xoopsUser);
            $mailer->send_pm();
        } else {
            $mailer->send();
        }
    }
    if ($errors != '') {
        redirectMsg('items.php' . $params, __('Errors ocurred while trying to delete selected downloads!', 'dtransport') . '<br />' . $errors, RMMSG_ERROR);
    }
    redirectMsg('items.php' . $params, __('Downloads deleted successfully!', 'dtransport'), RMMSG_SUCCESS);
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:64,代码来源:items.php


注:本文中的XoopsUser::name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。