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


PHP In_Array函数代码示例

本文整理汇总了PHP中In_Array函数的典型用法代码示例。如果您正苦于以下问题:PHP In_Array函数的具体用法?PHP In_Array怎么用?PHP In_Array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: Get_Fancy_Images

     function Get_Fancy_Images($orderby = 'ID', $order = 'ASC', $limit = -1)
     {
         global $wpdb;
         // Check Parameters
         if (!$orderby) {
             $orderby = 'ID';
         }
         if (!In_Array($order, array('ASC', 'DESC', 'RAND'))) {
             $order = 'ASC';
         }
         $limit = IntVal($limit);
         // Build Statement
         $stmt = '
 SELECT attachment.*, gallery.ID gallery_id
 FROM   ' . $wpdb->posts . ' attachment, ' . $wpdb->posts . ' gallery
 WHERE  attachment.post_type = "attachment"
 AND    attachment.post_mime_type LIKE "image/%"
 AND    gallery.post_type = "' . $this->fancy_gallery->gallery_post_type . '"
 AND    attachment.post_parent = gallery.ID
 GROUP BY attachment.ID ';
         if ($order == 'RAND') {
             $stmt .= 'ORDER BY RAND() ';
         } else {
             $stmt .= 'ORDER BY attachment.' . $orderby . ' ' . $order . ' ';
         }
         if ($limit > 0) {
             $stmt .= 'LIMIT ' . $limit;
         }
         return $wpdb->Get_Results($stmt);
     }
开发者ID:RichyVN,项目名称:RST-Intranet,代码行数:30,代码来源:wp-widget-fancy-random-images.php

示例2: ValidateLogin

 public static function ValidateLogin(&$ErrorMessage, $SelfURL)
 {
     $Mode = Filter_Input(INPUT_GET, 'openid_mode', FILTER_SANITIZE_SPECIAL_CHARS);
     if ($Mode === 'error') {
         $ErrorMessage = Filter_Input(INPUT_GET, 'openid_error', FILTER_SANITIZE_STRING);
         if (empty($ErrorMessage)) {
             $ErrorMessage = 'Something went wrong.';
         }
         return false;
     } else {
         if ($Mode !== 'id_res') {
             $ErrorMessage = 'Invalid OpenID mode.';
             return false;
         }
     }
     // See http://openid.net/specs/openid-authentication-2_0.html#positive_assertions
     $Arguments = Filter_Input_Array(INPUT_GET, array('openid_ns' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array('regexp' => '/^http:\\/\\/specs\\.openid\\.net\\/auth\\/2\\.0$/')), 'openid_op_endpoint' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array('regexp' => '/^' . Preg_Quote(self::STEAM_LOGIN, '/') . '$/')), 'openid_claimed_id' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array('regexp' => '/^https?:\\/\\/steamcommunity.com\\/openid\\/id\\/(7656119[0-9]{10})\\/?$/')), 'openid_identity' => FILTER_SANITIZE_URL, 'openid_return_to' => FILTER_SANITIZE_URL, 'openid_response_nonce' => FILTER_SANITIZE_STRING, 'openid_assoc_handle' => FILTER_SANITIZE_SPECIAL_CHARS, 'openid_signed' => FILTER_SANITIZE_SPECIAL_CHARS, 'openid_sig' => FILTER_SANITIZE_SPECIAL_CHARS));
     if (!Is_Array($Arguments)) {
         $ErrorMessage = 'Invalid arguments.';
         return false;
     } else {
         if (In_Array(null || false, $Arguments)) {
             $ErrorMessage = 'One of the arguments is invalid and/or missing.';
             return false;
         } else {
             if ($Arguments['openid_claimed_id'] !== $Arguments['openid_identity']) {
                 $ErrorMessage = 'Claimed id must match your identity.';
                 return false;
             } else {
                 if (strpos($Arguments['openid_return_to'], $SelfURL) !== 0) {
                     $ErrorMessage = 'Invalid return uri.';
                     return false;
                 }
             }
         }
     }
     if (Preg_Match('/^https?:\\/\\/steamcommunity.com\\/openid\\/id\\/(7656119[0-9]{10})\\/?$/', $Arguments['openid_identity'], $CommunityID) === 1) {
         $CommunityID = $CommunityID[1];
     } else {
         $ErrorMessage = 'Failed to find your CommunityID. If this issue persists, please contact us.';
         return false;
     }
     $Arguments['openid_mode'] = 'check_authentication';
     // Add mode for verification
     $c = cURL_Init();
     cURL_SetOpt_Array($c, array(CURLOPT_USERAGENT => 'Steam Database Party OpenID Login', CURLOPT_RETURNTRANSFER => true, CURLOPT_URL => self::STEAM_LOGIN, CURLOPT_CONNECTTIMEOUT => 6, CURLOPT_TIMEOUT => 6, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $Arguments));
     $Response = cURL_Exec($c);
     cURL_Close($c);
     if (Preg_Match('/is_valid\\s*:\\s*true/', $Response) === 1) {
         return $CommunityID;
     }
     // If we reach here, then it failed
     $ErrorMessage = 'Failed to verify your login with Steam, it could be down. Check Steam\'s status at http://steamstat.us.';
     return false;
 }
开发者ID:KEFumpl,项目名称:kefumpl.github.io,代码行数:55,代码来源:login.php

示例3: System_IsLoaded

function System_IsLoaded($Path)
{
    /****************************************************************************/
    $__args_types = array('string');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $Loaded = (array) Link_Get('System');
    #-----------------------------------------------------------------------------
    return In_Array($Path, $Loaded);
}
开发者ID:carriercomm,项目名称:jbs,代码行数:12,代码来源:System.php

示例4: getParams

 public function getParams()
 {
     #-------------------------------------------------------------------------------
     $Server = new DomainServer();
     #-------------------------------------------------------------------------------
     $IsSelected = $Server->Select((int) $this->params['ServerID']);
     #-------------------------------------------------------------------------------
     switch (ValueOf($IsSelected)) {
         #-------------------------------------------------------------------------------
         case 'error':
             return ERROR | @Trigger_Error(500);
         case 'true':
             #-------------------------------------------------------------------------------
             // For RegRu only
             if ($Server->Settings['Params']['SystemID'] == 'RegRu' && In_Array($this->params['Name'], array('ru', 'su', 'рф'))) {
                 #-------------------------------------------------------------------------------
                 $Domain = SprintF("%s.%s", $this->params['DomainName'], $this->params['Name']);
                 #-------------------------------------------------------------------------------
                 $Result = $Server->GetUploadID($Domain);
                 #-------------------------------------------------------------------------------
                 switch (ValueOf($Result)) {
                     case 'error':
                         return ERROR | @Trigger_Error(500);
                     case 'array':
                         #-------------------------------------------------------------------------------
                         $UploadID = $Result['UploadID'];
                         #-------------------------------------------------------------------------------
                         $this->params['UploadID'] = $UploadID;
                         #-------------------------------------------------------------------------------
                         Debug(SPrintF('[system/classes/DomainOrdersOnRegisterMsg.class.php]: UploadID = %s', $UploadID));
                         #-------------------------------------------------------------------------------
                         break;
                         #-------------------------------------------------------------------------------
                     #-------------------------------------------------------------------------------
                     default:
                         return ERROR | @Trigger_Error(101);
                 }
                 #-------------------------------------------------------------------------------
             }
             #-------------------------------------------------------------------------------
             break;
             #-------------------------------------------------------------------------------
         #-------------------------------------------------------------------------------
         default:
             return ERROR | @Trigger_Error(101);
     }
     #-------------------------------------------------------------------------------
     return $this->params;
     #-------------------------------------------------------------------------------
 }
开发者ID:carriercomm,项目名称:jbs,代码行数:50,代码来源:DomainOrdersOnRegisterMsg.class.php

示例5: defineRewriteRules

 static function defineRewriteRules()
 {
     # Add filter permalink structure for post type archive
     $post_type = Get_Post_Type_Object(Post_Type::$post_type_name);
     $archive_url_path = $post_type->rewrite['slug'];
     self::$rewrite_rules[LTrim(SPrintF('%s/filter:([^/]+)/?$', $archive_url_path), '/')] = SPrintF('index.php?post_type=%s&filter=$matches[1]', Post_Type::$post_type_name);
     self::$rewrite_rules[LTrim(SPrintF('%s/filter:([^/]+)/page/([0-9]{1,})/?$', $archive_url_path), '/')] = SPrintF('index.php?post_type=%s&filter=$matches[1]&paged=$matches[2]', Post_Type::$post_type_name);
     # Add filter permalink structure for taxonomy archives
     foreach (Get_Taxonomies(Null, 'objects') as $taxonomy) {
         $taxonomy_slug = $taxonomy->rewrite['slug'];
         if (!In_Array(Post_Type::$post_type_name, $taxonomy->object_type)) {
             continue;
         }
         self::$rewrite_rules[LTrim(SPrintF('%s/([^/]+)/filter:([^/]+)/?$', $taxonomy_slug), '/')] = SPrintF('index.php?%s=$matches[1]&filter=$matches[2]', $taxonomy->name);
         self::$rewrite_rules[LTrim(SPrintF('%s/([^/]+)/filter:([^/]+)/page/([0-9]{1,})/?$', $taxonomy_slug), '/')] = SPrintF('index.php?%s=$matches[1]&filter=$matches[2]&paged=$matches[3]', $taxonomy->name);
     }
 }
开发者ID:andyUA,项目名称:kabmin-new,代码行数:17,代码来源:class.permalinks.php

示例6: Get_Fancy_Images

 function Get_Fancy_Images($orderby = 'ID', $order = 'ASC', $limit = -1)
 {
     global $wpdb;
     # Check Parameters
     if (!$orderby) {
         $orderby = 'ID';
     }
     if (!In_Array($order, array('ASC', 'DESC', 'RAND'))) {
         $order = 'ASC';
     }
     $limit = IntVal($limit);
     # Build Statement
     $stmt = "\n      SELECT\n        attachment.*,\n        gallery.ID gallery_id\n      FROM\n        {$wpdb->posts} attachment,\n        {$wpdb->posts} gallery\n      WHERE  attachment.post_type = \"attachment\"\n      AND    attachment.post_mime_type LIKE \"image/%\"\n      AND    gallery.post_type = \"{$this->core->gallery_post_type->name}\"\n      AND    attachment.post_parent = gallery.ID\n      GROUP BY attachment.ID ";
     if ($order == 'RAND') {
         $stmt .= 'ORDER BY RAND() ';
     } else {
         $stmt .= 'ORDER BY attachment.' . $orderby . ' ' . $order . ' ';
     }
     if ($limit > 0) {
         $stmt .= 'LIMIT ' . $limit;
     }
     return $wpdb->Get_Results($stmt);
 }
开发者ID:marleexoxo,项目名称:FWC,代码行数:23,代码来源:widget.random-images.php

示例7: createPay

 function createPay($AppInfo, $PartnerInfo, $ServerInfo, $PassageInfo, $OrderInfo, $Pay)
 {
     $comment = json_decode($AppInfo['comment'], true);
     /* 密钥 */
     if (in_array($OrderInfo['SubPassageId'], array('1001', '1002', '1003', '1004', '1005', '1006', '1009', '1020', '1022', '1032', 'BOCB2C', 'PAB', 'GDB', 'POST', 'HXB', 'BEA', 'SHB', 'ECITIC', 'NBCB', 'NJB', 'GZRCC', 'CBHB', 'BJRCB', 'ZSB', 'SHRCB', 'YP', 'BILL', 'TENPAY', 'ALIPAY'))) {
         $channelid = 1;
         $Amount = trim(sprintf("%10.2F", $OrderInfo['Amount']));
     } else {
         $paytype = 1;
         $Amount = intval($OrderInfo['Amount']);
         if (in_array($OrderInfo['SubPassageId'], array('CMPAY', 'YDSZX'))) {
             $channelid = 2;
         } elseif (In_Array($OrderInfo['SubPassageId'], array('DXCT'))) {
             $channelid = 3;
         } elseif (In_Array($OrderInfo['SubPassageId'], array('UNION'))) {
             $channelid = 4;
         } elseif (In_Array($OrderInfo['SubPassageId'], array('JUNNET'))) {
             $channelid = 5;
         } elseif (In_Array($OrderInfo['SubPassageId'], array('TXTONG'))) {
             $Params['key'] = "game_id=5462&prod_uid=119868&prod_type=1&sign=00ab0a497a5122328fc049b850df61e7";
             $Params['validate'] = "";
             return $Params;
         } elseif (In_Array($OrderInfo['SubPassageId'], array('SDCARD'))) {
             $channelid = 7;
         } elseif (In_Array($OrderInfo['SubPassageId'], array('EFT'))) {
             $channelid = 8;
         } else {
             return False;
         }
     }
     $Fronturl = 'http://passport.limaogame.com/?c=ka91';
     $Bgurl = 'http://payment.limaogame.com/?ctl=callback/ka91';
     $Params['key'] = "orderid=" . $OrderInfo['OrderId'] . "&origin=" . $PassageInfo['StagePartnerId'] . "&chargemoney=" . $Amount . "&channelid=" . $channelid . "&paytype=" . $paytype . "&bankcode=" . $OrderInfo['SubPassageId'] . "&cardno=&cardpwd=&cardamount=&fronturl=" . $Fronturl . "&bgurl=" . $Bgurl . "&ext1=lm&ext2=limaogame";
     $Params['validate'] = "&version=2.0.1&validate=" . substr(md5($Params['key'] . $PassageInfo['StageSecureCode']), 8, 16);
     return $Params;
 }
开发者ID:eappl,项目名称:prototype,代码行数:36,代码来源:Ka91.php

示例8: __WalkThrougtTree

 function __WalkThrougtTree($path, $arSkipPaths, $level, &$arTs, $fileFunction)
 {
     $path = Str_Replace("\\", "/", $path);
     $path = Trim(Trim($path, "/\\"));
     if (StrLen($path) > 0) {
         $path = "/" . $path;
     }
     $le = false;
     if (StrLen($this->startPath) > 0) {
         if (StrLen($path) <= 0 || StrLen($this->startPath) >= StrLen($path) && SubStr($this->startPath, 0, StrLen($path)) == $path) {
             if (StrLen($path) > 0) {
                 $startPath = SubStr($this->startPath, StrLen($path) + 1);
             } else {
                 $startPath = $this->startPath;
             }
             $pos = StrPos($startPath, "/");
             $le = $pos === false ? false : true;
             if ($pos === false) {
                 $startPathPart = $startPath;
             } else {
                 $startPathPart = SubStr($startPath, 0, $pos);
             }
         }
     }
     $arFiles = array();
     if ($handle = @opendir($_SERVER["DOCUMENT_ROOT"] . $path)) {
         while (($file = readdir($handle)) !== false) {
             if ($file == "." || $file == "..") {
                 continue;
             }
             if (StrLen($startPathPart) > 0 && ($le && $startPathPart > $file || !$le && $startPathPart >= $file)) {
                 continue;
             }
             if (Count($arSkipPaths) > 0) {
                 $bSkip = False;
                 for ($i = 0; $i < count($arSkipPaths); $i++) {
                     if (strlen($path . "/" . $file) >= strlen($arSkipPaths[$i]) && substr($path . "/" . $file, 0, strlen($arSkipPaths[$i])) == $arSkipPaths[$i]) {
                         $bSkip = True;
                         break;
                     }
                 }
                 if ($bSkip) {
                     continue;
                 }
             }
             $arFiles[] = $file;
         }
         closedir($handle);
     }
     for ($i = 0; $i < Count($arFiles) - 1; $i++) {
         for ($j = $i + 1; $j < Count($arFiles); $j++) {
             if ($arFiles[$i] > $arFiles[$j]) {
                 $t = $arFiles[$i];
                 $arFiles[$i] = $arFiles[$j];
                 $arFiles[$j] = $t;
             }
         }
     }
     for ($i = 0; $i < Count($arFiles); $i++) {
         if (is_dir($_SERVER["DOCUMENT_ROOT"] . $path . "/" . $arFiles[$i])) {
             $res = $this->__WalkThrougtTree($path . "/" . $arFiles[$i], $arSkipPaths, $level + 1, $arTs, $fileFunction);
             if (!$res) {
                 return false;
             }
         } else {
             if (Count($this->arCollectedExtensions) > 0) {
                 $fileExt = StrToLower(GetFileExtension($arFiles[$i]));
                 if (!In_Array($fileExt, $this->arCollectedExtensions)) {
                     continue;
                 }
             }
             Call_User_Func(array(&$this, $fileFunction), $path . "/" . $arFiles[$i]);
             $arTs["StatNum"]++;
         }
         if ($arTs["MaxExecutionTime"] > 0 && getmicrotime() - START_EXEC_TIME > $arTs["MaxExecutionTime"]) {
             $arTs["StartPoint"] = $path . "/" . $arFiles[$i];
             return false;
         }
     }
     $arTs["StartPoint"] = "";
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:82,代码来源:security_file_verifier.php

示例9: DB_Update

         #-------------------------------------------------------------------------------
     }
     #-------------------------------------------------------------------------------
     $IsUpdate = DB_Update('DomainOrders', $UDomainOrder, array('ID' => $DomainOrder['ID']));
     if (Is_Error($IsUpdate)) {
         return ERROR | @Trigger_Error(500);
     }
     #-------------------------------------------------------------------------------
     return array('Status' => 'Ok');
     #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 case 'true':
     #-------------------------------------------------------------------------------
     if (isset($IsInternal)) {
         #-------------------------------------------------------------------------------
         if (In_Array($DomainOrder['StatusID'], array('Active', 'Suspended', 'ForTransfer', 'OnTransfer'))) {
             #-------------------------------------------------------------------------------
             # add admin message
             $Event = array('UserID' => 1, 'PriorityID' => 'Error', 'Text' => SPrintF('Домен %s.%s является свободным, невозможно обновить информацию WhoIs', $DomainOrder['DomainName'], $DomainOrder['SchemeName']), 'IsReaded' => $IsReaded);
             $Event = Comp_Load('Events/EventInsert', $Event);
             if (!$Event) {
                 return ERROR | @Trigger_Error(500);
             }
             #-------------------------------------------------------------------------------
             # update last whois update date
             $IsUpdate = DB_Update('DomainOrders', array('UpdateDate' => Time()), array('ID' => $DomainOrder['ID']));
             if (Is_Error($IsUpdate)) {
                 return ERROR | @Trigger_Error(500);
             }
             #-------------------------------------------------------------------------------
         }
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:DomainOrderWhoIsUpdate.comp.php

示例10: Tag

        #---------------------------------------------------------------------------
        $Option = new Tag('OPTION', array('value' => $OptionID), $Options[$OptionID]);
        #---------------------------------------------------------------------------
        if (!Is_Null($SelectedIDs)) {
            #-------------------------------------------------------------------------
            if (!Is_Array($SelectedIDs)) {
                $SelectedIDs = array($SelectedIDs);
            }
            #-------------------------------------------------------------------------
            if (In_Array($OptionID, $SelectedIDs)) {
                $Option->AddAttribs(array('selected' => 'true'));
            }
        }
        #---------------------------------------------------------------------------
        if (!Is_Null($DisabledIDs)) {
            #-------------------------------------------------------------------------
            if (!Is_Array($DisabledIDs)) {
                $DisabledIDs = array($DisabledIDs);
            }
            #-------------------------------------------------------------------------
            if (In_Array($OptionID, $DisabledIDs)) {
                $Option->AddAttribs(array('disabled' => 'true'));
            }
        }
    }
    #-----------------------------------------------------------------------------
    $Select->AddChild($Option);
}
#-------------------------------------------------------------------------------
return $Select;
#-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:Select.comp.php

示例11: foreach

foreach (Array_Reverse($HostsIDs) as $HostID) {
    #-------------------------------------------------------------------------------
    $Path = SPrintF('%s/hosts/%s/servers', SYSTEM_PATH, $HostID);
    #-------------------------------------------------------------------------------
    if (!Is_Dir($Path)) {
        continue;
    }
    #-------------------------------------------------------------------------------
    $Files = IO_Scan($Path);
    #-------------------------------------------------------------------------------
    if (Is_Error($Files)) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    foreach ($Files as $File) {
        if (!In_Array($File, $Array)) {
            $Array[] = $File;
        }
    }
    #-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
foreach ($Array as $Value) {
    #-------------------------------------------------------------------------------
    $Value = Str_Replace('.xml', '', $Value);
    #-------------------------------------------------------------------------------
    $Template = System_XML(SPrintF('servers/%s.xml', $Value));
    if (Is_Error($Template)) {
        return ERROR | @Trigger_Error(500);
    }
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:ServerEdit.comp.php

示例12: Current

         return ERROR | @Trigger_Error(500);
     case 'exception':
         return ERROR | @Trigger_Error(400);
     case 'array':
         break;
     default:
         return ERROR | @Trigger_Error(101);
 }
 #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 $Order = Current($Orders);
 #-------------------------------------------------------------------------------
 $UserID = $Order['UserID'];
 #-------------------------------------------------------------------------------
 # если сотрудник или исключение - ничего не делаем
 if (In_Array($UserID, $ExcludeIDs)) {
     continue;
 }
 #-------------------------------------------------------------------------------
 #-------------------------------------------------------------------------------
 $Array = array();
 #-------------------------------------------------------------------------------
 foreach ($Orders as $Order) {
     #-------------------------------------------------------------------------------
     if ($Order['StatusID'] == 'Suspended') {
         #-------------------------------------------------------------------------------
         Debug(SPrintF('[comp/Tasks/GC/ResetOrdersDays]: UserID = %s; OrderID = %s в статусе Suspended, все заказы пользователя пропускаются', $UserID, $Order['ID']));
         #-------------------------------------------------------------------------------
         $ExcludeIDs[] = $UserID;
         #-------------------------------------------------------------------------------
         continue 2;
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:ResetOrdersDays.comp.php

示例13: DeleteIDs

 /**
 * Удаляет идентификаторы тегов
 *
 * Функция необходима в случае, когда необходимо исключить id тега из списка всех аттрибутов данного тега.
 */
 public function DeleteIDs()
 {
     #-----------------------------------------------------------------------------
     $Names = Func_Get_Args();
     #-----------------------------------------------------------------------------
     $Links =& $this->Links;
     #-----------------------------------------------------------------------------
     foreach (Array_Keys($Links) as $LinkID) {
         #---------------------------------------------------------------------------
         $Attribs =& $Links[$LinkID]->Attribs;
         #---------------------------------------------------------------------------
         if (isset($Attribs['id'])) {
             #-------------------------------------------------------------------------
             if (Count($Names)) {
                 #-----------------------------------------------------------------------
                 if (In_Array($Attribs['id'], $Names)) {
                     unset($Attribs['id']);
                 }
             } else {
                 unset($Attribs['id']);
             }
         }
     }
 }
开发者ID:carriercomm,项目名称:jbs,代码行数:29,代码来源:DOM.php

示例14: Str_Replace

 $Text = Str_Replace("  ", " ", $Text);
 # delete carrier return
 $Text = Str_Replace("\r", "", $Text);
 # delete many \n
 $Text = Str_Replace("\n\n", "\n", $Text);
 # prepare for java script
 $Text = Str_Replace("\n", '\\n', $Text);
 # format: SortOrder:ImageName.gif
 # button image, get image name
 $Partition = Explode(":", $Article['Partition']);
 $Extension = isset($Partition[1]) ? Explode(".", StrToLower($Partition[1])) : '';
 #-------------------------------------------------------------------------------
 # если есть чё-то после точки, и если оно похоже на расширение картинки, ставим это как картинку
 $Image = 'Info.gif';
 #дефолтовую информационную картинку
 if (isset($Extension[1]) && In_Array($Extension[1], array('png', 'gif', 'jpg', 'jpeg'))) {
     $Image = $Partition[1];
 }
 #-------------------------------------------------------------------------------
 # делаем кнопку, если это системная кнопка или этого админа
 if (!Preg_Match('/@/', $Partition[0]) && $Partition[0] < 2000 && $__USER['Params']['Settings']['EdeskButtons'] == "No" || StrToLower($Partition[0]) == StrToLower($__USER['Email'])) {
     #-------------------------------------------------------------------------------
     $Comp = Comp_Load('Buttons/Standard', array('onclick' => SPrintF("form.Message.value += '%s';form.Message.focus();", $Text), 'style' => 'cursor: pointer;'), $Article['Title'], $Image);
     if (Is_Error($Comp)) {
         return ERROR | @Trigger_Error(500);
     }
     #-------------------------------------------------------------------------------
     $Tr->AddChild(new Tag('TD', $Comp));
     #-------------------------------------------------------------------------------
 }
 #-------------------------------------------------------------------------------
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:TicketRead.comp.php

示例15: DB_Select

$DomainOrders = DB_Select('DomainOrdersOwners', $Columns, array('Where' => $Where));
switch (ValueOf($DomainOrders)) {
    case 'error':
        return ERROR | @Trigger_Error(500);
    case 'exception':
        return TRUE;
    case 'array':
        break;
    default:
        return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
foreach ($DomainOrders as $DomainOrder) {
    #-------------------------------------------------------------------------------
    if (!($DomainOrder['StatusID'] == 'ForTransfer' || $DomainOrder['StatusID'] == 'OnTransfer' && In_Array($DomainOrder['Name'], array('ru', 'su', 'рф')))) {
        #-------------------------------------------------------------------------------
        Debug(SPrintF("[Tasks/GC/DeleteDomainForTransfer]: Домен не попал в условие: '%s.%s', статус: '%s'", $DomainOrder['DomainName'], $DomainOrder['Name'], $DomainOrder['StatusID']));
        #-------------------------------------------------------------------------------
    }
    #-------------------------------------------------------------------------------
    #-------------------------------------------------------------------------------
    Debug(SPrintF("[Tasks/GC/DeleteDomainForTransfer]: Удаление домена '%s.%s', статус '%s'", $DomainOrder['DomainName'], $DomainOrder['Name'], $DomainOrder['StatusID']));
    #----------------------------------TRANSACTION----------------------------------
    if (Is_Error(DB_Transaction($TransactionID = UniqID('comp/Tasks/GC/DeleteDomainForTransfer')))) {
        return ERROR | @Trigger_Error(500);
    }
    #-------------------------------------------------------------------------------
    $Comp = Comp_Load('www/API/StatusSet', array('ModeID' => 'DomainOrders', 'StatusID' => 'Deleted', 'RowsIDs' => $DomainOrder['ID'], 'Comment' => SPrintF('Заказ домена не был перенесён к регистратору %s, более 180 дней', $DomainOrder['Params']['Name'])));
    #-------------------------------------------------------------------------------
    switch (ValueOf($Comp)) {
开发者ID:carriercomm,项目名称:jbs,代码行数:31,代码来源:DeleteDomainForTransfer.comp.php


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