本文整理匯總了PHP中Defined函數的典型用法代碼示例。如果您正苦於以下問題:PHP Defined函數的具體用法?PHP Defined怎麽用?PHP Defined使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Defined函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Save_Meta_Box
function Save_Meta_Box($post_id, $post)
{
# If this is an autosave we dont care
if (Defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return;
}
# Check the PostType
#If ($post->post_type != $this->name) return;
# Check if this request came from the edit page section
if (isset($_POST[$this->meta_field]) && Is_Array($_POST[$this->meta_field])) {
# Save Meta data
Update_Post_Meta($post_id, '_wp_plugin_fancy_gallery', $_POST[$this->meta_field]);
}
}
示例2: error
/**
* Object constructor
*
* @access public
* @param string $description error description
* @param int $stop 0 - stop script execution, 1 - show warning and continue script execution
*/
function error($description, $stop=0, $short=0) {
$script='http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$dat=date("M d, Y H:i:s");
$description=$dat." ".$script."\nError:\n".$description;
DebMes($description);
if (Defined("DEBUG_MODE")) {
if (!$short) {
$this->alert(nl2br($description));
} else {
echo (nl2br($description));
}
} else {
if (!$short) {
$this->alert("");
} else {
echo "Warning...<br>";
}
}
sendmail("errors@".PROJECT_DOMAIN, PROJECT_BUGTRACK, "Error reporting: $script", $description);
if ($stop) exit;
}
示例3: error
/**
* Object constructor
*
* @access public
* @param string $description error description
* @param int $stop 0 - stop script execution, 1 - show warning and continue script execution
*/
function error($description, $stop = 0, $short = 0)
{
$script = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$description = $script . "\nError:\n" . $description;
$log = getLogger();
$log->error($description);
if (Defined("DEBUG_MODE")) {
if (!$short) {
$this->alert(nl2br($description));
} else {
echo nl2br($description);
}
} else {
if (!$short) {
$this->alert("");
} else {
echo "Warning...<br>";
}
}
sendmail("errors@" . PROJECT_DOMAIN, PROJECT_BUGTRACK, "Error reporting: {$script}", $description);
if ($stop) {
exit;
}
}
示例4: array
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/prolog.php";
if ($ID > 0) {
$APPLICATION->SetTitle(GetMessage("SRE_TITLE_UPDATE"));
} else {
$APPLICATION->SetTitle(GetMessage("SRE_TITLE_ADD"));
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
$dbRecurring = CSaleRecurring::GetList(array(), array("ID" => $ID), false, false, array("ID", "USER_ID", "MODULE", "PRODUCT_ID", "PRODUCT_NAME", "PRODUCT_URL", "PRODUCT_PRICE_ID", "RECUR_SCHEME_TYPE", "RECUR_SCHEME_LENGTH", "WITHOUT_ORDER", "PRICE", "CURRENCY", "ORDER_ID", "CANCELED", "CALLBACK_FUNC", "PRODUCT_PROVIDER_CLASS", "DESCRIPTION", "TIMESTAMP_X", "PRIOR_DATE", "NEXT_DATE", "REMAINING_ATTEMPTS", "SUCCESS_PAYMENT", "USER_LOGIN", "USER_NAME", "USER_LAST_NAME", "CANCELED_REASON"));
if (!$dbRecurring->ExtractFields("str_")) {
if ($saleModulePermissions < "W") {
$errorMessage .= GetMessage("SRE_NO_PERMS2ADD") . ".<br>";
}
$ID = 0;
$str_CANCELED = "N";
$str_REMAINING_ATTEMPTS = Defined("SALE_PROC_REC_ATTEMPTS") ? SALE_PROC_REC_ATTEMPTS : 3;
$str_SUCCESS_PAYMENT = "Y";
}
if ($bVarsFromForm) {
$DB->InitTableVarsForEdit("b_sale_recurring", "", "str_");
}
$aMenu = array(array("TEXT" => GetMessage("SREN_2FLIST"), "ICON" => "btn_list", "LINK" => "/bitrix/admin/sale_recurring_admin.php?lang=" . LANGUAGE_ID . GetFilterParams("filter_")));
if ($ID > 0 && $saleModulePermissions >= "U") {
$aMenu[] = array("SEPARATOR" => "Y");
$aMenu[] = array("TEXT" => GetMessage("SREN_NEW_RECURR"), "ICON" => "btn_new", "LINK" => "/bitrix/admin/sale_recurring_edit.php?lang=" . LANGUAGE_ID . GetFilterParams("filter_"));
if ($saleModulePermissions >= "W") {
$aMenu[] = array("TEXT" => GetMessage("SREN_DELETE_RECURR"), "ICON" => "btn_delete", "LINK" => "javascript:if(confirm('" . GetMessageJS("SREN_DELETE_RECURR_CONFIRM") . "')) window.location='/bitrix/admin/sale_recurring_admin.php?ID=" . $ID . "&action=delete&lang=" . LANGUAGE_ID . "&" . bitrix_sessid_get() . "#tb';", "WARNING" => "Y");
}
}
$context = new CAdminContextMenu($aMenu);
$context->Show();
示例5: AND
$result = $DB_hub->Query("SELECT nick, ip FROM banlist WHERE ip LIKE '".$_GET['ip']."' AND (`date_limit` > UNIX_TIMESTAMP() OR `date_limit` IS NULL)");
}
IF($result->num_rows) {
$ban = $result->Fetch_assoc();
Header("Location: index.php?".Change_URL_Query("q", "unban_request", "nick", urlencode($ban['nick']), "ip", $ban['ip']));
Die();
}
ELSE
VA_Message($text_banfree, "info32");
RETURN TRUE;
}
?>
<FORM action="index.php" method="get">
<INPUT name="q" type="hidden" value="bantest">
<TABLE class="b1 fs10px">
<TR>
<TD class="b bg_light right"> <?Print $text_nick;?> : </TD>
<TD class="b bg_light"><INPUT class="w160px" name="nick" type="text" value="<?IF(Defined("USER_NICK")){Print USER_NICK;} ELSE{Print $_GET['nick'];}?>"></TD>
</TR><TR>
<TD class="b bg_light right"> <?Print $text_ip;?> : </TD>
<TD class="b bg_light"><INPUT class="w160px" name="ip" type="text" value="<?IF($_GET['ip']){Print $_GET['ip'];} ELSE{Print $_SERVER['REMOTE_ADDR'];}?>"></TD>
</TR><TR>
<TD class="b bg_light right" colspan=2><INPUT class="w75px" type="submit" value="<?Print $text_check;?>"></TD>
</TR>
</TABLE>
</FORM>
示例6: SendEvent
public static function SendEvent($messageID, $mailTemplate = "SONET_NEW_MESSAGE")
{
$messageID = IntVal($messageID);
if ($messageID <= 0) {
return false;
}
$dbMessage = CSocNetMessages::GetList(array(), array("ID" => $messageID, "IS_LOG_ALL" => "Y"), false, false, array("ID", "FROM_USER_ID", "TO_USER_ID", "TITLE", "MESSAGE", "DATE_CREATE", "FROM_USER_NAME", "FROM_USER_LAST_NAME", "FROM_USER_LOGIN", "TO_USER_NAME", "TO_USER_LAST_NAME", "TO_USER_LOGIN", "TO_USER_EMAIL", "TO_USER_LID"));
$arMessage = $dbMessage->Fetch();
if (!$arMessage) {
return false;
}
$defSiteID = Defined("SITE_ID") ? SITE_ID : $arMessage["TO_USER_LID"];
$siteID = CSocNetUserEvents::GetEventSite($arMessage["TO_USER_ID"], $mailTemplate, $defSiteID);
if ($siteID == false || StrLen($siteID) <= 0) {
return false;
}
$arFields = array("MESSAGE_ID" => $messageID, "USER_ID" => $arMessage["TO_USER_ID"], "USER_NAME" => $arMessage["TO_USER_NAME"], "USER_LAST_NAME" => $arMessage["TO_USER_LAST_NAME"], "SENDER_ID" => $arMessage["FROM_USER_ID"], "SENDER_NAME" => $arMessage["FROM_USER_NAME"], "SENDER_LAST_NAME" => $arMessage["FROM_USER_LAST_NAME"], "EMAIL_TO" => $arMessage["TO_USER_EMAIL"], "TITLE" => $arMessage["TITLE"], "MESSAGE" => $arMessage["MESSAGE"]);
$event = new CEvent();
$event->Send($mailTemplate, $siteID, $arFields, "N");
return true;
}
示例7: die
<?if(!Defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();?>
<?if(isset($arParams["TITLE"])):?>
<div class="order_title"><?php
echo $arParams["TITLE"];
?>
</div>
<?endif;?>
<form id="filter_form">
<table border="1" cellspacing="0">
<?foreach ($arParams['FIELDS'] as $fieldID => $arField):?>
<tr style="height: 35px;">
<td width="40%" >
<a id="filter_<?php
echo $fieldID;
?>
" href="javascript:void(0);" onclick="maAdminFilter.showDiv(this);">
<?php
echo $arField["NAME"];
?>
:
</a>
</td>
<td width="50%" id="cond_<?php
echo $fieldID;
?>
"><?php
echo $arField["VALUE"];
?>
</td>
示例8: Defined
<?php
/**
* @package Spider Calendar lite
* @author Web-Dorado
* @copyright (C) 2011 Web-Dorado. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
**/
Defined('_JEXEC') or die;
jimport('joomla.application.component.model');
class spidercalendarModelajaxbigcalendar extends JModelLegacy
{
function getDate()
{
$app = JFactory::getApplication('site');
$componentParams = $app->getParams('com_spidercalendar');
$calendar_id = $componentParams->get('calendar');
$calendar = JTable::getInstance('spidercalendar_calendar', 'Table');
// load the row from the db table
$calendar->load($calendar_id);
if ((int) $calendar->def_month < 10) {
$month = '0' . (int) $calendar->def_month;
} else {
$month = (int) $calendar->def_month;
}
if ($calendar->def_year != '' and $calendar->def_month != '') {
$date = JRequest::getVar('date', $calendar->def_year . '-' . $month);
} else {
$date = JRequest::getVar('date', date("Y") . '-' . date("m"));
}
return array($date);
示例9: array
<?php
if (!Defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$arActions = array("barcode");
if ($_REQUEST["eshopapp_action"]) {
if ($_REQUEST["eshopapp_action"] == "login") {
include dirname(__FILE__) . "/actions/login.php";
} else {
header("Content-Type: application/x-javascript");
$data = array("error" => "unknow data request action");
$action = $_REQUEST["eshopapp_action"];
if (in_array($action, $arActions)) {
switch ($action) {
case "barcode":
require dirname(__FILE__) . "/actions/barcode.php";
break;
}
}
$APPLICATION->RestartBuffer();
echo json_encode($data);
die;
}
}
//$this->IncludeComponentTemplate();
示例10: Save_Meta_Box
function Save_Meta_Box($post_id)
{
global $post;
// If this is an autosave we dont care
if (Defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return;
}
// Check the PostType
if ($post->post_type != $this->gallery_post_type) {
return;
}
// Check if this request came from the edit page section
if (isset($_POST[__CLASS__])) {
// Save Meta data
update_post_meta($post_id, '_' . __CLASS__, (array) $_POST[__CLASS__]);
Delete_Post_Meta($post_id, '_wp_plugin_fancy_gallery_pro');
}
}
示例11: GetMessage
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddGroupError($ex->GetString(), $ID);
} else {
$lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("SRA_ERROR_DELETE")), $ID);
}
}
$DB->Commit();
} else {
$lAdmin->AddGroupError(GetMessage("SRA_NO_PERMS2DELETE"), $ID);
}
break;
case "cancel":
case "uncancel":
$arFields = array("CANCELED" => $_REQUEST['action'] == "cancel" ? "Y" : "N");
if ($_REQUEST['action'] != "cancel") {
$arFields["REMAINING_ATTEMPTS"] = Defined("SALE_PROC_REC_ATTEMPTS") ? SALE_PROC_REC_ATTEMPTS : 3;
}
if (!CSaleRecurring::Update($ID, $arFields)) {
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddGroupError($ex->GetString(), $ID);
} else {
$lAdmin->AddGroupError(str_replace("#ID#", $id, GetMessage("SRA_ERROR_UPDATE")), $ID);
}
}
break;
}
}
}
$dbResultList = CSaleRecurring::GetList(array($by => $order), $arFilter, false, false, array("*"));
$dbResultList = new CAdminResult($dbResultList, $sTableID);
$dbResultList->NavStart();
示例12: Find_WPML
public function Find_WPML()
{
$this->wpml_is_active = Defined('ICL_SITEPRESS_VERSION');
}
示例13: GetMessage
<?php
if (!Defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
die;
}
$control_id = $arParams['CONTROL_ID'];
?>
<div class="bx-ius-layout">
<?php
$APPLICATION->IncludeComponent('bitrix:main.lookup.input', 'crm_' . ToLower($arParams['ENTITY_TYPE']), array('CONTROL_ID' => $control_id, 'INPUT_NAME' => $arParams['~INPUT_NAME'], 'INPUT_NAME_STRING' => $arParams['~INPUT_NAME_STRING'], 'INPUT_VALUE_STRING' => $arParams['~INPUT_VALUE_STRING'], 'INPUT_NAME_SUSPICIOUS' => $arParams['~INPUT_NAME_SUSPICIOUS'], 'MULTIPLE' => $arParams['MULTIPLE'], 'START_TEXT' => $arParams['START_TEXT'], 'TEXTAREA_MAX_HEIGHT' => $arParams['~TEXTAREA_MAX_HEIGHT'], 'TEXTAREA_MIN_HEIGHT' => $arParams['~TEXTAREA_MIN_HEIGHT']), $component, array('HIDE_ICONS' => 'Y'));
$name = $APPLICATION->IncludeComponent('bitrix:crm.entity.search', '', array('ENTITY_TYPE' => ToLower($arParams['ENTITY_TYPE']), 'ONSELECT' => 'jsCES_' . $control_id . '.AddValue', 'MULTIPLE' => $arParams['MULTIPLE'], 'SHOW_BUTTON' => 'N', 'GET_FULL_INFO' => 'Y'), null, array('HIDE_ICONS' => 'Y'));
?>
<a href="javascript:void(0)" onclick="<?php
echo $name;
?>
.SetValue([]); <?php
echo $name;
?>
.Show()" class="bx-ius-structure-link"><?php
echo GetMessage('CRM_ES_ADD');
?>
</a>
</div>
示例14:
<IMG src="img/space.gif" width=4 height=15>
<? WHILE($row = $result->Fetch_Assoc()) {
Print "<A href=\"language.php?".Change_URL_Query("lang", $row['language'])."\">";
Print "<IMG src=\"img/".$row['language']."flag.gif\" width=22 height=15 alt=\"".StrToUpper($row['language'])."\">";
?> </A>
<IMG src="img/space.gif" width=4 height=15>
<? }
?> </TD>
</TR>
</TABLE>
<? BREAK;
//---------------------------------------------------------------------
CASE 2 :
Die(VA_Message("Not yet implemented", "error"));
IF(!Defined(SQLITE_ASSOC))
Die(VA_Message("SQLite support missing", "error"));
// $sqlite_db = SQLite_Open("language/".LANG);
$result = SQLite_Query($sqlite_db, "SELECT DISTINCT language FROM va_languages ORDER BY language");
?>
<TABLE align="right" class="rightpanel" width=0>
<TR>
<TD valign="middle" align="center" nowrap>
<IMG src="img/space.gif" width=4 height=15>
<? WHILE($row = SQLite_Fetch_Array($result, SQLITE_ASSOC)) {
Print "<A href=\"language.php?".Change_URL_Query("lang", $row['language'])."\">";
Print "<IMG src=\"img/".$row['language']."flag.gif\" width=22 height=15 alt=\"".StrToUpper($row['language'])."\">";
?> </A>
<IMG src="img/space.gif" width=4 height=15>
<? }
示例15: HTTP_Query
<?php
#-------------------------------------------------------------------------------
/** @author Бреславский А.В. (Joonte Ltd.) */
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (!Defined('ERROR')) {
#-------------------------------------------------------------------------------
if (!Define('ERROR', 0xabcdef)) {
exit("Can't define ERROR constant");
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (!Function_Exists('Debug')) {
#-------------------------------------------------------------------------------
function Debug($Message)
{
/* echo $Message; */
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
function HTTP_Query($Data, $Charset, $Hidden, $IsLogging = TRUE)
{
/******************************************************************************/
$__args_types = array('array', 'string', 'string', 'boolean');
#-------------------------------------------------------------------------------
$__args__ = Func_Get_Args();