public static function Update($ID, $arFields) { global $DB; $ID = intVal($ID); if ($ID <= 0) { return False; } if (!CForumRank::CheckFields("UPDATE", $arFields)) { return false; } $strUpdate = $DB->PrepareUpdate("b_forum_rank", $arFields); $strSql = "UPDATE b_forum_rank SET " . $strUpdate . " WHERE ID = " . $ID; $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__); if (is_set($arFields, "LANG")) { $DB->Query("DELETE FROM b_forum_rank_lang WHERE RANK_ID = " . $ID, false, "File: " . __FILE__ . "<br>Line: " . __LINE__); foreach ($arFields["LANG"] as $i => $val) { $arInsert = $DB->PrepareInsert("b_forum_rank_lang", $arFields["LANG"][$i]); $strSql = "INSERT INTO b_forum_rank_lang(RANK_ID, " . $arInsert[0] . ") VALUES(" . $ID . ", " . $arInsert[1] . ")"; $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__); } } return $ID; }
public static function Add($arFields) { global $DB; if (!CForumRank::CheckFields("ADD", $arFields)) { return false; } $arInsert = $DB->PrepareInsert("b_forum_rank", $arFields); $strSql = "INSERT INTO b_forum_rank(" . $arInsert[0] . ") VALUES(" . $arInsert[1] . ")"; $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__); $ID = intVal($DB->LastID()); foreach ($arFields["LANG"] as $i => $val) { $arInsert = $DB->PrepareInsert("b_forum_rank_lang", $arFields["LANG"][$i]); $strSql = "INSERT INTO b_forum_rank_lang(RANK_ID, " . $arInsert[0] . ") VALUES(" . $ID . ", " . $arInsert[1] . ")"; $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__); } return $ID; }
echo "<br>" . htmlspecialcharsEx($ar_Message["DESCRIPTION"]); } ?> <?php if (IntVal($ar_Message["AUTHOR_ID"]) > 0) { $arMessageUserGroups = CUser::GetUserGroup($ar_Message["AUTHOR_ID"]); $arMessageUserGroups[] = 2; $strMessageUserPerms = CForumNew::GetUserPermission($FID, $arMessageUserGroups); if ($strMessageUserPerms == "Q") { echo "<br><b>Модератор</b>"; } elseif ($strMessageUserPerms == "U") { echo "<br><b>Редактор</b>"; } elseif ($strMessageUserPerms == "Y") { echo "<br><b>Администратор</b>"; } elseif (IntVal($ar_Message["RANK_ID"]) > 0) { $arRank = CForumRank::GetLangByID($ar_Message["RANK_ID"], LANGUAGE_ID); echo "<br>" . $arRank["NAME"]; } } else { echo "<br><i>Гость</i>"; } ?> <br> <?php if (strlen($ar_Message["AVATAR"]) > 0) { ?> <center><br> <?php echo CFile::ShowImage($ar_Message["AVATAR"], 90, 90, "border=0", "", true); ?> </center>