本文整理汇总了PHP中CForumUser::GetByID方法的典型用法代码示例。如果您正苦于以下问题:PHP CForumUser::GetByID方法的具体用法?PHP CForumUser::GetByID怎么用?PHP CForumUser::GetByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CForumUser
的用法示例。
在下文中一共展示了CForumUser::GetByID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Delete
public static function Delete($ID)
{
global $DB;
$ID = intVal($ID);
if ($ID <= 0) {
return false;
}
/***************** Event onBeforeUserDelete ************************/
foreach (GetModuleEvents("forum", "onBeforeUserDelete", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array(&$ID));
}
/***************** /Event ******************************************/
$strSql = "SELECT F.ID FROM b_forum_user FU, b_file F WHERE FU.ID = " . $ID . " AND FU.AVATAR = F.ID ";
$z = $DB->Query($strSql, false, "FILE: " . __FILE__ . " LINE:" . __LINE__);
while ($zr = $z->Fetch()) {
CFile::Delete($zr["ID"]);
}
$arForumUser = CForumUser::GetByID($ID);
$res = $DB->Query("DELETE FROM b_forum_user WHERE ID = " . $ID, True);
/***************** Event onAfterUserDelete *************************/
foreach (GetModuleEvents("forum", "onAfterUserDelete", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($ID));
}
/***************** /Event ******************************************/
unset($GLOBALS["FORUM_CACHE"]["USER"][$ID]);
unset($GLOBALS["FORUM_CACHE"]["USER_ID"][$arForumUser["USER_ID"]]);
return $res;
}
示例2: GetMessage
$arUserGroups[] = "administrators";
elseif ($arG["GROUP_ID"] == 2)
$arUserGroups[] = "everyone";
}
$arSaveUser["GROUP_ID"] = $arUserGroups;
if (CModule::IncludeModule("blog"))
{
$arBlogUser = CBlogUser::GetByID($arUser['ID'], BLOG_BY_USER_ID);
if (is_array($arBlogUser) && $arBlogUser["AVATAR"] > 0)
$arSaveUser["BLOG_AVATAR"] = CFile::GetPath($arBlogUser["AVATAR"]);
}
if (CModule::IncludeModule("forum"))
{
$arForumUser = CForumUser::GetByID($arUser['ID'], BLOG_BY_USER_ID);
if (is_array($arForumUser) && $arForumUser["AVATAR"] > 0)
$arSaveUser["FORUM_AVATAR"] = CFile::GetPath($arForumUser["AVATAR"]);
}
$oResponse->status = "200 OK";
$oResponse->arParameters['USER_INFO'] = $arSaveUser;
if (defined("FORMAT_DATE"))
$oResponse->arParameters['FORMAT_DATE'] = FORMAT_DATE;
if (defined("FORMAT_DATETIME"))
$oResponse->arParameters['FORMAT_DATETIME'] = FORMAT_DATETIME;
}
else
{
$oResponse->status = "443 Bad password.";
$oResponse->text = GetMessage("CTRLR_WS_ERR_BAD_PASSW");