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'); } } }
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>
* 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>
</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
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>
*/ 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 {
<?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');
// 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); } }
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>
} } 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
?> </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>
</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> </dt> <dd><input type="submit" class="button rounded" name="profile" value="submit"></dd> </dl> </div> </form> <div class="clear"></div> </div>
</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']; ?>
/** * * @package adm * @version $Id$ * @copyright Copyright (c) 2013, Firat Akandere * @author Firat Akandere <*****@*****.**> * @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();
/** * 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)) { return false; } return true; } return '<a href="' . $url . '" rel="no-follow">' . $text . '</a>'; } } // Url parsing if (!function_exists('bbcode_img')) { function bbcode_img($action, $attributes, $content, $params, $node_object) { if ($action == 'validate') { if (substr($content, 0, 5) == 'data:' || substr($content, 0, 5) == 'file:' || substr($content, 0, 11) == 'javascript:' || substr($content, 0, 4) == 'jar:') { return false; } if (!preg_match('/((ht|f)tps?:\\/\\/)([^\\s<\\"]*?)\\.(jpg|jpeg|png|gif)/i', $content)) { return false; } return true; } return '<img src="' . $content . '" rel="no-follow">'; } } // Parsers $parser->addParser('list', 'bbcode_stripcontents'); $parser->addParser('code', 'bbcode_code_convert'); // Codes $parser->addCode('b', 'simple_replace', null, array('start_tag' => '<b>', 'end_tag' => '</b>'), 'inline', array('listitem', 'block', 'inline', 'link', 'quote'), array()); $parser->addCode('i', 'simple_replace', null, array('start_tag' => '<i>', 'end_tag' => '</i>'), 'inline', array('listitem', 'block', 'inline', 'link', 'quote'), array()); $parser->addCode('u', 'simple_replace', null, array('start_tag' => '<u>', 'end_tag' => '</u>'), 'inline', array('listitem', 'block', 'inline', 'link', 'quote'), array()); $parser->addCode('s', 'simple_replace', null, array('start_tag' => '<s>', 'end_tag' => '</s>'), 'inline', array('listitem', 'block', 'inline', 'link', 'quote'), array()); // Text related $parser->addCode('color', 'usecontent?', 'bbcode_color', array('usecontent_param' => 'default'), 'inline', array('listitem', 'block', 'inline', 'link', 'quote'), array('link')); // Links $parser->addCode('url', 'usecontent?', 'bbcode_url', array('usecontent_param' => 'default'), 'link', array('listitem', 'block', 'inline', 'link', 'quote'), array()); $parser->addCode('link', 'usecontent', 'bbcode_url', array(), 'link', array('listitem', 'block', 'inline', 'quote'), array()); // List $parser->addCode('list', 'simple_replace', null, array('start_tag' => '<ul>', 'end_tag' => '</ul>'), 'list', array('listitem', 'block', 'inline', 'link', 'quote'), array()); $parser->addCode('*', 'simple_replace', null, array('start_tag' => '<li>', 'end_tag' => '</li>'), 'listitem', array('list'), array()); // Images $parser->addCode('img', 'usecontent', 'bbcode_img', array(), 'image', array('listitem', 'block', 'inline', 'link', 'quote'), array()); $parser->addCode('image', 'usecontent', 'bbcode_img', array(), 'image', array('listitem', 'block', 'inline', 'link', 'quote'), array()); // Quote & Code $parser->addCode('quote', 'callback_replace', 'bbcode_quote', array('usecontent_param' => 'default'), 'quote', array('block', 'inline', 'quote'), array()); $parser->addCode('code', 'simple_replace', null, array('start_tag' => '<div class="codebox"><h4>Code:</h4><div class="scrollbox"><pre>', 'end_tag' => '</pre></div></div>'), 'code', array('block', 'inline', 'quote'), array('listitem', 'link')); // Occurrences $parser->setOccurrenceType('img', 'image'); $parser->setOccurrenceType('image', 'image'); $parser->setOccurrenceType('url', 'link'); $parser->setMaxOccurrences('image', 4); $parser->setMaxOccurrences('link', 20); // Flags $parser->setCodeFlag('*', 'closetag', BBCODE_CLOSETAG_OPTIONAL); $parser->setCodeFlag('*', 'paragraphs', false); $parser->setCodeFlag('list', 'paragraph_type', BBCODE_PARAGRAPH_BLOCK_ELEMENT); $parser->setCodeFlag('list', 'opentag.after.newline', BBCODE_NEWLINE_DROP); $parser->setCodeFlag('list', 'closetag.after.newline', BBCODE_NEWLINE_DROP); $parser->setCodeFlag('quote', 'opentag.after.newline', BBCODE_NEWLINE_DROP); $parser->setCodeFlag('quote', 'closetag.after.newline', BBCODE_NEWLINE_DROP); // Just before its parsed load_hook('bbcode_before_parse'); // Parse the text $text = $parser->parse($text); // Just once $text = nl2br($text); // Clickable $text = clickable($text); // Revert the code changes $text = bbcode_code_revert($text); // After everything is done. load_hook('bbcode_after'); } // Return a fully parsed post / other return $text; }
/** * Checks to see what type of user we are dealing with * @global resource * @param string $username username of user to be checked against * @return boolean|integer */ function type($username) { global $database; // Don't trust anyone $username = $database->escape($username); // Select only admin from the user table with the username given. $data = $database->query("SELECT * FROM `users` WHERE `username` = '{$username}' LIMIT 1"); // Check to see if any rows were returned if ($database->num($data) < 0) { return false; } else { // There were, So return that they are infact an admin. $data = $database->fetch($data); // before load_hook('type_before'); if ($data['banned']) { return 3; } if ($data['moderator']) { return 2; } if ($data['admin']) { return 1; } // after load_hook('type_after'); return false; } }
<?php if (is_loaded('titles')) { ?> <?php echo get_title($author); ?> - <?php } ?> <?php echo forum_count(false, $author['id'], 'user'); ?> posts <?php load_hook('message_user_info_after'); ?> <div class="clear"></div> </div> <div id="post"> <?php load_hook('message_before'); ?> <?php echo parse($post['message']); load_hook('message_after'); ?> </div> </div>
?> " type="submit" /> <?php load_hook('qr_subject_after'); ?> </div> <div class="content"> <?php echo lang('message'); ?> :<br /> <?php load_hook('qr_textarea_before'); ?> <textarea name="qcontent" id="qcontent" class="border" style="width: 98.3%; height: 150px;"><?php echo switchs(field_clean($_POST['qcontent'])); ?> </textarea> <?php load_hook('qr_textarea_after'); ?> </div> <?php load_hook('qr_inside_after'); ?> </div> </form> <?php load_hook('qr_after');
"><?php echo lang('edit_account'); ?> </a></li> <li><a href="<?php echo $config['url_path']; ?> /users.php?a=avatar" class="<?php echo equals($action, "avatar", "menu-current", "menu"); ?> "><?php echo lang('edit_avatar'); ?> </a></li> <li><a href="<?php echo $config['url_path']; ?> /users.php?a=profile" class="<?php echo equals($action, "profile", "menu-current", "menu"); ?> "><?php echo lang('edit_profile'); ?> </a></li> <?php load_hook('user_navigation'); ?> <div class="clear"></div> </ul> <div class="clear"></div>
} if (!isset($plugin['name'])) { continue; } if ($loading['name'] == $plugin['plugin']) { // Load the plugin include 'plugins/' . $plugin['file']; // That plugin has been loaded. plugin_loaded($plugin['plugin']); } } } } /** * Include Sessions */ include "include/sessions.php"; // Common hook load_hook('common'); // Just incase unset($user_data); // Logged in? if ($_SESSION['logged_in']) { /** * Set user data * @global array $user_data */ $user_data = user_data($_SESSION['user_id']); // Last seen update update_user($user_data['id'], false, 'last_seen', time()); }
?> :</label><input name="password" size="15" type="password" class="border" value="" /></li> <?php load_hook('navigation_login'); ?> <li><input type="submit" name="login" value="<?php echo lang('login'); ?> " class="button"></li> <div class="clear"></div> </ul> </form> <?php } if ($_SESSION['logged_in']) { load_hook('navigation_right'); ?> <ul> <?php if ($in_topic) { if ($closed && (!$_SESSION['admin'] || !$_SESSION['moderator'])) { ?> <li><a href="" class="nav_link"><?php echo lang('closed'); ?> </a></li> <?php } else { ?> <li><a href="<?php echo $config['url_path'];
} else { $errors[$key] = lang_parse('error_invalid_chars', array(lang($key))); } } else { if ($key == "first_name" || $key == "last_name") { // Check the data, output error into errors array if there was an error. if (alpha($data, 'alpha-space') || $data == "") { update_user($user_data['id'], false, $key, $data); } else { $errors[$key] = lang_parse('error_invalid_chars', array(lang($key))); } } } } } load_hook('user_profile_post'); } } } if (!$error && !$errors) { $success = lang('success_update_profile'); // Get new details unset($_POST); $user_data = user_data($_SESSION['user_id']); } } // Include the navigation include $config['template_path'] . "user/navigation.php"; // Include profile template include $config['template_path'] . "user/profile.php"; } else {
?> :<br /> <input type="text" name="qsubject" class="border" style="width: 93%" value="<?php echo switchs(field_clean($_POST['qsubject'])); ?> " /> <input name="post" value="<?php echo lang('reply'); ?> " type="submit" /> </td> </tr> <tr> <td width="200px;" valign="top"> <?php echo lang('message'); ?> :<br /> <textarea name="qcontent" id="qcontent" class="border" style="width: 99.3%; height: 150px;"><?php echo switchs(field_clean($_POST['qcontent'])); ?> </textarea> </td> </tr> <?php load_hook('quickreply_inside_after'); ?> </table> </form> <?php load_hook('quickreply_after');
$i++; } ?> </select> <input type="text" id="year" name="year" style="padding: 3px; width:10%;" class="border" value="<?php echo switchs(field_clean($_POST['year'])); ?> "> </td> </tr> <?php } ?> <?php load_hook('registration_form'); ?> <tr> <td class="post" colspan="2"> <div class="title"> <?php echo lang('agreement_title'); ?> </div> <div style="padding:2px" class="form"> <?php echo lang('agreement_terms'); ?> </div> </td>
<div class="container"> <h1 class="title topic"><a href="<?php echo $config['url_path']; ?> ?category=<?php echo $category['id']; ?> "><?php echo $category['name']; ?> »</a></h1> <table width="100%" id="topic"> <tr> <th class="subject" colspan="2">Topic</th> <th class="posts">Posts</th> <th class="last">Last Poster</th> <?php load_hook('topic_headers'); ?> </tr>
#Default: day before yestoday, e.g 'dt=20121019' $dt_new = date("Ymd", strtotime("-1 day")); #Default: yestoday, e.g 'dt=20121020' $cfg = $GLOBALS['sync_config']['configs'][$idx]; if (!isset($cfg['hive_item_key']) || empty($cfg['hive_item_key'])) { write2wflog("Failed: tbl [{$idx}] have invalid config --- hive_item_key"); continue; } $datadir = file_dir_init($cfg); $part = ""; $partition = ""; if (isset($cfg['data_sharding_tag'])) { $part = "pt={$cfg['data_sharding_tag']}/"; $partition = ", pt='{$cfg['data_sharding_tag']}'"; } $hook_flag = load_hook($cfg['dbname'] . "_" . $cfg['tblname']); if ($param_arr['type'] == "history") { ##DB table define copy to DW $ret = create_hive_table_if_noexist($cfg, $datadir['hql_create_tbl_dir']); if ($ret == false) { write2wflog("Failed: Create hive table failed, tbl={$idx}"); exit(1); } else { write2log("Success: Check & Create hive table"); } ##History data convert to DW $outf = convert_dbtable_history($cfg, $datadir['data_his_dir']); if (0 != exec("sh hive_tool.sh fput {$outf} {$cfg['hdfs_snapshot_path']}/dt=history/{$part} && rm -f {$outf}")) { write2wflog("Failed: sh hive_tool.sh fput {$outf} {$cfg['hdfs_snapshot_path']}/dt=history/{$part}"); exit(1); } else {