本文整理汇总了PHP中get_self_url函数 的典型用法代码示例。如果您正苦于以下问题:PHP get_self_url函数的具体用法?PHP get_self_url怎么用?PHP get_self_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_self_url函数 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
require_code('textfiles');
$file = array_key_exists('param', $map) ? $map['param'] : 'admin_notes';
$title = array_key_exists('title', $map) ? $map['title'] : do_lang('NOTES');
$lang_none = array_key_exists('lang_none', $map) ? $map['lang_none'] : '0';
$scrolls = array_key_exists('scrolls', $map) ? $map['scrolls'] : '0';
$lang = $lang_none == '1' ? NULL : '';
$file = filter_naughty($file, true);
$new = post_param('new', NULL);
if (!is_null($new)) {
$hooks = find_all_hooks('blocks', 'main_notes');
foreach (array_keys($hooks) as $hook) {
require_code('hooks/blocks/main_notes/' . filter_naughty_harsh($hook));
$ob = object_factory('Hook_notes_' . filter_naughty_harsh($hook), true);
if (is_null($ob)) {
continue;
}
$ob->run($file);
}
write_text_file($file, $lang, $new);
log_it('NOTES', $file);
attach_message(do_lang_tempcode('SUCCESS'), 'inform');
}
$contents = read_text_file($file, $lang, true);
$post_url = get_self_url();
$map_comcode = '';
foreach ($map as $key => $val) {
$map_comcode .= ' ' . $key . '="' . addslashes($val) . '"';
}
return do_template('BLOCK_MAIN_NOTES', array('_GUID' => 'f737053505de3bd8ccfe806ec014b8fb', 'TITLE' => $title, 'BLOCK_NAME' => 'main_notes', 'MAP' => $map_comcode, 'CONTENTS' => $contents, 'SCROLLS' => array_key_exists('scrolls', $map) && $map['scrolls'] == '1', 'URL' => $post_url));
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:38, 代码来源:main_notes.php
示例2: ajax_tree
/**
* Get details for an ajax-tree-list of entries for the content covered by this search hook.
*
* @return array A pair: the hook, and the options
*/
function ajax_tree()
{
$catalogue_name = get_param('catalogue_name', '');
if ($catalogue_name == '') {
@ob_end_clean();
$tree = nice_get_catalogues(NULL, true);
if ($tree->is_empty()) {
inform_exit(do_lang_tempcode('NO_ENTRIES'));
}
require_code('form_templates');
$fields = form_input_list(do_lang_tempcode('NAME'), '', 'catalogue_name', $tree, NULL, true);
if (running_script('iframe')) {
$post_url = get_self_url_easy();
} else {
$post_url = get_self_url(false, false, NULL, false, true);
}
$submit_name = do_lang_tempcode('PROCEED');
$hidden = build_keep_post_fields();
$title = get_page_title('SEARCH');
$tpl = do_template('FORM_SCREEN', array('_GUID' => 'a2812ac8056903811f444682d45ee448', 'TARGET' => '_self', 'GET' => true, 'SKIP_VALIDATION' => true, 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => '', 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name));
$echo = globalise($tpl, NULL, '', true);
$echo->evaluate_echo();
exit;
}
return array('choose_catalogue_category', array('catalogue_name' => $catalogue_name));
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:31, 代码来源:catalogue_entries.php
示例3: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
unset($map);
$forum = get_forum_type();
$out = new ocp_tempcode();
if ($forum != 'none') {
// Standard welcome back vs into greeting
$member = get_member();
if (is_guest($member)) {
$redirect = get_self_url(true, true);
$login_url = build_url(array('page' => 'login', 'type' => 'misc', 'redirect' => $redirect), get_module_zone('login'));
$join_url = $GLOBALS['FORUM_DRIVER']->join_url();
$join_bits = do_template('JOIN_OR_LOGIN', array('LOGIN_URL' => $login_url, 'JOIN_URL' => $join_url));
$p = do_lang_tempcode('WELCOME', $join_bits);
$out->attach(paragraph($p, 'hhrt4dsgdsgd'));
} else {
$out->attach(paragraph(do_lang_tempcode('WELCOME_BACK', escape_html($GLOBALS['FORUM_DRIVER']->get_username($member))), 'gfgdf9gjd'));
}
}
$message = get_option('welcome_message');
if (has_actual_page_access(get_member(), 'admin_config')) {
if ($message != '') {
$message .= ' [[page="_SEARCH:admin_config:category:SITE#group_GENERAL"]' . do_lang('EDIT') . '[/page]]';
}
}
$out->attach(comcode_to_tempcode($message, NULL, true));
return $out;
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:34, 代码来源:main_greeting.php
示例4: run
/**
* Standard modular run function.
*
* @param MEMBER The ID of the member we are getting link hooks for
* @return array List of tuples for results. Each tuple is: type,title,url
*/
function run($member_id)
{
if (!addon_installed('chat')) {
return array();
}
$modules = array();
if (has_actual_page_access(get_member(), 'chat', get_page_zone('chat'))) {
if (!is_guest() && $member_id != get_member()) {
require_lang('chat');
require_code('chat');
if (!$GLOBALS['FORUM_DRIVER']->is_staff($member_id)) {
if (!member_blocked($member_id)) {
$modules[] = array('contact', do_lang_tempcode('EXPLAINED_BLOCK_MEMBER'), build_url(array('page' => 'chat', 'type' => 'blocking_add', 'member_id' => $member_id, 'redirect' => get_self_url(true)), get_module_zone('chat')));
if (has_specific_permission(get_member(), 'start_im')) {
$modules[] = array('contact', do_lang_tempcode('START_IM'), build_url(array('page' => 'chat', 'type' => 'misc', 'enter_im' => $member_id), get_module_zone('chat')));
}
} else {
$modules[] = array('contact', do_lang_tempcode('EXPLAINED_UNBLOCK_MEMBER'), build_url(array('page' => 'chat', 'type' => 'blocking_remove', 'member_id' => $member_id, 'redirect' => get_self_url(true)), get_module_zone('chat')));
}
}
if (!member_befriended($member_id)) {
$modules[] = array('contact', do_lang_tempcode('MAKE_BUDDY'), build_url(array('page' => 'chat', 'type' => 'buddy_add', 'member_id' => $member_id, 'redirect' => get_self_url(true)), get_module_zone('chat')));
} else {
$modules[] = array('contact', do_lang_tempcode('DUMP_BUDDY'), build_url(array('page' => 'chat', 'type' => 'buddy_remove', 'member_id' => $member_id, 'redirect' => get_self_url(true)), get_module_zone('chat')));
}
}
}
return $modules;
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:35, 代码来源:chat.php
示例5: render_tab
/**
* Standard modular render function for profile tab hooks.
*
* @param MEMBER The ID of the member who is being viewed
* @param MEMBER The ID of the member who is doing the viewing
* @param boolean Whether to leave the tab contents NULL, if tis hook supports it, so that AJAX can load it later
* @return array A triple: The tab title, the tab contents, the suggested tab order
*/
function render_tab($member_id_of, $member_id_viewing, $leave_to_ajax_if_possible = false)
{
$title = do_lang_tempcode('MODULE_TRANS_NAME_warnings');
$order = 80;
if ($leave_to_ajax_if_possible) {
return array($title, NULL, $order);
}
require_lang('ocf');
require_css('ocf');
$warnings = new ocp_tempcode();
$rows = $GLOBALS['FORUM_DB']->query_select('f_warnings', array('*'), array('w_member_id' => $member_id_of, 'w_is_warning' => 1));
foreach ($rows as $row) {
$warning_by = $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($row['w_by']);
$date = get_timezoned_date($row['w_time']);
if ($row['w_explanation'] == '') {
$row['w_explanation'] = '?';
} else {
$row['w_explanation'] = str_replace(chr(10), ' ', $row['w_explanation']);
}
$row['w_explanation_orig'] = $row['w_explanation'];
if (strlen($row['w_explanation']) > 30) {
$row['w_explanation'] = substr($row['w_explanation'], 0, 27) . '...';
}
$explanation = hyperlink(build_url(array('page' => 'warnings', 'type' => '_ed', 'id' => $row['id'], 'redirect' => get_self_url(true)), get_module_zone('warnings')), $row['w_explanation'], false, true, $row['w_explanation_orig']);
$warnings->attach(paragraph(do_lang_tempcode('MEMBER_WARNING', $explanation, $warning_by, array(make_string_tempcode(escape_html($date)))), 'treyerhy34y'));
}
$content = do_template('OCF_MEMBER_PROFILE_WARNINGS', array('MEMBER_ID' => strval($member_id_of), 'WARNINGS' => $warnings));
return array($title, $content, $order);
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:37, 代码来源:warnings.php
示例6: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
//if (count($_POST)!=0) return new ocp_tempcode(); Can't do that, breaks previewing it
require_lang('recommend');
$_map = array('page' => 'recommend', 'from' => get_self_url(true));
if (array_key_exists('title', $map)) {
$_map['title'] = $map['title'];
}
$recommend_url = build_url($_map, '_SEARCH');
return do_template('BLOCK_MAIN_SCREEN_ACTIONS', array('PRINT_URL' => get_self_url(true, false, array('wide_print' => 1, 'max' => 1000)), 'RECOMMEND_URL' => $recommend_url, 'EASY_SELF_URL' => str_replace("'", '', urlencode(get_self_url(true))), 'TITLE' => array_key_exists('title', $map) ? $map['title'] : ''));
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:17, 代码来源:main_screen_actions.php
示例7: manage_custom_fields_donext_link
/**
* Get extra do-next icon for managing custom fields for a content type.
*
* @param ID_TEXT Award hook codename
* @return array Extra do-next icon (single item array, or empty array if catalogues not installed)
*/
function manage_custom_fields_donext_link($content_type)
{
if (addon_installed('catalogues')) {
require_lang('fields');
require_code('hooks/systems/awards/' . $content_type);
$ob = object_factory('Hook_awards_' . $content_type);
$info = $ob->info();
if (array_key_exists('supports_custom_fields', $info) && $info['supports_custom_fields'] && has_specific_permission(get_member(), 'submit_cat_highrange_content', 'cms_catalogues') && has_specific_permission(get_member(), 'edit_cat_highrange_content', 'cms_catalogues')) {
$exists = !is_null($GLOBALS['SITE_DB']->query_value_null_ok('catalogues', 'c_name', array('c_name' => '_' . $content_type)));
return array(array('edit_one_catalogue', array('cms_catalogues', array('type' => $exists ? '_edit_catalogue' : 'add_catalogue', 'id' => '_' . $content_type, 'redirect' => get_self_url(true)), get_module_zone('cms_catalogues')), do_lang('EDIT_CUSTOM_FIELDS', $info['title'])));
}
}
return array();
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:20, 代码来源:fields.php
示例8: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
require_lang('messaging');
require_code('feedback');
$to = array_key_exists('param', $map) ? $map['param'] : get_option('staff_address');
$post = post_param('post', '');
if (post_param_integer('_comment_form_post', 0) == 1 && $post != '') {
if (addon_installed('captcha')) {
if (get_option('captcha_on_feedback') == '1') {
require_code('captcha');
enforce_captcha();
}
}
$message = new ocp_tempcode();
/*Used to be written out here*/
attach_message(do_lang_tempcode('MESSAGE_SENT'), 'inform');
require_code('mail');
$email_from = trim(post_param('email', $GLOBALS['FORUM_DRIVER']->get_member_email_address(get_member())));
mail_wrap(post_param('title'), $post, array($to), NULL, $email_from, $GLOBALS['FORUM_DRIVER']->get_username(get_member()), 3, NULL, false, get_member());
if ($email_from != '') {
mail_wrap(do_lang('YOUR_MESSAGE_WAS_SENT_SUBJECT', post_param('title')), do_lang('YOUR_MESSAGE_WAS_SENT_BODY', $post), array($email_from), NULL, '', '', 3, NULL, false, get_member());
}
} else {
$message = new ocp_tempcode();
}
$box_title = array_key_exists('title', $map) ? $map['title'] : do_lang('CONTACT_US');
$private = array_key_exists('private', $map) && $map['private'] == '1';
$em = $GLOBALS['FORUM_DRIVER']->get_emoticon_chooser();
require_javascript('javascript_editing');
$comcode_help = build_url(array('page' => 'userguide_comcode'), get_comcode_zone('userguide_comcode', false));
require_javascript('javascript_validation');
$comment_url = get_self_url();
$email_optional = array_key_exists('email_optional', $map) ? intval($map['email_optional']) == 1 : true;
if (addon_installed('captcha')) {
require_code('captcha');
$use_captcha = get_option('captcha_on_feedback') == '1' && use_captcha();
if ($use_captcha) {
generate_captcha();
}
} else {
$use_captcha = false;
}
$comment_details = do_template('COMMENTS_POSTING_FORM', array('JOIN_BITS' => '', 'FIRST_POST_URL' => '', 'FIRST_POST' => '', 'USE_CAPTCHA' => $use_captcha, 'EMAIL_OPTIONAL' => $email_optional, 'POST_WARNING' => '', 'COMMENT_TEXT' => '', 'GET_EMAIL' => !$private, 'GET_TITLE' => !$private, 'EM' => $em, 'DISPLAY' => 'block', 'TITLE' => $box_title, 'COMMENT_URL' => $comment_url));
$out = do_template('BLOCK_MAIN_CONTACT_SIMPLE', array('_GUID' => '298a357f442f440c6b42e58d6717e57c', 'EMAIL_OPTIONAL' => true, 'COMMENT_DETAILS' => $comment_details, 'MESSAGE' => $message));
return $out;
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:52, 代码来源:main_contact_simple.php
示例9: build_bookmarks_menu
/**
* Build a bookmarks menu for the current member.
*
* @return array Faked database rows
*/
function build_bookmarks_menu()
{
require_lang('bookmarks');
$items = array();
$rows = $GLOBALS['SITE_DB']->query_select('bookmarks', array('*'), array('b_owner' => get_member()), 'ORDER BY b_folder');
// For managing existing bookmarks
if (count($rows) != 0) {
$rand_id = mt_rand(0, 1000000);
$_url = build_url(array('page' => 'bookmarks', 'type' => 'misc'), get_module_zone('bookmarks'));
$items[] = array('id' => $rand_id, 'i_parent' => NULL, 'cap' => do_lang('MANAGE_BOOKMARKS'), 'i_url' => $_url, 'i_check_permissions' => 0, 'i_expanded' => 0, 'i_new_window' => 1, 'i_page_only' => '');
}
// For adding a new bookmark
$self_url = get_param('url', '');
if ($self_url == '') {
$self_url = get_self_url(true);
}
$rand_id = mt_rand(0, 1000000);
//$url=build_url(array('page'=>'bookmarks','type'=>'ad','url'=>$self_url,'title'=>get_param('title','',true)),get_module_zone('bookmarks'));
$keep = symbol_tempcode('KEEP');
$url = find_script('bookmarks') . '?no_redirect=1&type=ad&url=' . urlencode(base64_encode($self_url)) . '&title=' . urlencode(get_param('title', '', true)) . $keep->evaluate();
$items[] = array('id' => $rand_id, 'i_parent' => NULL, 'cap' => do_lang('ADD_BOOKMARK'), 'i_popup' => 1, 'i_width' => 600, 'i_height' => 500, 'i_url' => $url, 'i_check_permissions' => 0, 'i_expanded' => 0, 'i_new_window' => 1, 'i_page_only' => '');
// Existing bookmarks
if (count($rows) != 0) {
// Spacer
$items[] = array('id' => $rand_id, 'i_parent' => NULL, 'cap' => '', 'i_url' => '', 'i_check_permissions' => 0, 'i_expanded' => 0, 'i_new_window' => 1, 'i_page_only' => '');
// Make our folders first
$parents = array('' => NULL);
foreach ($rows as $row) {
if (!array_key_exists($row['b_folder'], $parents)) {
$rand_id = mt_rand(0, 1000000);
$parents[$row['b_folder']] = $rand_id;
$items[] = array('id' => $rand_id, 'i_parent' => NULL, 'cap' => $row['b_folder'], 'i_url' => '', 'i_check_permissions' => 0, 'i_expanded' => 0, 'i_new_window' => 0, 'i_page_only' => '');
}
}
foreach ($rows as $row) {
$parent = $parents[$row['b_folder']];
list($zone, $attributes, $hash) = page_link_decode($row['b_page_link']);
$_url = build_url($attributes, $zone, NULL, false, false, false, $hash);
$items[] = array('id' => $row['id'], 'i_parent' => $parent, 'cap' => $row['b_title'], 'i_url' => $_url, 'i_check_permissions' => 0, 'i_expanded' => 0, 'i_new_window' => 0, 'i_page_only' => '');
}
}
return $items;
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:48, 代码来源:menus_bookmarks.php
示例10: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
require_code('templates_donext');
require_code('menus');
require_all_lang();
$type = get_param('type', 'misc');
if ((!has_specific_permission(get_member(), 'avoid_simplified_adminzone_look') || $GLOBALS['FORUM_DRIVER']->is_super_admin(get_member())) && num_staff_icons() < MIN_STAFF_ICONS_BEFORE_COLLAPSE) {
if ($type == 'misc') {
return do_next_manager_admin_simplified();
}
}
// Warning about whether the Setup Wizard still needs running
if (get_param_integer('cancel_sw_warn', 0) == 1 || !addon_installed('setupwizard')) {
set_value('setup_wizard_completed', '1');
} else {
$_done_sw_once = get_value('setup_wizard_completed');
$done_sw_once = !is_null($_done_sw_once);
if (!$done_sw_once && get_param('page', '') != 'admin_setupwizard' && has_actual_page_access(get_member(), 'admin_setupwizard')) {
$setup_wizard_url = build_url(array('page' => 'admin_setupwizard'), get_module_zone('admin_setupwizard'));
$cancel_sw_url = get_self_url(false, false, array('cancel_sw_warn' => 1));
attach_message(do_lang_tempcode('SETUP_WIZARD_NOT_RUN', escape_html($setup_wizard_url->evaluate()), escape_html($cancel_sw_url->evaluate())), 'notice');
}
}
switch ($type) {
case 'misc':
return do_next_manager_hooked('ADMIN_ZONE', 'DOC_ADMIN_ZONE', '');
case 'structure':
return do_next_manager_hooked('STRUCTURE', 'DOC_STRUCTURE', 'structure');
case 'usage':
return do_next_manager_hooked('USAGE', 'DOC_USAGE', 'usage');
case 'style':
return do_next_manager_hooked('STYLE', 'DOC_STYLE', 'style');
case 'setup':
return do_next_manager_hooked('SETUP', 'DOC_SETUP', 'setup');
case 'tools':
return do_next_manager_hooked('TOOLS', 'DOC_TOOLS', 'tools');
case 'security':
return do_next_manager_hooked('SECURITY', 'DOC_SECURITY', 'security');
case 'search':
return $this->search();
}
return new ocp_tempcode();
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:48, 代码来源:admin.php
示例11: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
$base_url = get_forum_base_url();
$forums = get_param('url', $base_url . '/');
if (substr($forums, 0, strlen($base_url)) != $base_url) {
$base_url = rtrim($forums, '/');
if (strpos($base_url, '.php') !== false || strpos($base_url, '?') !== false) {
$base_url = dirname($base_url);
}
//log_hack_attack_and_exit('REFERRER_IFRAME_HACK'); No longer a hack attack becase people webmasters changed their forum base URL at some point, creating problems with old bookmarks!
header('Location: ' . get_self_url(true, false, array('url' => get_forum_base_url())));
exit;
}
$old_method = false;
if ($old_method) {
return do_template('FORUMS_EMBED', array('_GUID' => '159575f6b83c5366d29e184a8dd5fc49', 'FORUMS' => $forums));
}
$GLOBALS['SCREEN_TEMPLATE_CALLED'] = '';
require_code('integrator');
return do_template('COMCODE_SURROUND', array('CLASS' => 'float_surrounder', 'CONTENT' => protect_from_escaping(reprocess_url($forums, $base_url))));
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:26, 代码来源:forums.php
示例12: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
require_lang('newsletter');
require_lang('javascript');
$newsletter_id = array_key_exists('param', $map) ? intval($map['param']) : db_get_first_id();
$_newsletter_title = $GLOBALS['SITE_DB']->query_value_null_ok('newsletters', 'title', array('id' => $newsletter_id));
if (is_null($_newsletter_title)) {
return paragraph(do_lang_tempcode('MISSING_RESOURCE'));
}
$newsletter_title = get_translated_text($_newsletter_title);
$address = post_param('address' . strval($newsletter_id), '');
if ($address != '') {
require_code('newsletter');
require_code('type_validation');
if (!is_valid_email_address($address)) {
$msg = do_template('INLINE_WIP_MESSAGE', array('MESSAGE' => do_lang_tempcode('INVALID_EMAIL_ADDRESS')));
return do_template('BLOCK_MAIN_NEWSLETTER_SIGNUP', array('URL' => get_self_url(), 'MSG' => $msg));
}
if (!array_key_exists('path', $map)) {
$map['path'] = 'uploads/website_specific/signup.txt';
}
require_code('character_sets');
$password = basic_newsletter_join($address, 4, NULL, !file_exists(get_custom_file_base() . '/' . $map['path']), $newsletter_id, post_param('firstname' . strval($newsletter_id), ''), post_param('lastname' . strval($newsletter_id), ''));
if ($password == '') {
return do_template('INLINE_WIP_MESSAGE', array('MESSAGE' => do_lang_tempcode('NEWSLETTER_THIS_ALSO')));
}
if ($password == do_lang('NA')) {
$manage_url = build_url(array('page' => 'newsletter', 'email' => $address), get_module_zone('newsletter'));
return do_template('INLINE_WIP_MESSAGE', array('MESSAGE' => do_lang_tempcode('ALREADY_EMAIL_ADDRESS', escape_html($manage_url->evaluate()))));
}
require_code('mail');
if (file_exists(get_custom_file_base() . '/' . $map['path'])) {
$url = (url_is_local($map['path']) ? get_custom_base_url() . '/' : '') . $map['path'];
mail_wrap(array_key_exists('subject', $map) ? $map['subject'] : do_lang('WELCOME'), convert_to_internal_encoding(http_download_file($url)), array($address), array_key_exists('to', $map) ? $map['to'] : '', '', '', 3, NULL, false, NULL, true);
}
return do_template('BLOCK_MAIN_NEWSLETTER_SIGNUP_DONE', array('_GUID' => '9953c83685df4970de8f23fcd5dd15bb', 'NEWSLETTER_TITLE' => $newsletter_title, 'NID' => strval($newsletter_id), 'PASSWORD' => $password));
} else {
return do_template('BLOCK_MAIN_NEWSLETTER_SIGNUP', array('NEWSLETTER_TITLE' => $newsletter_title, 'NID' => strval($newsletter_id), 'URL' => get_self_url()));
}
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:46, 代码来源:main_newsletter_signup.php
示例13: handle_permission_check_logging
/**
* Log permission checks to the permission_checks.log file, if it exists.
*
* @param MEMBER The user checking against
* @param ID_TEXT The function that was called to check a permission
* @param array Parameters to this permission-checking function
* @param boolean Whether the permission was held
*/
function handle_permission_check_logging($member, $op, $params, $result)
{
global $PERMISSION_CHECK_LOGGER, $PERMISSIONS_ALREADY_LOGGED, $SITE_INFO;
if ($PERMISSION_CHECK_LOGGER === NULL) {
$file_path = get_custom_file_base() . '/data_custom/permissioncheckslog.php';
if ((!isset($SITE_INFO['no_extra_logs']) || $SITE_INFO['no_extra_logs'] == '0') && is_file($file_path) && is_writable_wrap($file_path)) {
$PERMISSION_CHECK_LOGGER = fopen($file_path, 'at');
if (!function_exists('get_self_url')) {
require_code('tempcode');
require_code('urls');
}
$self_url = get_self_url(true);
if (!is_string($self_url)) {
$self_url = get_self_url_easy();
}
// A weirdness can happen here. If some kind of fatal error happens then output buffers can malfunction making it impossible to use Tempcode as above. So we fall back to this. (This function may be called in a fatal error due to the 'display_php_errors' permissions).
fwrite($PERMISSION_CHECK_LOGGER, chr(10) . chr(10) . date('Y/m/d h:m:i') . ' -- ' . $self_url . ' -- ' . $GLOBALS['FORUM_DRIVER']->get_username(get_member()) . chr(10));
} else {
$PERMISSION_CHECK_LOGGER = false;
}
}
static $fbe = NULL;
if ($fbe === NULL) {
$fbe = function_exists('fb');
}
if ($PERMISSION_CHECK_LOGGER === false && (!$fbe || get_param_integer('keep_firephp', 0) == 0)) {
return;
}
$sz = serialize(array($member, $op, $params));
if (array_key_exists($sz, $PERMISSIONS_ALREADY_LOGGED)) {
return;
}
$PERMISSIONS_ALREADY_LOGGED[$sz] = 1;
if ($result) {
return;
}
require_code('permissions2');
_handle_permission_check_logging($member, $op, $params, $result);
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:47, 代码来源:permissions.php
示例14: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
$file = array_key_exists('param', $map) ? $map['param'] : 'admin_notes';
$title = array_key_exists('title', $map) ? $map['title'] : do_lang('NOTES');
$scrolls = array_key_exists('scrolls', $map) ? $map['scrolls'] : '0';
$new = post_param('new', NULL);
if (!is_null($new)) {
set_long_value('note_text_' . $file, $new);
log_it('NOTES', $file);
attach_message(do_lang_tempcode('SUCCESS'), 'inform');
}
$contents = get_long_value('note_text_' . $file);
if (is_null($contents)) {
$contents = '';
}
$post_url = get_self_url();
$map_comcode = '';
foreach ($map as $key => $val) {
$map_comcode .= ' ' . $key . '="' . addslashes($val) . '"';
}
return do_template('BLOCK_MAIN_NOTES', array('_GUID' => '2a9e1c512b66600583735552b56e0911', 'TITLE' => $title, 'BLOCK_NAME' => 'main_db_notes', 'MAP' => $map_comcode, 'SCROLLS' => array_key_exists('scrolls', $map) && $map['scrolls'] == '1', 'CONTENTS' => $contents, 'URL' => $post_url));
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:28, 代码来源:main_db_notes.php
示例15: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
if (!array_key_exists('param', $map)) {
$map['param'] = 'main';
}
if (!array_key_exists('page', $map)) {
$map['page'] = get_page_name();
}
if (array_key_exists('extra_param_from', $map)) {
$extra = '_' . $map['extra_param_from'];
} else {
$extra = '';
}
require_code('feedback');
$self_url = get_self_url();
$self_title = $map['page'];
$id = $map['page'] . '_' . $map['param'] . $extra;
$test_changed = post_param('rating_' . $id, '');
if ($test_changed != '') {
decache('main_rating');
}
actualise_rating(true, 'block_main_rating', $id, $self_url, $self_title);
return get_rating_box($self_url, $self_title, 'block_main_rating', $id, true);
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:30, 代码来源:main_rating.php
示例16: order_details
/**
* UI to show details of an order
*
* @return tempcode The interface.
*/
function order_details()
{
$id = get_param_integer('id');
$title = get_page_title('MY_ORDER_DETAILS');
$order_title = do_lang('CART_ORDER', $id);
//pagination
$start = get_param_integer('start', 0);
$max = get_param_integer('max', 10);
require_code('templates_results_browser');
require_code('templates_results_table');
$sortables = array();
$query_sort = explode(' ', get_param('sort', 'p_name ASC'), 2);
if (count($query_sort) == 1) {
$query_sort[] = 'ASC';
}
list($sortable, $sort_order) = $query_sort;
$fields_title = results_field_title(array(do_lang_tempcode('SLNO'), do_lang_tempcode('PRODUCT_NAME'), do_lang_tempcode('THE_PRICE'), do_lang_tempcode('QUANTITY'), do_lang_tempcode('STATUS')), $sortables, 'sort', $sortable . ' ' . $sort_order);
$max_rows = $GLOBALS['SITE_DB']->query_value_null_ok('shopping_order_details', 'COUNT(*)', array('order_id' => $id));
$results_browser = results_browser(do_lang_tempcode('ORDERS'), NULL, $start, 'start', $max, 'max', $max_rows, NULL, 'show_orders', true, true);
$rows = $GLOBALS['SITE_DB']->query_select('shopping_order_details', array('*'), array('order_id' => $id), 'ORDER BY ' . $sortable . ' ' . $sort_order, $max, $start);
$product_entries = new ocp_tempcode();
breadcrumb_set_parents(array(array('_SEARCH:admin_ecommerce:ecom_usage', do_lang_tempcode('ECOMMERCE')), array('_SELF:_SELF:misc', do_lang_tempcode('ORDERS')), array('_SELF:_SELF:show_orders', do_lang_tempcode('ORDER_LIST'))));
foreach ($rows as $row) {
$product_info_url = build_url(array('page' => 'catalogues', 'type' => 'entry', 'id' => $row['p_id']), get_module_zone('catalogues'));
$product_name = $row['p_name'];
$product = hyperlink($product_info_url, $product_name, false, true, do_lang('VIEW'));
$product_entries->attach(results_entry(array(escape_html(strval($row['p_id'])), $product, ecommerce_get_currency_symbol() . escape_html(float_format($row['p_price'], 2)), escape_html(strval($row['p_quantity'])), do_lang($row['dispatch_status'])), false, NULL));
}
$text = do_lang_tempcode('ORDER_DETAILS_TEXT');
//Collecting order details
$rows = $GLOBALS['SITE_DB']->query_select('shopping_order', array('*'), array('id' => $id), '', 1);
if (!array_key_exists(0, $rows)) {
warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
}
$data = $rows[0];
$results_table = results_table(do_lang_tempcode('PRODUCTS'), 0, 'start', $max_rows, 'max', $max_rows, $fields_title, $product_entries, $sortables, $sortable, $sort_order, 'sort', NULL, NULL, 'cart');
$ordered_by_member_id = $data['c_member'];
$ordered_by_username = $GLOBALS['FORUM_DRIVER']->get_username($data['c_member']);
$self_url = get_self_url(true, true);
$ordr_act_submit = build_url(array('page' => '_SELF', 'type' => 'order_act', 'id' => $id, 'redirect' => $self_url), '_SELF');
$order_actions = do_template('ADMIN_ORDER_ACTIONS', array('ORDER_TITLE' => $order_title, 'ORDR_ACT_URL' => $ordr_act_submit, 'ORDER_STATUS' => do_lang($data['order_status'])));
//Shipping address display
$row = $GLOBALS['SITE_DB']->query_select('shopping_order_addresses', array('*'), array('order_id' => $id), '', 1);
if (array_key_exists(0, $row)) {
$address = $row[0];
$shipping_address = do_template('SHIPPING_ADDRESS', array('ADDRESS_NAME' => $address['address_name'], 'ADDRESS_STREET' => $address['address_street'], 'ADDRESS_CITY' => $address['address_city'], 'ADDRESS_ZIP' => $address['address_zip'], 'ADDRESS_COUNTRY' => $address['address_country'], 'RECEIVER_EMAIL' => $address['receiver_email']));
} else {
$shipping_address = new ocp_tempcode();
}
return do_template('ECOM_ADMIN_ORDERS_DETAILS_SCREEN', array('TITLE' => $title, 'TEXT' => $text, 'CURRENCY' => get_option('currency'), 'RESULT_TABLE' => $results_table, 'RESULTS_BROWSER' => $results_browser, 'ORDER_NUMBER' => strval($id), 'ADD_DATE' => get_timezoned_date($data['add_date'], true, false, true, true), 'TOTAL_PRICE' => float_format($data['tot_price'], 2), 'ORDERED_BY_MEMBER_ID' => strval($ordered_by_member_id), 'ORDERED_BY_USERNAME' => $ordered_by_username, 'ORDER_STATUS' => do_lang($data['order_status']), 'NOTES' => $data['notes'], 'PURCHASED_VIA' => $data['purchase_through'], 'ORDER_ACTIONS' => $order_actions, 'SHIPPING_ADDRESS' => $shipping_address));
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:56, 代码来源:admin_orders.php
示例17: delete
/**
* Actualiser to delete an invoice.
*
* @return tempcode The result.
*/
function delete()
{
$title = get_page_title('DELETE_INVOICE');
breadcrumb_set_parents(array(array('_SEARCH:admin_ecommerce:ecom_usage', do_lang_tempcode('ECOMMERCE')), array('_SELF:_SELF:misc', do_lang_tempcode('INVOICES')), array('_SELF:_SELF:undelivered', do_lang_tempcode('UNDELIVERED_INVOICES'))));
if (post_param_integer('confirmed', 0) != 1) {
$url = get_self_url();
$text = do_lang_tempcode('DELETE_INVOICE');
breadcrumb_set_self(do_lang_tempcode('CONFIRM'));
$hidden = build_keep_post_fields();
$hidden->attach(form_input_hidden('confirmed', '1'));
$hidden->attach(form_input_hidden('from', get_param('from', 'misc')));
return do_template('CONFIRM_SCREEN', array('_GUID' => '45707062c00588c33726b256e8f9ba40', 'TITLE' => $title, 'FIELDS' => $hidden, 'PREVIEW' => $text, 'URL' => $url));
}
breadcrumb_set_self(do_lang_tempcode('DONE'));
$GLOBALS['SITE_DB']->query_delete('invoices', array('id' => get_param_integer('id')), '', 1);
$url = build_url(array('page' => '_SELF', 'type' => post_param('from', 'misc')), '_SELF');
return redirect_screen($title, $url, do_lang_tempcode('SUCCESS'));
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:23, 代码来源:admin_invoices.php
示例18: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
if (!array_key_exists('param', $map)) {
$map['param'] = 'main';
}
if (!array_key_exists('page', $map)) {
$map['page'] = str_replace('-', '_', get_page_name());
}
if (array_key_exists('extra_param_from', $map)) {
$extra = '_' . $map['extra_param_from'];
} else {
$extra = '';
}
require_code('feedback');
$submitted = post_param_integer('_comment_form_post', 0) == 1;
$self_url = build_url(array('page' => '_SELF'), '_SELF', NULL, true, false, true);
$self_title = $map['page'];
$test_changed = post_param('title', NULL);
if (!is_null($test_changed)) {
decache('main_comments');
}
$hidden = $submitted ? actualise_post_comment(true, 'block_main_comments', $map['page'] . '_' . $map['param'] . $extra, $self_url, $self_title, array_key_exists('forum', $map) ? $map['forum'] : NULL, false, NULL, get_page_name() == 'guestbook') : false;
$out = new ocp_tempcode();
if (array_key_exists('title', $_POST) && $hidden && $submitted) {
$out->attach(paragraph(do_lang_tempcode('MESSAGE_POSTED'), 'dsgdgdfl;gkd09'));
if (get_forum_type() == 'ocf') {
if (addon_installed('unvalidated')) {
require_code('submit');
$validate_url = get_self_url(true, false, array('keep_session' => NULL));
$_validate_url = build_url(array('page' => 'topics', 'type' => 'validate_post', 'id' => $GLOBALS['LAST_POST_ID'], 'redirect' => $validate_url), get_module_zone('topics'), NULL, false, false, true);
$validate_url = $_validate_url->evaluate();
send_validation_request('MAKE_POST', 'f_posts', false, $GLOBALS['LAST_POST_ID'], $validate_url);
}
}
}
$invisible_if_no_comments = array_key_exists('invisible_if_no_comments', $map) && $map['invisible_if_no_comments'] == '1';
$reverse = array_key_exists('reverse', $map) && $map['reverse'] == '1';
$allow_reviews = !array_key_exists('reviews', $map) || $map['reviews'] == '1';
$out->attach(get_comments('block_main_comments', true, $map['page'] . '_' . $map['param'] . $extra, $invisible_if_no_comments, array_key_exists('forum', $map) ? $map['forum'] : NULL, NULL, NULL, get_page_name() == 'guestbook', $reverse, NULL, $allow_reviews));
return $out;
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:47, 代码来源:main_comments.php
示例19: report
/**
* A bug report for a test.
*
* @return tempcode The result of execution.
*/
function report()
{
$id = get_param_integer('id');
$test_row = $GLOBALS['SITE_DB']->query_select('tests t LEFT JOIN ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'test_sections s ON t.t_section=s.id', array('*'), array('t.id' => $id), '', 1);
if (!array_key_exists(0, $test_row)) {
warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
}
$section = $test_row[0]['s_section'];
$test = $test_row[0]['t_test'];
$self_title = $section . '/' . substr($test, 0, 20);
$title = get_page_title('BUG_REPORT_FOR', true, array(escape_html($self_title)));
require_code('feedback');
$self_url = get_self_url();
$forum = get_option('tester_forum_name');
actualise_post_comment(true, 'bug_report', strval($id), $self_url, $self_title, $forum);
$comment_text = str_replace('{1}', $test, get_option('bug_report_text'));
$comments = get_comments('bug_report', true, strval($id), false, $forum, $comment_text);
return do_template('TESTER_REPORT', array('_GUID' => '0c223a0a29a2c5289d71fbb69b0fe40d', 'TITLE' => $title, 'TEST' => $test, 'COMMENTS' => $comments));
}
开发者ID:erico-deh, 项目名称:ocPortal, 代码行数:24, 代码来源:tester.php
示例20: ocf_show_isolated_post
Windows Boot Manager Security Feature Bypass Vulnerability.
阅读:894| 2022-07-29
PacktPublishing/Python-Machine-Learning-Second-Edition: Python Machine Learning
阅读:975| 2022-08-18
altair-viz/altair: Declarative statistical visualization library for Python
阅读:1108| 2022-08-15
sussillo/hfopt-matlab: A parallel, cpu-based matlab implemention of the Hessian
阅读:999| 2022-08-17
win7系统电脑使用过程中有不少朋友表示遇到过win7系统USB驱动器RAM的状况,当出现win7
阅读:891| 2022-11-06
emersion/go-ostatus: An OStatus library written in Go
阅读:752| 2022-08-17
这篇文章讲的很好
但是那位老哥 你唯一没有说的就是 最后结局方法里面的 env:“jnfrie
阅读:575| 2022-07-18
elipapa/markdown-cv: a simple template to write your CV in a readable markdown f
阅读:514| 2022-08-17
zju-sclab/NDT-library: These is ndt library for ndt_mapping and ndt_localization
阅读:735| 2022-08-16
Call Me Maybe 中英字幕 对于加拿大歌手卡莉·蕾·吉普森很多人有些陌生,她隶属于贾
阅读:632| 2022-11-06
请发表评论