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


PHP gcms::loadfile方法代码示例

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


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

示例1: AND

 $sql2 .= " LEFT JOIN `" . DB_USER . "` AS U ON U.`id` = Q.`member_id`";
 $sql2 .= " WHERE Q.`module_id`=" . $index['module_id'] . " AND Q.`published` = '1' AND Q.`published_date`<='{$c_date}' AND Q.`index` = '0' AND Q.`id`<" . $index['id'] . " AND (" . implode(' OR ', $qs) . ") ORDER BY Q.`create_date` DESC";
 $sql2 .= ") AS Q2, (SELECT @row2:=0) r";
 $sql2 .= ") AS Q3";
 $sql = "SELECT * FROM (SELECT * FROM (({$sql1}) UNION ({$sql2})) AS X ORDER BY X.`row` LIMIT " . $match[2] * $match[3] . ") AS Y ORDER BY `create_date` DESC";
 $datas = $cache->get($sql);
 if (!$datas) {
     $datas = $db->customQuery($sql);
     $cache->save($sql, $datas);
 }
 // styles
 $styles = in_array($match[5], array('list', 'icon', 'thumb')) ? $match[5] : 'list';
 // เครื่องหมาย new
 $valid_date = $mmktime - $index['new_date'];
 // template
 $skin = gcms::loadfile(ROOT_PATH . 'widgets/relate/widgetitem.html');
 $patt = array('/{BG}/', '/{URL}/', '/{TOPIC}/', '/{DETAIL}/', '/{CATEGORY}/', '/{DATE}/', '/{UID}/', '/{SENDER}/', '/{STATUS}/', '/{COMMENTS}/', '/{VISITED}/', '/{THUMB}/', '/{ICON}/');
 $widget = array();
 $bg = 'bg2';
 foreach ($datas as $i => $item) {
     if ($i > 0 && $i % $match[2] == 0) {
         $widget[] = '</div><div class="row ' . $styles . 'view">';
     }
     $bg = $bg == 'bg1' ? 'bg2' : 'bg1';
     $replace = array();
     $replace[] = "{$bg} background" . rand(0, 5);
     if ($config['module_url'] == '1') {
         $replace[] = gcms::getURL($index['module'], $item['alias']);
     } else {
         $replace[] = gcms::getURL($index['module'], '', 0, $item['id']);
     }
开发者ID:phannack,项目名称:GCMS,代码行数:31,代码来源:getnews.php

示例2: array

<?php

// admin/register.php
if (MAIN_INIT == 'admin' && $isAdmin) {
    // title
    $title = $lng['LNG_REGISTER_TITLE'];
    // แสดงผล
    $patt2 = array('/{STATUS}/');
    $replace2 = array();
    $statuses = array();
    foreach ($config['member_status'] as $i => $value) {
        $statuses[] = '<option value=' . $i . '>' . $value . '</option>';
    }
    $replace2[] = implode('', $statuses);
    $content[] = preg_replace($patt2, $replace2, gcms::loadfile(ROOT_PATH . "admin/skin/{$config['admin_skin']}/register.html"));
} else {
    $title = $lng['LNG_DATA_NOT_FOUND'];
    $content[] = '<aside class=error>' . $title . '</aside>';
}
开发者ID:goragod,项目名称:php-framework-benchmark,代码行数:19,代码来源:register.php

示例3: header

<?php

// modal.php
header("content-type: text/html; charset=UTF-8");
// inint
include dirname(__FILE__) . '/bin/inint.php';
// ตรวจสอบ referer
if (gcms::isReferer() && preg_match('/^([a-z]+)$/', $_POST['module'], $match)) {
    if (is_file(ROOT_PATH . SKIN . "{$match['1']}.html")) {
        $patt = array('/{(LNG_[A-Z0-9_]+)}/e', '/{SKIN}/', '/{WEBURL}/', '/{TITLE}/', '/{DESCRIPTION}/', '/{LANGUAGE}/');
        $replace = array(OLD_PHP ? '$lng[\'$1\']' : 'gcms::getLng', SKIN, WEB_URL, $config['web_title'], $config['web_description'], LANGUAGE);
        echo gcms::pregReplace($patt, $replace, gcms::loadfile(ROOT_PATH . SKIN . "{$match['1']}.html"));
    } else {
        echo '<div class=error>' . $lng['PAGE_NOT_FOUND'] . '</div>';
    }
}
开发者ID:phannack,项目名称:GCMS,代码行数:16,代码来源:modal.php

示例4: preg_replace

     $menu = '/class="(' . preg_replace('/([\\/\\-])/', '\\1', preg_quote($menu)) . ')(.*?)"/';
     if (!preg_match($menu, $main_patt['/{MAINMENU}/'])) {
         // ถ้าไม่มีจะใช้่โมดูลแรกสุด
         $menu = $install_modules[$module_list[0]];
         $menu = empty($menu['alias']) ? $menu['module'] : $menu['alias'];
         $menu = '/class="(' . preg_replace('/([\\/\\-])/u', '\\1', preg_quote($menu)) . ')(.*?)"/';
     }
     $main_patt['/{MAINMENU}/'] = preg_replace($menu, 'class="\\1 select\\2"', $main_patt['/{MAINMENU}/']);
 }
 // เวอร์ชั่น
 $main_patt['/{VERSION}/'] = VERSION;
 // ข้อความบน title bar
 $main_patt['/{TITLE}/'] = strip_tags($title);
 // ภาษาที่ติดตั้ง
 $languages = array();
 $skin = gcms::loadfile(ROOT_PATH . SKIN . 'language.html');
 foreach ($config['languages'] as $language) {
     $languages[] = preg_replace('/{LNG}/', $language, $skin);
 }
 $script[] = 'changeLanguage("' . implode(',', $config['languages']) . '");';
 $main_patt['/{LANGUAGES}/'] = implode('', $languages);
 // ขนาดตัวอักษร
 $main_patt['/{FONTSIZE}/'] = '<a class="font_size small" title="{LNG_CHANGE_FONT_SMALL}">A<sup>-</sup></a><a class="font_size normal" title="{LNG_CHANGE_FONT_NORMAL}">A</a><a class="font_size large" title="{LNG_CHANGE_FONT_LARGE}">A<sup>+</sup></a>';
 // widgets
 $main_patt['/{WIDGET_([A-Z]+)(([\\s_])(.*))?}/e'] = OLD_PHP ? 'gcms::getWidgets(array(1=>\'$1\',3=>\'$3\',4=>\'$4\'))' : 'gcms::getWidgets';
 // ภาษา
 $main_patt['/{(LNG_[A-Z0-9_]+)}/e'] = OLD_PHP ? '$lng[\'$1\']' : 'gcms::getLng';
 // logo
 $main_patt['/{LOGO}/'] = $image_logo;
 // meta, keywords และ description
 $meta['description'] = '<meta name=description content="' . $description . '">';
开发者ID:phannack,项目名称:GCMS,代码行数:31,代码来源:load.php

示例5: header

<?php

// widgets/tags/view.php
header("content-type: text/html; charset=UTF-8");
// inint
include '../../bin/inint.php';
// referer
if (gcms::isReferer()) {
    list($action, $id) = explode('-', $_POST['id']);
    $tag = $db->getRec(DB_TAGS, $id);
    if ($tag) {
        $patt = array('/{(LNG_[A-Z0-9_]+)}/e', '/{TAG}/', '/{COUNT}/');
        $replace = array();
        $replace[] = OLD_PHP ? '$lng[\'$1\']' : 'gcms::getLng';
        $replace[] = $tag['tag'];
        $replace[] = number_format($tag['count']);
        echo gcms::pregReplace($patt, $replace, gcms::loadfile('tags.tpl'));
    }
}
开发者ID:phannack,项目名称:GCMS,代码行数:19,代码来源:view.php

示例6: strip_tags

    $replace[] = strip_tags($title);
    $replace[] = $config['web_title'];
    if (isset($login_result)) {
        $name = trim("{$login_result['pname']} {$login_result['fname']} {$login_result['lname']}");
        $name = $name == '' ? $login_result['displayname'] : $name;
        $replace[] = $name == '' ? $login_result['email'] : $name;
        $replace[] = $login_result['id'];
    } else {
        $replace[] = '';
        $replace[] = 0;
    }
    $replace[] = OLD_PHP ? '$lng[\'$1\']' : 'gcms::getLng';
    $replace[] = VERSION;
    $replace[] = LANGUAGE;
    $replace[] = $config['admin_skin'];
    $replace[] = WEB_URL;
    if (isset($input)) {
        $replace[] = $input == 'login_email' ? 'autofocus' : '';
        $replace[] = $input == 'login_password' ? 'autofocus' : '';
    } else {
        $replace[] = '';
        $replace[] = '';
    }
    $replace[] = DATA_URL;
    $replace[] = OLD_PHP ? 'gcms::adminURL(array(2 => \'$2\'))' : 'gcms::adminURL';
    $replace[] = gcms::getVars($_GET, 'src', '');
    $replace[] = $login_remember == 1 ? 'checked' : '';
    $replace[] = $login_email;
    $replace[] = $login_password;
    echo gcms::pregReplace($patt, $replace, gcms::loadfile(ROOT_PATH . "admin/skin/{$config['admin_skin']}/index.html"));
}
开发者ID:phannack,项目名称:GCMS,代码行数:31,代码来源:index.php

示例7: loadtemplate

 /**
  * ฟังก์ชั่น โหลด template ของโมดูลที่เลือก
  *
  * @param string $module ชื่อโมดูล
  * @param string $owner ชื่อโฟลเดอร์ ตามใน modules/
  * @param string $file ชื่อไฟล์ ไม่ต้องระบุนามสกุล html
  * @return string คืนค่า template จาก $module ถ้าไม่มีจะโหลดจาก $owner ถ้าไม่พบคืนค่าว่าง
  */
 public static function loadtemplate($module, $owner, $file)
 {
     $template = is_file(ROOT_PATH . SKIN . "{$module}/{$file}.html") ? $module : $owner;
     return gcms::loadfile(ROOT_PATH . SKIN . str_replace('//', '/', "{$template}/{$file}.html"));
 }
开发者ID:phannack,项目名称:GCMS,代码行数:13,代码来源:class.gcms.php

示例8: isset

<?php

// widgets/relate/index.php
$widget = '';
if (defined('MAIN_INIT') && preg_match('/^[0-9]+$/', $id)) {
    // ค่าที่ส่งมา
    $id = (int) $id;
    if ($id > 0) {
        $cols = isset($cols) ? (int) $cols : 1;
        $rows = isset($rows) ? (int) $rows : 1;
        $sort = isset($sort) ? (int) $sort : 1;
        if ($cols * $cols > 0) {
            $styles = isset($styles) && in_array($styles, array('list', 'icon', 'thumb')) ? $styles : 'list';
            // แสดงผล
            $patt = array('/{ID}/', '/{DETAIL}/');
            $replace = array();
            $replace[0] = "widget_{$id}_{$cols}_{$rows}_{$sort}_{$styles}";
            $replace[1] = "<script>getWidgetNews('{$replace['0']}', 'relate', 0);</script>";
            $widget = preg_replace($patt, $replace, gcms::loadfile(ROOT_PATH . 'widgets/relate/widget.html'));
        }
    }
}
开发者ID:phannack,项目名称:GCMS,代码行数:22,代码来源:index.php

示例9: elseif

            } elseif ($key == 'provinceID') {
                // จังหวัด
                $provinces = array();
                $provinces[] = '<option value="">--- ' . $lng['LNG_PLEASE_SELECT'] . ' ---</option>';
                $sql = "SELECT `id`, `name` FROM `" . DB_PROVINCE . "`";
                $datas = $cache->get($sql);
                if (!$datas) {
                    $datas = $db->customQuery($sql);
                    $cache->save($sql, $datas);
                }
                foreach ($datas as $item) {
                    $sel = $user['provinceID'] == $item['id'] ? ' selected' : '';
                    $provinces[] = '<option value=' . $item['id'] . $sel . '>' . $item['name'] . '</option>';
                }
                $replace2[] = implode('', $provinces);
            } else {
                $replace2[] = $value;
            }
        }
        $content[] = gcms::pregReplace($patt2, $replace2, gcms::loadfile(ROOT_PATH . "admin/skin/{$config['admin_skin']}/editprofile.html"));
        // หน้าปัจจุบัน
        $url_query['module'] = 'editprofile';
    } else {
        // ไม่ได้กำหนด id มา หรือ ไม่พบ user ที่เรียก
        $title = $lng['LNG_DATA_NOT_FOUND'];
        $content[] = '<aside class=error>' . $title . '</aside>';
    }
} else {
    $title = $lng['LNG_DATA_NOT_FOUND'];
    $content[] = '<aside class=error>' . $title . '</aside>';
}
开发者ID:goragod,项目名称:php-framework-benchmark,代码行数:31,代码来源:editprofile.php


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