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


PHP load_library函数代码示例

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


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

示例1: load_libraries

function load_libraries()
{
    $libs = array('error', 'module', 'security', 'url', 'asset', 'session');
    $libs = array_unique(array_merge($libs, get_config('autoload', array())));
    $conn = get_config('database')->load;
    foreach ($libs as $lib) {
        if (load_library($lib)) {
            if ($lib == 'database' && $conn) {
                db_start();
            }
        }
    }
}
开发者ID:londomloto,项目名称:immortal,代码行数:13,代码来源:cores.php

示例2: getcookie

 /**
  * 获取Cookie值
  */
 public static function getcookie($name)
 {
     load_library('Edcrypt');
     $cookieconfig = load_config('config', 'cookie');
     $prefix = $cookieconfig['prefix'];
     $name = $prefix . $name;
     $name = base64_encode($name);
     $name = strtr($name, '=', 'S');
     $ed = new Edcrypt();
     if (isset($_COOKIE[$name])) {
         return $ed->decrypt($_COOKIE[$name]);
     } else {
         return false;
     }
 }
开发者ID:sunqinye,项目名称:SunPHP,代码行数:18,代码来源:CookieHelper.php

示例3: __construct

    /**
     * This allows for easy usage of Uploadify. You will have to style things yourself. This class will just generate the HTML. Uploader instances must be instantiated before the page is displayed. createHTML() can be called at any time.
     *
     * @param string $name When files are uploaded they will appear in the $_FILES superglobal with this key. If unsure, use "Filedata".
     * @param callback $callback The function/method to call to handle an upload.
     * @param string $uploadButtonText The text to display on the upload button. Default is false.
     * @param string $uploadifyOptions Options to pass to Uploadify in the form of a PHP associative array. See the options section of this page for details: http://www.uploadify.com/documentation/ .
     */
    public function __construct($name, $callback = false, $uploadButtonText = false, $uploadifyOptions = array())
    {
        $this->name = $name;
        $this->callback = $callback;
        $this->id = abs(crc32(microtime(true)));
        $this->text = $uploadButtonText ? $uploadButtonText : __('admin', 'upload');
        $this->options = $uploadifyOptions;
        if (array_key_exists($this->name, $_FILES)) {
            Hooks::bind('system_ready', array($this, 'runCallback'));
        }
        load_library('uploadify');
        $js_options = json_encode(array_merge($this->options, array('queueID' => $this->id . "_queue", 'uploader' => TH_PUB_ROOT . TH_CONTENT . 'libraries/js/uploadify/uploadify.swf', 'cancelImg' => TH_PUB_ROOT . TH_CONTENT . 'libraries/js/uploadify/cancel.png', 'script' => TH_PUB_ROOT, 'displayData' => 'both')));
        $js = <<<EOT
\$(function () {
\t\$('#{$this->id}_button').uploadify({$js_options});
\t\$('#{$this->id}_upload_box button').click(function () {
\t\t\$('#{$this->id}_button').uploadifyUpload();
\t});
});
EOT;
        queue_js_string($js);
    }
开发者ID:alecgorge,项目名称:TopHat,代码行数:30,代码来源:cc-uploadify.php

示例4: emember_initialize

function emember_initialize()
{
    //Both front end and admin side init time tasks
    load_library();
    //Front end only init time tasks
    if (!is_admin()) {
        if (isset($_REQUEST['emember_feed_key'])) {
            $emember_auth = Emember_Auth::getInstance();
            $emember_auth->login_with_feed_key($_REQUEST['emember_feed_key']);
        }
        emember_init_frontend();
        emember_menu();
        $emember_allow_comment = Emember_Config::getInstance()->getValue('eMember_member_can_comment_only');
        if ($emember_allow_comment) {
            emember_check_comment();
        }
        emember_del_bookmark();
        emember_do_caching_plugin_compatibility();
    }
    //Admin side only init time tasks
    if (is_admin()) {
        emember_init_admin_side();
    }
}
开发者ID:phupx,项目名称:genco,代码行数:24,代码来源:eMember_init.php

示例5: foreach

/*
 * ---------------------------------------------------------------
 * Variables
 * ---------------------------------------------------------------
 */
$method = $_SERVER['REQUEST_METHOD'];
/*
 * ---------------------------------------------------------------
 * Init frameworks
 * ---------------------------------------------------------------
 */
$default = $config->load("default");
if (!is_null($default)) {
    if (array_key_exists("libraries", $default)) {
        foreach ($default["libraries"] as $library) {
            if (!load_library($library)) {
                show_error("The library " . $library . " not loaded.");
            }
        }
    }
    if (array_key_exists("config", $default)) {
        foreach ($default["config"] as $conf) {
            $config->load($conf);
        }
    }
    if (array_key_exists("models", $default)) {
        foreach ($default["models"] as $model) {
            if (!load_model($model)) {
                show_error("The model " . $model . " not loaded.");
            }
        }
开发者ID:philllamarmotte,项目名称:Backdoor_API_PHP,代码行数:31,代码来源:core.php

示例6: date

    $tpl = $_CFG['template'];
    //$tpl = trim($_REQUEST['tpl_name']);
    $filename = '../temp/backup/' . $tpl . '_' . date('Ymd') . '.zip';
    $zip = new PHPZip();
    $done = $zip->zip('../themes/' . $tpl . '/', $filename);
    if ($done) {
        make_json_result($filename);
    } else {
        make_json_error($_LANG['backup_failed']);
    }
}
/*------------------------------------------------------ */
//-- 载入指定库项目的内容
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'load_library') {
    $library = load_library($_CFG['template'], trim($_GET['lib']));
    $message = $library['mark'] & 7 ? '' : $_LANG['library_not_written'];
    make_json_result($library['html'], $message);
}
/*------------------------------------------------------ */
//-- 更新库项目内容
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'update_library') {
    check_authz_json('library_manage');
    $html = stripslashes(json_str_iconv($_POST['html']));
    $lib_file = '../themes/' . $_CFG['template'] . '/library/' . $_POST['lib'] . '.lbi';
    $lib_file = str_replace("0xa", '', $lib_file);
    // 过滤 0xa 非法字符
    $org_html = str_replace("", '', file_get_contents($lib_file));
    if (@file_exists($lib_file) === true && @file_put_contents($lib_file, $html)) {
        @file_put_contents('../temp/backup/library/' . $_CFG['template'] . '-' . $_POST['lib'] . '.lbi', $org_html);
开发者ID:norain2050,项目名称:mhFault,代码行数:31,代码来源:template.php

示例7: display

    public static function display()
    {
        if ($_GET['do'] == 'reorder') {
            self::updateFromPOST();
        }
        load_library(array('nestedSortable', 'json'));
        $r = "<button id='save-btn' class='btn btn-primary'>" . __('admin', 'save-changes') . "</button>" . "<p class='page-intro'>" . __('admin', 'content-intro') . "</p>\n\t\t<div id='outbox' style='clear:both;'></div>";
        $editUrl = Admin::link('content/edit-page');
        $edit = __('admin', 'edit-page');
        $view = __('admin', 'view-page');
        $deleteUrl = Admin::link('content/delete-page');
        $delete = __('admin', 'delete-page');
        $r .= Content::generateNavHTML(array('root' => "\n<ol class='sortable' id='sortable-nav'>\n%s\n</ol>\n", 'child' => "\n<ol>\n%s\n</ol>\n", 'item' => "\n\t<li data-node-id='%3\$s'>\n\t<div class='clearfix'>\n\t\t<span class='name'>%1\$s</span>\n\t\t<span class='delete-link link'><a href='{$deleteUrl}'>{$delete}</a></span>\n\t\t<span class='edit-link link'><a href='{$editUrl}&id=%3\$s'>{$edit}</a></span>\n\t\t<span class='pub-link link'><a href='%2\$s' target='_blank'>{$view}</a></span>\n\t</div>\n</li>", 'itemHasChild' => "\n\t<li data-node-id='%4\$s'>\n\t<div class='clearfix'>\n\t\t<span class='name'>%1\$s</span>\n\t\t<span class='delete-link link'><a href='{$deleteUrl}'>{$delete}</a></span>\n\t\t<span class='edit-link link'><a href='{$editUrl}&id=%4\$s'>{$edit}</a></span>\n\t\t<span class='pub-link link'><a href='%2\$s' target='_blank'>{$view}</a></span>\n\t</div>\n\t%3\$s\n</li>"));
        $save_url = Admin::link('content', array('do' => 'reorder'));
        $local_success = Message::success(__('admin', 'page-reorder-success'), true);
        $local_error = Message::error(__('admin', 'page-reorder-failure'), true);
        $conf_text = __("admin", 'delete-confirm');
        queue_js_string(<<<EOT
\t\$(function () {
\t\tvar restripe = function () {
\t\t\tvar stripe = false;
\t\t\t\$("#sortable-nav li").each(function () {
\t\t\t\tif(stripe = !stripe) \$(this).addClass('stripe');
\t\t\t});
\t\t};

\t\t\$("#sortable-nav").nestedSortable({
\t\t\tdisableNesting: 'no-nest',
\t\t\tforcePlaceholderSize: true,
\t\t\thandle: 'div',
\t\t\thelper:\t'clone',
\t\t\titems: 'li',
\t\t\tmaxLevels: 0,
\t\t\topacity: .6,
\t\t\tplaceholder: 'placeholder',
\t\t\trevert: 250,
\t\t\ttabSize: 25,
\t\t\ttolerance: 'pointer',
\t\t\ttoleranceElement: '> div'
\t\t}).bind('change', restripe);
\t\trestripe();

\t\t\$('.delete-link a').click(function (e) {
\t\t\te.preventDefault();

\t\t\tif(!confirm("{$conf_text}")) return;

\t\t\tvar g = \$(this).parent().parent().parent();

\t\t\t\$.ajax({
\t\t\t\turl : \$(this).attr('href'),
\t\t\t\ttype : "post",
\t\t\t\tdata : {
\t\t\t\t\t'id': g.attr('data-node-id')
\t\t\t\t},
\t\t\t\tsuccess: function(e, returnText) {
\t\t\t\t\tvar out = \$('#outbox');
\t\t\t\t\tout.html(e);
\t\t\t\t}
\t\t\t});

\t\t\tg.remove();

\t\t\treturn false;
\t\t});

\t\t\$('#save-btn').click(function () {
\t\t\tdis = \$(this).addClass('disabled')
\t\t\t, json = {};

\t\t\t\$("#sortable-nav li span.name").each(function() {
\t\t\t\tvar li = \$(this).parent().parent()
\t\t\t\t, grandparent = li.parent().parent();

\t\t\t\tjson[li.attr('data-node-id')] = {
\t\t\t\t\t'parent_id': grandparent[0].tagName == 'LI' ? grandparent.attr('data-node-id') : '0',
\t\t\t\t\t'weight': li.index()
\t\t\t\t};
\t\t\t});

\t\t\t\$.ajax({
\t\t\t\turl : "{$save_url}",
\t\t\t\ttype : "post",
\t\t\t\tdata : {
\t\t\t\t\torder: JSON.stringify(json)
\t\t\t\t},
\t\t\t\tsuccess: function(e, returnText) {
\t\t\t\t\tvar out = \$('#outbox');
\t\t\t\t\tout.html('');
\t\t\t\t\tif(e == 'ok') {
\t\t\t\t\t\t\$("{$local_success}").hide().appendTo(out).slideDown();
\t\t\t\t\t}
\t\t\t\t\telse {
\t\t\t\t\t\t\$("{$local_error}").hide().appendTo(out).slideDown();
\t\t\t\t\t\tif(typeof console != 'undefined' && console.log) {
\t\t\t\t\t\t\tconsole.log(e);
\t\t\t\t\t\t}
\t\t\t\t\t\telse {
\t\t\t\t\t\t\talert(e);
\t\t\t\t\t\t}
//.........这里部分代码省略.........
开发者ID:alecgorge,项目名称:TopHat,代码行数:101,代码来源:content.php

示例8: _e

<!doctype html>
<html>
	<head>
		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
		<title><?php 
echo Admin::pageTitle();
?>
 &lsaquo; <?php 
_e('admin', 'TopHat Admin');
?>
</title>

		<?php 
load_library(array('bootstrap-css', 'jquery', 'bootstrap-js'));
queue_css(TH_PUB_ADMIN . 'design/styles.css');
queue_js(TH_PUB_ADMIN . 'design/admin.js');
load_css();
load_js();
?>
	</head>

	<body class="<?php 
echo Admin::bodyClasses();
?>
">
		<div id="topnavbar" class="navbar navbar-fixed-top">
			<div class="navbar-inner">
				<div class="container">
					<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
开发者ID:alecgorge,项目名称:TopHat,代码行数:31,代码来源:index.tpl.php

示例9: index

 function index()
 {
     require_once 'include' . DS . 'smilies.inc.php';
     $vars = array();
     $errors = array();
     $authorizer = check_model::getInstance();
     // user or not
     if (!$authorizer->is_user()) {
         cpg_die(ERROR, Lang::item('error.perm_denied'), __FILE__, __LINE__);
     }
     // to-do: display the profile if + avatar
     $vars['nagavitor'] = $this->forum->get_nagavitor();
     $vars['user'] = $user = $this->forum->get_user_data();
     if ($this->validate->post->keyExists('submit')) {
         $data = array('fr_signature' => $this->validate->post->getRaw('fr_signature'));
         if (strlen($data['fr_signature']) > Config::item('fr_signature_max_size') && Config::item('fr_signature_max_size')) {
             $data['fr_signature'] = substr($data['fr_signature'], 0, Config::item('fr_signature_max_size'));
         }
         $avatar_type = $this->validate->post->getRaw('avatar_type');
         if ($avatar_type == 'url') {
             $data['fr_avatar'] = $this->validate->post->getRaw('fr_avatar_url');
             $files = explode('.', $data['fr_avatar']);
             if (!in_array($files[count($files) - 1], array('gif', 'jpg', 'jpeg', 'png'))) {
                 $errors[] = Lang::item('error.wrong_avatar_extension');
             }
         } else {
             if ($avatar_type == 'file') {
                 $upload = load_library('upload', TRUE);
                 $upload->upload_dir = 'plugins/forum/forum/uploads/avatars/';
                 if (!is_dir($upload->upload_dir)) {
                     mkdir($upload->upload_dir, octdec(Config::item('default_dir_mode')));
                 }
                 $upload->extensions = array('.jpg', '.jpeg', '.gif', '.png');
                 $upload->max_length_filename = 255;
                 $upload->rename_file = true;
                 $upload->the_temp_file = $this->validate->files->getRaw('/fr_avatar_file/tmp_name');
                 $upload->the_file = $this->validate->files->getRaw('/fr_avatar_file/name');
                 $upload->http_error = $this->validate->files->getRaw('/fr_avatar_file/error');
                 $upload->replace = 'y';
                 $upload->do_filename_check = 'y';
                 $new_name = 'avatar_' . USER_ID;
                 if ($upload->do_upload($new_name)) {
                     $extension = strtolower(strrchr($upload->the_file, "."));
                     $data['fr_avatar'] = $upload->upload_dir . $new_name . $extension;
                 } else {
                     $errors[] = $upload->show_error_string();
                 }
                 $imagesize = getimagesize($data['fr_avatar']);
                 if (max($imagesize[0], $imagesize[1]) > Config::item('fr_avatar_size') && Config::item('fr_avatar_size')) {
                     if (!function_exists('resize_image')) {
                         require_once 'include/picmgmt.inc.php';
                     }
                     resize_image($data['fr_avatar'], $data['fr_avatar'], Config::item('fr_avatar_size'), Config::item('thumb_method'), Config::item('thumb_use'));
                 }
             } else {
                 unset($data['fr_avatar']);
             }
         }
         if (count($errors) == 0) {
             $this->forum->edit_profile($user['user_id'], $data);
             forum::message(Lang::item('common.message'), Lang::item('profile.update_profile_success'), 'forum.php?c=profile');
         }
     }
     $vars['errors'] = $errors;
     $this->view->render('profile/index', $vars);
 }
开发者ID:phill104,项目名称:branches,代码行数:66,代码来源:profile.php

示例10: show

 /**
  * 显示页码
  */
 public function show($style)
 {
     load_library("Page");
     $page = new Page($this->datanum, $this->pagesize);
     return $page->show($style);
 }
开发者ID:sunqinye,项目名称:SunPHP,代码行数:9,代码来源:Database.php


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