本文整理汇总了PHP中TemplateReplace函数的典型用法代码示例。如果您正苦于以下问题:PHP TemplateReplace函数的具体用法?PHP TemplateReplace怎么用?PHP TemplateReplace使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TemplateReplace函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: BuildApp
/**
*
* ZPanel - A Cross-Platform Open-Source Web Hosting Control panel.
*
* @package ZPanel
* @version $Id$
* @author Bobby Allen - ballen@zpanelcp.com
* @copyright (c) 2008-2011 ZPanel Group - http://www.zpanelcp.com/
* @license http://opensource.org/licenses/gpl-3.0.html GNU Public License v3
*
* This program (ZPanel) is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
function BuildApp($a, $useraccount, $packageinfo, $quotainfo, $permissionset, $personalinfo)
{
$body = $a;
include 'conf/zcnf.php';
# Lets work out what template we are going to need to use..
$template_path = 'templates/' . GetSystemOption('zpanel_template');
$templatefile = $template_path . '/template.php';
$fd = fopen($templatefile, 'r');
$fileContents = fread($fd, filesize($templatefile));
fclose($fd);
$file = $body;
$fd = fopen($file, 'r');
$bodycontent = fread($fd, filesize($file));
fclose($fd);
function TemplateReplace($content, $bodycontent, $template_path, $useraccount, $packageinfo, $quotainfo, $permissionset, $personalinfo)
{
include 'conf/zcnf.php';
include 'lang/' . GetSystemOption('zpanel_lang') . '.php';
$fileContents = str_replace('{{usage:domains}}', GetQuotaUsages('domains', $useraccount['ac_id_pk']), $content);
$fileContents = str_replace('{{usage:subdomains}}', GetQuotaUsages('subdomains', $useraccount['ac_id_pk']), $fileContents);
$fileContents = str_replace('{{usage:parkeddomains}}', GetQuotaUsages('parkeddomains', $useraccount['ac_id_pk']), $fileContents);
$fileContents = str_replace('{{usage:mailboxes}}', GetQuotaUsages('mailboxes', $useraccount['ac_id_pk']), $fileContents);
$fileContents = str_replace('{{usage:forwarders}}', GetQuotaUsages('forwarders', $useraccount['ac_id_pk']), $fileContents);
$fileContents = str_replace('{{usage:distlists}}', GetQuotaUsages('distlists', $useraccount['ac_id_pk']), $fileContents);
$fileContents = str_replace('{{usage:ftpaccounts}}', GetQuotaUsages('ftpaccounts', $useraccount['ac_id_pk']), $fileContents);
$fileContents = str_replace('{{usage:mysql}}', GetQuotaUsages('mysql', $useraccount['ac_id_pk']), $fileContents);
$fileContents = str_replace('{{usage:diskspace}}', FormatFileSize(GetQuotaUsages('diskspace', $useraccount['ac_id_pk'])), $fileContents);
$fileContents = str_replace('{{usage:bandwidth}}', FormatFileSize(GetQuotaUsages('bandwidth', $useraccount['ac_id_pk'])), $fileContents);
$fileContents = str_replace('{{quota:domains}}', $quotainfo['qt_domains_in'], $fileContents);
$fileContents = str_replace('{{quota:subdomains}}', $quotainfo['qt_subdomains_in'], $fileContents);
$fileContents = str_replace('{{quota:parkeddomains}}', $quotainfo['qt_parkeddomains_in'], $fileContents);
$fileContents = str_replace('{{quota:mailboxes}}', $quotainfo['qt_mailboxes_in'], $fileContents);
$fileContents = str_replace('{{quota:forwarders}}', $quotainfo['qt_fowarders_in'], $fileContents);
$fileContents = str_replace('{{quota:distlists}}', $quotainfo['qt_distlists_in'], $fileContents);
$fileContents = str_replace('{{quota:ftpaccounts}}', $quotainfo['qt_ftpaccounts_in'], $fileContents);
$fileContents = str_replace('{{quota:mysql}}', $quotainfo['qt_mysql_in'], $fileContents);
$fileContents = str_replace('{{quota:diskspace}}', FormatFileSize($quotainfo['qt_diskspace_bi']), $fileContents);
$fileContents = str_replace('{{quota:bandwidth}}', FormatFileSize($quotainfo['qt_bandwidth_bi']), $fileContents);
$fileContents = str_replace('{{progbar:diskspace}}', "<img src=\"inc/zProgressBar.php?used=" . GetQuotaUsages('diskspace', $useraccount['ac_id_pk']) . "&total=" . $quotainfo['qt_diskspace_bi'] . "\">", $fileContents);
$fileContents = str_replace('{{progbar:bandwidth}}', "<img src=\"inc/zProgressBar.php?used=" . GetQuotaUsages('bandwidth', $useraccount['ac_id_pk']) . "&total=" . $quotainfo['qt_bandwidth_bi'] . "\">", $fileContents);
$fileContents = str_replace('{{server:company}}', GetSystemOption('sever_company'), $fileContents);
$fileContents = str_replace('{{server:serverip}}', $_SERVER['SERVER_ADDR'], $fileContents);
$fileContents = str_replace('{{server:userip}}', $_SERVER['REMOTE_ADDR'], $fileContents);
$fileContents = str_replace('{{server:uptime}}', GetServerUptime(), $fileContents);
$fileContents = str_replace('{{server:verapache}}', ShowApacheVersion(), $fileContents);
$fileContents = str_replace('{{server:verphp}}', ShowPHPVersion(), $fileContents);
$fileContents = str_replace('{{server:verkernal}}', ShowKernelVersion(ShowServerPlatform()), $fileContents);
$fileContents = str_replace('{{server:vermysql}}', ShowMySQLVersion(), $fileContents);
$fileContents = str_replace('{{server:veros}}', ShowServerPlatform(), $fileContents);
$fileContents = str_replace('{{server:osname}}', ShowServerOSName(), $fileContents);
$fileContents = str_replace('{{server:oslogo}}', "<img src=\"lib/emblems/os_icons/" . ShowServerOSName() . ".png\" title=\"This server is running " . ShowServerOSName() . "\">", $fileContents);
$fileContents = str_replace('{{server:verzpanel}}', GetSystemOption('zpanel_version'), $fileContents);
$fileContents = str_replace('{{link:home}}', "<a href=\"./\">" . $lang['215'] . "</a>", $fileContents);
$fileContents = str_replace('{{link:logout}}', "<a href=\"./login.php?logout\">" . $lang['216'] . "</a>", $fileContents);
$fileContents = str_replace('{{zp:templatepath}}', $template_path, $fileContents);
$fileContents = str_replace('{{account:username}}', $useraccount['ac_user_vc'], $fileContents);
$fileContents = str_replace('{{account:email}}', $personalinfo['ap_email_vc'], $fileContents);
$fileContents = str_replace('{{account:created}}', date(GetSystemOption('zpanel_df'), $useraccount['ac_created_ts']), $fileContents);
$fileContents = str_replace('{{account:fullname}}', $personalinfo['ap_fullname_vc'], $fileContents);
$fileContents = str_replace('{{package:name}}', $packageinfo['pk_name_vc'], $fileContents);
$fileContents = str_replace('{{account:type}}', ShowAccountType($permissionset), $fileContents);
$fileContents = str_replace('{{zp:content}}', $bodycontent, $fileContents);
return $fileContents;
}
$templatecontent = TemplateReplace($fileContents, $bodycontent, $template_path, $useraccount, $packageinfo, $quotainfo, $permissionset, $personalinfo);
return eval('?>' . $templatecontent . '');
}
示例2: DB_Select
}
#-------------------------------------------------------------------------------
} else {
#-------------------------------------------------------------------------------
$Clause = DB_Select('Clauses', '*', array('UNIQ', 'Where' => "`Partition` = 'CreateTicket/LOCK_OVERLIMITS'"));
#-------------------------------------------------------------------------------
switch (ValueOf($Clause)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
Debug(SPrintF('[comp/Tasks/HostingCPUUsage]: Статья для создания тикета не обнаружена: CreateTicket/LOCK_OVERLIMITS'));
break;
case 'array':
#-------------------------------------------------------------------------------
# готовим тикет
$ITicket = array('Theme' => $Clause['Title'], 'PriorityID' => 'Low', 'Flags' => 'CloseOnSee', 'TargetGroupID' => 3100000, 'TargetUserID' => 100, 'UserID' => $HostingOrder['UserID'], 'Message' => TemplateReplace(Strip_Tags($Clause['Text']), $Params, FALSE));
#-------------------------------------------------------------------------------
$IsAdd = Comp_Load('www/API/TicketEdit', $ITicket);
if (Is_Error($IsAdd)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
break;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
示例3: Tag
//}
#-------------------------------------------------------------------------------
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/Standard.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/DOM.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/HTTP.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/CheckBox.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/FormEdit.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/CtrlEnterEvent.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/Ajax/Window.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/Ajax/AutoComplite.js}')));
$DOM->AddChild('Head', new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{others/jQuery/core.js}')));
#-------------------------------------------------------------------------------
$DOM->AddChild('Head', new Tag('LINK', array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => 'SRC:{others/jQuery/smoothness/jquery-ui-custom.css}')));
#-------------------------------------------------------------------------------
$DOM->AddHTML('Floating', TemplateReplace('Triggers.DOM.Before.Base.TABLE'));
#-------------------------------------------------------------------------------
$DOM->AddHTML('Floating', TemplateReplace('Triggers.DOM.Before.Base.DIV'));
#-------------------------------------------------------------------------------
if (isset($_COOKIE['Eval'])) {
#-------------------------------------------------------------------------------
$Eval = $_COOKIE['Eval'];
#-------------------------------------------------------------------------------
$DOM->AddAttribs('Body', array('onload' => $Eval));
#-------------------------------------------------------------------------------
if (!SetCookie('Eval', $Eval, Time() - 86400, '/')) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
示例4: array
#-------------------------------------------------------------------------------
$Settings = $Config['Interface']['Administrator']['Notes']['Events'];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (!$Settings['ShowUnReaded']) {
return $Result;
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Result = array();
#-------------------------------------------------------------------------------
$Count = DB_Count('Events', array('Where' => "`IsReaded` != 'yes'"));
if (Is_Error($Count)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
if ($Count) {
#-------------------------------------------------------------------------------
$Result = array();
#-------------------------------------------------------------------------------
$NoBody = new Tag('NOBODY');
#-------------------------------------------------------------------------------
$NoBody->AddHTML(TemplateReplace('Notes.Administrator.Events', array('Count' => $Count)));
#-------------------------------------------------------------------------------
$Result = array($NoBody);
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Result;
#-------------------------------------------------------------------------------
示例5: CreatePage
function CreatePage()
{
global $template, $_GET, $zpaneldirectory, $user, $config, $settings, $package, $DB;
if (!isset($_GET['page'])) {
$body = "main.php";
} else {
if (!isset($_GET['ext']) || $_GET['ext'] == '') {
if ($_GET['page'] == "main") {
$body = "main.php";
} else {
$body = "modules/" . $_GET['cat'] . "/" . $_GET['page'] . "/index.php";
//Load module information
require "modules/" . $_GET['cat'] . "/" . $_GET['page'] . "/modinfo.zp.php";
}
} else {
$body = "modules/" . $_GET['cat'] . "/" . $_GET['page'] . "/" . $_GET['ext'] . ".php";
//Load module information
require "modules/" . $_GET['cat'] . "/" . $_GET['page'] . "/modinfo.zp.php";
}
}
// Get Template
$templatefile = $template['path'] . '/template.php';
$fd = fopen($templatefile, 'r');
$fileContents = fread($fd, filesize($templatefile));
fclose($fd);
// Get Content
$file = $body;
$fd = fopen($file, 'r');
$content = fread($fd, filesize($file));
fclose($fd);
// Get Header
$headerfile = 'includes/pagehead.php';
$fd = fopen($headerfile, 'r');
$pageheader = fread($fd, filesize($headerfile));
fclose($fd);
// Load xajax functions
include_once 'ajax_functions.php';
#
# Replace template variables
#
function TemplateReplace($content, $type, $body = 0)
{
global $user, $config, $settings, $template, $package, $DB, $pageheader, $xajax;
if ($type == 'template') {
global $bodycontent;
}
// Look for if statements
$fileContents = str_replace('{if:tech}', '<?php if ($user[\'tech\']) {?>', $content);
$fileContents = str_replace('{if:linux}', '<?php if (OS() == \'Linux\') {?>', $fileContents);
$fileContents = str_replace('{if:windows}', '<?php if (OS() == \'Windows\') {?>', $fileContents);
$fileContents = str_replace('{if!linux}', '<?php if (OS() != \'Linux\') {?>', $fileContents);
$fileContents = str_replace('{if!windows}', '<?php if (OS() != \'Windows\') {?>', $fileContents);
$fileContents = str_replace('{/if}', '<?php } ?>', $fileContents);
// User Information
$usrvars = $DB->GetAll('SHOW COLUMNS FROM accounts');
foreach ($usrvars as $var) {
$fileContents = str_replace('{user:' . $var[0] . '}', $user[$var[0]], $fileContents);
}
// Plan Information
$pkgvars = $DB->GetAll('SHOW COLUMNS FROM packages');
foreach ($pkgvars as $var) {
$fileContents = str_replace('{package:' . $var[0] . '}', $package[$var[0]], $fileContents);
}
// Usage Information
$fileContents = str_replace('{usage:ftp}', UsageInfo('ftp'), $fileContents);
$fileContents = str_replace('{usage:space}', UsageInfo('space'), $fileContents);
$fileContents = str_replace('{usage:domains}', UsageInfo('domains'), $fileContents);
$fileContents = str_replace('{usage:subdomains}', UsageInfo('subdomains'), $fileContents);
$fileContents = str_replace('{usage:parked}', UsageInfo('parkeddomains'), $fileContents);
$fileContents = str_replace('{usage:sql}', UsageInfo('mysql'), $fileContents);
// Final Content
$fileContents = str_replace('{company}', $config['company'], $fileContents) or die('Ooops');
$fileContents = str_replace('{apachever}', ApacheVer(), $fileContents);
$fileContents = str_replace('{phpver}', phpversion(), $fileContents);
$fileContents = str_replace('{kernelver}', KernelVer(), $fileContents);
$fileContents = str_replace('{mysqlver}', $DB->GetOne('SELECT version( ) ;'), $fileContents);
$fileContents = str_replace('{operatingsystem}', OS(), $fileContents);
$fileContents = str_replace('{templatepath}', $template['path'], $fileContents);
$fileContents = str_replace('{zpanelheader}', '<?php include(\'includes/pagehead.php\'); ?>', $fileContents);
if ($type == 'template') {
$fileContents = str_replace('{content}', $body, $fileContents);
}
return $fileContents;
}
$bodycontent = TemplateReplace($content, 'body');
$templatecontent = TemplateReplace($fileContents, 'template', $bodycontent);
$finalcontents = str_replace('<' . '?php', '<' . '?', $templatecontent);
$finalcontents = '?' . '>' . trim($finalcontents) . '<' . '?';
return eval($finalcontents);
}
示例6: Tag
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------
$Table[] = new Tag('DIV', array('align' => 'center'), $Comp);
}
#-----------------------------------------------------------------
$Comp = Comp_Load('Formats/Currency', $CostPay);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-----------------------------------------------------------------
$Table[] = array('Всего к оплате', $Comp);
#-----------------------------------------------------------------
$Div = new Tag('DIV', array('align' => 'right', 'class' => 'Standard'));
#-------------------------------------------------------------------------------
$Div->AddHTML(TemplateReplace('www.ServiceOrderPay', array('ServiceCode' => 'VPS')));
#-----------------------------------------------------------------
$Table[] = $Div;
#-----------------------------------------------------------------
$Table[] = new Tag('DIV', array('align' => 'right', 'style' => 'font-size:10px;'), $CostPay > $VPSOrder['ContractBalance'] ? '[заказ будет добавлен в корзину]' : '[заказ будет оплачен с баланса договора]');
#-----------------------------------------------------------------
$Div = new Tag('DIV', array('align' => 'right'));
#-----------------------------------------------------------------
if ($IsChange) {
#---------------------------------------------------------------
$Comp = Comp_Load('Form/Input', array('type' => 'button', 'onclick' => 'WindowPrev();', 'value' => 'Изменить период'));
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------
$Div->AddChild($Comp);
示例7: foreach
break;
case 'array':
#-------------------------------------------------------------------------------
$bill_list = "";
#-------------------------------------------------------------------------------
foreach ($Items as $Item) {
#-------------------------------------------------------------------------
#Debug("[comp/Tasks/GC/QIWI]: processing invoice #" . $Item['ID']);
$bill_list .= "\t\t" . SPrintF('<bill txn-id="%s"/>', $Item['ID']) . "\n";
#-------------------------------------------------------------------------
$NumInvoices++;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
# create request
$Result = TemplateReplace('Tasks.QIWI', array('Settings' => $Settings, 'bill_list' => $bill_list), FALSE);
#Debug(SPrintF('[comp/Tasks/GC/QIWI]: Result = %s',print_r($Result,true)));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# calculate encrypt key
$PasswordMD5 = md5($Settings['Hash'], true);
#-------------------------------------------------------------------------------
$salt = md5($Settings['Send']['from'] . bin2hex($PasswordMD5), true);
#-------------------------------------------------------------------------------
$key = Str_Pad($PasswordMD5, 24, '\\0');
#-------------------------------------------------------------------------------
# XOR calculating
for ($i = 8; $i < 24; $i++) {
#-------------------------------------------------------------------------------
if ($i >= 16) {
#-------------------------------------------------------------------------------
示例8: Links
if (!Comp_IsLoaded('Upload')) {
#-------------------------------------------------------------------------------
$Links =& Links();
#-------------------------------------------------------------------------------
$DOM =& $Links['DOM'];
#-------------------------------------------------------------------------------
$Script = new Tag('SCRIPT', array('type' => 'text/javascript', 'src' => 'SRC:{Js/Upload.js}'));
#-------------------------------------------------------------------------------
$DOM->AddChild('Head', $Script);
#-------------------------------------------------------------------------------
$Comp = Comp_Load('Css', array('Upload'));
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#-------------------------------------------------------------------------------
foreach ($Comp as $Css) {
$DOM->AddChild('Head', $Css);
}
#-------------------------------------------------------------------------------
$DOM->AddHTML('Floating', TemplateReplace('Upload.DIV'));
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
$Table = new Tag('TABLE', array('width' => '200', 'cellspacing' => 0));
#-------------------------------------------------------------------------------
$Table->AddHTML(TemplateReplace('Upload.Button', array('Name' => $Name, 'Info' => $Info ? $Info : '-', 'MaxFileSize' => $Settings['MaxFileSize'])));
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Table;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
示例9: Debug
#-------------------------------------------------------------------------------
$Percent = $Bonus['Discont'] * 100;
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Notes/User/Bonuses]: Code = %s; Percent = %s', $Bonus['Code'], $Percent));
#-------------------------------------------------------------------------------
if ($Percent < $Settings['Percent']) {
continue;
}
#-------------------------------------------------------------------------------
if (Is_Null($Bonus['NameShort'])) {
#-------------------------------------------------------------------------------
$Bonus['NameShort'] = 'Любой сервис';
$Bonus['Code'] = 'Hosting';
$Bonus['Measure'] = 'шт.';
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
$Params = array('Bonus' => $Bonus, 'Percent' => $Percent);
#-------------------------------------------------------------------------------
$NoBody = new Tag('NOBODY');
$NoBody->AddHTML(TemplateReplace('Notes.User.Bonuses', $Params));
$Result[] = $NoBody;
unset($NoBody);
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Result;
#-------------------------------------------------------------------------------
示例10: File_Get_Contents
#-------------------------------------------------------------------------------
$LastExecuted = File_Get_Contents($Marker);
#-------------------------------------------------------------------------------
$LastExecuted = StrToTime($LastExecuted);
#-------------------------------------------------------------------------------
Debug(SPrintF('[comp/Notes/Administrator/CheckCronRun]: LastExecuted = %s', Date('Y-m-d H:i:s', $LastExecuted)));
#-------------------------------------------------------------------------------
if ($LastExecuted < Time() - $Settings['CronDownTime']) {
$Array = array('Message' => SPrintF('Последнее задание было выполнено <B>%s в %s</B>', Date('Y-m-d', $LastExecuted), Date('H:i:s', $LastExecuted)));
}
} else {
#-------------------------------------------------------------------------------
$Array = array('Message' => SPrintF('Планировщик ни разу не запускался в штатном режиме, или, отсутствует доступ к файлу <BR /><B>%s</B>', $Marker));
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (isset($Array)) {
#-------------------------------------------------------------------------------
$NoBody = new Tag('NOBODY');
#-------------------------------------------------------------------------------
$NoBody->AddHTML(TemplateReplace('Notes.Administrator.CheckCronRun', $Array));
#-------------------------------------------------------------------------------
$Result[] = $NoBody;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Result;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
示例11: Explode
return $Result;
}
#-------------------------------------------------------------------------------
if (!Is_Array($Cached)) {
return $Result;
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Array = Explode(',', $Settings['ExcludeIPs']);
#-------------------------------------------------------------------------------
foreach ($Array as $IP) {
if (Trim($IP) == $Cached['EnterIP']) {
return $Result;
}
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($Cached['EnterIP'] != $GLOBALS['__USER']['EnterIP']) {
#-------------------------------------------------------------------------------
$Params = array('EnterIP' => $Cached['EnterIP'], 'IP' => $GLOBALS['__USER']['EnterIP'], 'EnterDate' => Date('Y-m-d H:i:s', $Cached['EnterDate']));
#-------------------------------------------------------------------------------
$NoBody = new Tag('NOBODY');
$NoBody->AddHTML(TemplateReplace('Notes.CheckEnterIP', $Params));
$Result[] = $NoBody;
#-------------------------------------------------------------------------------
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
return $Result;
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
示例12: DB_Select
$DomainOrder = DB_Select('DomainOrdersOwners', $Columns, array('UNIQ', 'Where' => SPrintF('`OrderID` = %u', $Order['ID'])));
switch (ValueOf($DomainOrder)) {
case 'error':
return ERROR | @Trigger_Error(500);
case 'exception':
return ERROR | @Trigger_Error(400);
case 'array':
#-------------------------------------------------------------------------------
$NoBody = new Tag('NOBODY');
#-------------------------------------------------------------------------------
$Params['TransferDaysRemainded'] = Ceil(($DomainOrder['StatusDate'] + 180 * 24 * 3600 - Time()) / (24 * 3600));
$Params['DomainOrder'] = $DomainOrder;
#-------------------------------------------------------------------------------
if (In_Array($DomainOrder['Name'], array('ru', 'su', 'рф'))) {
#-------------------------------------------------------------------------------
$NoBody->AddHTML(TemplateReplace('Notes.User.NoticeOrders.OnTransfer.USSR', $Params));
#-------------------------------------------------------------------------------
$Result[] = $NoBody;
#-------------------------------------------------------------------------------
} else {
# ничё?
}
#-------------------------------------------------------------------------
break;
default:
return ERROR | @Trigger_Error(101);
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
} else {
# ничё не делаем?
示例13: eval
#-------------------------------------------------------------------------------
/** @author Alex Keda, for www.host-food.ru **/
/******************************************************************************/
/******************************************************************************/
eval(COMP_INIT);
/******************************************************************************/
/******************************************************************************/
$Result = array();
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$Config = Config();
#-------------------------------------------------------------------------------
$Settings = $Config['Interface']['Administrator']['Notes']['CheckUserID'];
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if (!$Settings['MakeCheckUserID']) {
return $Result;
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
if ($GLOBALS['__USER']['ID'] != 100) {
return $Result;
}
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
$NoBody = new Tag('NOBODY');
$NoBody->AddHTML(TemplateReplace('Notes.Administrator.CheckUserID'));
$Result[] = $NoBody;
#-------------------------------------------------------------------------------
return $Result;
#-------------------------------------------------------------------------------
示例14: GenerateBulkWO
function GenerateBulkWO($params)
{
global $WOIPTeams;
$loc = rmabs(__FILE__ . "GenerateBulkWO");
$sql = 'SELECT * FROM AllActiveUsersView ORDER BY LastName, FirstName';
$result = SqlQuery($loc, $sql);
$d = array();
$num = 0;
$matchtags = ArrayFromSlashStr($params["FilterTags"]);
if (empty($matchtags)) {
$matchtags = array("Worker");
}
$title_template = $params["Title"];
$nerr = 0;
$nok = 0;
$wid0 = 0;
$wid1 = 0;
$num = 0;
while ($userinfo = $result->fetch_assoc()) {
// Decide if this person should get a WO.
$taglist = ArrayFromSlashStr($userinfo["Tags"]);
if (TagMatch(array("Guest"), $taglist)) {
continue;
}
// Guests NEVER get one.
if (!TagMatch($matchtags, $taglist)) {
continue;
}
// We passed the test, this person gets one!
// Figure out the receiving IPT.
$ipt = $userinfo["IPT"];
if (empty($ipt)) {
$ipt = $WOIPTeams[8];
}
// Hopefully this is management.
$params["Receiver"] = $ipt;
$num++;
$snum = sprintf("%d", $num);
$params["Title"] = TemplateReplace($title_template, $snum, "##");
$rwo = CreateNewWorkOrder($params);
$wid = $rwo[0];
if ($wid == 0) {
// failed.
log_error($loc, array("Failed to Create Bulk WO. Reason: " . $rwo[1], 'WO Title: ' . $params["Title"]));
$nerr++;
continue;
}
// Add assingment
MakeAssignment($wid, $userinfo["UserID"]);
if ($nok == 0) {
$wid0 = $wid;
}
$wid1 = $wid;
$nok++;
}
$msg = 'Number of WOs Created = ' . $nok . '. Number of Failures = ' . $nerr . '.';
$msg .= " WID=" . $wid0 . " to " . $wid1 . ".";
log_msg($loc, "Bulk WO Created. WIDs " . $wid0 . " to " . $wid1);
return $msg;
}
示例15: Tag
$Prefix = $Item['IsActive'] ? 'Active' : 'UnActive';
#-------------------------------------------------------------------------------
$A = new Tag('A', array('href' => $Item['Href']), $Item['Text']);
#-----------------------------------------------------------------------------
if (isset($Item['Prompt'])) {
#---------------------------------------------------------------------------
$LinkID = UniqID('ID');
#---------------------------------------------------------------------------
$Links =& Links();
#---------------------------------------------------------------------------
$Links[$LinkID] =& $A;
#---------------------------------------------------------------------------
$Comp = Comp_Load('Form/Prompt', $LinkID, $Item['Prompt']);
if (Is_Error($Comp)) {
return ERROR | @Trigger_Error(500);
}
#---------------------------------------------------------------------------
unset($Links[$LinkID]);
}
#-----------------------------------------------------------------------------
$Td->AddHTML(TemplateReplace('Tab.Table2', array('Prefix' => $Prefix, 'Href' => $A->ToXMLString())));
#-----------------------------------------------------------------------------
$Tr->AddChild($Td);
}
#-------------------------------------------------------------------------------
$Tr->AddChild(new Tag('TD', array('width' => '10px')));
#-------------------------------------------------------------------------------
$DOM->AddChild('TabMenu', $Tr);
#-------------------------------------------------------------------------------
return $DOM->Object;
#-------------------------------------------------------------------------------