本文整理汇总了PHP中getParaInfo函数的典型用法代码示例。如果您正苦于以下问题:PHP getParaInfo函数的具体用法?PHP getParaInfo怎么用?PHP getParaInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getParaInfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build_page
function build_page($method)
{
global $mystep, $req, $db, $tpl, $tpl_info, $setting, $id, $web_id;
$tpl_info['idx'] = "art_info_" . ($method == "list" ? "list" : "input");
$tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
if ($method == "list") {
$condition = array();
if (!empty($web_id)) {
$condition = array("web_id", "n=", $web_id);
}
$db->select($setting['db']['pre'] . "info_show", "*", $condition, array("order" => "id asc"));
$n = 0;
while ($record = $db->GetRS()) {
$n++;
if ($webInfo = getParaInfo("website", "web_id", $record['web_id'])) {
$record['web_id'] = $webInfo['name'];
} else {
$record['web_id'] = "ALL";
}
$tpl_tmp->Set_Loop('record', $record);
}
$tpl_tmp->Set_If('empty', $n == 0);
$tpl_tmp->Set_Variable('title', $setting['language']['admin_art_info_title']);
$tpl_tmp->Set_Variable('web_id', $web_id);
} else {
if ($method == "edit") {
$record = $db->record($setting['db']['pre'] . "info_show", "*", array("id", "n=", $id));
if ($record === false) {
$tpl->Set_Variable('main', showInfo($setting['language']['admin_art_info_error'], 0));
$mystep->show($tpl);
$mystep->pageEnd(false);
}
$web_id = $record['web_id'];
HtmlTrans(&$record);
} else {
$record = array();
$record['id'] = 0;
$record['web_id'] = $web_id;
$record['subject'] = "";
$record['content'] = "";
$record['attach_list'] = "|";
}
$tpl_tmp->Set_Variables($record);
$Max_size = round(GetFileSize(ini_get('upload_max_filesize')) / 1024 / 1024, 2);
$tpl_tmp->Set_Variable('title', $method == 'add' ? $setting['language']['admin_art_info_add'] : $setting['language']['admin_art_info_edit']);
$tpl_tmp->Set_Variable('method', $method);
$tpl_tmp->Set_Variable('MaxSize', $Max_size);
$tpl_tmp->Set_Variable('back_url', $req->getServer("HTTP_REFERER"));
}
$max_count = count($GLOBALS['website']);
for ($i = 0; $i < $max_count; $i++) {
$GLOBALS['website'][$i]['selected'] = $GLOBALS['website'][$i]['web_id'] == $web_id ? "selected" : "";
$tpl_tmp->Set_Loop("website", $GLOBALS['website'][$i]);
}
$db->Free();
$tpl->Set_Variable('main', $tpl_tmp->Get_Content('$db, $setting'));
unset($tpl_tmp);
$mystep->show($tpl);
return;
}
示例2: install
public static function install()
{
global $setting;
$info = self::info();
if ($plugin_info = getParaInfo("plugin", "idx", $info['idx'])) {
showInfo(sprintf($setting['language']['plugin_err_dup'], $info['name']));
}
if ($plugin_info = getParaInfo("plugin", "class", $info['class'])) {
showInfo(sprintf($setting['language']['plugin_err_classname'], $info['name']));
}
global $db, $admin_cat;
$strFind = array("{pre}", "{charset}");
$strReplace = array($setting['db']['pre'], $setting['db']['charset']);
$result = $db->ExeSqlFile(dirname(__FILE__) . "/install.sql", $strFind, $strReplace);
$db->insert($setting['db']['pre'] . 'plugin', array(0, $info['name'], $info['idx'], $info['ver'], "plugin_news_mark", 1, $info['intro'], $info['copyright'], 1, ","));
$db->insert($setting['db']['pre'] . 'admin_cat', array(0, 7, $info['cat_name'], 'news_mark.php', '../plugin/news_mark/', 0, 0, $info['cat_desc']));
deleteCache("admin_cat");
deleteCache("plugin");
$err = array();
if ($db->GetError($err)) {
showInfo($setting['language']['plugin_err_install'] . "\r\n\t\t\t<br />\r\n\t\t\t<pre>\r\n\t\t\t" . join("\n------------------------\n", $err) . "\r\n\t\t\t</pre>\r\n\t\t\t");
} else {
includeCache("admin_cat");
$admin_cat = toJson($admin_cat, $setting['gen']['charset']);
echo <<<mystep
<script language="javascript">
parent.admin_cat = {$admin_cat};
parent.setNav();
</script>
mystep;
buildParaList("plugin");
echo showInfo($setting['language']['plugin_install_done'], false);
}
}
示例3: getMenuContent
public static function getMenuContent($cat_id, $web_id, $deep, $class = "", $all = "")
{
global $news_cat, $cache;
if ($cat_id == 0) {
$cat_id = "";
}
$key = md5("Menu_" . $cat_id . "_" . $web_id . "_" . $deep);
$result = $cache->get($key);
if (!$result) {
$result = "";
$last_idx = -1;
$deep_start = 0;
$deep_max = 0;
$deep_cur = 0;
$catInfo = getParaInfo("news_cat", "cat_id", $cat_id);
if (!$catInfo) {
$catInfo = array("cat_layer" => 1);
}
for ($i = 0, $m = count($news_cat); $i < $m; $i++) {
if (!empty($web_id) && $web_id != $news_cat[$i]['web_id']) {
continue;
}
if (empty($all)) {
if ($deep_start == 0 && $news_cat[$i]['cat_layer'] != $catInfo['cat_layer']) {
continue;
}
if (($news_cat[$i]['cat_show'] & 2) != 2) {
if ($last_idx == -1 || $last_idx == $i - 1) {
$last_idx = $i;
}
continue;
}
if ($deep_start > 0 && ($news_cat[$i]['cat_show'] & 2) == 2 && $last_idx != -1 && $news_cat[$last_idx]['cat_layer'] < $news_cat[$i]['cat_layer']) {
continue;
}
}
$last_idx = -1;
//if(empty($all) && (($news_cat[$i]['cat_show'] & 2)!=2 || ($deep_start==0 && $news_cat[$i]['cat_layer']>$catInfo['cat_layer']))) continue;
if ($deep_start > 0) {
$theLink = $news_cat[$i]['cat_link'];
if (empty($theLink)) {
$theLink = getUrl("list", $news_cat[$i]['cat_idx'], 1, $news_cat[$i]['web_id']);
}
if ($deep_cur == $news_cat[$i]['cat_layer']) {
if ($cat_id != "" && $cat_id != $news_cat[$i]['cat_id'] && $deep_start == $news_cat[$i]['cat_layer']) {
break;
}
$result .= "</li>\n";
$result .= str_repeat("\t", $news_cat[$i]['cat_layer']) . "<li><a href=\"" . $theLink . "\">" . $news_cat[$i]['cat_name'] . "</a>";
} elseif ($deep_cur < $news_cat[$i]['cat_layer']) {
if ($news_cat[$i]['cat_layer'] < $deep_max) {
$result .= "<ul>\n";
$result .= str_repeat("\t", $news_cat[$i]['cat_layer']) . "<li><a href=\"" . $theLink . "\">" . $news_cat[$i]['cat_name'] . "</a>";
$deep_cur = $news_cat[$i]['cat_layer'];
}
} else {
if ($news_cat[$i]['cat_layer'] > $deep_start || $cat_id == "") {
$result .= "</li>\n" . str_repeat("\t", $deep_cur) . "</ul></li>\n";
for ($j = $deep_cur - $news_cat[$i]['cat_layer'] - 1; $j > 0; $j--) {
$result .= str_repeat("\t", $j) . "</ul></li>\n";
}
$result .= str_repeat("\t", $news_cat[$i]['cat_layer']) . "<li><a href=\"" . $theLink . "\">" . $news_cat[$i]['cat_name'] . "</a>";
$deep_cur = $news_cat[$i]['cat_layer'];
} else {
if ($cat_id != "") {
break;
}
}
}
} else {
if ($cat_id == $news_cat[$i]['cat_id'] || $cat_id == "") {
$theLink = $news_cat[$i]['cat_link'];
if (empty($theLink)) {
$theLink = getUrl("list", $news_cat[$i]['cat_idx'], 1, $news_cat[$i]['web_id']);
}
$deep_cur = $news_cat[$i]['cat_layer'];
$deep_start = $news_cat[$i]['cat_layer'];
$deep_max = $deep_start + $deep;
$result .= "<ul class=\"{$class}\">\n";
$result .= str_repeat("\t", $news_cat[$i]['cat_layer']) . "<li><a href=\"" . $theLink . "\">" . $news_cat[$i]['cat_name'] . "</a>";
}
}
}
if (!empty($result)) {
$result .= "</li>\n";
for ($i = $deep_cur - $deep_start; $i > 0; $i--) {
$result .= str_repeat("\t", $i + 1) . "</ul></li>\n";
}
$result .= "</ul>\n";
$cache->set($key, $result, 3600);
}
}
return $result;
}
示例4: switch
}
}
$log_info = "";
switch ($method) {
case "add":
case "edit":
case "list":
build_page($method);
break;
case "delete":
if (!$op_mode) {
$goto_url = $setting['info']['self'];
} else {
$log_info = $setting['language']['admin_web_subweb_delete'];
$web_id = $req->getGet("web_id");
if ($web_info = getParaInfo("website", "web_id", $web_id)) {
$cfg_file = ROOT_PATH . "/include/config_" . $web_info['idx'] . ".php";
include $cfg_file;
if ($setting['db']['name'] != $setting_sub['db']['name']) {
$db->exec("drop", "database", $setting_sub['db']['name']);
} elseif ($setting['db']['pre'] != $setting_sub['db']['pre']) {
$db->exec("drop", "table", $setting_sub['db']['pre'] . "news_show");
$db->exec("drop", "table", $setting_sub['db']['pre'] . "news_detail");
$db->exec("drop", "table", $setting_sub['db']['pre'] . "news_tag");
} else {
$db->update($setting['db']['pre'] . "news_cat", array("web_id" => 1), array("web_id", "n=", $web_id));
$db->update($setting['db']['pre'] . "news_show", array("web_id" => 1), array("web_id", "n=", $web_id));
}
unlink($cfg_file);
$db->delete($setting['db']['pre'] . "website", array("web_id", "n=", $web_id));
deleteCache("website");
示例5: includeCache
<?php
require "inc.php";
includeCache("link");
$method = $req->getGet("method");
if (empty($method)) {
$method = "list";
}
$id = $req->getReq("id");
$idx = $req->getReq("idx");
$log_info = "";
if (!empty($id)) {
$cur_link = getParaInfo("link_txt", "id", $id);
if ($cur_link == false) {
$cur_link = getParaInfo("link_img", "id", $id);
}
if ($cur_link == false || !$op_mode && $web_id != $cur_link['web_id']) {
echo showInfo($setting['language']['admin_func_link_error']);
$mystep->pageEnd(false);
}
}
switch ($method) {
case "add":
case "edit":
case "list":
build_page($method);
break;
case "delete":
$log_info = $setting['language']['admin_func_link_delete'];
$db->delete($setting['db']['pre'] . "links", array("id", "n=", $id));
deleteCache("link");
示例6: getUrl
if ($article = getData($sql, "record")) {
if ($cat_info = getParaInfo("news_cat", "cat_id", $article['cat_id'])) {
$cat_idx = $cat_info['cat_idx'];
} else {
$cat_idx = "";
}
$tpl_tmp->Set_Variable('article_prev_link', getUrl("read", array($article['news_id'], $cat_idx), 1, $setting['info']['web']['web_id']));
$tpl_tmp->Set_Variable('article_prev_text', $article['subject']);
} else {
$tpl_tmp->Set_Variable('article_prev_link', "###");
$tpl_tmp->Set_Variable('article_prev_text', "");
}
//Next Article
$sql = $db->buildSel($setting['db']['pre_sub'] . "news_show", "news_id, cat_id, subject, add_date", array("news_id", "n>", $news_id), array("order" => "news_id asc", "limit" => "1"));
if ($article = getData($sql, "record")) {
if ($cat_info = getParaInfo("news_cat", "cat_id", $article['cat_id'])) {
$cat_idx = $cat_info['cat_idx'];
} else {
$cat_idx = "";
}
$tpl_tmp->Set_Variable('article_next_link', getUrl("read", array($article['news_id'], $cat_idx), 1, $setting['info']['web']['web_id']));
$tpl_tmp->Set_Variable('article_next_text', $article['subject']);
} else {
$tpl_tmp->Set_Variable('article_next_link', "###");
$tpl_tmp->Set_Variable('article_next_text', "");
}
//News Tag
$tag = explode(",", $detail['tag']);
$max_count = count($tag);
for ($i = 0; $i < $max_count; $i++) {
if ($setting['rewrite']['enable']) {
示例7: build_page
//.........这里部分代码省略.........
$tpl_tmp->Set_Variable('order_type_org', $order_type);
$order_type = $order_type == "asc" ? "desc" : "asc";
$tpl_tmp->Set_Variable('order_type', $order_type);
$tpl_tmp->Set_Variable('keyword', $keyword);
} elseif ($method == "edit_data") {
global $para, $record;
$keyword = mysql_real_escape_string($req->getGet("keyword"));
$record = $db->record($setting['db']['pre'] . "custom_form_" . $mid, "*", array("id", "n=", $id));
if ($record === false || !file_exists("setting/{$mid}.php")) {
$tpl->Set_Variable('main', showInfo("指定的记录不存在或配置文件缺失!", 0));
$mystep->show($tpl);
$mystep->pageEnd(false);
}
HtmlTrans(&$record);
if (function_exists("ext_func")) {
ext_func();
}
$tpl_tmp->Set_Variables($record, "record");
$tpl_tmp->Set_Variable('custom_form_name', $db->result($setting['db']['pre'] . "custom_form", "name", array("mid", "n=", $mid)));
$tpl_tmp->Set_Variable('title', '表单信息更新');
$tpl_tmp->Set_Variable('method', 'edit_data');
$tpl_tmp->Set_Variable('keyword', $keyword);
include "setting/{$mid}.php";
$tpl_tmp->allow_script = true;
} elseif ($method == "list") {
$db->select($setting['db']['pre'] . "custom_form", "*", "", array("order" => "mid desc"));
while ($record = $db->GetRS()) {
HtmlTrans(&$record);
if ($record['web_id'] == 0) {
$record['web_id'] = "仅管理面板";
} elseif ($record['web_id'] == 255) {
$record['web_id'] = "全部子站";
} else {
$webinfo = getParaInfo("website", "web_id", $record['web_id']);
$record['web_id'] = $webinfo['name'];
}
$record['link_submit'] = getUrl("cf_submit", $record['mid']);
$record['link_list'] = getUrl("cf_list", $record['mid']);
$tpl_tmp->Set_Loop('record', $record);
}
$tpl_tmp->Set_Variable('title', '表单浏览');
$tpl_tmp->Set_Variable('order_type_org', $order_type);
$order_type = $order_type == "asc" ? "desc" : "asc";
$tpl_tmp->Set_Variable('order_type', $order_type);
global $admin_cat;
$tpl_tmp->Set_Variable('admin_cat', toJson($admin_cat, $setting['gen']['charset']));
} elseif ($method == "edit") {
$record = $db->record($setting['db']['pre'] . "custom_form", "*", array("mid", "n=", $mid));
if ($record === false) {
$tpl->Set_Variable('main', showInfo("指定的记录不存在!", 0));
$mystep->show($tpl);
$mystep->pageEnd(false);
}
if (function_exists("ext_func")) {
ext_func();
}
$tpl_tmp->Set_Variables($record);
$tpl_tmp->Set_Variable('title', '修改表单项目');
$tpl_tmp->Set_Variable('method', 'edit');
$max_count = count($GLOBALS['website']);
for ($i = 0; $i < $max_count; $i++) {
$tpl_tmp->Set_Loop("website", $GLOBALS['website'][$i]);
}
include "setting/{$mid}.php";
$tpl_tmp->Set_Variable('cf_item', toJson($para, $setting['gen']['charset']));
$tpl_tmp->Set_Variable('tpl_cf_submit_cn', htmlspecialchars(GetFile("setting/{$mid}_cf_submit_cn.tpl")));
示例8: getParaInfo
$setting['gen']['minify'] = false;
$usergroup = $req->getSession("usergroup");
if ($usergroup === 0) {
$goto_url = $setting['web']['url'];
//debug("usergroup",$goto_url);
$mystep->pageEnd(false);
}
$group = getParaInfo("user_group", "group_id", $usergroup);
if (empty($group['power_func'])) {
$goto_url = "/" . $setting['path']['admin'] . "login.php";
//debug("power_func",$goto_url);
$req->setCookie("referer", $req->getServer("REQUEST_URI"), 1000);
$mystep->pageEnd(false);
}
$op_mode = $setting['info']['web']['web_id'] == 1 && ($group['power_func'] == "all" || strpos("," . $group['power_func'] . ",", ",1,") !== false);
includeCache("admin_cat");
$cat_info = getParaInfo("admin_cat_plat", "file", $setting['info']['self'], true);
$plugin_info = getParaInfo("plugin", "idx", basename($cat_info["path"]));
if ($plugin_info['active'] == 0) {
$cat_info = false;
}
if (!$op_mode) {
$admin_cat = $admin_cat_plat;
}
if ($cat_info === false && !checkSign(8) || $group['power_func'] != "all" && strpos("," . $group['power_func'] . ",", "," . $cat_info['id'] . ",") === false) {
echo showInfo($setting['language']['login_nopower'], false);
$mystep->pageEnd(false);
}
if (!$op_mode) {
$web_id = $setting['info']['web']['web_id'];
}
示例9: build_page
function build_page($method)
{
global $mystep, $req, $db, $setting, $id;
$tpl_info = array("idx" => $method == "list" ? "list" : "input", "style" => "../plugin/" . basename(realpath(dirname(__FILE__))) . "/tpl/", "path" => ROOT_PATH . "/" . $setting['path']['template']);
$tpl = $mystep->getInstance("MyTpl", $tpl_info);
if ($method == "list") {
$max_count = count($GLOBALS['admin_cat']);
for ($i = 0; $i < $max_count; $i++) {
switch ($GLOBALS['admin_cat'][$i]['web_id']) {
case "0":
$GLOBALS['admin_cat'][$i]['web_id'] = $setting['language']['plugin_admin_cat_panle'];
break;
case "255":
$GLOBALS['admin_cat'][$i]['web_id'] = $setting['language']['plugin_admin_cat_allsub'];
break;
default:
$webInfo = getParaInfo("website", "web_id", $GLOBALS['admin_cat'][$i]['web_id']);
$GLOBALS['admin_cat'][$i]['web_id'] = $webInfo['name'];
break;
}
$tpl->Set_Loop('record', $GLOBALS['admin_cat'][$i]);
$max_count2 = count($GLOBALS['admin_cat'][$i]['sub']);
for ($j = 0; $j < $max_count2; $j++) {
switch ($GLOBALS['admin_cat'][$i]['sub'][$j]['web_id']) {
case "0":
$GLOBALS['admin_cat'][$i]['sub'][$j]['web_id'] = $setting['language']['plugin_admin_cat_panle'];
break;
case "255":
$GLOBALS['admin_cat'][$i]['sub'][$j]['web_id'] = $setting['language']['plugin_admin_cat_allsub'];
break;
default:
$GLOBALS['admin_cat'][$i]['sub'][$j]['web_id'] = getParaInfo("website", "web_id", $GLOBALS['admin_cat'][$i]['sub'][$j]['web_id']);
$GLOBALS['admin_cat'][$i]['sub'][$j]['web_id'] = $GLOBALS['admin_cat'][$i]['sub'][$j]['web_id']['name'];
break;
}
$GLOBALS['admin_cat'][$i]['sub'][$j]['name'] = " " . $GLOBALS['admin_cat'][$i]['sub'][$j]['name'];
$tpl->Set_Loop('record', $GLOBALS['admin_cat'][$i]['sub'][$j]);
}
}
$tpl->Set_Variable('title', $setting['language']['plugin_admin_cat_title']);
} else {
if ($method == "edit") {
$record = $db->record($setting['db']['pre'] . "admin_cat", "*", array("id", "n=", $id));
if ($record === false) {
$tpl->Set_Variable('main', showInfo($setting['language']['plugin_admin_cat_error'], 0));
$mystep->show($tpl);
$mystep->pageEnd(false);
}
$web_id = $record['web_id'];
HtmlTrans(&$record);
} else {
$record = array();
$record['id'] = 0;
$record['pid'] = 0;
$record['name'] = "";
$record['file'] = "";
$record['path'] = "";
$record['web_id'] = "0";
$record['order'] = "0";
$record['comment'] = "";
}
$tpl->Set_Variables($record);
$tpl->Set_Variable('title', $method == 'add' ? $setting['language']['plugin_admin_cat_add'] : $setting['language']['plugin_admin_cat_edit']);
$tpl->Set_Variable('method', $method);
$tpl->Set_Variable('back_url', $req->getServer("HTTP_REFERER"));
$max_count = count($GLOBALS['website']);
for ($i = 0; $i < $max_count; $i++) {
$tpl->Set_Loop("website", $GLOBALS['website'][$i]);
}
$max_count = count($GLOBALS['admin_cat']);
for ($i = 0; $i < $max_count; $i++) {
$tpl->Set_Loop("cat", array("id" => $GLOBALS['admin_cat'][$i]['id'], "name" => $GLOBALS['admin_cat'][$i]['name'], "selected" => $GLOBALS['admin_cat'][$i]['id'] == $record['pid'] ? "selected" : ""));
}
}
$tpl->Set_Variable('path_admin', $setting['path']['admin']);
$db->Free();
$mystep->show($tpl);
return;
}
示例10: build_page
function build_page($method)
{
global $mystep, $req, $db, $tpl, $user_id, $user_group, $user_type, $tpl_info, $setting;
$tpl_info['idx'] = "user_" . ($method == "list" ? "list" : "input");
$tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
if ($method == "list") {
//navigation
$order = $req->getGet("order");
$tpl_tmp->Set_Variable('order', $order);
$order_type = $req->getGet("order_type");
if (empty($order_type)) {
$order_type = "desc";
}
$keyword = $req->getGet("keyword");
$group_id = $req->getGet("group_id");
$type_id = $req->getGet("type_id");
$condition = array();
if (!empty($keyword)) {
$condition[] = array("username", "like", $keyword);
}
if (!empty($group_id)) {
$condition[] = array("group_id", "n=", $group_id);
}
if (!empty($type_id)) {
$condition[] = array("type_id", "n=", $type_id);
}
$counter = $db->result($setting['db']['pre'] . "users", "count(*)", $condition);
$page = $req->getGet("page");
list($page_arr, $page_start, $page_size) = GetPageList($counter, "?keyword={$keyword}&group_id={$group_id}&type_id={$type_id}&order={$order}&order_type={$order_type}", $page);
$tpl_tmp->Set_Variables($page_arr);
if (empty($order)) {
$order = "user_id";
}
$the_order = array();
$the_order[] = "{$order} {$order_type}";
if ($order != "user_id") {
$the_order[] = "user_id desc";
}
$db->select($setting['db']['pre'] . "users", "*", $condition, array("order" => $the_order, "limit" => "{$page_start}, {$page_size}"));
$tpl_tmp->para_list['record'] = array();
while ($record = $db->GetRS()) {
HtmlTrans(&$record);
$record['regdate'] = date("Y-m-d H:i:s", $record['regdate']);
$type_info = getParaInfo("user_type", "type_id", $record['type_id']);
$record['group_name'] = $type_info['type_name'];
if ($group_info = getParaInfo("user_group", "group_id", $record['group_id'])) {
$record['group_name'] .= " ги" . $group_info['group_name'] . "гй";
}
$tpl_tmp->Set_Loop('record', $record);
}
$tpl_tmp->Set_Variable('title', $setting['language']['admin_user_detail_title']);
$tpl_tmp->Set_Variable('order_type_org', $order_type);
if ($order_type == "asc") {
$order_type = "desc";
} else {
$order_type = "asc";
}
$tpl_tmp->Set_Variable('order_type', $order_type);
$tpl_tmp->Set_Variable('group_id', $group_id);
$tpl_tmp->Set_Variable('type_id', $type_id);
$tpl_tmp->Set_Variable('keyword', $keyword);
} elseif ($method == "edit") {
$tpl_tmp->Set_Variable('title', $setting['language']['admin_user_detail_edit']);
$record = $db->record($setting['db']['pre'] . "users", "*", array("user_id", "n=", $user_id));
if ($record !== false) {
$tpl->Set_Variable('main', showInfo($setting['language']['admin_user_detail_error'], 0));
$mystep->show($tpl);
$mystep->pageEnd(false);
}
$group_id = $record['group_id'];
$type_id = $record['type_id'];
$tpl_tmp->Set_Variables($record);
$tpl_tmp->Set_Variable('back_url', $req->getServer("HTTP_REFERER"));
} else {
$tpl_tmp->Set_Variable('title', $setting['language']['admin_user_detail_add']);
$group_id = 0;
$type_id = 1;
$record['user_id'] = 0;
$record['username'] = "";
$record['email'] = "";
$tpl_tmp->Set_Variables($record);
}
$max_count = count($user_group);
for ($i = 0; $i < $max_count; $i++) {
$user_group[$i]["selected"] = $user_group[$i]['group_id'] == $group_id ? "selected" : "";
$tpl_tmp->Set_Loop('user_group', $user_group[$i]);
}
$max_count = count($user_type);
for ($i = 0; $i < $max_count; $i++) {
$user_type[$i]["selected"] = $user_type[$i]['type_id'] == $type_id ? "selected" : "";
$tpl_tmp->Set_Loop('user_type', $user_type[$i]);
}
$tpl_tmp->Set_Variable('back_url', $req->getServer("HTTP_REFERER"));
$tpl_tmp->Set_Variable('method', $method);
$tpl->Set_Variable('main', $tpl_tmp->Get_Content('$db, $setting'));
unset($tpl_tmp);
$db->Free();
$mystep->show($tpl);
return;
}
示例11: array
$news_detail = array();
$news_detail['id'] = 0;
$news_detail['news_id'] = 0;
$news_detail['cat_id'] = 0;
$news_detail['page'] = 1;
$news_detail['sub_title'] = "";
$news_detail['content'] = "";
$idx = $req->getReq("idx");
$para = array();
for ($i = 0, $m = count($rules); $i < $m; $i++) {
if ($rules[$i]['idx'] == $idx) {
$para = $rules[$i]['para'];
break;
}
}
if (isset($para['web_id']) && ($web_info = getParaInfo("website", "web_id", $para['web_id']))) {
include ROOT_PATH . "/include/config_" . $web_info['idx'] . ".php";
} else {
include ROOT_PATH . "/include/config_main.php";
}
$setting_sub['db']['pre'] = $setting_sub['db']['name'] . "." . $setting_sub['db']['pre'];
require "rule/" . $idx . "_import.php";
if (!empty($id)) {
if ($record = $db->record($setting['db']['pre'] . "news_snatch", "*", array("id", "n=", $id))) {
importData($record, $para);
$db->delete($setting['db']['pre'] . "news_snatch", array("id", "n=", $id));
}
$goto_url = $setting['info']['self'] . "?method=news";
} else {
$id_list = array();
$db->select($setting['db']['pre'] . "news_snatch", "id", array("idx", "=", $idx), array("order" => "add_date asc, id asc"));
示例12: array
$condition[] = array("web_id", "n=", $web_id);
if (!empty($keyword)) {
$condition[] = array("subject", "like", $keyword, "and");
}
$counter = $db->result($setting['db']['pre'] . "news_visit", "count(*)", $condition);
list($page_arr, $page_start, $page_size) = GetPageList($counter, "?keyword={$keyword}&order={$order}&order_type={$order_type}", $page);
$tpl->Set_Variables($page_arr);
if (empty($order)) {
$order = "news_id";
}
$db->select($setting['db']['pre'] . "news_visit", "*", $condition, array("order" => "{$order} {$order_type}", "limit" => "{$page_start}, {$page_size}"));
while ($record = $db->GetRS()) {
HtmlTrans(&$record);
$record['day_start'] = date("Y-m-d", $record['day_start']);
$record['link'] = getUrl("read", array($record['news_id'], $record['cat_id']), 1, $record['web_id']);
$catInfo = getParaInfo("news_cat", "cat_id", $record['cat_id']);
$record['cat_id'] = $catInfo['cat_name'];
$tpl->Set_Loop('record', $record);
}
$db->Free();
$tpl->Set_Variable('order_type_org', $order_type);
if ($order_type == "desc") {
$order_type = "asc";
} else {
$order_type = "desc";
}
$tpl->Set_Variable('order', $order);
$tpl->Set_Variable('order_type', $order_type);
$tpl->Set_Variable('path_admin', $setting['path']['admin']);
$tpl->Set_Variable('title', $info['name']);
$tpl->Set_Variable('web_id', $web_id);
示例13: strtolower
<?php
$ms_sign = 1;
require "inc.php";
$cat_idx = strtolower($req->getGet("cat"));
if ($cat_info = getParaInfo("news_cat", "cat_idx", $cat_idx)) {
$web_info = getSubSetting($cat_info['web_id']);
} else {
$cat_idx = "";
$web_info = getSubSetting($setting['info']['web']['web_id']);
}
$tpl_info['idx'] = "rss";
if ($setting['gen']['cache']) {
$cache_info = array('idx' => "rss_" . $web_info["info"]["web_id"] . (empty($cat_idx) ? "" : "_{$cat_info[cat_id]}"), 'path' => $cache_path . "/rss/", 'expire' => getCacheExpire());
} else {
$cache_info = false;
}
$tpl = $mystep->getInstance("MyTpl", $tpl_info, $cache_info);
if ($tpl->Is_Cached()) {
echo $tpl->Get_Content();
$mystep->pageEnd(false);
}
if (empty($cat_idx)) {
$cat_txt = $setting['language']['page_all_news'];
} else {
$cat_txt = $cat_info['cat_name'];
$setting['web']['description'] .= ", " . $cat_info['cat_comment'];
}
$cat_txt .= sprintf($setting['language']['page_update_lastest'], $setting['list']['rss']);
$charset_tag = '<?xml version="1.0" encoding="' . $setting['gen']['charset'] . '"?>' . "\n";
$tpl->Set_Variable('charset_tag', $charset_tag);
示例14: getUrl
$sub_list = $cat_info['cat_sub'];
}
$menu_cat_id = $cat_id;
if (isset($cat_info['cat_type'])) {
if ($cat_info['cat_type'] == 3) {
$tpl_info['idx'] = "list_cat_" . $cat_id;
} else {
$tpl_info['idx'] = "list_" . $cat_info['cat_type'];
}
} else {
$tpl_info['idx'] = "list";
}
$cat_main_link = "";
if ($cat_main > 0) {
$menu_cat_id = $cat_main;
if ($cat_info = getParaInfo("news_cat_sub", "cat_id", $cat_main)) {
$cat_main_link = '<a href="' . getUrl("list", $cat_info['cat_idx'], 1, $cat_info['web_id']) . '">' . $cat_info['cat_name'] . '</a>';
}
}
$condition = array();
if ($cat_id == 0) {
$condition[] = array("b.cat_main", "n=", 0);
} else {
$condition[] = array(array("a.cat_id", "n=", $cat_id), array("b.cat_main", "n=", $cat_id, "or"));
}
$condition_ext = "";
if (!empty($prefix)) {
$prefix = htmlspecialchars($prefix);
$condition[] = array("subject", "like", "[" . $prefix . "]%", "and");
$condition_ext = $db->buildCondition(array("subject", "like", "[" . $prefix . "]%"));
}
示例15: build_page
function build_page($method)
{
global $mystep, $req, $tpl, $tpl_info, $plugin, $setting, $idx, $plugin_path, $website;
$tpl_info['idx'] = "web_plugin_" . $method;
$tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
$tpl_tmp->allow_script = true;
if ($method == "list") {
if ($plugin_info = json_decode(GetRemoteContent($setting['gen']['update'] . "/plugin.php?l=" . $setting['gen']['language']))) {
foreach ($plugin_info as $key => $value) {
$update_info[$key] = array();
$update_info[$key]['idx'] = $key;
$update_info[$key]['name'] = getString($value->name);
$update_info[$key]['ver'] = $value->ver;
$update_info[$key]['intro'] = getString($value->intro);
}
unset($plugin_info);
} else {
$update_info = array();
}
$fso = $mystep->getInstance("MyFSO");
$plugin_list = $fso->Get_List($plugin_path);
$max_count = count($plugin_list['dir']);
$n = 0;
for ($i = 0; $i < $max_count; $i++) {
if (is_file($plugin_list['dir'][$i] . "/info.php")) {
$info = array();
include $plugin_list['dir'][$i] . "/info.php";
$update_info_hash = array();
if (isset($info['update_url'])) {
if (isset($update_info_hash[md5($info['update_url'])])) {
$plugin_info_remote = $update_info_hash[md5($info['update_url'])];
} else {
if ($plugin_info_remote = json_decode(GetRemoteContent($info['update_url'] . "/plugin.php?l=" . $setting['gen']['language']))) {
$update_info_hash[md5($info['update_url'])] = $plugin_info_remote;
} else {
$plugin_info_remote = new stdClass();
}
}
if (isset($plugin_info_remote->{$info}['idx'])) {
$update_info[$info['idx']] = array();
$update_info[$info['idx']]['idx'] = $info['idx'];
$update_info[$info['idx']]['name'] = getString($plugin_info_remote->{$info}['idx']->name);
$update_info[$info['idx']]['ver'] = $plugin_info_remote->{$info}['idx']->ver;
$update_info[$info['idx']]['intro'] = getString($plugin_info_remote->{$info}['idx']->intro);
}
}
if (isset($update_info[$info['idx']]) && $info['ver'] < $update_info[$info['idx']]['ver']) {
$info['ver_new'] = $update_info[$info['idx']]['ver'];
$info['update'] = "";
} else {
$info['ver_new'] = "";
$info['update'] = "none";
}
if ($plugin_info = getParaInfo("plugin", "idx", $info['idx'])) {
$info['order'] = $plugin_info['order'];
$info['active'] = $plugin_info['active'] ? $setting['language']['close'] : $setting['language']['open'];
$tpl_tmp->Set_Loop("plugin_list_1", $info);
} else {
$n++;
$tpl_tmp->Set_Loop("plugin_list_2", $info);
}
unset($update_info[$info['idx']]);
}
}
foreach ($update_info as $key => $value) {
$tpl_tmp->Set_Loop("plugin_list_3", $value);
}
$tpl_tmp->Set_If('empty_2', $n == 0);
$tpl_tmp->Set_If('empty_3', count($update_info) == 0);
$tpl_tmp->Set_Variable('self', $setting['info']['self']);
$tpl_tmp->Set_Variable('title', $setting['language']['admin_web_plugin_title']);
global $db;
$db->select($setting['db']['pre'] . "admin_cat", "file, count(*) as counter", array("file", "!=", "###"), array("group" => "file", "having" => array("counter", "n>", 1)));
$dp_list = "";
while ($cur = $db->getRS()) {
$dp_list .= $cur['file'] . " (" . $cur['counter'] . ")\\n";
}
$tpl_tmp->Set_Variable('dp_list', $dp_list);
} elseif ($method == "setting") {
$tpl_tmp->Set_Variable('title', $setting['language']['admin_web_plugin_setup']);
$plugin_info = getParaInfo("plugin", "idx", $idx);
include $plugin_path . $idx . "/info.php";
if ($plugin_info === false) {
$tpl->Set_Variable('main', showInfo($setting['language']['admin_web_plugin_err'], 0));
$mystep->show($tpl);
$mystep->pageEnd(false);
}
$max_count = count($website);
for ($i = 0; $i < $max_count; $i++) {
$tpl_tmp->Set_Loop('subweb', array("web_id" => $website[$i]['web_id'], "name" => $website[$i]['name'], "checked" => strpos($plugin_info['subweb'], "," . $website[$i]['web_id'] . ",") !== false ? "checked" : ""));
}
$info['description'] = nl2br($info['description']);
$tpl_tmp->Set_Variable('idx', $plugin_info['idx']);
$tpl_tmp->Set_Variable('name', $plugin_info['name']);
$tpl_tmp->Set_Variable('subweb', $plugin_info['subweb']);
$tpl_tmp->Set_Variable('description', $info['description']);
$tpl_tmp->Set_Variable('back_url', $req->getServer("HTTP_REFERER"));
} elseif ($method == "upload") {
global $script;
$tpl_tmp->Set_Variable('script', $script);
//.........这里部分代码省略.........