• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP iPHP类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中iPHP的典型用法代码示例。如果您正苦于以下问题:PHP iPHP类的具体用法?PHP iPHP怎么用?PHP iPHP使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了iPHP类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: favorite_data

function favorite_data($vars = null)
{
    $maxperpage = isset($vars['row']) ? (int) $vars['row'] : "10";
    $where_sql = "WHERE 1=1 ";
    isset($vars['userid']) && ($where_sql .= " AND `uid`='" . (int) $vars['userid'] . "' ");
    $vars['fid'] && ($where_sql .= " AND `fid`='" . (int) $vars['fid'] . "' ");
    isset($vars['appid']) && ($where_sql .= " AND `appid`='" . (int) $vars['appid'] . "' ");
    $cache_time = isset($vars['time']) ? (int) $vars['time'] : -1;
    $by = $vars['by'] == "ASC" ? "ASC" : "DESC";
    switch ($vars['orderby']) {
        default:
            $order_sql = " ORDER BY `id` {$by}";
    }
    $md5 = md5($where_sql . $order_sql);
    $offset = 0;
    if ($vars['page']) {
        $total = iPHP::total($md5, "SELECT count(*) FROM `#iCMS@__favorite_data` {$where_sql} ");
        iPHP::assign("fav_data_total", $total);
        $multi = iCMS::page(array('total' => $total, 'perpage' => $maxperpage, 'unit' => iPHP::lang('iCMS:page:list'), 'nowindex' => $GLOBALS['page']));
        $offset = $multi->offset;
    }
    if ($vars['cache']) {
        $cache_name = 'favorite_data/' . $md5 . "/" . (int) $GLOBALS['page'];
        $resource = iCache::get($cache_name);
    }
    if (empty($resource)) {
        $resource = iDB::all("SELECT * FROM `#iCMS@__favorite_data` {$where_sql} {$order_sql} LIMIT {$offset},{$maxperpage}");
        iPHP_SQL_DEBUG && iDB::debug(1);
        // $resource = array();
        // if($rs)foreach ($rs as $key => $value) {
        // }
        $vars['cache'] && iCache::set($cache_name, $resource, $cache_time);
    }
    return $resource;
}
开发者ID:sunhk25,项目名称:iCMS,代码行数:35,代码来源:favorite.func.php


示例2: do_check

 function do_check()
 {
     if (empty($this->patch)) {
         if ($_GET['ajax']) {
             iPHP::json(array('code' => 0));
         } else {
             iPHP::success("您使用的 iCMS 版本,目前是最新版本<hr />当前版本:iCMS " . iCMS_VER . " [" . iCMS_RELEASE . "]", 0, "5");
         }
     } else {
         switch (iCMS::$config['system']['patch']) {
             case "1":
                 //自动下载,安装时询问
                 $this->msg = iPatch::download($this->patch[1]);
                 $json = array('code' => "1", 'url' => __ADMINCP__ . '=patch&do=install', 'msg' => "发现iCMS最新版本<br /><span class='label label-warning'>iCMS " . $this->patch[0] . " [" . $this->patch[1] . "]</span><br />" . $this->patch[3] . "<hr />您当前使用的版本<br /><span class='label label-info'>iCMS " . iCMS_VER . " [" . iCMS_RELEASE . "]</span><br /><br />新版本已经下载完成!! 是否现在更新?");
                 break;
             case "2":
                 //不自动下载更新,有更新时提示
                 $json = array('code' => "2", 'url' => __ADMINCP__ . '=patch&do=update', 'msg' => "发现iCMS最新版本<br /><span class='label label-warning'>iCMS " . $this->patch[0] . " [" . $this->patch[1] . "]</span><br />" . $this->patch[3] . "<hr />您当前使用的版本<br /><span class='label label-info'>iCMS " . iCMS_VER . " [" . iCMS_RELEASE . "]</span><br /><br />请马上更新您的iCMS!!!");
                 break;
         }
         if ($_GET['ajax']) {
             iPHP::json($json, true);
         }
         $moreBtn = array(array("text" => "马上更新", "url" => $json['url']), array("text" => "以后在说", "js" => 'return true'));
         iPHP::dialog('success:#:check:#:' . $json['msg'], 0, 30, $moreBtn);
     }
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:27,代码来源:patch.app.php


示例3: value

 public function value($tag)
 {
     $categoryApp = iPHP::app("category");
     if ($tag['cid']) {
         $category = $categoryApp->category($tag['cid'], false);
         $tag['category'] = $categoryApp->get_lite($category);
     }
     if ($tag['tcid']) {
         $tag_category = $categoryApp->category($tag['tcid'], false);
         $tag['tag_category'] = $categoryApp->get_lite($tag_category);
     }
     $tag['iurl'] = iURL::get('tag', array($tag, $category, $tag_category));
     $tag['url'] or $tag['url'] = $tag['iurl']->href;
     $tag['link'] = '<a href="' . $tag['url'] . '" class="tag" target="_blank">' . $tag['name'] . '</a>';
     if ($category['mode'] && stripos($tag['url'], '.php?') === false) {
         iCMS::set_html_url($tag['iurl']);
     }
     $tag['metadata'] && ($tag['meta'] = json_decode($tag['metadata']));
     $tag['related'] && ($tag['relArray'] = explode(',', $tag['related']));
     $tag['appid'] = iCMS_APP_TAG;
     $tag['pic'] = get_pic($tag['pic']);
     $tag['bpic'] = get_pic($tag['bpic']);
     $tag['mpic'] = get_pic($tag['mpic']);
     $tag['spic'] = get_pic($tag['spic']);
     return $tag;
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:26,代码来源:tag.app.php


示例4: iCMS_lang

/**
 * @package iCMS
 * @copyright 2007-2010, iDreamSoft
 * @license http://www.idreamsoft.com iDreamSoft
 * @author coolmoo <[email protected]>
 * @$Id: iCMS.push.php 148 2013-03-14 16:15:12Z coolmoo $
 */
function iCMS_lang($vars)
{
    if (empty($vars['key'])) {
        return;
    }
    echo iPHP::lang($vars['key']);
}
开发者ID:sunhk25,项目名称:iCMS,代码行数:14,代码来源:iCMS.lang.php


示例5: cleancookie

 public function cleancookie()
 {
     iPHP::set_cookie('WB_ACCESS_TOKEN', '', -31536000);
     iPHP::set_cookie('WB_REFRESH_TOKEN', '', -31536000);
     iPHP::set_cookie('WB_OPENID', '', -31536000);
     iPHP::set_cookie('WB_STATE', '', -31536000);
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:7,代码来源:WB.class.php


示例6: public_qrcode

function public_qrcode($vars = null)
{
    $data = $vars['data'];
    $query = array('app' => 'public', 'do' => 'qrcode', 'url' => $data);
    isset($vars['cache']) && ($query['cache'] = true);
    $url = iPHP::router('/api', iCMS_REWRITE);
    echo buildurl($url, $query);
}
开发者ID:World3D,项目名称:iCMS,代码行数:8,代码来源:public.func.php


示例7: push_list

/**
 * @package iCMS
 * @copyright 2007-2010, iDreamSoft
 * @license http://www.idreamsoft.com iDreamSoft
 * @author coolmoo <[email protected]>
 * @$Id: push.tpl.php 1392 2013-05-20 12:28:08Z coolmoo $
 */
function push_list($vars)
{
    $maxperpage = isset($vars['row']) ? (int) $vars['row'] : "100";
    $cache_time = isset($vars['time']) ? (int) $vars['time'] : "-1";
    $where_sql = "WHERE `status`='1'";
    isset($vars['userid']) && ($where_sql .= " AND `userid`='{$vars['userid']}'");
    if (isset($vars['cid!'])) {
        $ncids = explode(',', $vars['cid!']);
        $vars['sub'] && ($ncids += iCMS::get_category_ids($ncids, true));
        $where_sql .= iPHP::where($ncids, 'cid', 'not');
    }
    if (isset($vars['cid'])) {
        $cid = explode(',', $vars['cid']);
        $vars['sub'] && ($cid += iCMS::get_category_ids($cid, true));
        $where_sql .= iPHP::where($cid, 'cid');
    }
    isset($vars['pid']) && ($where_sql .= " AND `type` ='{$vars['pid']}'");
    isset($vars['pic']) && ($where_sql .= " AND `haspic`='1'");
    isset($vars['nopic']) && ($where_sql .= " AND `haspic`='0'");
    isset($vars['startdate']) && ($where_sql .= " AND `addtime`>='" . strtotime($vars['startdate']) . "'");
    isset($vars['enddate']) && ($where_sql .= " AND `addtime`<='" . strtotime($vars['enddate']) . "'");
    $by = $vars['by'] == "ASC" ? "ASC" : "DESC";
    switch ($vars['orderby']) {
        case "id":
            $order_sql = " ORDER BY `id` {$by}";
            break;
        case "addtime":
            $order_sql = " ORDER BY `addtime` {$by}";
            break;
        case "disorder":
            $order_sql = " ORDER BY `ordernum` {$by}";
            break;
        default:
            $order_sql = " ORDER BY `id` DESC";
    }
    if ($vars['cache']) {
        $cache_name = iPHP_DEVICE . '/push/' . md5($where_sql);
        $resource = iCache::get($cache_name);
    }
    if (empty($resource)) {
        $resource = iDB::all("SELECT * FROM `#iCMS@__push` {$where_sql} {$order_sql} LIMIT {$maxperpage}");
        iPHP_SQL_DEBUG && iDB::debug(1);
        if ($resource) {
            foreach ($resource as $key => $value) {
                $value['pic'] && ($value['pic'] = iFS::fp($value['pic'], '+http'));
                $value['pic2'] && ($value['pic2'] = iFS::fp($value['pic2'], '+http'));
                $value['pic2'] && ($value['pic2'] = iFS::fp($value['pic2'], '+http'));
                $value['metadata'] && ($value['metadata'] = unserialize($value['metadata']));
                $resource[$key] = $value;
            }
        }
        $vars['cache'] && iCache::set($cache_name, $resource, $cache_time);
    }
    return $resource;
}
开发者ID:sunhk25,项目名称:iCMS,代码行数:62,代码来源:push.func.php


示例8: do_save

 function do_save()
 {
     $disable = explode("\n", iS::escapeStr($_POST['disable']));
     $filter = explode("\n", iS::escapeStr($_POST['filter']));
     foreach ($filter as $k => $val) {
         $filterArray[$k] = explode("=", $val);
     }
     $this->setting->set($filterArray, 'word.filter', 0, true);
     $this->setting->set($disable, 'word.disable', 0, true);
     iPHP::success('更新完成');
 }
开发者ID:World3D,项目名称:iCMS,代码行数:11,代码来源:filter.app.php


示例9: run

 public static function run($pre = null)
 {
     extension_loaded('gd') && function_exists('gd_info') or self::$noGD = true;
     self::$code or self::$code = self::__mkcode();
     self::$noGD && (self::$code = 'iCMS');
     $name = 'seccode';
     $pre && ($name = $pre . '_seccode');
     //设定cookie
     iPHP::set_cookie($name, authcode(self::$code, 'ENCODE'));
     self::__image();
 }
开发者ID:World3D,项目名称:iCMS,代码行数:11,代码来源:iSeccode.class.php


示例10: do_iCMS

 function do_iCMS()
 {
     $res = iPHP::folder('template', array('htm', 'css', 'js', 'png', 'jpg', 'gif'));
     $dirRs = $res['DirArray'];
     $fileRs = $res['FileArray'];
     $pwd = $res['pwd'];
     $parent = $res['parent'];
     $URI = $res['URI'];
     $navbar = true;
     $file_edit = true;
     include iACP::view("files.explorer");
 }
开发者ID:World3D,项目名称:iCMS,代码行数:12,代码来源:template.app.php


示例11: yun

 public static function yun($vendor = null)
 {
     if ($vendor === null) {
         return false;
     }
     $conf = self::$config['sdk'][$vendor];
     if ($conf['AccessKey'] && $conf['SecretKey']) {
         iPHP::import(iPHP_LIB . '/' . $vendor . '.php');
         return new $vendor($conf['AccessKey'], $conf['SecretKey'], $conf['AppId']);
     } else {
         return false;
     }
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:13,代码来源:iYun.class.php


示例12: do_save

 function do_save()
 {
     $filter = explode("\n", $_POST['filter']);
     $disable = explode("\n", $_POST['disable']);
     $disable = array_unique($disable);
     foreach ($filter as $k => $val) {
         $filterArray[$k] = explode("=", $val);
     }
     $this->setting->set($filterArray, 'word.filter', 0, true);
     $this->setting->set($disable, 'word.disable', 0, true);
     $this->cache();
     iPHP::success('更新完成');
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:13,代码来源:filter.app.php


示例13: iCMS_router

/**
 * @package iCMS
 * @copyright 2007-2010, iDreamSoft
 * @license http://www.idreamsoft.com iDreamSoft
 * @author coolmoo <[email protected]>
 * @$Id: iCMS.push.php 148 2013-03-14 16:15:12Z coolmoo $
 */
function iCMS_router($vars)
{
    if (empty($vars['url'])) {
        echo 'javascript:;';
        return;
    }
    $router = $vars['url'];
    unset($vars['url'], $vars['app']);
    $url = iPHP::router($router, iCMS_REWRITE);
    $vars['query'] && ($url = buildurl($url, $vars['query']));
    if ($url && stripos($url, 'http://') === false && $vars['host']) {
        $url = rtrim(iCMS_URL, '/') . '/' . ltrim($url, '/');
    }
    echo $url ? $url : 'javascript:;';
}
开发者ID:World3D,项目名称:iCMS,代码行数:22,代码来源:iCMS.router.php


示例14: index

 public function index($a = null)
 {
     $index_name = $a[1] ? $a[1] : iCMS::$config['template']['index_name'];
     $index_tpl = $a[0] ? $a[0] : iCMS::$config['template']['index'];
     $index_name or $index_name = 'index';
     $iurl = iURL::get('index', array('urlRule' => $index_name . iCMS::$config['router']['html_ext']));
     if (iCMS::$config['template']['index_mode'] && iPHP_DEVICE == "desktop") {
         iCMS::gotohtml($iurl->path, $iurl->href);
     }
     if (iPHP::$iTPL_MODE == "html" || iCMS::$config['template']['index_rewrite']) {
         iCMS::set_html_url($iurl);
     }
     $html = iPHP::view($index_tpl);
     if (iPHP::$iTPL_MODE == "html") {
         return array($html, $iurl);
     }
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:17,代码来源:index.app.php


示例15: do_batch

 function do_batch()
 {
     $idArray = (array) $_POST['id'];
     $idArray or iPHP::alert("请选择要操作的关键词");
     $ids = implode(',', $idArray);
     $batch = $_POST['batch'];
     switch ($batch) {
         case 'dels':
             iPHP::$break = false;
             foreach ($idArray as $id) {
                 $this->do_del($id, false);
             }
             iPHP::$break = true;
             iPHP::success('关键词全部删除完成!', 'js:1');
             break;
     }
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:17,代码来源:keywords.app.php


示例16: search_url

function search_url($vars)
{
    $q = rawurlencode($vars['query']);
    if (empty($q)) {
        return;
    }
    $query['app'] = 'search';
    if (isset($vars['_app'])) {
        $query['app'] = $vars['_app'];
        $query['do'] = 'search';
    }
    $query['q'] = $q;
    $url = iPHP::router('/api', iPHP_ROUTER_REWRITE);
    $url = buildurl($url, $query);
    if ($vars['ret']) {
        return $url;
    }
    echo $url;
}
开发者ID:sunhk25,项目名称:iCMS,代码行数:19,代码来源:search.func.php


示例17: search

 public function search($tpl = false)
 {
     $q = htmlspecialchars(rawurldecode($_GET['q']));
     $encode = mb_detect_encoding($q, array("ASCII", "UTF-8", "GB2312", "GBK", "BIG5"));
     if (strtoupper($encode) != 'UTF-8') {
         if (function_exists('iconv')) {
             $q = iconv($encode, 'UTF-8//IGNORE', $q);
         } elseif (function_exists('mb_convert_encoding')) {
             $q = mb_convert_encoding($q, 'UTF-8//IGNORE', $encode);
         }
     }
     $q = iS::escapeStr($q);
     //empty($q) && iPHP::throw404('应用程序运行出错.亲!搜点什么吧!!', 60001);
     $fwd = iCMS::filter($q);
     $fwd && iPHP::throw404('非法搜索词!', 60002);
     $search['title'] = stripslashes($q);
     $search['keyword'] = $q;
     $tpl === false && ($tpl = '{iTPL}/search.htm');
     $q && $this->slog($q);
     iPHP::assign("search", $search);
     return iPHP::view($tpl, 'search');
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:22,代码来源:search.app.php


示例18: marker_html

/**
 * @package iCMS
 * @copyright 2007-2010, iDreamSoft
 * @license http://www.idreamsoft.com iDreamSoft
 * @author coolmoo <[email protected]>
 * @$Id: push.tpl.php 1392 2013-05-20 12:28:08Z coolmoo $
 */
function marker_html($vars)
{
    $where_sql = "WHERE `status`='1'";
    $vars['key'] or iPHP::warning('iCMS&#x3a;marker&#x3a;html 标签出错! 缺少"key"属性或"key"值为空.');
    if (isset($vars['cid']) && $vars['cid'] != '') {
        $where_sql .= " AND `cid`='{$vars['cid']}'";
    }
    if (isset($vars['pid']) && $vars['pid'] != '') {
        $where_sql .= " AND `pid`='{$vars['pid']}'";
    }
    if (isset($vars['key']) && $vars['key'] != '') {
        $where_sql .= " AND `key`='{$vars['key']}'";
    }
    if (isset($vars['id']) && $vars['id'] != '') {
        $where_sql .= " AND `id`='{$vars['id']}'";
    }
    $marker = iDB::row("SELECT * FROM `#iCMS@__marker` {$where_sql}", ARRAY_A);
    iPHP_SQL_DEBUG && iDB::debug(1);
    if ($marker) {
        echo $marker['data'];
    }
}
开发者ID:sunhk25,项目名称:iCMS,代码行数:29,代码来源:marker.func.php


示例19: logout

 function logout()
 {
     iPHP::set_cookie(self::$AUTH, '', -31536000);
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:4,代码来源:iUser.class.php


示例20: header

header('Content-Type: text/html; charset=' . iPHP_CHARSET);
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
if (function_exists('memory_get_usage') && (int) @ini_get('memory_limit') < abs(intval(iPHP_MEMORY_LIMIT))) {
    @ini_set('memory_limit', iPHP_MEMORY_LIMIT);
}
@ini_set('date.timezone', iPHP_TIME_ZONE);
//设置时区
function_exists('date_default_timezone_set') && date_default_timezone_set(iPHP_TIME_ZONE);
require iPHP_PATH . '/iPHP.compat.php';
require iPHP_PATH . '/iPHP.class.php';
set_error_handler('iPHP_ERROR_HANDLER');
iPHP::timer_start();
//waf
iPHP::LoadClass("Waf");
waf::filter();
//security
iPHP::LoadClass("Security", 'S');
iS::filter();
iS::GP('page', 'GP', 2);
define('__SELF__', $_SERVER['PHP_SELF']);
define('__REF__', $_SERVER['HTTP_REFERER']);
$iDB_CLASS = 'Mysql';
iPHP_DB_TYPE == 'mysql' && version_compare(PHP_VERSION, '5.5', '>=') && ($iDB_CLASS = 'Mysqli');
iPHP_DB_TYPE == 'pgsql' && ($iDB_CLASS = 'Pgsql');
iPHP_DB_TYPE == 'sqlite' && ($iDB_CLASS = 'SQLite');
iPHP::loadClass($iDB_CLASS, 'DB');
//加载数据库操作类
iPHP::loadClass("FileSystem", 'FS');
//加载文件操作类
iPHP::loadClass('Cache');
//加载缓存操作类
开发者ID:sunhk25,项目名称:iCMS,代码行数:31,代码来源:iPHP.php



注:本文中的iPHP类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP iaCore类代码示例发布时间:2022-05-23
下一篇:
PHP iMSCP_pTemplate类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap