本文整理汇总了PHP中sys_init函数的典型用法代码示例。如果您正苦于以下问题:PHP sys_init函数的具体用法?PHP sys_init怎么用?PHP sys_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sys_init函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
}
开发者ID:norain2050,项目名称:hkgbf,代码行数:8,代码来源:admin.php
示例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;
}
}
开发者ID:ahmatjan,项目名称:yida,代码行数:15,代码来源:currency_model.php
示例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里的缓存
}
}
开发者ID:ahmatjan,项目名称:yida,代码行数:15,代码来源:cache.php
示例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");
}
开发者ID:ahmatjan,项目名称:yida,代码行数:16,代码来源:www.php
示例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;
}
开发者ID:norain2050,项目名称:hkgbf,代码行数:39,代码来源:format_model.php
示例6: __construct
function __construct()
{
$this->app = sys_init();
}
开发者ID:norain2050,项目名称:hkgbf,代码行数:4,代码来源:email.php
示例7: sys_app
function sys_app($var)
{
$app = sys_init();
return $app->{$var};
}
开发者ID:helloyuanyuan,项目名称:ReferralBonus,代码行数:5,代码来源:index.inc.php
示例8: auto_app
function auto_app()
{
$app = sys_init();
$this->app = $app;
}
开发者ID:ahmatjan,项目名称:yida,代码行数:5,代码来源:upload.php
示例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;
}
开发者ID:norain2050,项目名称:hkgbf,代码行数:38,代码来源:global.func.php
示例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;
}
开发者ID:ahmatjan,项目名称:yida,代码行数:19,代码来源:phpok.sys.php
示例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;
}
开发者ID:ahmatjan,项目名称:yida,代码行数:30,代码来源:phpok_input.php
示例12: cache_clear
function cache_clear()
{
$app = sys_init();
return $app->cache_lib->cache_clear();
}
开发者ID:ahmatjan,项目名称:yida,代码行数:5,代码来源:mysql.php
示例13: __construct
function __construct()
{
$this->app = sys_init();
//执行读取list类
$this->app->load_model("list_model", true);
}
开发者ID:helloyuanyuan,项目名称:ReferralBonus,代码行数:6,代码来源:phpok.php
示例14: format_video_subject
function format_video_subject($val)
{
$app = sys_init();
$app->load_model("msg");
return $app->msg_m->get_one($val);
}
开发者ID:ahmatjan,项目名称:yida,代码行数:6,代码来源:format_model.php
示例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;
}
开发者ID:helloyuanyuan,项目名称:ReferralBonus,代码行数:82,代码来源:page.php
示例16: sys_user_popedom
function sys_user_popedom($chktype = "read")
{
$app = sys_init();
$app->load_model("usergroup");
if ($_SESSION["user_id"]) {
$rs = $_SESSION["group_id"] ? $app->usergroup_m->get_one($_SESSION["group_id"]) : $app->usergroup_m->get_default();
if (!$rs) {
return false;
}
} else {
$rs = $app->usergroup_m->get_guest();
if (!$rs) {
return false;
}
}
//格式化权限
$popedom = "";
if ($chktype == "read") {
$popedom = $rs["popedom_read"];
}
if ($chktype == "post") {
$popedom = $rs["popedom_post"];
}
if ($chktype == "reply") {
$popedom = $rs["popedom_reply"];
}
if (!$popedom) {
return false;
}
if ($popedom == "all") {
return $popedom;
}
//格式化权限
$array = $m = $c = array();
$popedom = sys_id_list($popedom);
foreach ($popedom as $key => $value) {
$tmp = explode(":", $value);
if ($tmp[0] == "m") {
$m[] = $tmp[1];
} else {
$c[] = $tmp[1];
}
}
unset($popedom);
if ((!$m || count($m) < 1) && (!$c || count($c) < 1)) {
return false;
}
$popedom = array();
$popedom["module"] = $m ? $m : false;
$popedom["category"] = $c ? $c : false;
return $popedom;
}
开发者ID:helloyuanyuan,项目名称:ReferralBonus,代码行数:52,代码来源:global.func.php
示例17: sys_rtype
function sys_rtype($type = "")
{
$app = sys_init();
if ($type == "tpl") {
error($app->lang["no_popedom"]);
} elseif ($type == "ajax") {
exit($app->lang["no_popedom"]);
} else {
return false;
}
}
开发者ID:helloyuanyuan,项目名称:ReferralBonus,代码行数:11,代码来源:global.func.php
示例18: phpok_c
function phpok_c($id, $field = "content", $pageid = 1, $is_span = true)
{
if (!$id || !$field) {
return false;
}
$app = sys_init();
$app->load_model("msg");
$content = $app->msg_m->get_c($id, $field);
if (!$content) {
return false;
}
$content = preg_replace("/<div/isU", "<p", $content);
$content = preg_replace("/<\\/div>/isU", "</p>", $content);
//格式化内容
$rslist = explode("[:page:]", $content);
$content_count = count($rslist);
if ($content_count < 2) {
return $content;
}
unset($content);
$html = "<div class='content-page' align='center'>";
$html .= "<table cellpadding='0' cellspacing='0'><tr>";
foreach ($rslist as $key => $value) {
$html .= '<td>';
$html .= '<a href="javascript:phpok_content_page(' . $id . ',\'' . $field . '\',' . ($key + 1) . ');void(0);"';
if ($key + 1 == $pageid) {
$html .= ' class="now"';
}
$html .= '>' . ($key + 1) . "</a>";
$html .= "</td>";
}
$html .= "</tr></table>";
$html .= "</div>";
$keyid = $pageid - 1;
$content = $rslist[$keyid] ? $rslist[$keyid] : $rslist[$content_count - 1];
if ($is_span) {
return "<span id='phpok_c_" . $field . "'>" . $content . $html . "</span>";
} else {
return $content . $html;
}
}
开发者ID:echenxin-company,项目名称:TuoJuHui,代码行数:41,代码来源:phpok.sys.php
示例19: load_plugin
function load_plugin($string, $rs = "", $is_return = false)
{
if (!$string) {
return false;
}
$string = "[" . PLUGIN_NAME . "]" . $string . "[/" . PLUGIN_NAME . "]";
$app = sys_init();
$app->load_model("plugin_model", true);
$rslist = $app->plugin_model->get_all($string);
if (!$rslist) {
return false;
}
$tmplist = array();
$is_html = false;
foreach ($rslist as $key => $value) {
//获取扩展插件
$hooks = str_replace(array("\t", "\r"), "", $value["hooks"]);
$hooks_array = explode("\n", $hooks);
$action = "content";
foreach ($hooks_array as $k => $v) {
$tmp_v = str_replace($string, "", $v);
if ($tmp_v != $v) {
$action = $tmp_v ? $tmp_v : "content";
//break;
}
}
$myplugin = $app->plugin($value["identifier"]);
$methods = get_class_methods($myplugin);
if (!in_array($action, $methods)) {
$action = "content";
}
$mytmp = $myplugin->{$action}($rs);
if (!is_int($mytmp) && !is_bool($mytmp)) {
$is_html = true;
$tmplist[] = $mytmp;
}
}
$content = "";
if (count($tmplist) > 0) {
$content = implode("", $tmplist);
}
if ($is_return) {
return $content;
} else {
$app->tpl->assign("plugin_html", $content);
}
return true;
}
开发者ID:helloyuanyuan,项目名称:ReferralBonus,代码行数:48,代码来源:helper.sys.php
注:本文中的sys_init函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论