function list_children($from, MCSession $curusr, $filter = null) { $path_parts = explode("/", $from); $names = array(); foreach ($path_parts as $name) { if (!empty($name)) { $names[] = storagenamedecode($name); } } $cid = find_cid($names); $con = new DataBaseTable('content', true, DATACONF); $types = new DataBaseTable('types', true, DATACONF); $cq = $con->getData("pid:`= {$cid}`", null, null, $curusr->items_per_page, $_GET['offset']); $cols = $curusr->items_per_page / $curusr->rows_per_page; $grid = con_list_to_grid($cq); $list = "<div id=\"Grid-{$cid}\" class=\"grid grid-col-{$cols}\">" . $grid . "</div>\n"; if (empty($grid)) { $self = $con->getData("cid:`= {$cid}`"); $self = $self->fetch(); $type = $types->getData("ttid:`= {$self['ttid']}`"); $type = $type->fetch(); if ($type['ctype'] == 'page') { require_once dirname(__FILE__) . "/page.mod.php"; $list = load_page($self, $curusr); } else { $list = "<div id=\"Message-{$cid}\" class=\"alert alert-warning\">No Children detected for this content!</div>\n"; } } return $list; }
function handleShutdown() { if (($error = error_get_last())) { $buffer = ob_get_contents(); ob_clean(); # raport the event, send email etc. $msg= $buffer; $um ='We have found some error please try again later.'; ob_start(); $data=array(); $CI = get_instance(); if(!$CI->config->item('DEBUG_PRINT')) { $msg=''; } $data['print_msg'] =$msg; $data['um'] = $um; load_page('exception',$data); $buffer = ob_get_contents(); ob_end_clean(); echo $buffer; exit(); # from /error-capture, you can use another redirect, to e.g. home page } }
<?php namespace YABA; require_once 'includes/includes.inc.php'; if (!file_exists('config/')) { header('Location: setup/index.php?page=1'); } $config = load_object('blog'); $page = 1; if (array_key_exists('page', $_GET)) { $page = $_GET['page']; } $pages = []; load_page('main', ['page' => $page, 'parser' => new \Parsedown(), 'pages' => $pages]);
<?php /* * * "The main script. * * WELCOME. :)" - Andrzej Dąbski * */ /* * Very importat begining. * Remember to define AD_ROOT. */ define('AD_ROOT', '/var/www/AD_Project/'); function load_class($class_name) { include_once AD_ROOT . 'Class/' . $class_name . '.php'; } function load_page($page_name) { include_once AD_ROOT . 'Temples/' . $page_name . '.php'; } function load_config($config_name) { include_once AD_ROOT . 'Configs/' . $config_name . '.conf.php'; } load_class('Authorization'); Authorization::get_instance(); load_page('index');
<?php include_once "core/core.php"; load_page();
/** * Enables/disables Admin mode * @return boolean */ function admin_mode_update() { global $input; global $ezplayer_url; if (acl_admin_user()) { $_SESSION['admin_enabled'] = !$_SESSION['admin_enabled']; } $input['action'] = $_SESSION['ezplayer_mode']; if (count($input) > 0) { $ezplayer_url .= '/index.php?'; foreach ($input as $key => $value) { $ezplayer_url .= "{$key}={$value}&"; } } trace_append(array('0', 'admin_mode_update', $_SESSION['admin_enabled'])); // 4) Displaying the previous page header("Location: " . $ezplayer_url); load_page(); }
<?php require_once "app/functions.php"; $content = load_page($nid, $pdo); // ========================================== // // TEMPLATE FILES // -------------- // // All CMS page template files should be prefixed // with 'page-' and must have '.tpl.php' as the // extensions (e.g. 'page-my-custom-template.tpl.php') // // The 'load_page()' function must be called after // the functions file has been included to make the // the following variables available for use. // // // AVAILABLE VARIABLES: // ------------------- // // $content->nodeID : The ID of the current page // $content->title : The title of the CMS page // $content->description : The description meta tag // $content->body : The HTML body of the page // $content->published : The timestamp of when the page was created // $content->updated : The timestamp of when the page was last edited // $content->url : The default/original URL alias for the page // $content->template : The filename of the template this page uses // $content->head_title : The title (text) to be used within <title> tags in the header file // $content->head_code : Code to be included within the <head> tags of the header file
$l_sResponseStatusName = $vals[4]['value']; if ($l_iResponseStatusCode == 1) { //coordinates have been found successfully $l_sLongitude = $vals[11]['value']; $l_sLatitude = $vals[13]['value']; print "\n" . date("d/m/y : H:i:s", time()) . " Response long: " . $l_sLongitude; print "\n" . date("d/m/y : H:i:s", time()) . " Response latt: " . $l_sLatitude; } else { //error response - sending new request with only city name print "\n" . date("d/m/y : H:i:s", time()) . " Full address response was not found."; print "\n" . date("d/m/y : H:i:s", time()) . " Response status code: {$l_iResponseStatusCode}"; print "\n" . date("d/m/y : H:i:s", time()) . " Response status name: {$l_sResponseStatusName}"; $l_sAddress = trim($l_aOneRow['l_city']); $l_sURLTemp = str_replace("{address}", $l_sAddress, $l_sURL); print "\n" . date("d/m/y : H:i:s", time()) . " Calling API with only city name ({$l_sURLTemp})"; $l_iStatus = load_page($l_sURLTemp, &$a_sResult); if ($l_iStatus != 200) { print "\n" . date("d/m/y : H:i:s", time()) . " Error loading page."; } else { print "\n" . date("d/m/y : H:i:s", time()) . " Parsing XML..."; $p = xml_parser_create(); xml_parse_into_struct($p, $a_sResult, $vals, $index); xml_parser_free($p); $l_iResponseStatusCode = $vals[3]['value']; $l_sResponseStatusName = $vals[4]['value']; if ($l_iResponseStatusCode == 1) { //coordinates have been found successfully $l_sLongitude = $vals[11]['value']; $l_sLatitude = $vals[13]['value']; print "\n" . date("d/m/y : H:i:s", time()) . " Response long: " . $l_sLongitude; print "\n" . date("d/m/y : H:i:s", time()) . " Response latt: " . $l_sLatitude;
require_once 'config.php'; // Load all Configuration Parameters require_once 'functions.php'; // Load all needed base Functions if (isset($_GET['logout'])) { require_once ABSCPATH . 'modules/citizens/logout.php'; } //Logout User user_session_manager(); // Start the Session Manager if (!user_is_logged_in()) { // Check if User is Logged In if (!isset($_GET['login']) && !isset($_GET['oauth_token'])) { require_once 'modules/citizens/login.php'; } else { require_once 'modules/citizens/oauth.php'; } //If trying to Login, start the Oauth Procedure } else { session_start(); initiate(); // Initiate all Needed Variables/Methods debug(); if (isset($_GET['p'])) { load_page(trim($_GET['p'])); } else { load_home(); } // else Load Home }
<?php // load functions require '../functions/functions.php'; $_SESSION['exist'] = false; $_SESSION['match']; load_page('banner.html'); load_page("log_reg.php"); load_page("quote.html"); load_page("footer.html"); ?>
function doload($dir, $allow_directory = true, $may_execute = true) { if (file_exists($dir)) { if (is_file($dir)) { load_local_file($dir, EXTENSION, $may_execute); return true; } elseif (is_dir($dir) && !TRAILING_SLASH && REDIRECT_TRAILING_SLASH) { if ($_SERVER['REQUEST_METHOD'] == "POST") { load_page("404", 503); } else { header('Location: ' . URL . '/'); } return true; } elseif ($allow_directory && is_dir($dir) && (TRAILING_SLASH || FILENAME == '' || HANDLE_TRAILING_SLASH)) { require "defaults.php"; foreach ($defaults as $default => $execute) { # TODO: Optimize this! $extension = explode('.', $default); $extension = $extension[1]; if (file_exists("{$dir}/{$default}")) { if ($execute && $may_execute) { load_script_file("{$dir}/{$default}"); } else { load_local_file("{$dir}/{$default}", $extension); } return true; } } } } if (REQUESTED_FILE == "favicon.ico") { return serve_favicon(); } return false; }
if ($id > 0) { $url .= "/{$id}"; } //if (isset($_POST['cancel_id'])) { //} $url .= ".xml"; } else { if (isset($_GET['test'])) { $url = "http://dining.foretees.com/portal/reservations/available_time_options.json?reservation_category=dining&organization_id=4&location_id=124&reservation_date=2014-2-3"; } } if (strlen($url)) { //echo "<!-- $url -->"; //echo "<br>".url_encode_array($_POST); //echo load_page($url, $_POST); $xml = trim(load_page($url, $_POST)); if ($xml == "") { $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; $xml .= "<success>1</success>"; } echo $xml; } else { echo "Bad target selection. {$id}"; } function load_page($url, $post, $ref_url = false) { $ch = curl_init(); if (strlen($ref_url)) { curl_setopt($ch, CURLOPT_REFERER, $ref_url); } curl_setopt($ch, CURLOPT_URL, $url);
case "/": return "include/php/pages/start.php"; break; default: return "include/php/pages/404.php"; } } } } $path = $_SERVER["REQUEST_URI"]; // Remove GET Parameters $path = preg_replace('/\\?.*/', '', $path); // Remove prescending directory part e.g. webmum/ defined in SUBDIR $path = preg_replace("#" . SUBDIR . "#", '', $path); // Webserver should add trailing slash, but if there is no trailing slash for any reason, add one ;) if (strrpos($path, "/") != strlen($path) - 1) { $path = $path . "/"; } /* * Include page content here */ include load_page($path); /* * End of dynamic content */ require_once 'include/php/template/footer.php'; include_once 'include/php/db_close.inc.php'; ?>
<input onclick="custom_width(this)" type="radio" name="tabs" id="tab2"> <label for="tab2"> <i class="fa fa-css3"></i><span>Studs</span> </label> <!-- Radio button and lable for Kittens --> <input onclick="custom_width(this)" type="radio" name="tabs" id="tab3"> <label for="tab3"> <i class="fa fa-code"></i><span>Kittens</span> </label> <!-- Radio button and lable for Customers --> <input onclick="custom_width(this)" type="radio" name="tabs" id="tab4"> <label for="tab4"> <i class="fa fa-code"></i><span>Customers</span> </label> <?php load_page("queen", "1"); ?> <?php load_page("stud", "2"); ?> <?php load_page("kitten", "3"); ?> <?php load_page("customer", "4"); ?> <?php require 'includes/footer.php';
<?php namespace YABA; require_once 'includes/includes.inc.php'; $pages = ['categories' => 'Categories', 'posts' => 'Posts', 'newpost' => 'New Post']; session_start(); if (!logged_in()) { header('Location: index.php'); exit; } $page = array_key_exists('page', $_GET) ? $_GET['page'] : 'posts'; if ($_SERVER['REQUEST_METHOD'] == "GET") { load_page(sprintf(ADMIN_PAGE_PATH, $page), ['pages' => $pages]); } else { call_user_func(sprintf(ADMIN_FUNC_PATH, $page)); } function newpost() { $title = $_POST['post_title']; $text = $_POST['post_text']; $category = $_POST['post_category']; $author = $_SESSION['user_id']; add_post($title, $text, $category, $author); }
<button type="submit" name="markread" class="btn btn-primary"><span class="fa fa-fw fa-eye"></span> <?php _e('Mark as read', 'luna'); ?> </button> <button type="submit" name="markunread" class="btn btn-primary"><span class="fa fa-fw fa-eye-slash"></span> <?php _e('Mark as unread', 'luna'); ?> </button> </div> <div class="btn-group"> <a href="#" data-toggle="modal" data-target="#delete-form" class="btn btn-danger"><span class="fa fa-fw fa-trash"></span> <?php _e('Delete', 'luna'); ?> </a> <?php include load_page('inbox-delete-post.php'); ?> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><?php _e('Inbox', 'luna'); ?> </h3> </div> <input type="hidden" name="box" value="0" /> <table class="table"> <thead> <tr> <th><?php
<?php require dirname(__FILE__) . "/appcore/common.inc.php"; switch ($_GET['action']) { case 'restore': echo $_POST['data']; break; case 'process': default: require_once dirname(__FILE__) . "/appmodules/page.mod.php"; echo load_page($_POST, $session); }
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> </div> <?php } ?> </div> </div> <div class="right-column <?php echo $options['float'] ? 'float-view' : ''; ?> content-area span9"> <div class="content-page"> <article> <?php echo load_page($tree); ?> </article> </div> </div> </div> </div> <?php } ?> <?php if ($options['google_analytics']) { ?> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
<?php namespace YABA; require_once 'includes/includes.inc.php'; $error = false; $error_msg = ""; if (array_key_exists('logout', $_GET)) { session_start(); session_unset(); session_destroy(); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $result = login($_POST['email_address'], $_POST['password']); if ($result) { session_start(); $_SESSION = get_session_array($result); session_write_close(); header('Location: index.php'); } else { $error = true; $error_msg = "Invalid username and/or password"; } } $page_vars = ['error' => $error, '$error_msg' => $error_msg]; load_page('login', $page_vars);
$homepage_url = homepage_url($tree); $docs_url = docs_url($tree); } else { $homepage_url = "/"; } $docs_url = docs_url($tree); $url_params = url_params(); if (count($options['languages']) > 0 && count($url_params) > 0 && strlen($url_params[0]) > 0) { $language = array_shift($url_params); $base_path = "docs/" . $language; } else { $language = null; $base_path = "docs"; } $tree = get_tree($base_path, $base_url, '', true, $language); $page = load_page($tree, $url_params); // If a timezone has been set in the config file, override the default PHP timezone for this application. if (isset($options['timezone'])) { date_default_timezone_set($options['timezone']); } // Redirect to docs, if there is no homepage if ($homepage && $homepage_url !== '/') { header('Location: ' . $homepage_url); } ?> <!doctype html> <!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> <!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> <!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <head>
function message($message, $no_back_link = false, $http_status = null) { global $db, $luna_config, $luna_start, $luna_user; // Did we receive a custom header? if (!is_null($http_status)) { header('HTTP/1.1 ' . $http_status); } $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Info', 'luna')); define('FORUM_ACTIVE_PAGE', 'index'); require load_page('header.php'); ?> <div class="error-message"> <h2><?php _e('We\'ve got us a situation here.', 'luna'); ?> </h2> <p><?php echo $message; ?> </p> </div> <?php require load_page('footer.php'); exit; }
case 'clear': comment_delete($to); break; case 'post': post_add($at); break; case 'board': board_view($at); break; case 'join': member_join(); break; case 'modify': member_modify(); break; case 'member': member_view($to); break; case 'feed': feed(); break; case 'action': require './core/action.php'; break; default: include load_page($_GET['do']); } } else { include load_page('index'); } mysql_close($connect);
<button type="submit" name="markread" class="btn btn-primary"><span class="fa fa-fw fa-eye"></span> <?php _e('Mark as read', 'luna'); ?> </button> <button type="submit" name="markunread" class="btn btn-primary"><span class="fa fa-fw fa-eye-slash"></span> <?php _e('Mark as unread', 'luna'); ?> </button> </div> <div class="btn-group"> <a href="#" data-toggle="modal" data-target="#delete-form" class="btn btn-danger"><span class="fa fa-fw fa-trash"></span> <?php _e('Delete', 'luna'); ?> </a> <?php include load_page('inbox-delete-comment.php'); ?> </div> <div class="btn-group pull-right"> <a type="button" class="btn btn-success" href="new_inbox.php"><span class="fa fa-fw fa-pencil"></span> <?php _e('Compose', 'luna'); ?> </a> </div> </div> <?php if ($luna_user['g_inbox_limit'] != '0' && !$luna_user['is_admmod']) { $per_cent_box = ceil($luna_user['num_inbox'] / $luna_user['g_inbox_limit'] * '100'); echo '<div class="progress"><div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="' . $per_cent_box . '" aria-valuemin="0" aria-valuemax="100" style="width: ' . $per_cent_box . '%;"><span class="progress-text">' . $per_cent_box . '%</span></div></div>'; } ?>
$limit = $start_from . ',' . $luna_config['o_message_per_page']; // Start building page $page_title = array(luna_htmlspecialchars($luna_config['o_board_title']), __('Private Messages', 'luna'), __('Inbox', 'luna')); $result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.facebook, u.msn, u.twitter, u.google, u.location, u.signature, u.disp_threads, u.disp_comments, u.email_setting, u.notify_with_comment, u.auto_notify, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.php_timezone, u.language, u.style, u.num_comments, u.last_comment, u.registered, u.registration_ip, u.admin_note, u.date_format, u.time_format, u.last_visit, u.color_scheme, u.accent, g.g_id, g.g_user_title, g.g_moderator FROM ' . $db->prefix . 'users AS u LEFT JOIN ' . $db->prefix . 'groups AS g ON g.g_id=u.group_id WHERE u.id=' . $id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); if (!$db->num_rows($result)) { message(__('Bad request. The link you followed is incorrect, outdated or you are simply not allowed to hang around here.', 'luna'), false, '404 Not Found'); } $user = $db->fetch_assoc($result); $user_username = luna_htmlspecialchars($user['username']); $user_usertitle = get_title($user); define('LUNA_ACTIVE_PAGE', 'inbox'); require load_page('header.php'); ?> <script type="text/javascript"> /* <![CDATA[ */ function checkAll(checkWhat,command){ var inputs = document.getElementsByTagName('input'); for(index = 0; index < inputs.length; index++){ if(inputs[index].name == checkWhat){ inputs[index].checked=document.getElementById(command).checked; } } } /* ]]> */ </script> <?php require load_page('inbox.php'); } require load_page('footer.php');
<?php load_meta(); ?> <style> .emoji { font-size: <?php echo $luna_config['o_emoji_size']; ?> px; } </style> </head> <body> <?php if ($luna_user['is_guest']) { require load_page('login.php'); } ?> <div class="container container-main" id="main"> <div id="header"> <div class="navbar navbar-inverse navbar-static-top"> <div class="container"> <a class="navbar-brand" href="index.php"><?php echo $menu_title; ?> </a> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-primary-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>
case 'template': $path = settings('output_path'); if (empty($path)) { $path = get_cache_path(settings('mde_template_filename')); } $unlinked = file_exists($path) ? unlink($path) : true; if ($unlinked && prepare_markdown_template($path)) { ok(sprintf('template file created at "%s"', $path)); } else { error(sprintf('template file NOT created! (check user rights on file "%s")', $path)); } break; case 'flush': if (flush_cache()) { ok(sprintf('app-cache has been flushed at "%s"', settings('temporary_directory'))); } else { error(sprintf('app-cache has NOT been flushed! (check user rights on directory "%s")', settings('temporary_directory'))); } break; case 'debug': $content = load_page(settings('arg_page')); header('Content-Type: text/plain'); var_export(settings()); exit('-- debug --'); break; default: echo sprintf('Unknown action "%s"!', $action); break; } } exit;
<?php require "includes/requires/config.php"; function load_page($current_page) { global $current_sec, $current_sub; if ($current_page == "home") { include "templates/default/pages/home.php"; } else { if (file_exists("content/pages/" . $current_page . ".php")) { include "content/pages/" . $current_page . ".php"; } else { include "templates/default/pages/404.php"; } } } if (isset($_GET["sub"])) { $current_sub = $_GET["sub"]; $current_sec = $_GET["sec"]; $current_page = $current_sub; } else { if (isset($_GET["sec"])) { $current_sec = $_GET["sec"]; $current_page = $current_sec; } else { $current_page = "home"; } } load_page($current_page);
function load_page($page) { if (!$page) { $page = 'index.inc.php'; } else { $page = $page . '.inc.php'; } if (file_exists('pool/pages/' . $page)) { $page = 'pool/pages/' . $page; } elseif (file_exists('chrome/content/' . $page)) { $page = 'chrome/content/' . $page; } else { set_clue('您尋找的頁面並不存在!'); $page = load_page('notfound'); } return $page; }
post_delete_action(); break; case 'comment_add': comment_add_action(); break; case 'comment_certify': comment_certify_action(); break; case 'comment_edit': comment_edit_action(); break; case 'comment_delete': comment_delete_action(); break; default: include load_page('denied'); } function member_join_action() { $OK = TRUE; if (empty($_POST['member_login'])) { $OK = FALSE; set_clue('請記得填寫帳號!'); } if (!empty($_POST['member_login']) && member_exist(strtolower($_POST['member_login']))) { $OK = FALSE; set_clue('此帳號已有人使用!'); } if (empty($_POST['member_nicename'])) { $OK = FALSE; set_clue('請記得填寫暱稱!');
} // Try one last-ditch attempt to load a default file. if ($method_level == 0) { load_defaultmethodfile(); } // If the methods class implements a default method, call that and don't fail. if ($method_level == 1 && method_exists($method_base, '__default')) { $method_name = '__default'; $method_level++; } # TODO : This might not fire if the error occurs on the last item; // Throw a 404 if the URL doesn't specify a class and method if ($method_level < 2) { load_page("404", 404); } else { // Otherwise, call the method in the class $result = call_user_func_array(array($method_base, $method_name), $method_arguments); if ($result !== false) { // This should have Django-like output (HttpResponse, etc.) $result->output(); } } } elseif (is_file(PATH_PREFIX . '/endpoint.php')) { load_script_file(PATH_PREFIX . '/endpoint.php'); } else { ini_set("include_path", PATH_PREFIX . ':' . ini_get("include_path")); if (!doload(PATH_PREFIX . '/' . REQUESTED_FILE)) { load_page("404", 404); } } }