当前位置: 首页>>代码示例>>PHP>>正文


PHP iPHP类代码示例

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


在下文中一共展示了iPHP类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 <idreamsoft@qq.com>
 * @$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 <idreamsoft@qq.com>
 * @$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 <idreamsoft@qq.com>
 * @$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


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