本文整理匯總了PHP中load_skin函數的典型用法代碼示例。如果您正苦於以下問題:PHP load_skin函數的具體用法?PHP load_skin怎麽用?PHP load_skin使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了load_skin函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: load_skin
* - [style=fantasy]...[/style] - guess what will appear
* - [style=my_style]...[/style] - translated to <span class="my_style">...</span>
*
* @see codes/index.php
*
* @author Bernard Paques
* @author GnapZ
* @reference
* @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
*/
// common definitions and initial processing
include_once '../shared/global.php';
// load localized strings
i18n::bind('codes');
// load the skin
load_skin('codes');
// the path to this page
$context['path_bar'] = array('help/' => i18n::s('Help index'), 'codes/' => i18n::s('Formatting Codes'));
// the title of the page
$context['page_title'] = i18n::s('In-line formatting codes');
// the date of last modification
if (Surfer::is_associate()) {
$context['page_details'] .= '<p class="details">' . sprintf(i18n::s('Edited %s'), Skin::build_date(getlastmod())) . '</p>';
}
// page header
$context['text'] .= '<p>' . i18n::s('On this page we are introducing some formatting codes and live examples of utilization.') . '</p>';
// add a toc
$context['text'] .= "\n" . '[toc]' . "\n";
// **...**
$context['text'] .= '[title]' . i18n::s('Wiki bold') . ' [escape]**...**[/escape][/title]' . Skin::table_prefix('wide') . Skin::table_row(array(i18n::s('Example'), i18n::s('Rendering')), 'header') . '<tr><td class="sample">[escape]' . i18n::s('This is very **important**, isn\'t it?') . '[/escape]</td>' . '<td>' . i18n::s('This is very **important**, isn\'t it?') . '</td></tr>' . Skin::table_suffix();
// [b]...[/b]
示例2: elseif
$id = NULL;
if (isset($_REQUEST['id'])) {
$id = $_REQUEST['id'];
} elseif (isset($context['arguments'][0])) {
$id = $context['arguments'][0];
}
$id = strip_tags($id);
// get the related anchor, if any
$anchor = NULL;
if (isset($id)) {
$anchor = Anchors::get($id);
}
// load localized strings
i18n::bind('behaviors');
// load the skin, maybe with a variant
load_skin('agreements', $anchor);
// no subject
if (!is_object($anchor)) {
Logger::error(i18n::s('No item has the provided id.'));
} else {
// initialize the list of agreements
if (!isset($_SESSION['agreements']) || !is_array($_SESSION['agreements'])) {
$_SESSION['agreements'] = array();
}
// append the new agreement
$_SESSION['agreements'][] = $anchor->get_reference();
// revisit referer
if (isset($_SERVER['HTTP_REFERER'])) {
Safe::redirect($_SERVER['HTTP_REFERER']);
}
}
示例3: load_skin
<?php
/**
* add intelligence to yacs
*
* @author Bernard Paques
* @author GnapZ
* @reference
* @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
*
*/
include_once '../shared/global.php';
// load localized strings
i18n::bind('behaviors');
// load the skin
load_skin('behaviors');
// set page title
$context['page_title'] = i18n::s('Behaviors');
// splash message
if (Surfer::is_associate()) {
$context['text'] .= '<p>' . i18n::s('Behaviors listed below can be used to customise articles attached to some sections.') . '</p>';
}
// list behaviors available on this system
$context['text'] .= '<ul>';
if ($dir = Safe::opendir($context['path_to_root'] . 'behaviors')) {
// every php script is a behavior, except index.php, behavior.php and behaviors.php
while (($file = Safe::readdir($dir)) !== FALSE) {
if ($file[0] == '.' || is_dir($context['path_to_root'] . 'behaviors/' . $file)) {
continue;
}
if ($file == 'index.php') {
示例4: elseif
if (isset($_REQUEST['search'])) {
$search = $_REQUEST['search'];
} elseif (isset($context['arguments'][0])) {
$search = $context['arguments'][0];
}
$search = strip_tags($search);
// search type
$type = '';
if (isset($_REQUEST['type'])) {
$type = $_REQUEST['type'];
}
$type = strip_tags($type);
// load localized strings
i18n::bind('services');
// load a skin engine
load_skin('services');
// loads feeding parameters
Safe::load('parameters/feeds.include.php');
// set default values
if (!$context['channel_title']) {
$context['channel_title'] = $context['site_name'];
}
if (!$context['channel_description']) {
$context['channel_description'] = $context['site_description'];
}
// channel attributes
$values = array();
$values['channel'] = array();
// set channel information
if ($search) {
$values['channel']['title'] = sprintf(i18n::s('%s at %s'), $search, $context['channel_title']);
示例5: elseif
$anchor = Anchors::get($item['anchor']);
}
// associates can do what they want
if (Surfer::is_associate()) {
$permitted = TRUE;
} elseif (is_object($anchor) && !$anchor->is_viewable()) {
$permitted = FALSE;
} elseif ($item['active'] == 'R' && Surfer::is_member()) {
$permitted = TRUE;
} elseif ($item['active'] == 'Y') {
$permitted = TRUE;
} else {
$permitted = FALSE;
}
// load the skin
load_skin('servers');
// current item
if (isset($item['id'])) {
$context['current_item'] = 'server:' . $item['id'];
}
// the path to this page
$context['path_bar'] = array('servers/' => i18n::s('Servers'));
// the title of the page
if ($item['title']) {
$context['page_title'] = $item['title'];
}
// not found
if (!$item['id']) {
include '../error.php';
// permission denied
} elseif (!$permitted) {
示例6: strip_tags
$id = strip_tags($id);
// get the item from the database
$item = Tables::get($id);
// get the related anchor, if any
$anchor = NULL;
if (isset($item['anchor']) && $item['anchor']) {
$anchor = Anchors::get($item['anchor']);
}
// only associates can proceed
if (Surfer::is_associate()) {
$permitted = TRUE;
} else {
$permitted = FALSE;
}
// load the skin, maybe with a variant
load_skin('tables', $anchor);
// clear the tab we are in, if any
if (is_object($anchor)) {
$context['current_focus'] = $anchor->get_focus();
}
// the path to this page
if (is_object($anchor) && $anchor->is_viewable()) {
$context['path_bar'] = $anchor->get_path_bar();
} else {
$context['path_bar'] = array('tables/' => i18n::s('Tables'));
}
// the title of the page
$context['page_title'] = i18n::s('Delete a table');
// not found
if (!isset($item['id'])) {
include '../error.php';
示例7: load_skin
* @author GnapZ
* @tester Agnes
* @reference
* @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
*/
// common definitions and initial processing
include_once '../shared/global.php';
include_once '../comments/comments.php';
include_once '../links/links.php';
// find the target anchor in path args (e.g., http:.../sections/select.php?anchor=article:15)
$anchor = NULL;
if (isset($_REQUEST['anchor'])) {
$anchor = Anchors::get($_REQUEST['anchor']);
}
// load the skin, maybe with a variant
load_skin('sections', $anchor);
// the path to this page
if (is_object($anchor) && $anchor->is_viewable()) {
$context['path_bar'] = $anchor->get_path_bar();
} else {
$context['path_bar'] = array('sections/' => i18n::s('Site map'));
}
// the title of the page
if (is_object($anchor) && $anchor->is_viewable()) {
$context['page_title'] = sprintf(i18n::s('Sections of %s'), $anchor->get_title());
}
// stop crawlers
if (Surfer::is_crawler()) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// an anchor is mandatory
示例8: elseif
$anchor = Anchors::get($item['anchor']);
}
// associates and editors can do what they want
if (Surfer::is_associate() || is_object($anchor) && $anchor->is_assigned()) {
$permitted = TRUE;
} elseif (is_object($anchor) && !$anchor->is_viewable()) {
$permitted = FALSE;
} elseif ($item['active'] == 'R' && Surfer::is_member()) {
$permitted = TRUE;
} elseif ($item['active'] == 'Y') {
$permitted = TRUE;
} else {
$permitted = FALSE;
}
// load the skin
load_skin('print');
// the path to this page
if (is_object($anchor) && $anchor->is_viewable()) {
$context['path_bar'] = $anchor->get_path_bar();
} else {
$context['path_bar'] = array('categories/' => i18n::s('Categories'));
}
// the title of the page
if (isset($item['title'])) {
$context['page_title'] = $item['title'];
}
// stop crawlers
if (Surfer::is_crawler()) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// not found
示例9: strip_tags
$id = strip_tags($id);
// get the item from the database
$item = Locations::get($id);
// get the related anchor, if any
$anchor = NULL;
if (isset($item['anchor']) && $item['anchor']) {
$anchor = Anchors::get($item['anchor']);
}
// the anchor has to be viewable by this surfer
if (!is_object($anchor) || $anchor->is_viewable()) {
$permitted = TRUE;
} else {
$permitted = FALSE;
}
// load the skin, maybe with a variant
load_skin('locations', $anchor);
// current item
if (isset($item['id'])) {
$context['current_item'] = 'location:' . $item['id'];
}
// the path to this page
if (is_object($anchor)) {
$context['path_bar'] = $anchor->get_path_bar();
} else {
$context['path_bar'] = array('locations/' => i18n::s('Locations'));
}
// the title of the page
if ($item['geo_place_name']) {
$context['page_title'] = $item['geo_place_name'];
}
// not found -- help web crawlers
示例10: load_skin
* the active configuration before the last change.
*
* If the file [code]parameters/demo.flag[/code] exists, the script assumes that this instance
* of YACS runs in demonstration mode.
* In this mode the edit form is displayed, but parameters are not saved in the configuration file.
*
* @author Bernard Paques
* @author GnapZ
* @reference
* @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
*/
// common definitions and initial processing
include_once '../shared/global.php';
include_once 'files.php';
// load the skin
load_skin('files');
// the path to this page
$context['path_bar'] = array('control/' => i18n::s('Control Panel'));
// the title of the page
$context['page_title'] = sprintf(i18n::s('%s: %s'), i18n::s('Configure'), i18n::s('Files'));
// anonymous users are invited to log in or to register
if (!Surfer::is_logged()) {
Safe::redirect($context['url_to_home'] . $context['url_to_root'] . 'users/login.php?url=' . urlencode('files/configure.php'));
} elseif (!Surfer::is_associate()) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// display the input form
} elseif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'POST') {
// load current parameters, if any
Safe::load('parameters/files.include.php');
// the form
示例11: elseif
$id = NULL;
if (isset($_REQUEST['id'])) {
$id = $_REQUEST['id'];
} elseif (isset($context['arguments'][0])) {
$id = $context['arguments'][0];
}
$id = strip_tags($id);
// get the item from the database
$item = Articles::get($id);
// get the related anchor
$anchor = NULL;
if (isset($item['anchor']) && $item['anchor']) {
$anchor = Anchors::get($item['anchor']);
}
// load the skin, maybe with a variant
load_skin('articles', $anchor, isset($item['options']) ? $item['options'] : '');
// clear the tab we are in, if any
if (is_object($anchor)) {
$context['current_focus'] = $anchor->get_focus();
}
// the title of the page
if (isset($item['title'])) {
$context['page_title'] = $item['title'];
}
// not found
if (!isset($item['id'])) {
include '../error.php';
// permission denied
} elseif (!Articles::allow_access($item, $anchor)) {
// give anonymous surfers a chance for HTTP authentication
if (!Surfer::is_logged()) {
示例12: elseif
$anchor = Anchors::get($item['anchor']);
}
// associates and authenticated editors can do what they want
if (Surfer::is_associate() || Surfer::is_member() && is_object($anchor) && $anchor->is_assigned()) {
$permitted = TRUE;
} elseif (is_object($anchor) && !$anchor->is_viewable()) {
$permitted = FALSE;
} elseif (Surfer::is_member() && !strcmp($item['anchor'], 'user:' . Surfer::get_id())) {
$permitted = TRUE;
} elseif (isset($item['edit_id']) && Surfer::is($item['edit_id'])) {
$permitted = TRUE;
} else {
$permitted = FALSE;
}
// load the skin, maybe with a variant
load_skin('links', $anchor);
// clear the tab we are in, if any
if (is_object($anchor)) {
$context['current_focus'] = $anchor->get_focus();
}
// the path to this page
if (is_object($anchor) && $anchor->is_viewable()) {
$context['path_bar'] = $anchor->get_path_bar();
} else {
$context['path_bar'] = array('links/' => i18n::s('Links'));
}
// the title of the page
$context['page_title'] = i18n::s('Delete a link');
// not found
if (!isset($item['id'])) {
include '../error.php';
示例13: load_skin
*
* YACS attempts to stop robots by generating a random string and by asking user to type it.
*
* @author Bernard Paques
* @tester fw_crocodile
* @reference
* @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
*/
// common definitions and initial processing
include_once 'shared/global.php';
// do not always show the edition form
$with_form = FALSE;
// load localized strings
i18n::bind('root');
// load the skin
load_skin('query');
// the title of the page
$context['page_title'] = i18n::s('Help');
// get a section for queries
if (!($anchor = Anchors::get('section:queries'))) {
$fields = array();
$fields['nick_name'] = 'queries';
$fields['title'] =& i18n::c('Queries');
$fields['introduction'] =& i18n::c('Submitted to the webmaster by any surfers');
$fields['description'] =& i18n::c('<p>This section has been created automatically on query submission. It\'s aiming to capture feedback directly from surfers. It is highly recommended to delete pages below after their processing. Of course you can edit submitted queries to assign them to other sections if necessary.</p>');
$fields['locked'] = 'Y';
// no direct contributions
$fields['active_set'] = 'N';
// for associates only
$fields['index_map'] = 'N';
// listed only to associates
示例14: elseif
} elseif (is_readable('yacs/shared/global.php')) {
include_once 'yacs/shared/global.php';
} else {
exit('The file shared/global.php has not been found. Please reinstall or mention home directory in file yacs.home or configure the YACS_HOME environment variable.');
}
// load libraries used in this script
include_once $context['path_to_root'] . 'feeds/feeds.php';
// some links to newsfeeds
include_once $context['path_to_root'] . 'links/links.php';
// load localized strings
i18n::bind('root');
// load the skin, and flag topmost page against regular front page
if ($context['script_url'] == '/index.php' && $context['url_to_root'] != '/') {
load_skin('slash');
} else {
load_skin('home');
}
// the menu bar may be made of sections
if (isset($context['root_sections_at_home']) && $context['root_sections_at_home'] != 'none' && isset($context['root_sections_layout']) && $context['root_sections_layout'] == 'menu') {
// default number of sections to list
if (!isset($context['root_sections_count_at_home']) || $context['root_sections_count_at_home'] < 1) {
$context['root_sections_count_at_home'] = 5;
}
if ($items = Sections::list_by_title_for_anchor(NULL, 0, $context['root_sections_count_at_home'], 'menu')) {
$context['page_menu'] = $items;
}
}
// load the cover page
if ((!isset($context['root_cover_at_home']) || $context['root_cover_at_home'] != 'none') && $context['master_host'] == $context['main_host']) {
// look for a named page
if ($cover_page = Articles::get('cover')) {
示例15: load_skin
*
* Only associates can use this script.
*
* This script relies on an external library to handle archive files.
*
* @author Bernard Paques
* @reference
* @license http://www.gnu.org/copyleft/lesser.txt GNU Lesser General Public License
*/
// common definitions and initial processing
include_once '../shared/global.php';
// the target file
$id = NULL;
$name = NULL;
// load the skin
load_skin('skins');
// the path to this page
$context['path_bar'] = array('skins/' => i18n::s('Themes'));
// the title of the page
$context['page_title'] = i18n::s('Upload a theme');
// stop crawlers
if (Surfer::is_crawler()) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// anonymous users are invited to log in or to register
} elseif (!Surfer::is_logged()) {
Safe::redirect($context['url_to_home'] . $context['url_to_root'] . 'users/login.php?url=' . urlencode('skins/upload.php'));
} elseif (!Surfer::is_associate()) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// process uploaded data