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


PHP in_Array函数代码示例

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


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

示例1: rechts

function rechts($LinksRechts, $RechtsLinks)
{
    global $RechtesArray;
    global $LinkesArray;
    global $AlleRechte;
    global $GewRechte;
    echo "<select name='GewRechte' size='10'>";
    if ($LinksRechts) {
        if ($AlleRechte != NULL) {
            //Prüft ob der Wert schon im rechten Array steht
            if (in_Array($AlleRechte, $RechtesArray) == FALSE) {
                //Weisst dem rechten Array den Selektierten Wert zu
                $RechtesArray[] = $AlleRechte;
            }
        }
        $Anzahl = count($RechtesArray);
        for ($i = 0; $i < $Anzahl; $i++) {
            echo "<option>{$RechtesArray[$i]}</option>";
        }
        echo "</select>";
    }
    if ($RechtsLinks) {
        if ($GewRechte != NULL) {
            //Sucht nach dem gewählten Wert im rechten Array und löscht diesen aus dem Array
            $key = array_search($GewRechte, $RechtesArray);
            array_splice($RechtesArray, $key, 1);
        }
        $Anzahl = count($RechtesArray);
        for ($i = 0; $i < $Anzahl; $i++) {
            echo "<option>{$RechtesArray[$i]}</option>";
        }
        echo "</select>";
    }
}
开发者ID:BackupTheBerlios,项目名称:sage,代码行数:34,代码来源:zwei_listen.inc.php

示例2: start_page

 public function start_page($action)
 {
     global $theme;
     global $page;
     global $role;
     $master_actions = array('login', 'register', 'logout', 'hacker');
     $admin_actions = array('admin', 'reset', 'ban', 'events', 'add_res', "kody_vip", "massmsg");
     $user_actions = array('town', 'build', 'messages', 'clan', 'map', 'army', 'profile', 'spy', 'hero', 'colectors', 'thiefs', 'assasins', 'rank', 'help', 'settings', 'vip');
     if (empty($action)) {
         $action = 'default';
     }
     $role = -1;
     if (in_Array($action, $master_actions)) {
         $theme = 'templates/master/master.php';
         $page = 'templates/master/' . $action . '.php';
     } elseif (in_Array($action, $user_actions)) {
         $theme = 'templates/master_user/master.php';
         $page = 'templates/master_user/' . $action . '.php';
         $role = 1;
     } elseif (in_Array($action, $admin_actions)) {
         $theme = 'templates/master_admin/master.php';
         $page = 'templates/master_admin/' . $action . '.php';
         $role = 2;
     } else {
         $theme = 'templates/master/master.php';
         $page = 'templates/master/hello.php';
     }
 }
开发者ID:WlasnaGra,项目名称:Utopia,代码行数:28,代码来源:core.php

示例3: addUnit

 public function addUnit(Unit $unit)
 {
     //將一戰鬥單位加入到軍隊群組中
     if (in_Array($unit, $this->units, true)) {
         return;
     }
     $this->units[] = $unit;
 }
开发者ID:chzhonge,项目名称:DesignPatternPHP,代码行数:8,代码来源:iterator.php

示例4: Add

 function Add($files,$compact)
 {
  if(!is_array($files[0])) $files=Array($files);

  for($i=0;$files[$i];$i++){
    $fn = $files[$i];
    if(!in_Array(dirname($fn[0]),$this->dirs))
     $this->add_Dir(dirname($fn[0]));
    if(basename($fn[0]))
     $ret[basename($fn[0])]=$this->add_File($fn[1],$fn[0],$compact);
  }
  return $ret;
 }
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:13,代码来源:zip.lib.php

示例5: javo_dashboard_template

 static function javo_dashboard_template($template)
 {
     global $wp_query;
     if (get_query_var('pn') == 'member') {
         $javo_this_get_user = get_user_by('login', str_replace("%20", " ", get_query_var('user')));
         if (!empty($javo_this_get_user)) {
             add_filter('body_class', array(__CLASS__, 'javo_dashboard_bodyclass_callback'));
             if (in_Array(get_query_var('sub_page'), self::$pages)) {
                 add_action('wp_enqueue_scripts', array(__CLASS__, 'wp_media_enqueue_callback'));
                 add_filter('wp_title', array(__CLASS__, 'javo_dashbarod_set_title_callback'));
                 return JAVO_DSB_DIR . '/mypage-' . get_query_var('sub_page') . '.php';
             } else {
                 add_filter('wp_title', array(__CLASS__, 'javo_dashbarod_set_title_callback'));
                 return JAVO_DSB_DIR . '/mypage-member.php';
             }
         } else {
             return JAVO_DSB_DIR . '/mypage-no-user.php';
         }
     }
     return $template;
 }
开发者ID:redcypress,项目名称:lacecake,代码行数:21,代码来源:functions.php

示例6: dump

 /**
  * Pretty wrapper to print_r()
  *
  * @version     1.0
  * @since       1.0.0
  * @author      xLink
  *
  * @param       variable        $var
  * @param       string          $info
  *
  * @return      string
  */
 public static function dump($var, $info = false, $color = '#0E5B72')
 {
     if (!in_Array(app()->environment(), array('dev', 'local'))) {
         return;
     }
     // actually do the debug & grab it in some output buffering
     ob_start();
     (new Dumper())->dump($var);
     $debugVar = ob_get_clean();
     // if we happen to be running in the console
     if (app()->runningInConsole()) {
         // return the debug without any extras
         return $debugVar;
     }
     // otherwise
     // get where this is being called from
     $debug = debug_backtrace();
     $call_info = array_shift($debug);
     $code_line = $call_info['line'];
     $filePath = $call_info['file'];
     // get the current document root :)
     $docRoot = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : null;
     $docRoot = explode('/', $docRoot);
     $docRoot = array_filter($docRoot);
     array_pop($docRoot);
     $docRoot = implode('/', $docRoot);
     $filePath = str_replace('\\', '/', $filePath);
     $filePath = str_replace(array($docRoot, '/~'), '~', $filePath);
     $return = '';
     // setup a little prettyness
     $id = substr(md5(microtime()), 0, 6);
     $return .= sprintf('<div class="debug-dump" style="overflow: auto; margin: 0 0 10px 0; background: white; color: black; font-family: Verdana; border: 1px solid #cccccc; padding: 5px; font-size: 10px; line-height: 12px; display: block; max-width: 1000px;text-align: left;"><div><div class="header" style="background-color: ' . $color . '; color: white; padding: 3px 5px; font-size: 12px; margin: 0 0 5px;"></div>DEBUG! (<strong>%s : %s</strong>)', $filePath, $code_line);
     if ($info != false) {
         $return .= ' | <strong style="color: red;">' . $info . ':</strong>';
     }
     $return .= '</div>';
     $return .= $debugVar . '</div>';
     // BOOM! :D
     return $return;
 }
开发者ID:xLink,项目名称:Portfolio,代码行数:52,代码来源:Debug.php

示例7: javo_dashboard_template

 static function javo_dashboard_template($template)
 {
     global $wp_query, $javo_tso_db;
     if (get_query_var('pn') == 'member') {
         $javo_this_get_user = get_user_by('login', str_replace("%20", " ", get_query_var('user')));
         if (!empty($javo_this_get_user)) {
             add_filter('body_class', array(__CLASS__, 'javo_dashboard_bodyclass_callback'));
             if (in_Array(get_query_var('sub_page'), self::$pages)) {
                 if ($javo_tso_db->get(get_query_var('sub_page'), '') == 'disabled') {
                     return locate_template('content-block.php');
                 }
                 add_action('wp_enqueue_scripts', array(__CLASS__, 'wp_media_enqueue_callback'));
                 add_filter('wp_title', array(__CLASS__, 'javo_dashbarod_set_title_callback'), 99);
                 return apply_filters('javo_dashboard_custom_template_url', JAVO_DSB_DIR . '/mypage-' . get_query_var('sub_page') . '.php', get_query_var('sub_page'));
             } else {
                 add_filter('wp_title', array(__CLASS__, 'javo_dashbarod_set_title_callback'));
                 return JAVO_DSB_DIR . '/mypage-member.php';
             }
         } else {
             return JAVO_DSB_DIR . '/mypage-no-user.php';
         }
     }
     return $template;
 }
开发者ID:ksingh812,项目名称:epb,代码行数:24,代码来源:functions.php

示例8: clipNumPane

 /**
  * Returns TRUE if a numeric clipboard pad is selected/active
  *
  * @return boolean
  * @todo Define visibility
  */
 public function clipNumPane()
 {
     return in_Array('_CLIPBOARD_', $this->fieldArray) && $this->clipObj->current != 'normal';
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:10,代码来源:DatabaseRecordList.php

示例9: setSlot

 /**
  * Method to configure a slot on Dynamips nodes
  *
  * @param   int     $i                  slot_id
  * @param   string  $s                  slot type
  * @return  int                         0 means ok
  */
 public function setSlot($i, $s)
 {
     if ($this->type != 'dynamips') {
         error_log(date('M d H:i:s ') . 'ERROR: ' . $GLOBALS['messages'][40023]);
         return 40023;
     }
     // Storing old configuration
     if (isset($this->ethernets)) {
         $old_ethernets = $this->ethernets;
     } else {
         $old_ethernets = array();
     }
     switch ($this->getTemplate()) {
         default:
             // Should not be here
             error_log(date('M d H:i:s ') . 'ERROR: ' . $GLOBALS['messages'][40019]);
             return 40019;
         case 'c3725':
             // c3725 has two slots
             if (in_Array($i, array(1, 2))) {
                 switch ($s) {
                     default:
                         // Unsupported module
                         error_log(date('M d H:i:s ') . 'ERROR: ' . $GLOBALS['messages'][40024]);
                         return 40024;
                     case 'NM-1FE-TX':
                         $this->slots[$i] = $s;
                         if (isset($old_ethernets[16 * $i])) {
                             // Previous interface found, copy from old one
                             $this->ethernets[16 * $i] = $old_ethernets[16 * $i];
                         } else {
                             // New interface
                             try {
                                 $this->ethernets[16 * $i] = new Interfc(array('name' => 'fa' . $i . '/0', 'type' => 'ethernet'), 16 * $i);
                             } catch (Exception $e) {
                                 error_log(date('M d H:i:s ') . 'ERROR: ' . $GLOBALS['messages'][40020]);
                                 error_log(date('M d H:i:s ') . (string) $e);
                                 return 40020;
                             }
                         }
                         // Setting CMD flags (module and tap interface map)
                         $this->flags_eth .= ' -p ' . $i . ':' . $s;
                         $this->flags_eth .= ' -s ' . $i . ':0:tap:vunl' . $this->tenant . '_' . $this->id . '_' . 16 * $i;
                         break;
                     case 'NM-16ESW':
                         $this->slots[$i] = $s;
                         $this->flags_eth .= ' -p ' . $i . ':' . $s;
                         // Setting CMD flags (module)
                         for ($p = 0; $p <= 15; $p++) {
                             if (isset($old_ethernets[16 * $i + $p])) {
                                 // Previous interface found, copy from old one
                                 $this->ethernets[16 * $i + $p] = $old_ethernets[16 * $i + $p];
                             } else {
                                 // New interface
                                 try {
                                     $this->ethernets[16 * $i + $p] = new Interfc(array('name' => 'fa' . $i . '/' . $p, 'type' => 'ethernet'), 16 * $i + $p);
                                 } catch (Exception $e) {
                                     error_log(date('M d H:i:s ') . 'ERROR: ' . $GLOBALS['messages'][40020]);
                                     error_log(date('M d H:i:s ') . (string) $e);
                                     return 40020;
                                 }
                             }
                             // Setting CMD flags (tap interface map)
                             $this->flags_eth .= ' -s ' . $i . ':' . $p . ':tap:vunl' . $this->tenant . '_' . $this->id . '_' . (16 * $i + $p);
                         }
                         break;
                     case '':
                         // Empty module
                         break;
                 }
             }
             break;
         case 'c7200':
             // c7200 has six slots
             if (in_Array($i, array(1, 2, 3, 4, 5, 6))) {
                 switch ($s) {
                     default:
                         error_log(date('M d H:i:s ') . 'ERROR: ' . $GLOBALS['messages'][40024]);
                         return 40024;
                     case 'PA-FE-TX':
                         $this->slots[$i] = $s;
                         if (isset($old_ethernets[16 * $i])) {
                             // Previous interface found, copy from old one
                             $this->ethernets[16 * $i] = $old_ethernets[16 * $i];
                         } else {
                             // New interface
                             try {
                                 $this->ethernets[16 * $i] = new Interfc(array('name' => 'fa' . $i . '/0', 'type' => 'ethernet'), 16 * $i);
                             } catch (Exception $e) {
                                 error_log(date('M d H:i:s ') . 'ERROR: ' . $GLOBALS['messages'][40020]);
                                 error_log(date('M d H:i:s ') . (string) $e);
                                 return 40020;
                             }
//.........这里部分代码省略.........
开发者ID:RobertoRiosMX,项目名称:unetlab,代码行数:101,代码来源:__node.php

示例10: hit_dis

function hit_dis($attack, $defend, $type, $blocked, $hit, $hand, $blok, $blokzone, $bat)
{
    $at_priem = array();
    $def_priem = array();
    $battle_id = $bat;
    $date = date("H:i");
    global $P_HDATA;
    ################ Doyuwculer ################################
    if ($type[0] == 0) {
        //если не бот
        $ATTACK_QUERY = mysql_query("SELECT users.*,zver.id as zver_count,zver.level as zver_level,zver.type as zver_type FROM users LEFT JOIN zver on zver.owner=users.id and zver.sleep=0 WHERE login='" . $attack . "'");
        $ATTACK_DATA = mysql_fetch_array($ATTACK_QUERY);
        mysql_free_result($ATTACK_QUERY);
        $a_pr = mysql_query("SELECT pr_name FROM person_on WHERE id_person=" . $ATTACK_DATA["id"] . " and battle_id={$bat} and pr_active=2 and pr_cur_uses>0");
        while ($attack_priem = mysql_fetch_array($a_pr)) {
            $at_priem[] = $attack_priem["pr_name"];
        }
    } else {
        if ($type[0] == 1) {
            //если бот
            $ATT_SQL = mysql_query("SELECT * FROM bot_temp WHERE battle_id={$bat} and  bot_name='" . $attack . "'");
            $ATT_DATA = mysql_fetch_array($ATT_SQL);
            mysql_free_result($ATT_SQL);
            if (!$ATT_DATA["zver"]) {
                $ATTACK_QUERY = mysql_query("SELECT * FROM users WHERE login='" . $ATT_DATA["prototype"] . "'");
                #bot from users
            } else {
                $ATTACK_QUERY = mysql_query("SELECT * FROM zver WHERE id='" . $ATT_DATA["prototype"] . "'");
                #is_Zver
            }
            $ATTACK_DATA = mysql_fetch_array($ATTACK_QUERY);
            mysql_free_result($ATTACK_QUERY);
        }
    }
    if ($type[1] == 0) {
        //если не бот
        $DEFEND_QUERY = mysql_query("SELECT users.*,zver.id as zver_count,zver.level as zver_level,zver.type as zver_type FROM users LEFT JOIN zver on zver.owner=users.id and zver.sleep=0 WHERE login='" . $defend . "'");
        $DEFEND_DATA = mysql_fetch_array($DEFEND_QUERY);
        mysql_free_result($DEFEND_QUERY);
        $d_pr = mysql_query("SELECT pr_name FROM person_on WHERE id_person=" . $DEFEND_DATA["id"] . " and battle_id={$bat} and pr_active=2 and pr_cur_uses>0");
        while ($defend_priem = mysql_fetch_array($d_pr)) {
            $def_priem[] = $defend_priem["pr_name"];
        }
    } else {
        if ($type[1] == 1) {
            //если бот
            $DEF_SQL = mysql_query("SELECT * FROM bot_temp WHERE battle_id={$bat} and  bot_name='" . $defend . "'");
            $DEF_DATA = mysql_fetch_array($DEF_SQL);
            mysql_free_result($DEF_SQL);
            if (!$DEF_DATA["zver"]) {
                $DEFEND_QUERY = mysql_query("SELECT * FROM users WHERE login='" . $DEF_DATA["prototype"] . "'");
            } else {
                $DEFEND_QUERY = mysql_query("SELECT * FROM zver WHERE id='" . $DEF_DATA["prototype"] . "'");
            }
            $DEFEND_DATA = mysql_fetch_array($DEFEND_QUERY);
            mysql_free_result($DEFEND_QUERY);
        }
    }
    ################################################################################################
    if ($type[0] == 0) {
        if ($ATTACK_DATA["battle_team"] == 1) {
            $span1 = "p1";
            $span2 = "p2";
        } else {
            $span1 = "p2";
            $span2 = "p1";
        }
    } else {
        if ($type[0] == 1) {
            if ($ATT_DATA["team"] == 1) {
                $span1 = "p1";
                $span2 = "p2";
            } else {
                $span1 = "p2";
                $span2 = "p1";
            }
        }
    }
    ################################################################################################
    $attack_priem_count = array_count_values($at_priem);
    $defent_priem_count = array_count_values($def_priem);
    /*if (in_Array("resolvetactic",$def_priem))
    	{
    		$phrase.= "<span class=date>$date</span> <span class=$span1>".$defend."</span> понял что его спасение это прием <b>Разгадать тактику</b>.<br>";
    		mysql_query("UPDATE person_on SET pr_active=1,pr_cur_uses=1 WHERE id_person='".$ATTACK_DATA["id"]."' and battle_id=".$bat." and pr_active=2");
    		mysql_query("UPDATE person_on SET pr_active=1 WHERE id_person='".$DEFEND_DATA["id"]."' and battle_id=".$bat." and pr_name='resolvetactic'");
    		unset($at_priem);
    	}*/
    if (in_Array("resolvetactic", $at_priem)) {
        $phrase .= "<span class=date>{$date}</span> <span class={$span1}>" . $attack . "</span> понял что его спасение это прием <b>Разгадать тактику</b>.<br>";
        mysql_query("UPDATE person_on SET pr_active=1,pr_cur_uses=1 WHERE id_person='" . $DEFEND_DATA["id"] . "' and battle_id=" . $bat . " and pr_active=2");
        mysql_query("UPDATE person_on SET pr_active=1 WHERE id_person='" . $ATTACK_DATA["id"] . "' and battle_id=" . $bat . " and pr_name='resolvetactic'");
        unset($def_priem);
    }
    include "calc_g.php";
    include "hit_dis.php";
    ################################################################################################
    if ($ATTACK_DATA["sex"] == "male") {
        $pref = "";
    } else {
//.........这里部分代码省略.........
开发者ID:ehmedov,项目名称:www,代码行数:101,代码来源:functions.php

示例11: CompanyGroupFilter

}
if ($ModuleName == 'SubGroup') {
    echo "<tr><td height='40' style='text-align:right'>" . "<div  style='padding-right:35px; padding-bottom:15px;'>";
    echo '<b>Organization : </b>';
    $ddlist = new CompanyGroupFilter($_SESSION["sess_iAdminId"], $_SESSION['sess_eType']);
    echo $ddlist->getCompaniesList($_SESSION['sess_iCompanyId'], $_REQUEST[$ddlist::companyValueFilterName]);
    echo "</div>" . "</td></tr>";
    //                . "<tr><td height='40' style='text-align:right'>" . "<div  style='padding-right:35px; padding-bottom:15px;'>";
    //        echo '<b>Group : </b>';
    //        echo $ddlist->getGroupsList($_REQUEST[$ddlist::companyValueFilterName], $_REQUEST[$ddlist::groupValueFilterName]);
    //        echo "</div>";
    //        echo "</td></tr>";
    echo $ddlist->getJScripts();
}
$module_array = array('Directory', 'Events', 'Courses', 'AudioCategory', 'VideoCategory', 'Library', 'Classes');
if (in_Array($ModuleName, $module_array)) {
    echo "<tr><td height='40' style='text-align:right'>" . "<div  style='padding-right:35px; padding-bottom:15px;'>";
    echo '<b>Organization : </b>';
    $ddlist = new CompanyGroupFilterForContent($_SESSION["sess_iAdminId"], $_SESSION['sess_eType']);
    echo $ddlist->getCompaniesList($_SESSION['iCompanyId'], $_REQUEST['iCompanyId'], 'Default Group');
    echo "</div>" . "</td></tr>" . "<tr><td height='40' style='text-align:right'>" . "<div  style='padding-right:35px; padding-bottom:15px;'>";
    echo '<b>Group : </b>';
    echo $ddlist->getGroupsList($_REQUEST['iCompanyId'], $_REQUEST['iSGroupId'], 'Default Group');
    echo "</div>";
    echo "</td></tr>";
    echo $ddlist->getJScripts();
    echo "<script type='text/javascript'>\n\t\t\t\$(function(){\n\t\t\tvar test_iCompanyId = \$.getQuery('iCompanyId');\n\t\t\tif(!test_iCompanyId){\n\t\t\t// debugger;\n\t\t\tchangeGroupList() ;}\n\t\t\t//\n\t\t\t//var test_iSGroupId = \$.getQuery('iSGroupId');\n\t\t\t//if( !test_iSGroupId){\n\t\t\t//debugger;\n\t\t\t//        changeGroupList();}\n\t\t\t//\n    });\n\n\t\t\t</script>";
}
if (isset($RelatedArr['TabHeader'])) {
    $class = "class='tab_border'";
    list($TabHeader, $TabId) = explode("||", $RelatedArr['TabHeader']);
开发者ID:redeyes1024,项目名称:medlii_mlm_backend,代码行数:31,代码来源:user_generallist.inc.php

示例12: display_social_login

    function display_social_login()
    {
        if (!$this->settings['facebook']) {
            return;
        }
        ?>
		<div id="fb-root" class="bp_social_connect_fb"></div>
		<script type="text/javascript">
		window.fbAsyncInit = function() {
			FB.init({
				appId      : "<?php 
        echo $this->settings['facebook_app_id'];
        ?>
", // replace your app id here
				status     : true, 
				cookie     : true, 
				xfbml      : true,
				version    : 'v2.0'  
			});
			FB.Event.subscribe('auth.authResponseChange', function(response){
				
				if (response.status === 'connected'){
					 console.log('success');
				}else if (response.status === 'not_authorized'){
					console.log('failed');
				} else{
					console.log('unknown error');
				}
			});
		};
		(function(d){
			var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
			if (d.getElementById(id)) {return;}
			js = d.createElement('script'); js.id = id; js.async = true;
			js.src = "//connect.facebook.net/en_US/all.js";
			ref.parentNode.insertBefore(js, ref);
		}(document));
		<?php 
        if (isset($this->settings['facebook_map_fields']) && is_array($this->settings['facebook_map_fields'])) {
            if (count($this->settings['facebook_map_fields']['field'])) {
                $fields = array('email', 'link', 'first_name', 'name');
                foreach ($this->settings['facebook_map_fields']['field'] as $field) {
                    if (!in_Array($field, $fields)) {
                        $fields[] = $field;
                    }
                }
                $fb_keys = '?fields=' . implode(',', $fields);
            } else {
                $fb_keys = '?fields=email,link,first_name,name';
            }
        }
        ?>
		jQuery(document).ready(function($){
			$('.bp_social_connect_facebook').on('click',function(){

				var $this = $(this);
				$this.addClass('loading');
				var security = $('#<?php 
        echo $this->security_key;
        ?>
').val();
				

				FB.login(function(response){
					if (response.authResponse){

						FB.api('/me<?php 
        echo $fb_keys;
        ?>
', function(response) {
							console.log(response);
							$.ajax({
								url: ajaxurl,
								data: 'action=bp_social_connect_facebook_login&id='+response.id+'&email='+response.email+'&first_name='+response.first_name+'&last_name='+response.last_name+'&gender='+response.gender+'&name='+response.name+'&link='+response.link+'&locale='+response.locale+'&security='+security,
								type: 'POST',
								dataType: 'JSON',
								success:function(data){
									$this.removeClass('loading');
									if (data.message){
										form.parents('.bp_social_connect_facebook').before( data.message );
									}
									if (data.redirect_uri){
										if (data.redirect_uri =='refresh') {
											document.location.href=jQuery(location).attr('href');
										} else {
											document.location.href=data.redirect_uri;
										}
									}else{
										document.location.href=jQuery(location).attr('href');
									}
								},
								error: function(xhr, ajaxOptions, thrownError) {
									$this.removeClass('loading');
									window.location.href = "<?php 
        echo home_url();
        ?>
";
								}
							});
						
//.........这里部分代码省略.........
开发者ID:nikitansk,项目名称:devschool,代码行数:101,代码来源:class.facebook.php

示例13: javo_all_new_post_registered_callback

 static function javo_all_new_post_registered_callback($post_id)
 {
     global $javo_tso;
     $javo_block_post_types = array();
     if ($javo_tso->get('direct_event', '') == 'no') {
         $javo_block_post_types[] = 'jv_events';
     }
     if ($javo_tso->get('direct_review', '') == 'no') {
         $javo_block_post_types[] = 'review';
     }
     if ($javo_tso->get('direct_rating', '') == 'no') {
         $javo_block_post_types[] = 'ratings';
     }
     if (current_user_can('administrator')) {
         return;
     }
     if (in_Array(get_post_type($post_id), $javo_block_post_types)) {
         remove_action('save_post', array(__CLASS__, 'javo_all_new_post_registered_callback'));
         $post_id = wp_update_post(array('ID' => $post_id, 'post_status' => 'pending'));
         add_action('save_post', array(__CLASS__, 'javo_all_new_post_registered_callback'));
     }
 }
开发者ID:redcypress,项目名称:lacecake,代码行数:22,代码来源:define.php

示例14: history

                if ($r["art"]) {
                    $db["platina"] = $db["platina"] - $price;
                } else {
                    $db["money"] = $db["money"] - $price;
                }
            }
            $msg = "Вы удачно купили  <b>&laquo;" . $r["name"] . "&raquo;</b> за <b>" . $price . " {$m_txt}</b>";
            history($login, 'Купил', $msg, $db["remote_ip"], 'Магазин Башни');
        }
    }
}
//***************************************************************************
if ($_GET["buy"]) {
    $_POST['shop'] = true;
    $item_id = (int) $_GET["buy"];
    if (!in_Array($item_id, $item_Array)) {
        $msg = "Вещь не найдена в магазине.";
    } else {
        $buy_item = mysql_fetch_array(mysql_query("SELECT * FROM paltar WHERE id='" . $item_id . "'"));
        if ($_GET["type"] == "art") {
            $my_money = $db["platina"];
            $money_type = 'Пл.';
        } else {
            $my_money = $db["naqrada"];
            $buy_item["price"] = $buy_item["price"] * 100;
            $money_type = 'Ед.';
            $buy_item["podzemka"] = 1;
        }
        if (!$buy_item) {
            $msg = "Вещь не найдена в магазине.";
        } else {
开发者ID:ehmedov,项目名称:www,代码行数:31,代码来源:castle_hall.php

示例15: rand

if ($rej > 0 && !$have_hit_type) {
    $gggj = rand(1, 100);
    if ($gggj < $rej) {
        $udar_rej = ($attack_sila * 0.2 + $attack_udacha * 0.4) * (1 + $ATTACK_DATA["ms_rej"] / 100);
        $txt_hit_type .= "[Режущий урон]";
        $have_hit_type = 1;
    }
}
$hit_k = $hit_k + $udar_kal + $udar_rub + $udar_drob + $udar_rej;
$hit_k = $hit_k * (1 + $ms_uron / 100);
if ($is_art == 1) {
    $hit_k = $hit_k * 1.2;
}
#if($is_art==2)$hit_k=$hit_k*1.3;
############################################################
$attack_krit = $attack_krit + (in_Array("jajda", $at_priem) ? 50 : 0);
if ($attack_priem_count["supreme"] == 1) {
    $attack_antikrit = $attack_antikrit + $attack_antikrit * 0.05;
    $attack_antiuvorot = $attack_antiuvorot + $attack_antiuvorot * 0.05;
} else {
    if ($attack_priem_count["supreme"] == 2) {
        $attack_antikrit = $attack_antikrit + $attack_antikrit * 0.1;
        $attack_antiuvorot = $attack_antiuvorot + $attack_antiuvorot * 0.1;
    } else {
        if ($attack_priem_count["supreme"] >= 3) {
            $attack_antikrit = $attack_antikrit + $attack_antikrit * 0.15;
            $attack_antiuvorot = $attack_antiuvorot + $attack_antiuvorot * 0.15;
        }
    }
}
/*===================определение характеристик защишаюшегося===============*/
开发者ID:ehmedov,项目名称:www,代码行数:31,代码来源:calc_g.php


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