• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP in_Array函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: array

    $item_id = (int) $_GET["buy"];
    if (!count($item_array[$item_id])) {
        $msg = "Вещь не найдена в магазине.";
    } else {
        $a = array();
        foreach ($item_array[$item_id] as $currentValue) {
            $sql_query = "SELECT wood.img,(SELECT count(*) FROM inv WHERE inv.object_type='wood' and inv.owner='" . $login . "' and inv.object_id=wood.id) as counts FROM wood WHERE  wood.id=" . $currentValue["item"];
            $query = mysql_fetch_Array(mysql_query($sql_query));
            if ($query["counts"] < $currentValue["count"]) {
                $err_msg .= "<img src='img/" . $query["img"] . "'> - " . ($currentValue["count"] - $query["counts"]) . " штук";
                $a[] = 0;
            } else {
                $a[] = 1;
            }
        }
        if (!in_Array(0, $a)) {
            foreach ($item_array[$item_id] as $currentValue) {
                mysql_query("DELETE FROM inv WHERE inv.object_type='wood' and inv.owner='" . $login . "' and inv.object_id=" . $currentValue["item"] . " LIMIT " . $currentValue["count"]);
            }
            $buy_item = mysql_fetch_array(mysql_query("SELECT * FROM paltar WHERE id='" . $item_id . "'"));
            if ($buy_item["object"] == "spear") {
                $del_time = time() + 30 * 24 * 3600;
            }
            mysql_query("LOCK TABLES inv WRITE");
            mysql_query("INSERT INTO `inv` (`id`, `owner`, `img`, `object_id`, `object_type`, `object_razdel`, `term`, `name`,  `mass`, `price`, `gos_price`, `min_sila`, `min_lovkost`, `min_udacha`, `min_power`, `min_intellekt`, `min_vospriyatie`, `min_level`, `min_sword_vl`, `min_staff_vl`, `min_axe_vl`, `min_fail_vl`, `min_knife_vl`, `min_spear_vl`,`min_fire`,`min_water`,`min_air`,`min_earth`,`min_svet`,`min_tma`,`min_gray`,`add_fire`, `add_water`, `add_air`, `add_earth`, `add_svet`, `add_tma`, `add_gray`, `add_sila`, `add_lovkost`, `add_udacha`, `add_intellekt`, `add_duxovnost`, `add_hp`, `add_mana`, `protect_head`, `protect_arm`, `protect_corp`, `protect_poyas`, `protect_legs`, `protect_rej`, `protect_drob`, `protect_kol`, `protect_rub`, `protect_fire`, `protect_water`, `protect_air`, `protect_earth`, `protect_svet`, `protect_tma`, `protect_gray`,`protect_mag`,`protect_udar`, `shieldblock`, `krit`, `akrit`, `uvorot`, `auvorot`, `parry`, `counter`, `add_rej`, `add_drob`, `add_kol`, `add_rub`, `ms_udar`, `ms_krit`, `ms_mag`, `ms_fire`, `ms_water`, `ms_air`, `ms_earth`, `ms_svet`, `ms_tma`, `ms_gray`, `ms_rej`, `ms_drob`, `ms_kol`, `ms_rub`, `iznos_max`, `min_attack`, `max_attack`, `proboy`, `add_oruj`, `add_sword_vl`, `add_staff_vl`, `add_axe_vl`, `add_fail_vl`, `add_knife_vl`, `add_spear_vl`, `need_orden`, `sex`, `art`, `podzemka`, `is_personal`, `personal_owner`, `noremont`, `two_hand`, `second_hand`,  `add_fire_att`, `add_air_att`, `add_watet_att`, `add_earth_att`, `edited`) \n\t\t\t\tVALUES (NULL, '" . $login . "','" . $buy_item["img"] . "' ,'" . $buy_item["id"] . "', '" . $buy_item["object"] . "', 'obj', '" . $del_time . "', '" . $buy_item["name"] . "', '" . $buy_item["mass"] . "', '" . $buy_item["price"] . "', '" . $buy_item["price"] . "', '" . $buy_item["min_sila"] . "', '" . $buy_item["min_lovkost"] . "', '" . $buy_item["min_udacha"] . "', '" . $buy_item["min_power"] . "', '" . $buy_item["min_intellekt"] . "', '" . $buy_item["min_vospriyatie"] . "', '" . $buy_item["min_level"] . "', '" . $buy_item["min_sword_vl"] . "', '" . $buy_item["min_staff_vl"] . "', '" . $buy_item["min_axe_vl"] . "', '" . $buy_item["min_fail_vl"] . "', '" . $buy_item["min_knife_vl"] . "', '" . $buy_item["min_spear_vl"] . "', '" . $buy_item["min_fire"] . "','" . $buy_item["min_water"] . "','" . $buy_item["min_air"] . "','" . $buy_item["min_earth"] . "','" . $buy_item["min_svet"] . "','" . $buy_item["min_tma"] . "','" . $buy_item["min_gray"] . "', '" . $buy_item["add_fire"] . "', '" . $buy_item["add_water"] . "', '" . $buy_item["add_air"] . "', '" . $buy_item["add_earth"] . "', '" . $buy_item["add_svet"] . "', '" . $buy_item["add_tma"] . "', '" . $buy_item["add_gray"] . "', '" . $buy_item["add_sila"] . "', '" . $buy_item["add_lovkost"] . "', '" . $buy_item["add_udacha"] . "', '" . $buy_item["add_intellekt"] . "', '" . $buy_item["add_duxovnost"] . "', '" . $buy_item["add_hp"] . "', '" . $buy_item["add_mana"] . "', '" . $buy_item["protect_head"] . "', '" . $buy_item["protect_arm"] . "', '" . $buy_item["protect_corp"] . "', '" . $buy_item["protect_poyas"] . "', '" . $buy_item["protect_legs"] . "', '" . $buy_item["protect_rej"] . "', '" . $buy_item["protect_drob"] . "', '" . $buy_item["protect_kol"] . "', '" . $buy_item["protect_rub"] . "', '" . $buy_item["protect_fire"] . "', '" . $buy_item["protect_water"] . "', '" . $buy_item["protect_air"] . "', '" . $buy_item["protect_earth"] . "', '" . $buy_item["protect_svet"] . "', '" . $buy_item["protect_tma"] . "', '" . $buy_item["protect_gray"] . "', '" . $buy_item["protect_mag"] . "', '" . $buy_item["protect_udar"] . "','" . $buy_item["shieldblock"] . "','" . $buy_item["krit"] . "', '" . $buy_item["akrit"] . "', '" . $buy_item["uvorot"] . "', '" . $buy_item["auvorot"] . "', '" . $buy_item["parry"] . "', '" . $buy_item["counter"] . "', '" . $buy_item["add_rej"] . "', '" . $buy_item["add_drob"] . "', '" . $buy_item["add_kol"] . "', '" . $buy_item["add_rub"] . "', '" . $buy_item["ms_udar"] . "', '" . $buy_item["ms_krit"] . "', '" . $buy_item["ms_mag"] . "', '" . $buy_item["ms_fire"] . "', '" . $buy_item["ms_water"] . "', '" . $buy_item["ms_air"] . "', '" . $buy_item["ms_earth"] . "', '" . $buy_item["ms_svet"] . "', '" . $buy_item["ms_tma"] . "', '" . $buy_item["ms_gray"] . "', '" . $buy_item["ms_rej"] . "', '" . $buy_item["ms_drob"] . "', '" . $buy_item["ms_kol"] . "', '" . $buy_item["ms_rub"] . "', '" . $buy_item["iznos_max"] . "', '" . $buy_item["min_attack"] . "', '" . $buy_item["max_attack"] . "', '" . $buy_item["proboy"] . "','" . $buy_item["add_oruj"] . "' ,'" . $buy_item["add_sword_vl"] . "', '" . $buy_item["add_staff_vl"] . "', '" . $buy_item["add_axe_vl"] . "', '" . $buy_item["add_fail_vl"] . "', '" . $buy_item["add_knife_vl"] . "', '" . $buy_item["add_spear_vl"] . "', '" . $buy_item["need_orden"] . "', '" . $buy_item["sex"] . "', '" . $buy_item["art"] . "', '1', '" . $buy_item["is_personal"] . "', '" . $buy_item["personal_owner"] . "', '" . $buy_item["noremont"] . "', '" . $buy_item["two_hand"] . "', '" . $buy_item["second_hand"] . "',  '" . $buy_item["add_fire_att"] . "', '" . $buy_item["add_air_att"] . "', '" . $buy_item["add_watet_att"] . "', '" . $buy_item["add_earth_att"] . "', '" . $buy_item["edited"] . "');");
            mysql_query("UNLOCK TABLES");
            $msg = "Вы удачно купили <b>&laquo;" . $buy_item["name"] . "&raquo;</b>";
            history($login, 'Купил', $buy_item["name"], $db["remote_ip"], 'Ледяной магазин');
        }
    }
}
开发者ID:ehmedov,项目名称:www,代码行数:31,代码来源:novruz_shop.php


示例17: insert_field

    static function insert_field($label, $type, $attributes = array(), $values = NULL, $default_value = NULL)
    {
        $javo_this_output = array('attribute' => '', 'values' => '');
        $javo_field_key = "";
        $attributes['class'] .= ' form-control';
        foreach ((array) $attributes as $key => $value) {
            if ($key == 'name') {
                $javo_this_output['attribute'] .= ' ' . $key . '="javo_custom_field[' . $value . '][value]"';
                $javo_field_key = $value;
            } else {
                $javo_this_output['attribute'] .= ' ' . $key . '="' . $value . '"';
            }
        }
        $javo_this_output['attribute'] .= ">";
        switch ($type) {
            case 'textarea':
                $javo_this_output['before'] = '<textarea';
                $javo_this_output['after'] = '</textarea>';
                $javo_this_output['values'] = $default_value != NULL ? $default_value : $values;
                break;
            case 'select':
                $javo_this_output['before'] = '<select';
                if (!empty($values)) {
                    $javo_this_values = explode(',', $values);
                    foreach ($javo_this_values as $value) {
                        $javo_this_output['values'] .= sprintf('<option value="%s"%s>%s</option>', trim($value), selected(trim($value) == trim($default_value), true, false), trim($value));
                    }
                }
                $javo_this_output['after'] = '</select>';
                break;
            case 'radio':
            case 'checkbox':
                $javo_this_output['before'] = '<div ';
                $javo_this_output['attribute'] = 'class="form-control" style="float:none;">';
                $javo_this_output['after'] = '</div>';
                $javo_this_field_array = $type == 'checkbox' ? '[]' : '';
                $javo_this_values = explode(',', $values);
                foreach ($javo_this_values as $value) {
                    $javo_this_output['values'] .= sprintf("<label><input type='{$type}' name='javo_custom_field[{$attributes['name']}][value]{$javo_this_field_array}' value='%s'%s>%s</label> &nbsp;", trim($va 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP in_array函数代码示例发布时间:2022-05-15
下一篇:
PHP inStr函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap