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


PHP SetValue函数代码示例

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


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

示例1: DiscussionController_BeforeDiscussionOptions_Handler

 /**
  * Suffix discussion name with DiscussionID in single view.
  */
 public function DiscussionController_BeforeDiscussionOptions_Handler($Sender, $Args)
 {
     $Discussion = $Sender->Data('Discussion');
     $NewName = GetValue('Name', $Discussion) . ' [' . GetValue('DiscussionID', $Discussion) . ']';
     SetValue('Name', $Discussion, $NewName);
     $Sender->SetData('Discussion', $Discussion);
 }
开发者ID:nilsen,项目名称:addons,代码行数:10,代码来源:class.supporttracker.plugin.php

示例2: createGroupWithID

 public function createGroupWithID($name, $id, $parentID)
 {
     $group = @IPS_GetObjectIDByIdent($id, $parentID);
     if (!$group) {
         $group = IPS_CreateCategory();
         IPS_SetName($group, $name);
         IPS_SetParent($group, $parentID);
         IPS_SetIdent($group, $id);
         $variable = IPS_CreateVariable(0);
         IPS_SetParent($variable, $group);
         IPS_SetName($variable, "Turn on");
         IPS_SetIdent($variable, "state_" . $id);
         SetValue($variable, true);
         $variable = IPS_CreateVariable(1);
         IPS_SetParent($variable, $group);
         IPS_SetName($variable, "Delay");
         IPS_SetIdent($variable, "delay_" . $id);
         SetValue($variable, 3600);
         $childs = IPS_CreateCategory();
         IPS_SetName($childs, "Links");
         IPS_SetParent($childs, $group);
         IPS_SetIdent($childs, "childs_" . $id);
     }
     return $group;
 }
开发者ID:mcbeyel,项目名称:IPSAbsence,代码行数:25,代码来源:module.php

示例3: Gdn_Form_DropDown_Override

 public function Gdn_Form_DropDown_Override($Form)
 {
     $FieldName =& $Form->EventArguments[0];
     $DataSet =& $Form->EventArguments[1];
     $Attributes =& $Form->EventArguments[2];
     //$ValueField = ArrayValueI('ValueField', $Attributes, 'value');
     $TextField = ArrayValueI('TextField', $Attributes, 'text');
     $MaxDropDownTextField = C('Plugins.Morf.MaxLengthDropDownTextField');
     if (GetIncomingValue('DeliveryType', DELIVERY_TYPE_ALL) != DELIVERY_TYPE_ALL) {
         $MaxTextLength = GetValue('Window', $MaxDropDownTextField);
     } else {
         $MaxTextLength = GetValue('Default', $MaxDropDownTextField);
     }
     if (is_numeric($MaxTextLength) && $MaxTextLength > 0) {
         if (is_object($DataSet)) {
             $TestValue = GetValue($TextField, $DataSet->FirstRow());
             if ($TestValue !== False) {
                 foreach ($DataSet->ResultObject() as $Data) {
                     $S = SliceString(GetValue($TextField, $Data), $MaxTextLength);
                     SetValue($TextField, $Data, $S);
                 }
             }
         } elseif (is_array($DataSet)) {
             // ResultSet is unexpected here
             foreach ($DataSet as &$Value) {
                 $Value = SliceString($Value, $MaxTextLength);
             }
         }
     }
     return $Form->DropDown($FieldName, $DataSet, $Attributes);
 }
开发者ID:unlight,项目名称:Morf,代码行数:31,代码来源:default.php

示例4: ProcessHookData

 public function ProcessHookData()
 {
     if ($_IPS['SENDER'] == "Execute") {
         echo "This script cannot be used this way.";
         return;
     }
     if (!isset($_POST['deviceName']) || !isset($_POST['deviceType']) || !isset($_POST['deviceFamily'])) {
         IPS_LogMessage("ips4WinDeviceRegistration", "Malformed data: " . print_r($_POST, true));
         return;
     }
     $id = str_replace("-", "", utf8_decode($_POST['deviceName']) . utf8_decode($_POST['deviceId']));
     $id = str_replace(" ", "", $id);
     $deviceID = $this->CreateInstanceByIdent($this->InstanceID, $id, utf8_decode($_POST['deviceName']) . "-" . utf8_decode($_POST['deviceId']));
     SetValue($this->CreateVariableByIdent($deviceID, "deviceName", "deviceName", 3), utf8_decode($_POST['deviceName']));
     SetValue($this->CreateVariableByIdent($deviceID, "deviceType", "deviceType", 3), utf8_decode($_POST['deviceType']));
     SetValue($this->CreateVariableByIdent($deviceID, "deviceId", "deviceId", 3), utf8_decode($_POST['deviceId']));
     SetValue($this->CreateVariableByIdent($deviceID, "deviceFamily", "deviceFamily", 3), utf8_decode($_POST['deviceFamily']));
     if (isset($_POST['SecChannel'])) {
         SetValue($this->CreateVariableByIdent($deviceID, "SecChannelExp", "SecChannelExp", 1, "~UnixTimestamp"), intval(strtotime($_POST['SecChannelExp'])));
         SetValue($this->CreateVariableByIdent($deviceID, "SecChannel", "SecChannel", 3), utf8_decode($_POST['SecChannel']));
         SetValue($this->CreateVariableByIdent($deviceID, "AccessToken", "AccessToken", 3), utf8_decode($_POST['AccessToken']));
     }
     if (isset($_POST['geoID'])) {
         $geoIDName = str_replace("-", "", utf8_decode($_POST['geoID']));
         $geoIDName = str_replace(" ", "", $geoIDName);
         $idGeofences = $this->CreateCategoryByIdent($deviceID, "Geofences", "Geofences");
         $idGeofence = $this->CreateInstanceByIdent($idGeofences, $geoIDName, utf8_decode($_POST['geoID']));
         //SetValue($this->CreateVariableByIdent($idGeofence, "Latitude", "Latitude", 2), floatval($_POST['Latitude']));
         //SetValue($this->CreateVariableByIdent($idGeofence, "Longitude", "Longitude", 2), floatval($_POST['Longitude']));
         SetValue($this->CreateVariableByIdent($idGeofence, "Timestamp", "Timestamp", 1, "~UnixTimestamp"), intval(strtotime($_POST['date'])));
         SetValue($this->CreateVariableByIdent($idGeofence, "LocationState", "Status", 0, "~Presence"), intval($_POST['geoPresence']) > 0);
     }
 }
开发者ID:Seb0815,项目名称:ips4Windows,代码行数:33,代码来源:module.php

示例5: blockall

 public function blockall()
 {
     $citys = explode(',', '北京,浙江,天津,安徽,上海,福建,莆田,重庆,江西,山东,河南,内蒙古,湖北,新疆,湖南,宁夏,广东,西藏,海南,广西,四川,河北,贵州,山西,云南,辽宁,陕西, 吉林,甘肃,黑龙江,青海,江苏,' . $_POST['city_list']);
     SetValue('ipblock_city', serialize($citys));
     cleanCache();
     $this->jumpUrl = U('Ipblock/index');
     $this->success('设置成功!');
 }
开发者ID:anshidai,项目名称:bagsloves,代码行数:8,代码来源:IpblockAction.class.php

示例6: DiscussionController_Render_Before

 /**
  * @param DiscussionController $Sender
  */
 public function DiscussionController_Render_Before($Sender)
 {
     // Get the tags on this discussion.
     $Tags = TagModel::instance()->getDiscussionTags($Sender->Data('Discussion.DiscussionID'), TagModel::IX_EXTENDED);
     foreach ($Tags as $Key => $Value) {
         SetValue($Key, $Sender->Data['Discussion'], $Value);
     }
 }
开发者ID:3marproof,项目名称:vanilla,代码行数:11,代码来源:class.tagging.plugin.php

示例7: RequestInfo

 /**
  * This function will be available automatically after the module is imported with the module control.
  * Using the custom prefix this function will be callable from PHP and JSON-RPC through:
  *
  * EL_RequestInfo($id);
  *
  */
 public function RequestInfo()
 {
     $strasse = $this->ReadPropertyString("streetName");
     $hausnr = $this->ReadPropertyString("streetNumber");
     $str = base64_encode('a:3:{s:3:"STR";s:' . strlen($strasse) . ':"' . $strasse . '";s:4:"YEAR";s:4:"' . date("Y") . '";s:3:"HNR";s:' . strlen($hausnr) . ':"' . $hausnr . '";}');
     $buffer = file_get_contents("http://luebeck.abfallkalender.insert-infotech.de/kalender.php?BaseString=" . $str . "%3D");
     if (strpos($buffer, "Leerungsdaten") !== false) {
         echo "Ungültige Adresse!";
         return;
     }
     //kill everything before the interesting table
     $buffer = stristr($buffer, '<div class="kw_table">');
     $i = 0;
     while (true) {
         //fetch div
         $buffer = stristr($buffer, '<div class="kw_td_');
         if ($buffer === false) {
             break;
         }
         $name = substr($buffer, 18, strpos($buffer, " ", 18) - 18);
         $buffer = stristr($buffer, '>');
         $value = substr($buffer, 1, strpos($buffer, "</div>") - 1);
         if ($name == "ueberschrift") {
             continue;
         }
         //skip
         if ($name == "wochentag") {
             $i++;
         }
         //increment counter
         $result[$i][$name] = $value;
     }
     //var_dump($result);
     $wasteTime = 0;
     foreach ($result as $item) {
         if (strpos($item['feiertag'], "tonne_schwarz") !== false) {
             $wasteTime = strtotime($item['tag'] . ". " . $item['monat']);
             break;
         }
     }
     SetValue($this->GetIDForIdent("WasteTime"), $wasteTime);
     $paperTime = 0;
     foreach ($result as $item) {
         if (strpos($item['feiertag'], "tonne_blau") !== false) {
             $paperTime = strtotime($item['tag'] . ". " . $item['monat']);
             break;
         }
     }
     SetValue($this->GetIDForIdent("PaperTime"), $paperTime);
     $bioTime = 0;
     foreach ($result as $item) {
         if (strpos($item['feiertag'], "tonne_braun") !== false) {
             $bioTime = strtotime($item['tag'] . ". " . $item['monat']);
             break;
         }
     }
     SetValue($this->GetIDForIdent("BioTime"), $bioTime);
 }
开发者ID:paresy,项目名称:paresyMisc,代码行数:65,代码来源:module.php

示例8: NetPlayer_NavigateCD

	function NetPlayer_NavigateCD ($delta) {
	   $directoryList = NetPlayer_GetDirectoryList();
	   $maxIdx        = count($directoryList);
	   $currentIdx    = GetValue(NP_ID_CDDIRECTORYIDX);
	   if ($currentIdx > $maxIdx - $delta) $currentIdx = $maxIdx - $delta;
		$currentIdx = $currentIdx + $delta;
	   if ($currentIdx < 0) $currentIdx = 0;
      SetValue(NP_ID_CDDIRECTORYIDX, $currentIdx);
	}
开发者ID:KOS-CH,项目名称:IPSLibrary,代码行数:9,代码来源:NetPlayer_ListFiles.inc.php

示例9: Entertainment_SetRemoteControl

	function Entertainment_SetRemoteControl($Id, $Value) {
	   $DeviceName = IPS_GetName(IPS_GetParent($Id));
		if (!isDevicePoweredOnByDeviceName($DeviceName)) {
		  return;
		}
		IPSLogger_Dbg(__file__, 'Set RemoteControl for Device "'.$DeviceName.'": '.$Value);
		SetValue($Id, $Value);
		Entertainment_SetRoomControlByDeviceControlId($Id, $Value);
	}
开发者ID:KOS-CH,项目名称:IPSLibrary,代码行数:9,代码来源:Entertainment_RemoteControl.inc.php

示例10: nodelist

 public function nodelist()
 {
     if ($this->isPost()) {
         $access = $_POST['access'];
         SetValue('accessmode', $access);
         cleanCache();
         $this->success("修改成功!");
     }
     $this->access = GetValue('accessmode') ? GetValue('accessmode') : 'module';
     $this->display();
 }
开发者ID:anshidai,项目名称:bagsloves,代码行数:11,代码来源:NodeAction.class.php

示例11: Entertainment_SetRoomPower

	function Entertainment_SetRoomPower($PowerId, $Value, $PowerOnDevices=true) {
	   if (GetValue($PowerId) <> $Value) {
	      IPSLogger_Inf(__file__, 'Set Power for Room "'.IPS_GetName(IPS_GetParent($PowerId)).'" '.bool2OnOff($Value));
			SetValue($PowerId, $Value);
	      Entertainment_SetRoomVisible($PowerId, $Value);
			if ($PowerOnDevices) {
	      	Entertainment_SetDevicePowerByRoomId(IPS_GetParent($PowerId), $Value);
			}
	      Entertainment_SyncRoomControls(IPS_GetParent($PowerId));
	   }
	}
开发者ID:KOS-CH,项目名称:IPSLibrary,代码行数:11,代码来源:Entertainment_Room.inc.php

示例12: RequestAction

		public function RequestAction($Ident, $Value)
		{
			
			switch($Ident) {
				case "TestVariable":
					SetValue($this->GetIDForIdent($Ident), $Value);
					break;
				default:
					throw new Exception("Invalid ident");
			}
		
		}
开发者ID:Vansdan,项目名称:SymconTest,代码行数:12,代码来源:module.php

示例13: EntryController_Render_Before

 /**
  * @param Gdn_Controller $Sender
  * @param array $Args
  */
 public function EntryController_Render_Before($Sender, $Args)
 {
     if ($Sender->RequestMethod != 'passwordreset') {
         return;
     }
     if (isset($Sender->Data['User'])) {
         // Get all of the users with the same email.
         $Email = $Sender->Data('User.Email');
         $Users = Gdn::SQL()->Select('Name')->From('User')->Where('Email', $Email)->Get()->ResultArray();
         $Names = array_column($Users, 'Name');
         SetValue('Name', $Sender->Data['User'], implode(', ', $Names));
     }
 }
开发者ID:vanilla,项目名称:addons,代码行数:17,代码来源:class.emailpasswordsync.plugin.php

示例14: CreateAndUpdateVariable

 protected function CreateAndUpdateVariable($variableType, $variableName, $value, $parent, $ident)
 {
     $existingVariableId = @IPS_GetObjectIDByIdent($ident, $parent);
     if (!$existingVariableId) {
         $newVariableId = IPS_CreateVariable($variableType);
         IPS_SetName($newVariableId, $variableName);
         SetValue($newVariableId, $value);
         IPS_SetParent($newVariableId, $parent);
         IPS_SetIdent($newVariableId, $ident);
         return $newVariableId;
     } else {
         SetValue($existingVariableId, $value);
         return $existingVariableId;
     }
 }
开发者ID:geelife,项目名称:IPS_NZBGet,代码行数:15,代码来源:module.php

示例15: Payment

 function Payment()
 {
     $model = D('Payment');
     $this->list = $model->order('sort desc')->select();
     if ($this->isPost()) {
         $id = implode(',', (array) $_POST['id']);
         $map['id'] = array('in', $id);
         $list = $model->where($map)->getField('id,name');
         $status = $_POST['status'];
         foreach ($list as $val) {
             SetValue($val . '_status', $status);
         }
         $count = count($list);
         cleanCache();
         $this->success(($status ? '启用了' : '禁用了') . $count . '个付款方式!');
     }
     $this->display();
 }
开发者ID:anshidai,项目名称:bagsloves,代码行数:18,代码来源:SettingAction.class.php


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