本文整理汇总了PHP中iPHP::loadClass方法的典型用法代码示例。如果您正苦于以下问题:PHP iPHP::loadClass方法的具体用法?PHP iPHP::loadClass怎么用?PHP iPHP::loadClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iPHP
的用法示例。
在下文中一共展示了iPHP::loadClass方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: API_seccode
public function API_seccode()
{
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
iPHP::loadClass("Seccode");
$_GET['pre'] && ($pre = iS::escapeStr($_GET['pre']));
iSeccode::run($pre);
}
示例2: page
public static function page($a)
{
iPHP::loadClass("Pages");
$lang = iPHP::lang(iPHP_APP . ':page');
$iPages = new iPages($a, $lang);
if ($iPages->totalpage > 1) {
$pagenav = $a['pagenav'] ? strtoupper($a['pagenav']) : 'NAV';
$pnstyle = $a['pnstyle'] ? $a['pnstyle'] : 0;
iPHP::$iTPL->_iTPL_VARS['PAGE'] = array($pagenav => $iPages->show($pnstyle), 'COUNT' => $a['total'], 'TOTAL' => $iPages->totalpage, 'CURRENT' => $iPages->nowindex, 'PN' => $iPages->nowindex, 'NEXT' => $iPages->next_page());
iPHP::$iTPL->_iTPL_VARS['PAGES'] = $iPages;
}
return $iPages;
}
示例3: 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');
//加载缓存操作类
示例4: get_seccode
public static function get_seccode()
{
iPHP::loadClass("Seccode");
iSeccode::run('iACP');
exit;
}
示例5: function_exists
}
@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');
//加载缓存操作类
if (iPHP_SESSION !== 'COOKIE') {
iPHP::loadClass('Session');
//加载Session操作类
}
示例6: sysCache
public static function sysCache()
{
iPHP::loadClass('FileCache', 'FC');
return new iFC(array('dirs' => '', 'level' => 0, 'compress' => 1));
}
示例7: value
public function value($article, $art_data = "", $vars = array(), $page = 1, $tpl = false)
{
$article['appid'] = iCMS_APP_ARTICLE;
$categoryApp = iPHP::app("category");
$category = $categoryApp->category($article['cid'], false);
if ($tpl) {
$category or iPHP::throw404('运行出错!找不到该文章的栏目缓存<b>cid:' . $article['cid'] . '</b> 请更新栏目缓存或者确认栏目是否存在', 10002);
} else {
if (empty($category)) {
return false;
}
}
if ($category['status'] == 0) {
return false;
}
if (iPHP::$iTPL_MODE == "html" && $tpl && (strstr($category['contentRule'], '{PHP}') || $category['outurl'] || $category['mode'] == "0")) {
return false;
}
$_iurlArray = array($article, $category);
$article['iurl'] = iURL::get('article', $_iurlArray, $page);
$article['url'] = $article['iurl']->href;
$article['link'] = "<a href='{$article['url']}'>{$article['title']}</a>";
$tpl && $category['mode'] == '1' && iCMS::gotohtml($article['iurl']->path, $article['iurl']->href);
if ($vars['category_lite']) {
$article['category'] = $categoryApp->get_lite($category);
} else {
$article['category'] = $category;
}
$this->taoke = false;
if ($art_data) {
$pkey = intval($page - 1);
$pageurl = $article['iurl']->pageurl;
if ($article['chapter']) {
$chapterArray = $art_data;
$count = count($chapterArray);
$adid = $chapterArray[$pkey]['id'];
$art_data = iDB::row("SELECT body,subtitle FROM `#iCMS@__article_data` WHERE aid='" . (int) $article['id'] . "' AND id='" . (int) $adid . "' LIMIT 1;", ARRAY_A);
}
$art_data['body'] = $this->ubb($art_data['body']);
preg_match_all("/<img.*?src\\s*=[\"|'|\\s]*(http:\\/\\/.*?\\.(gif|jpg|jpeg|bmp|png)).*?>/is", $art_data['body'], $pic_array);
$p_array = array_unique($pic_array[1]);
if ($p_array) {
foreach ($p_array as $key => $_pic) {
$article['pics'][$key] = trim($_pic);
}
}
if (substr($art_data['body'], 0, 19) == '#--iCMS.Markdown--#') {
// $art_data['body'] = iPHP::Markdown($art_data['body']);
$art_data['body'] = substr($art_data['body'], 19);
$article['markdown'] = ture;
}
if ($article['chapter']) {
$article['body'] = $art_data['body'];
} else {
$body = explode('#--iCMS.PageBreak--#', $art_data['body']);
$count = count($body);
$article['body'] = $body[$pkey];
}
$total = $count + intval(iCMS::$config['article']['pageno_incr']);
$article['body'] = $this->keywords($article['body']);
$article['body'] = $this->taoke($article['body']);
$article['taoke'] = $this->taoke;
$article['subtitle'] = $art_data['subtitle'];
unset($body, $art_data);
$pageArray = array();
if ($total > 1) {
iPHP::loadClass("Pages");
$_GLOBALS_iPage = $GLOBALS['iPage'];
$category['mode'] && iCMS::set_html_url($article['iurl']);
$pageconf = array('page_name' => 'p', 'url' => $pageurl, 'total' => $total, 'perpage' => 1, 'nowindex' => (int) $_GET['p'], 'lang' => iPHP::lang(iPHP_APP . ':page'));
if ($article['chapter']) {
foreach ((array) $chapterArray as $key => $value) {
$pageconf['titles'][$key + 1] = $value['subtitle'];
}
}
$iPages = new iPages($pageconf);
unset($GLOBALS['iPage']);
$GLOBALS['iPage'] = $_GLOBALS_iPage;
unset($_GLOBALS_iPage);
$pageArray['list'] = $iPages->list_page();
$pageArray['index'] = $iPages->first_page('array');
$pageArray['prev'] = $iPages->prev_page('array');
$pageArray['next'] = $iPages->next_page('array');
$pageArray['endof'] = $iPages->last_page('array');
$pagenav = $iPages->show(0);
$pagetext = $iPages->show(10);
}
$article['page'] = array('pn' => $page, 'total' => $total, 'count' => $count, 'current' => $page, 'nav' => $pagenav, 'pageurl' => $pageurl, 'text' => $pagetext, 'PAGES' => $iPages, 'args' => iS::escapeStr($_GET['pageargs']), 'first' => $page == "1" ? true : false, 'last' => $page == $count ? true : false, 'end' => $page == $total ? true : false) + $pageArray;
$next_url = $pageArray['next']['url'];
unset($pagenav, $pagetext, $iPages, $pageArray);
if ($pic_array[0]) {
$img_array = array_unique($pic_array[0]);
foreach ($img_array as $key => $img) {
$img = str_replace('<img', '<img title="' . $article['title'] . '" alt="' . $article['title'] . '"', $img);
if (iCMS::$config['article']['pic_center']) {
$img_replace[$key] = '<p align="center">' . $img . '</p>';
} else {
$img_replace[$key] = $img;
}
if (iCMS::$config['article']['pic_next'] && $count > 1) {
//.........这里部分代码省略.........
示例8: API_seccode
public function API_seccode()
{
iPHP::loadClass("Seccode");
$_GET['pre'] && ($pre = iS::escapeStr($_GET['pre']));
iSeccode::run($pre);
}
示例9: define
define('iPHP_PATH', dirname(strtr(__FILE__, '\\', '/')));
require iPHP_PATH . '/iPHP.version.php';
require iPHP_PATH . '/iPHP.define.php';
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();
//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');
//加载缓存操作类
iPHP::loadClass("Template");
//加载模板操作类
示例10: pagenav
public static function pagenav($total, $displaypg = 20, $unit = "条记录", $url = '', $target = '')
{
iPHP::loadClass("Pages");
$pageconf = array('url' => $url, 'target' => $target, 'total' => $total, 'perpage' => $displaypg, 'total_type' => 'G', 'lang' => iPHP::lang(iPHP_APP . ':page'));
$pageconf['lang']['format_left'] = '<li>';
$pageconf['lang']['format_right'] = '</li>';
$iPages = new iPages($pageconf);
self::$offset = $iPages->offset;
self::$pagenav = '<ul>' . (self::$pagenav .= $iPages->show(3));
self::$pagenav .= "<li> <span class=\"muted\">{$total}{$unit} {$displaypg}{$unit}/页 共{$iPages->totalpage}页</span></li>";
if ($iPages->totalpage > 200) {
$url = $iPages->get_url(1);
self::$pagenav .= "<li> <span class=\"muted\">跳到 <input type=\"text\" id=\"pageselect\" style=\"width:24px;height:12px;margin-bottom: 0px;line-height: 12px;\" /> 页 <input class=\"btn btn-small\" type=\"button\" onClick=\"window.location='{$url}&page='+\$('#pageselect').val();\" value=\"跳转\" style=\"height: 22px;line-height: 18px;\"/></span></li>";
} else {
self::$pagenav .= "<li> <span class=\"muted\">跳到" . $iPages->select() . "页</span></li>";
}
self::$pagenav .= '</ul>';
}