本文整理汇总了PHP中Parse函数的典型用法代码示例。如果您正苦于以下问题:PHP Parse函数的具体用法?PHP Parse怎么用?PHP Parse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Parse函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Show
function Show()
{
global $limit;
$this->Init();
$this->AddStrings($ret);
$offset = (int) get('offset');
$limit = (int) get('limit', $this->Param('limit', $limit));
$count = sql_getValue("SELECT COUNT(*) FROM " . STAT_SESSIONS_TABLE . " WHERE robot=0 AND time_last>" . (time() - STAT_SESS_TIME * 60));
$data = sql_getRows("SELECT ip, 'count_pages', path, time, time_last FROM " . STAT_SESSIONS_TABLE . " WHERE robot=0 AND time_last>" . (time() - STAT_SESS_TIME * 60) . " ORDER BY time_last DESC LIMIT " . $offset . ", " . $limit);
// Построить массив для всех страниц ($this->path)
if ($data) {
$pages_id = array();
foreach ($data as $row) {
$pages_id = array_merge($pages_id, explode(' ', trim($row['path'])));
}
$pages_id = array_unique($pages_id);
$this->path_pages = sql_getRows("SELECT id, CONCAT(host, uri) AS page FROM " . STAT_PAGES_TABLE . " WHERE id IN (" . join(', ', $pages_id) . ")", true);
$this->path_keys = array_flip(array_keys($this->path_pages));
foreach ($this->path_pages as $page_id => $href) {
$ret['pathes']['row'][] = array('key' => $this->path_keys[$page_id] + 1, 'href' => $href);
}
}
// Main Table
$columns = array(array('header' => 'ip', 'nowrap' => '1', 'type' => 'ip'), array('header' => 'pages', 'align' => 'right', 'type' => 'pages'), array('header' => 'pathes', 'type' => 'path'), array('header' => 'time', 'align' => 'right', 'type' => 'time'), array('header' => 'last', 'align' => 'right', 'type' => 'last'));
if (isset($GLOBALS['_stat']['stat/stat_banlist'])) {
$columns[] = array('header' => 'ban', 'type' => 'ban', 'align' => 'center');
}
$ret['table'] = $this->stat_table(array('columns' => $columns, 'data' => $data, 'count' => $count, 'offset' => $offset, 'limit' => $limit));
$ret['navig'] = $this->NavigForm(array('hidden' => array('show' => $this->show)));
return Parse($ret, 'stat/stat.no_navig.tmpl');
}
示例2: getContent
function getContent()
{
$data = array();
$func = get('func', '', 'pg');
if (!empty($func)) {
$func = get('func', '', 'pg');
if (!empty($func)) {
$data = $this->{$func}();
}
} else {
global $user;
$data['current_user'] = $user['id'];
$data['managers'] = sql_getRows("SELECT id, CONCAT(login,' (',email,') ') as name FROM admins", true);
$this->AddStrings($data);
include_fckeditor();
$oFCKeditor = new FCKeditor();
$oFCKeditor->ToolbarSet = 'Common';
$oFCKeditor->Value = '';
$data['editor'] = $oFCKeditor->ReturnFCKeditor('fld[html]', '100%', '100%');
$this->AddStrings($data);
}
$tpl = strtolower($this->dir . '/' . $this->name . (!empty($func) ? '.' . $func : '') . '.tmpl');
if (is_file($tpl)) {
return Parse($data, $tpl);
} else {
return $data;
}
}
示例3: Show
function Show()
{
// обязательная фигня
if (!empty($GLOBALS['_POST'])) {
$actions = get('actions', '', 'p');
if ($actions) {
return $this->{$actions}();
}
}
global $settings;
$types = array();
foreach ($settings['subscribe_categories'] as $key => $val) {
if (isset($val['sub'])) {
foreach ($val['sub'] as $k => $v) {
$types[$v['type']] = $v['title'];
}
}
}
require_once core('ajax_table');
$data['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'email', 'display' => 'email', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'type', 'display' => 'type', 'type' => 'type', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_display' => 'type', 'filter_type' => 'array', 'filter_value' => array('' => '-- Все --') + $types, 'filter_field' => 'type')), 'from' => $this->table, 'where' => 'root_id=' . domainRootId(), 'params' => array('page' => $this->name, 'do' => 'show'), 'click' => 'ID=cb.value'), $this);
$this->AddStrings($data);
$data['thisname'] = $this->name;
$data['thisname2'] = str_replace('/', '', $this->name);
return Parse($data, "notify/tmpls/properties.tmpl");
}
示例4: Show
function Show()
{
$this->Init();
$this->AddStrings($ret);
$this->show = 'csv';
$ret = @call_user_func(array(&$this, 'Get' . $this->show));
$ret['navig'] = $this->NavigForm(array('hidden' => array('show' => $this->show)));
return Parse($ret, 'stat/stat.tmpl');
}
示例5: Show
function Show()
{
$this->Init();
$this->AddStrings($ret);
if ($this->show != 'csv') {
$this->show = 'table';
}
$ret = @call_user_func(array(&$this, 'Get' . $this->show));
return Parse($ret, 'stat/stat.tmpl');
}
示例6: Show
function Show()
{
$ret['field_name'] = get('name', '');
$ret['sid'] = 0;
$this->sid = 0;
$this->AddStrings($ret);
$ret['tree'] = $this->GetTree();
$ret['STR_LOADING'] = $this->str('loading');
return Parse($ret, $this->name . '/tree.node_id.tmpl');
}
示例7: OnReadData
function OnReadData($proxies, $idx, $r, $header, $body)
{
//file_put_contents("0_" . $idx . ".html", $body);
//global $proxies;
print_r("OnReadData {$idx} : {$r}\n");
$r = Parse($body);
foreach ($r as $proxy) {
$proxies[] = $proxy;
}
}
示例8: ShowRecycle
function ShowRecycle()
{
global $limit;
$limit = -1;
require_once core('ajax_table');
$columns = sql_getRows('SHOW columns FROM ' . $this->table, 'Field');
$name = isset($columns['name']) ? 'name' : 'address';
$this->AddStrings($row);
$row['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => $name, 'display' => 'name')), 'where' => 'visible<0 and obj_type_id="room"', 'orderby' => 'address', 'params' => array('page' => $this->name, 'do' => 'Show')), $this);
return Parse($row, 'recycle.tmpl');
}
示例9: Show
function Show()
{
$row = array();
$row['analyze']['from'] = sql_getValue("SELECT MIN(time) FROM " . STAT_LOG_TABLE);
$row['analyze']['to'] = sql_getValue("SELECT MAX(time) FROM " . STAT_LOG_TABLE);
$row['process']['from'] = sql_getValue("SELECT MIN(time) FROM " . STAT_TEMP_TABLE);
$row['process']['to'] = sql_getValue("SELECT MAX(time) FROM " . STAT_TEMP_TABLE);
$row['total'] = sql_getValue("SELECT COUNT(*) FROM " . STAT_TEMP_TABLE);
$this->AddStrings($row);
return Parse($row, 'stat/stat_process/stat.process.tmpl');
}
示例10: Show
function Show()
{
$id = (int) get('id');
$ret = array();
$this->AddStrings($ret);
$ret['path'] = $this->GetPath($id);
$ret['tree'] = $this->GetAllTree(array('id' => $id, 'checkboxtree' => true));
$ret['name'] = $this->name;
$ret['fieldname'] = get("fieldname", '', 'gp');
$ret['target_ids'] = get("target_ids", '', 'gp');
return Parse($ret, 'tree/treecheck/treecheck.tmpl');
}
示例11: Show
function Show()
{
$id = (int) get('id');
$ret = array();
$this->AddStrings($ret);
$ret['path'] = $this->GetPath($id);
$ret['treeurl'] = $this->GetAllTree(array('id' => $id, 'treeurl' => true));
$ret['fld'] = $this->getQuoteJqueryString(get('fieldname'));
$ret['name'] = $this->name;
$ret['id'] = $id;
return Parse($ret, 'tree/treeurl/treeurl.tmpl');
}
示例12: scan
function scan()
{
if (system_is_overloaded(basename(__FILE__))) {
apache_admin_mysql(0, "Overloaded system, retry next time....", null, __FILE__, __LINE__);
return;
}
$pidtime = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
$pidFile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
$unix = new unix();
$pid = $unix->get_pid_from_file($pidFile);
if ($unix->process_exists($pid)) {
events("A process, {$pid} Already exists...");
return;
}
$GLOBALS["MYHOSTNAME_PROXY"] = $unix->hostname_g();
@file_put_contents($pidFile, getmypid());
$time = $unix->file_time_min($pidtime);
if (!$GLOBALS["VERBOSE"]) {
if ($time < 5) {
events("{$time}mn, require minimal 5mn");
return;
}
}
$q = new mysql_squid_builder();
$q->QUERY_SQL("CREATE TABLE IF NOT EXISTS `dashboard_apache_sizes` ( `TIME` DATETIME,\n\t\t\t`zmd5` VARCHAR(90) NOT NULL PRIMARY KEY,\n\t\t\t`SITENAME` VARCHAR(128),\n\t\t\t`SIZE` BIGINT UNSIGNED, `RQS` BIGINT UNSIGNED,\n\t\t\tKEY `TIME` (`TIME`),\n\t\t\tKEY `SIZE` (`SIZE`),\n\t\t\tKEY `RQS` (`RQS`)\n\t\t\t) ENGINE=MYISAM;");
if (!$q->ok) {
apache_admin_mysql(0, "Fatal MySQL error", $q->mysql_error, __FILE__, __LINE__);
return;
}
if (!is_file("/home/apache/artica-stats/requests.log")) {
echo "/home/apache/artica-stats/requests.log no such file...\n";
return;
}
@mkdir("/home/apache/artica-stats/works", 0755, true);
if (is_file("/home/apache/artica-stats/works/apache.log")) {
echo "Parse /home/apache/artica-stats/works/apache.log\n";
Parse("/home/apache/artica-stats/works/apache.log");
return;
}
if (!@copy("/home/apache/artica-stats/requests.log", "/home/apache/artica-stats/works/apache.log")) {
echo "Copy failed\n";
return;
}
if (!is_file("/home/apache/artica-stats/works/apache.log")) {
echo "/home/apache/artica-stats/works/apache.log no such file...\n";
return;
}
@unlink("/home/apache/artica-stats/requests.log");
echo "Parse /home/apache/artica-stats/works/apache.log\n";
Parse("/home/apache/artica-stats/works/apache.log");
CLEAN_MYSQL();
}
示例13: Show
function Show()
{
$this->Init();
$this->AddStrings($ret);
if ($this->show != 'diag' && $this->show != 'csv') {
$this->show = 'table';
}
$ret = @call_user_func(array(&$this, 'Get' . $this->show));
/* $ret['navig'] = $this->NavigForm(array(
'hidden' => array('show' => $this->show),
));
if ($this->show == 'table') $ret['show_search'] = 1;*/
return Parse($ret, 'stat/stat.tmpl');
}
示例14: Show
function Show()
{
$this->Init();
$this->AddStrings($ret);
$this->data['before'] = $this->GetStats();
$period = get('period', 'none', 'p');
if ($period == '1d' or $period == '7d' or $period == '1m' or $period == '3m' or $period == '6m' or $period == '1y') {
$ret['message'] = $this->DoClear($period);
}
$ret['navig'] = $this->NavigForm(array('hidden' => array('show' => $this->show)));
$ret['options'] = array('values' => array('1d', '7d', '1m', '3m', '6m', '1y'), 'names' => array($this->str('1d'), $this->str('7d'), $this->str('1m'), $this->str('3m'), $this->str('6m'), $this->str('1y')), 'selected' => $period);
$ret['data'] = $this->data;
return Parse($ret, 'stat/stat_clear/stat.clear.tmpl');
}
示例15: Show
function Show()
{
$this->Init();
$this->AddStrings($ret);
if ($this->show != 'diag' && $this->show != 'csv') {
$this->show = 'table';
}
$ret = @call_user_func(array(&$this, 'Get' . $this->show));
$ret['navig'] = $this->NavigForm(array('hidden' => array('show' => $this->show)));
$ret['site_select'] = $this->selectSite(array('hidden' => array('show' => $this->show)));
$ret['analyze_page'] = 'http://';
if ($this->show == 'table') {
$ret['show_search'] = 1;
}
return Parse($ret, 'stat/stat.tmpl');
}