本文整理汇总了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>";
}
示例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);
}