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


PHP load_hook函数代码示例

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


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

示例1: load_hook

function load_hook($page = '', $subpage = '')
{
    global $admin_pages, $auth;
    if ($page == '') {
        load_hook('dashboard');
    }
    // Only page
    if ($page != '' && $subpage == '') {
        if (isset($admin_pages[$page])) {
            if (!$auth->has_perm($admin_pages[$page]['capability'])) {
                trigger_error('PERMISSION_DENIED');
            }
            call_user_func($admin_pages[$page]['function']);
        } else {
            /**
             * @todo Page not found error
             */
            trigger_error('page not found');
        }
    }
    if ($page != '' && $subpage != '') {
        if (isset($admin_pages[$page]['subpages'][$subpage])) {
            if (!$auth->has_perm($admin_pages[$page]['subpages'][$subpage]['capability'])) {
                trigger_error('PERMISSION_DENIED');
            }
            call_user_func($admin_pages[$page]['subpages'][$subpage]['function']);
        } else {
            /**
             * @todo Page not found error
             */
            trigger_error('page not found');
        }
    }
}
开发者ID:pwltt,项目名称:MES-PWLTT-ENVI,代码行数:34,代码来源:functions-admin.php

示例2: switchs

                echo switchs($_POST['post_topic_time_limit'], $config['post_topic_time_limit']);
                ?>
" class="border" style="width: 10%" /> <label><?php 
                echo lang('seconds_between_topics');
                ?>
</label></dd><br />
				<dd><input type="text" name="post_reply_time_limit" value="<?php 
                echo switchs($_POST['post_reply_time_limit'], $config['post_reply_time_limit']);
                ?>
" class="border" style="width: 10%" /> <label><?php 
                echo lang('seconds_between_posting');
                ?>
</label></dd>
			</dl>
			
			<dl class="input">
				<dt><label for=""><span></span></label></dt>
				<dd><input type="submit" name="settings" class="button rounded" value="save" /></dd>
			</dl>
		</div>
		</form>
<?php 
            } else {
                load_hook('admin_settings_page');
            }
        }
    }
}
?>
	</div>
开发者ID:nijikokun,项目名称:NinkoBB,代码行数:30,代码来源:settings.php

示例3: load_hook

 * Require common.php
 */
require "include/common.php";
// gets cookie if there is one
$login_cookie = @$_COOKIE["login"];
// if cookie is found, reset cookie and destroy session
if (isset($login_cookie)) {
    // logging out
    load_hook('logout');
    setcookie("login", "", time() - 60000 * 24 * 30);
    @session_start();
    session_destroy();
    /**
     * include header template
     */
    include $config['template_path'] . "header.php";
    print_out(lang('success_logout'), lang('redirecting'));
} else {
    // logging out
    load_hook('logout');
    @session_start();
    session_destroy();
    /**
     * include header template
     */
    include $config['template_path'] . "header.php";
    print_out(lang('success_logout'), lang('redirecting'));
}
?>
</body>
</html>
开发者ID:nijikokun,项目名称:NinkoBB,代码行数:31,代码来源:logout.php

示例4: lang

	</div>
	
	<div class="content">
		<?php 
echo lang('message');
?>
:<br />
<?php 
load_hook('msg_textarea_before');
?>
		<textarea name="content" id="content" class="border" style="width: 98.3%; height: 200px;"><?php 
echo switchs(field_clean(stripslashes($_POST['content'])), $content);
?>
</textarea>
<?php 
load_hook('msg_textarea_after');
?>
	</div>
	
<?php 
if (($edit || !$reply) && !$post['reply']) {
    ?>
	<div class="content">
		<label for="category">
			<?php 
    echo lang('category');
    ?>
:
		</label>
		<select name="category">
<?php 
开发者ID:amenski,项目名称:BookSharing,代码行数:31,代码来源:message-form.php

示例5: equals

echo equals($action, "topics", "menu-current", "menu");
?>
"><?php 
echo lang('manage_topics');
?>
</a></li>
			<li><a href="<?php 
echo $config['url_path'];
?>
/admin.php?a=posts" class="<?php 
echo equals($action, "posts", "menu-current", "menu");
?>
"><?php 
echo lang('manage_posts');
?>
</a></li>
			<li><a href="<?php 
echo $config['url_path'];
?>
/admin.php?a=plugins" class="<?php 
echo equals($action, "plugins", "menu-current", "menu");
?>
"><?php 
echo lang('manage_plugins');
?>
</a></li>
<?php 
load_hook('admin_navigation');
?>
			<div class="clear"></div>
		</ul>
开发者ID:amenski,项目名称:BookSharing,代码行数:31,代码来源:navigation.php

示例6: header

 */
include "include/common.php";
// Are they already logged in?
if ($_SESSION['logged_in']) {
    header('Location: index.php');
}
// Defaults
$error = false;
$success = false;
// Have they submitted the form yet?
if (isset($_POST['submit'])) {
    // did they fall for the honeypot?
    if ($_POST['username']) {
        $error = "bot.";
    } else {
        load_hook('registration_check');
        if (!$error) {
            // If they want to validate age then ok!
            if ($config['age_validation']) {
                // Age conversion
                $age = "{$_POST['month']}/{$_POST['day']}/{$_POST['year']}";
            } else {
                $age = false;
            }
            // The results
            $result = add_user($_POST['blatent'], $_POST['password'], $_POST['pagain'], $_POST['email'], $age);
            // Check the results?
            if (is_string($result)) {
                // String is instant error.
                $error = $result;
            } else {
开发者ID:amenski,项目名称:BookSharing,代码行数:31,代码来源:register.php

示例7: load_hook

<?php 
load_hook('topic_subject_name');
?>
			</td>
			<td class="posts"><?php 
echo $posts;
?>
</td>
			<td class="last">
				<span title="<?php 
echo $last_post['date'];
?>
"><?php 
echo $last_post['ago'];
?>
 ago</span><br />
				<span class="by"><?php 
echo lang('by');
?>
 <?php 
echo $last_post_author['styled_name'];
?>
</span>
<?php 
load_hook('topic_info_after');
?>

		</tr>
<?php 
load_hook('topic_after');
开发者ID:amenski,项目名称:BookSharing,代码行数:30,代码来源:topics.php

示例8: load_hook

     // Can't sticky or close if we aren't an admin
     $sticky = 0;
     $closed = 0;
 }
 // Trying to preview post?
 if ($_POST['preview']) {
     $preview = true;
 } else {
     // Before post function
     load_hook('before_post_function');
     /**
      * Now for the fun part!
      */
     $data = post($_POST['category'], $_POST['subject'], $_POST['content'], $_POST['reply'], $sticky, $closed);
     // After the post is done dunno what for but w/e
     load_hook('after_post_function');
     // Errors
     if (is_string($data) && !is_numeric($data)) {
         $error = $data;
     } else {
         if (is_array($data)) {
             $redirect = $config['url_path'] . '/read.php?id=' . $_POST['reply'] . '&page=' . $data['page'] . '#p-' . $data['id'];
             $success = lang('success_post');
         } else {
             $redirect = $config['url_path'] . '/read.php?id=' . $data;
             $success = lang('success_topic');
         }
         // Redirect back to the topic!
         print_out($success, lang('redirecting_topic'), $redirect);
     }
 }
开发者ID:nijikokun,项目名称:NinkoBB,代码行数:31,代码来源:message.php

示例9: load_hook

assets/js/jquery.js"></script>
	<script src="<?php 
echo $config['template_url'];
?>
assets/js/jquery.scrollTo-min.js"></script>
<?php 
load_hook('page_head');
?>
</head>
<body>
<?php 
load_hook('page_start');
?>
<div id="wrapper">
	<div id="header">
		<div class="right">
			<?php 
load_hook('header_right');
?>
		</div>

		<h1 class="logo">
			<a href="<?php 
echo $config['url_path'];
?>
"><?php 
echo $config['site_name'];
?>
</a>
		</h1>
	</div>
开发者ID:amenski,项目名称:BookSharing,代码行数:31,代码来源:header.php

示例10: foreach

         }
     }
     foreach ($_POST as $key => $setting) {
         if ($key == "settings") {
             continue;
         }
         if ($setting == "on") {
             $setting = true;
         }
         // Update the item only when its not already set to that inside of the config
         if ($setting != $config[$key]) {
             update_config($key, $database->escape($setting));
         }
     }
     // Admin home hook
     load_hook('admin_settings_update');
 }
 /**
  * Include header
  */
 include $config['template_path'] . "header.php";
 /**
  * Include navigation
  */
 include $config['template_path'] . "navigation.php";
 /**
  * Include admin navigation
  */
 include $config['template_path'] . "admin/navigation.php";
 /**
  * Include admin settings page
开发者ID:nijikokun,项目名称:NinkoBB,代码行数:31,代码来源:admin.php

示例11: load_hook

    ?>
</a> | 
<?php 
}
?>
			<?php 
load_hook('footer_right');
?>
            Powered by <a href="http://ninko.anigaiku.com/">Ninko</a>
         </div>
     </td>
</tr>
</table>
</div>
<?php 
load_hook('page_end');
?>
<script>
	$("a#qq").click(function(){
            var id = $(this).attr('alt');
            var data = $(this).attr('value');
            var username = $(this).attr('name');
            
            // start the html part
                data = "[quote=" + username + "]" + $.trim(data) + "[/quote]";
            
            $("#qcontent").val($("#qcontent").val() + $.trim(data));
			
			$.scrollTo('#qr', 800);
        });
    </script>
开发者ID:KR3W,项目名称:NinkoBB,代码行数:31,代码来源:footer.php

示例12: switchs

</dt>
				<dd><input type="text" class="border cp" name="aim" value="<?php 
echo switchs($user_data['aim'], $_POST['aim']);
?>
"></dd>
			</dl>
			
			<dl class="input">
				<dt><?php 
echo lang('interests');
?>
</dt>
				<dd><textarea class="border cp" name="interests" rows="10"><?php 
echo htmlspecialchars(stripslashes(switchs($user_data['interests'], $_POST['interests'])));
?>
</textarea></dd>
			</dl>
			
			<?php 
load_hook('user_profile_edit');
?>
			
			<dl class="input">
				<dt>&nbsp;</dt>
				<dd><input type="submit" class="button rounded" name="profile" value="submit"></dd>
			</dl>
		</div>
		</form>
		
		<div class="clear"></div>
	</div>
开发者ID:nijikokun,项目名称:NinkoBB,代码行数:31,代码来源:profile.php

示例13: load_hook

</div>

<?php 
if ($current_category == 0) {
    // If we do..
    if (show_categories()) {
        ?>
<div class="container">
	<h1 class="title topic">Categories</h1>
	<table width="100%" id="topic">
		<tr>
			<th class="subject">Category</th>
			<th class="posts">Posts</th>
			<th class="posts">Topics</th>
<?php 
        load_hook('category_headers');
        ?>
		</tr>
<?php 
        foreach ($categories as $category) {
            if ($category['expanded']) {
                continue;
            }
            ?>
		<tr>
			<td class="subject"><a href="?category=<?php 
            echo $category['id'];
            ?>
"><?php 
            echo $category['name'];
            ?>
开发者ID:amenski,项目名称:BookSharing,代码行数:31,代码来源:index-close.php

示例14: define

/**
*
* @package adm
* @version $Id$
* @copyright Copyright (c) 2013, Firat Akandere
* @author Firat Akandere <f.akandere@gmail.com>
* @license http://opensource.org/licenses/GPL-3.0 GNU Public License, version 3
*
*/
/**
* @ignore
*/
define('IN_MANGAREADER', true);
define('IN_ADMIN', true);
$mangareader_root_path = defined('MANGAREADER_ROOT_PATH') ? MANGAREADER_ROOT_PATH : './../';
$mangareader_admin_root_path = defined('MANGAREADER_ADMIN_ROOT_PATH') ? MANGAREADER_ADMIN_ROOT_PATH : './';
require $mangareader_root_path . 'common.php';
include_once $mangareader_root_path . 'includes/functions-admin.php';
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$page = request_var('page', '');
$subpage = request_var('subpage', '');
// Prepare menu pages
do_action('admin_menu_pages');
register_script('bootstrap', get_admin_template_directory_uri(true) . '/js/bootstrap.min.js', array('jquery'));
enqueue_script('bootstrap', true);
get_admin_header();
get_admin_sidebar();
load_hook($page, $subpage);
get_admin_footer();
开发者ID:pwltt,项目名称:MES-PWLTT-ENVI,代码行数:31,代码来源:index.php

示例15: parse

/**
 * Parse post content into readable data, or return default text
 * @global array
 * @param string $text data to be parsed
 * @param boolean $bbcode show bbcode or not?
 * @return mixed
 */
function parse($text, $bbcode_show = true)
{
    global $config, $parser;
    // Return base text!
    if (!$bbcode_show) {
        // Load the hook on a no bbcode parsing message
        load_hook('no_bbcode_message');
        return htmlspecialchars($text, ENT_QUOTES, 'UTF-8', FALSE);
    }
    // Do they allow bbcode or does this post allow bbcode?
    if ($config['bbcode'] && $bbcode_show) {
        // Convert special characters before bbcode :3
        $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8', FALSE);
        // Load the hook after special characters just incase.
        load_hook('bbcode_before');
        // Convert newlines
        $text = preg_replace("/\r\n|\r|\n/", "\n", $text);
        // Strip everything but newlines
        if (!function_exists('bbcode_stripcontents')) {
            function bbcode_stripcontents($text)
            {
                return preg_replace("/[^\n]/", '', $text);
            }
        }
        // Convert codes related specifically to code bbcode
        if (!function_exists('bbcode_code_convert')) {
            function bbcode_code_convert($text)
            {
                return preg_replace("/(\n|\r\n)/", '%nl', $text);
            }
        }
        // Convert codes related specifically to code bbcode
        if (!function_exists('bbcode_code_revert')) {
            function bbcode_code_revert($text)
            {
                return preg_replace("/\\%nl/", chr(13) . chr(10), $text);
            }
        }
        // Quoting :D
        if (!function_exists('bbcode_quote')) {
            function bbcode_quote($action, $attributes, $content, $params, $node_object)
            {
                if ($action == 'validate') {
                    return true;
                }
                if (!isset($attributes['default'])) {
                    $name = $content;
                    if ($action == 'output') {
                        $text = $content;
                    }
                    return '<blockquote><div class="userquotebox"><h4>Quote:</h4><div class="text">' . $text . '</div></div></blockquote>';
                } else {
                    $name = $attributes['default'];
                    if ($action == 'output') {
                        $text = $content;
                    }
                    return '<blockquote><div class="userquotebox"><h4>' . $name . ' wrote:</h4><div class="text">' . $text . '</div></div></blockquote>';
                }
            }
        }
        if (!function_exists('bbcode_color')) {
            function bbcode_color($action, $attributes, $content, $params, $node_object)
            {
                if ($action == 'validate') {
                    if ($attributes['default'] == "") {
                        return false;
                    }
                    if (!preg_match('/([a-zA-Z]*|\\#?[0-9a-fA-F]{6})/i', $attributes['default'])) {
                        return false;
                    }
                    return true;
                }
                $color = $attributes['default'];
                $text = $content;
                return '<span style="color: ' . $color . '">' . $text . '</span>';
            }
        }
        // Url parsing
        if (!function_exists('bbcode_url')) {
            function bbcode_url($action, $attributes, $content, $params, $node_object)
            {
                if (!isset($attributes['default'])) {
                    $url = $content;
                    $text = $content;
                } else {
                    $url = $attributes['default'];
                    $text = $content;
                }
                if ($action == 'validate') {
                    if (substr($url, 0, 5) == 'data:' || substr($url, 0, 5) == 'file:' || substr($url, 0, 11) == 'javascript:' || substr($url, 0, 4) == 'jar:') {
                        return false;
                    }
                    if (!is_url($url)) {
//.........这里部分代码省略.........
开发者ID:amenski,项目名称:BookSharing,代码行数:101,代码来源:forum.php


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