本文整理汇总了PHP中sys_init函数的典型用法代码示例。如果您正苦于以下问题:PHP sys_init函数的具体用法?PHP sys_init怎么用?PHP sys_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sys_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: config
function config($rs)
{
$app = sys_init();
if ($rs["ext"]) {
$rs["ext"] = unserialize($rs["ext"]);
}
$app->file_lib->vi($rs, ROOT_PLUGIN . $rs["identifier"] . "/config.php", "config");
}
示例2: get_one
function get_one($currency = "RMB")
{
$app = sys_init();
if ($app->currency->{$currency}) {
return $app->currency->{$currency};
} else {
$sql = "SELECT * FROM " . $app->db->prefix . "currency WHERE code='" . $currency . "'";
$rs = $this->db->get_one($sql);
if (!$rs) {
return false;
}
$app->currency($rs, $currency);
return $rs;
}
}
示例3: load_setting
function load_setting()
{
$this->app = sys_init();
if ($this->app->db->dbcache) {
$this->iscache = true;
}
$this->cache_type = $this->app->db->cache_type;
$this->cache_server = $this->app->db->cache_server;
$this->cache_port = $this->app->db->cache_port;
$this->cache_time = $this->app->db->cache_time;
if ($this->cache_type == "sql") {
$this->app->load_model("cache_model", true);
//加载SQL里的缓存
}
}
示例4: phpok
function phpok()
{
$rs = $this->config["ext"] ? $this->config["ext"] : array();
$width = $rs["width"] ? $rs["width"] : 330;
$height = $rs["height"] ? $rs["height"] : 190;
$phpok = $rs["phpok"] ? $rs["phpok"] : "";
//取得插件扩展配置
$app = sys_init();
$swfurl = "plugins/" . $this->config["identifier"] . "/templates/player.swf";
$xmlfile = rawurlencode($app->url("plugin", "plugin=picplay&phpok=" . $phpok, "&"));
$app->tpl->assign("swfurl", $swfurl);
$app->tpl->assign("xmlfile", $xmlfile);
$app->tpl->assign("width", $width);
$app->tpl->assign("height", $height);
$app->tpl->plugin($this->config["identifier"], "templates/play.html");
}
示例5: format_subject
function format_subject($val)
{
$val = sys_id_string($val, ",", "intval");
if (!$val) {
return false;
}
$app = sys_init();
$sql = "SELECT l.*,c.cate_name,u.filename picture FROM " . $this->db->prefix . "list l LEFT JOIN " . $this->db->prefix . "cate c ON(l.cate_id = c.id) ";
$sql .= " LEFT JOIN " . $this->db->prefix . "upfiles u ON (l.thumb_id=u.id) ";
$sql .= " WHERE l.id IN(" . $val . ")";
$rslist = $this->db->get_all($sql, "id");
if (!$rslist) {
return false;
}
$sql = "SELECT * FROM " . $this->db->prefix . "list_ext WHERE id IN(" . $val . ")";
$tmplist = $this->db->get_all($sql);
if (!$tmplist) {
$tmplist = array();
}
foreach ($tmplist as $key => $value) {
$rslist[$value["id"]][$value["field"]] = $value["val"];
}
unset($tmplist);
$sql = "SELECT * FROM " . $this->db->prefix . "list_c WHERE id IN(" . $val . ")";
$tmp_rs = $this->db->get_all($sql);
if (!$tmp_rs) {
$tmp_rs = array();
}
foreach ($tmp_rs as $key => $value) {
$rslist[$value["id"]][$value["field"]] = $value["val"];
}
unset($tmp_rs);
$list = array();
foreach ($rslist as $key => $value) {
$list[] = $value;
}
unset($rslist);
return $list;
}
示例6: __construct
function __construct()
{
$this->app = sys_init();
}
示例7: sys_app
function sys_app($var)
{
$app = sys_init();
return $app->{$var};
}
示例8: auto_app
function auto_app()
{
$app = sys_init();
$this->app = $app;
}
示例9: sys_search
function sys_search($mid = 0, $cateid = 0, $keywords = "", $ext = "", $tplfile = "", $bgcolor = "")
{
if (is_array($ext)) {
$tmp = array();
foreach ($ext as $key => $value) {
$tmp[] = "ext_keywords[" . $key . "]=" . rawurlencode($value);
}
$ext = implode("&", $tmp);
}
$app = sys_init();
$html = "<script type='text/javascript'>\n";
$html .= "function __" . $mid . "__iFrameHeight() {\n\t";
$html .= "var ifm= document.getElementById('__" . $mid . "__iframepage');\n\t";
$html .= "var subWeb = document.frames ? document.frames['__" . $mid . "__iframepage'].document : ifm.contentDocument;\n\t";
$html .= "if(ifm != null && subWeb != null) {\n\t\t";
$html .= "ifm.height = subWeb.body.scrollHeight + 30;\n\t";
$html .= "}\n}\n</script>\n";
$url_ext = "mid=" . $mid;
if ($cateid) {
$url_ext .= "&cateid=" . $cateid;
}
if ($bgcolor) {
$url_ext .= "&bgcolor=" . rawurlencode($bgcolor);
}
if ($keywords) {
$url_ext .= "&keywords=" . rawurlencode($keywords);
}
if ($tplfile) {
$url_ext .= "&tplfile=" . rawurlencode($tplfile);
}
$url_ext .= "&randtime=" . time() . rand(0, 100);
$iframe_url = $app->url("search,iframe", $url_ext);
if ($ext) {
$iframe_url .= $ext;
}
$html .= "<iframe src='" . $iframe_url . "' id='__" . $mid . "__iframepage' name='__" . $mid . "__iframepage' frameBorder=0 scrolling=no width='100%' onLoad='__" . $mid . "__iFrameHeight()' style='z-index:50'></iframe>";
return $html;
}
示例10: phpok_star
function phpok_star($id)
{
if (!$id) {
return false;
}
$app = sys_init();
$app->load_model("reply");
$rslist = $app->reply_m->getlist_star($id);
$rs = array(0, 1, 2, 3, 4, 5);
$mylist = array();
foreach ($rs as $key => $value) {
if ($rslist[$value]) {
$mylist[$value] = $rslist[$value]["mycount"];
} else {
$mylist[$value] = 0;
}
}
return $mylist;
}
示例11: format_edit_msg
function format_edit_msg($msg)
{
if (!$msg) {
return false;
}
if (function_exists("base_url")) {
$url = base_url();
} else {
$app = sys_init();
if ($app->config["siteurl"]) {
$url = $app->config["siteurl"];
} else {
return false;
}
}
$imgArray = array();
preg_match_all("/src=[\"|'| ]((.*)\\.(gif|jpg|jpeg|bmp|png|swf))/isU", $msg, $imgArray);
$imgArray = array_unique($imgArray[1]);
$count = count($imgArray);
if ($count < 1) {
return $msg;
}
foreach ($imgArray as $key => $value) {
$value = trim($value);
if (strpos($value, "http://") === false && $value) {
$msg = str_replace($value, $url . $value, $msg);
}
}
return $msg;
}
示例12: cache_clear
function cache_clear()
{
$app = sys_init();
return $app->cache_lib->cache_clear();
}
示例13: __construct
function __construct()
{
$this->app = sys_init();
//执行读取list类
$this->app->load_model("list_model", true);
}
示例14: format_video_subject
function format_video_subject($val)
{
$app = sys_init();
$app->load_model("msg");
return $app->msg_m->get_one($val);
}
示例15: page_rewrite
function page_rewrite($url, $total, $ifarray = false, $ifselect = true)
{
if (!$this->lang) {
$this->langs();
}
if (!$total || !$url) {
return false;
}
$app = sys_init();
//$urlend = ".html";
$url = substr($url, 0, -5);
$pageid = $this->pageid;
if ($pageid < 1) {
$pageid = 1;
}
$half_page = $this->half;
#[共有页数]
$total_page = intval($total / $this->psize);
if ($total % $this->psize) {
$total_page++;
#[判断是否存余,如存,则加一
}
#[判断如果分页ID超过总页数时]
if ($pageid > $total_page) {
$pageid = $total_page;
}
#[Html]
$array_m = 0;
if ($pageid > 0) {
$returnlist[$array_m]["url"] = $url . ".html";
$returnlist[$array_m]["name"] = $this->lang["home"];
$returnlist[$array_m]["status"] = 0;
if ($pageid > 1) {
$array_m++;
$returnlist[$array_m]["url"] = $pageid > 2 ? $url . "-" . ($pageid - 1) . ".html" : $url . ".html";
$returnlist[$array_m]["name"] = $this->lang["prev"];
$returnlist[$array_m]["status"] = 0;
}
}
if ($half_page > 0) {
#[添加中间项]
for ($i = $pageid - $half_page, $i > 0 || ($i = 0), $j = $pageid + $half_page, $j < $total_page || ($j = $total_page); $i < $j; $i++) {
$l = $i + 1;
$array_m++;
$returnlist[$array_m]["url"] = $l == 1 ? $url . ".html" : $url . "-" . $l . ".html";
$returnlist[$array_m]["name"] = $l;
$returnlist[$array_m]["status"] = $l == $pageid ? 1 : 0;
}
}
if ($half_page < 1) {
$half_page = 5;
}
#[添加尾项]
if ($pageid < $total_page) {
$array_m++;
$t_pageid = $pageid + 1 > 1 ? $pageid + 1 : "index";
$returnlist[$array_m]["url"] = $pageid + 1 > 1 ? $url . "-" . ($pageid + 1) . ".html" : $url . ".html";
$returnlist[$array_m]["name"] = $this->lang["next"];
$returnlist[$array_m]["status"] = 0;
}
$array_m++;
if ($pageid != $total_page) {
$returnlist[$array_m]["url"] = $url . "-" . $total_page . ".html";
$returnlist[$array_m]["name"] = $this->lang["last"];
$returnlist[$array_m]["status"] = 0;
}
if ($ifarray) {
return $returnlist;
}
#[组织样式]
$msg = "<table class='pagelist' cellpadding='0' cellspacing='1'><tr><td class='n'>" . $this->psize . "/" . $total . "</td>";
foreach ($returnlist as $key => $value) {
if ($value["status"]) {
$msg .= "<td class='m'>" . $value["name"] . "</td>";
} else {
$msg .= "<td class='n'><a href='" . $value["url"] . "'>" . $value["name"] . "</a></td>";
}
}
$msg .= "</tr></table>";
unset($returnlist);
return $msg;
}