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


PHP Rank::addNew方法代码示例

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


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

示例1: filterArray

             $countErrors++;
             $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must include a rank image.<br>";
         } else {
             $rankImgURL = $_POST['rankimageurl'];
         }
     }
 }
 if ($countErrors > 0) {
     $_POST = filterArray($_POST);
     $_POST['submit'] = false;
 } else {
     // EVERYTHING IS OK
     $newRank = new Rank($mysqli);
     $arrColumns = array("rankcategory_id", "name", "description", "imageurl", "ordernum", "autodays", "hiderank", "promotepower", "autodisable", "color", "imagewidth", "imageheight");
     $arrValues = array($_POST['rankcat'], $_POST['rankname'], $_POST['rankdesc'], $rankImgURL, $intNewRankOrderNum, isset($_POST['autodays']) ? $_POST['autodays'] : 0, isset($_POST['hiderank']) ? $_POST['hiderank'] : 0, isset($_POST['promoterank']) ? $_POST['promoterank'] : 0, isset($_POST['autodisable']) ? $_POST['autodisable'] : 0, $_POST['rankcolor'], $_POST['rankimagewidth'], $_POST['rankimageheight']);
     if ($newRank->addNew($arrColumns, $arrValues)) {
         // Added Rank! Now give the rank its privileges
         $newRankInfo = $newRank->get_info_filtered();
         // If maximum rank is set to "(this rank)", set the promotepower to the new rank's rank_id
         if ($_POST['promoterank'] == -1) {
             $newRank->update(array("promotepower"), array($newRankInfo['rank_id']));
         }
         $arrColumns = array("rank_id", "console_id");
         $privObj = new Basic($mysqli, "rank_privileges", "privilege_id");
         $result = $mysqli->query("SELECT * FROM " . $dbprefix . "console ORDER BY sortnum");
         $rankOptions = "";
         while ($row = $result->fetch_assoc()) {
             $strPostVarName = "consoleid_" . $row['console_id'];
             if (isset($_POST[$strPostVarName]) && $_POST[$strPostVarName] == 1) {
                 $arrValues = array($newRankInfo['rank_id'], $row['console_id']);
                 $privObj->addNew($arrColumns, $arrValues);
开发者ID:nsystem1,项目名称:clanscripts,代码行数:31,代码来源:addrank.php


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