本文整理匯總了PHP中XoopsUser::getUnameFromID方法的典型用法代碼示例。如果您正苦於以下問題:PHP XoopsUser::getUnameFromID方法的具體用法?PHP XoopsUser::getUnameFromID怎麽用?PHP XoopsUser::getUnameFromID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XoopsUser
的用法示例。
在下文中一共展示了XoopsUser::getUnameFromID方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: empty
(!empty($_POST["uid"]) && $moderate_handler->getLatest($_POST["uid"])>(time()+$_POST["expire"]*3600*24))
||
(!empty($_POST["ip"]) && $moderate_handler->getLatest($_POST["ip"], false)>(time()+$_POST["expire"]*3600*24))
||
(empty($_POST["uid"]) && empty($_POST["ip"]))
){
}else{
$moderate_obj =& $moderate_handler->create();
$moderate_obj->setVar("uid", @$_POST["uid"]);
$moderate_obj->setVar("ip", @$_POST["ip"]);
$moderate_obj->setVar("forum_id", $forum_id);
$moderate_obj->setVar("mod_start", time());
$moderate_obj->setVar("mod_end", time()+$_POST["expire"]*3600*24);
$moderate_obj->setVar("mod_desc", @$_POST["desc"]);
if($res = $moderate_handler->insert($moderate_obj) && !empty($forum_id) && !empty($_POST["uid"]) ){
$uname = XoopsUser::getUnameFromID($_POST["uid"]);
$post_handler =& xoops_getmodulehandler("post", "xforum");
$xforumpost =& $post_handler->create();
$xforumpost->setVar("poster_ip", forum_getIP());
$xforumpost->setVar("uid", empty($GLOBALS["xoopsUser"])?0:$GLOBALS["xoopsUser"]->getVar("uid"));
$xforumpost->setVar("forum_id", $forum_id);
$xforumpost->setVar("subject", sprintf(_MD_SUSPEND_SUBJECT, $uname, $_POST["expire"]));
$xforumpost->setVar("post_text", sprintf(_MD_SUSPEND_TEXT, '<a href="' . XOOPS_URL . '/userinfo.php?uid='.$_POST["uid"].'">'.$uname.'</a>', $_POST["expire"], @$_POST["desc"], formatTimestamp(time()+$_POST["expire"]*3600*24) ));
$xforumpost->setVar("dohtml", 1);
$xforumpost->setVar("dosmiley", 1);
$xforumpost->setVar("doxcode", 1);
$xforumpost->setVar("post_time", time());
$post_handler->insert($xforumpost);
unset($xforumpost);
}
if($_POST["uid"]>0){