本文整理汇总了PHP中filter_naughty_harsh函数的典型用法代码示例。如果您正苦于以下问题:PHP filter_naughty_harsh函数的具体用法?PHP filter_naughty_harsh怎么用?PHP filter_naughty_harsh使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了filter_naughty_harsh函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: init__themewizard
/**
* Standard code module initialisation function.
*/
function init__themewizard()
{
global $THEME_WIZARD_IMAGES_CACHE, $THEME_SEED_CACHE, $THEME_DARK_CACHE;
$THEME_WIZARD_IMAGES_CACHE = array();
$THEME_SEED_CACHE = array();
$THEME_DARK_CACHE = array();
global $THEME_WIZARD_IMAGES, $THEME_WIZARD_IMAGES_NO_WILD;
$THEME_WIZARD_IMAGES = array();
$THEME_WIZARD_IMAGES_NO_WILD = array();
if (function_exists('imagecreatefromgif')) {
$THEME_WIZARD_IMAGES[] = '';
}
$hooks = find_all_hooks('modules', 'admin_themewizard');
foreach (array_keys($hooks) as $hook) {
require_code('hooks/modules/admin_themewizard/' . filter_naughty_harsh($hook));
$ob = object_factory('Hook_admin_themewizard_' . filter_naughty_harsh($hook), true);
if (is_null($ob)) {
continue;
}
$results = $ob->run();
if (is_null($results)) {
continue;
}
list($a, $b) = $results;
$THEME_WIZARD_IMAGES = array_merge($THEME_WIZARD_IMAGES, $a);
$THEME_WIZARD_IMAGES_NO_WILD = array_merge($THEME_WIZARD_IMAGES_NO_WILD, $b);
}
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:31,代码来源:themewizard.php
示例2: get_chmod_array
/**
* Get the list of files that need CHmodding for write access.
*
* @return array The list of files
*/
function get_chmod_array()
{
global $LANG;
// if ((function_exists('ocp_enterprise')) && (ocp_enterprise()))
// {
$extra_files = array('collaboration/pages/html_custom', 'collaboration/pages/html_custom/' . $LANG, 'collaboration/pages/comcode_custom', 'collaboration/pages/comcode_custom/' . $LANG);
// } else $extra_files=array();
if (function_exists('find_all_hooks')) {
$hooks = find_all_hooks('systems', 'addon_registry');
$hook_keys = array_keys($hooks);
foreach ($hook_keys as $hook) {
//require_code('hooks/systems/addon_registry/'.filter_naughty_harsh($hook));
//$object=object_factory('Hook_addon_registry_'.filter_naughty_harsh($hook));
//$extra_files=array_merge($extra_files,$object->get_chmod_array());
// Save memory compared to above commented code...
$path = get_custom_file_base() . '/sources/hooks/systems/addon_registry/' . filter_naughty_harsh($hook) . '.php';
if (!file_exists($path)) {
$path = get_file_base() . '/sources/hooks/systems/addon_registry/' . filter_naughty_harsh($hook) . '.php';
}
$matches = array();
if (preg_match('#function get_chmod_array\\(\\)\\s*\\{([^\\}]*)\\}#', file_get_contents($path), $matches) != 0) {
if (!defined('HIPHOP_PHP')) {
$extra_files = array_merge($extra_files, eval($matches[1]));
} else {
require_code('hooks/systems/addon_registry/' . $hook);
$hook = object_factory('Hook_addon_registry_' . $hook);
$extra_files = array_merge($extra_files, $hook->get_chmod_array());
}
}
}
}
return array_merge($extra_files, array('safe_mode_temp', 'persistant_cache', 'data_custom/modules/admin_backup', 'data_custom/modules/chat', 'data_custom/fields.xml', 'data_custom/breadcrumbs.xml', 'data_custom/modules/admin_stats', 'data_custom/spelling/write.log', 'data_custom/spelling/output.log', 'data_custom/spelling/personal_dicts', 'themes/map.ini', 'text_custom', 'text_custom/' . $LANG, 'data_custom/modules/chat/chat_last_msg.dat', 'data_custom/modules/chat/chat_last_event.dat', 'lang_cached', 'lang_cached/' . $LANG, 'lang_custom', 'lang_custom/' . $LANG, 'data_custom/errorlog.php', 'ocp_sitemap.xml', 'data_custom/permissioncheckslog.php', 'pages/html_custom', 'site/pages/html_custom', 'docs/pages/html_custom', 'adminzone/pages/html_custom', 'forum/pages/html_custom', 'cms/pages/html_custom', 'pages/html_custom/' . $LANG, 'site/pages/html_custom/' . $LANG, 'docs/pages/html_custom/' . $LANG, 'adminzone/pages/html_custom/' . $LANG, 'forum/pages/html_custom/' . $LANG, 'cms/pages/html_custom/' . $LANG, 'pages/comcode_custom', 'site/pages/comcode_custom', 'docs/pages/comcode_custom', 'adminzone/pages/comcode_custom', 'forum/pages/comcode_custom', 'cms/pages/comcode_custom', 'pages/comcode_custom/' . $LANG, 'site/pages/comcode_custom/' . $LANG, 'docs/pages/comcode_custom/' . $LANG, 'adminzone/pages/comcode_custom/' . $LANG, 'forum/pages/comcode_custom/' . $LANG, 'cms/pages/comcode_custom/' . $LANG, 'themes/default/css_custom', 'themes/default/images_custom', 'themes/default/templates_custom', 'themes/default/templates_cached', 'themes/default/templates_cached/' . $LANG, 'themes/default/theme.ini', 'uploads/incoming', 'uploads/website_specific', 'uploads/personal_sound_effects', 'uploads/banners', 'uploads/downloads', 'uploads/galleries', 'uploads/watermarks', 'uploads/grepimages', 'uploads/galleries_thumbs', 'uploads/iotds', 'uploads/iotds_thumbs', 'uploads/catalogues', 'uploads/attachments', 'uploads/attachments_thumbs', 'uploads/auto_thumbs', 'uploads/ocf_avatars', 'uploads/ocf_cpf_upload', 'uploads/ocf_photos', 'uploads/ocf_photos_thumbs', 'uploads/filedump', 'info.php', 'exports/backups', 'exports/file_backups', 'exports/mods', 'imports/mods', 'site/pages/html_custom/' . $LANG . '/download_tree_made.htm', 'site/pages/html_custom/' . $LANG . '/cedi_tree_made.htm'));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:38,代码来源:inst_special.php
示例3: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
unset($map);
require_lang('custom_comcode');
$tags = array();
$wmap = array('tag_enabled' => 1);
if (!has_specific_permission(get_member(), 'comcode_dangerous')) {
$wmap['tag_dangerous_tag'] = 0;
}
$tags = array_merge($tags, $GLOBALS['SITE_DB']->query_select('custom_comcode', array('tag_title', 'tag_description', 'tag_example', 'tag_parameters', 'tag_replace', 'tag_tag', 'tag_dangerous_tag', 'tag_block_tag', 'tag_textual_tag'), $wmap));
if (isset($GLOBALS['FORUM_DB']) && $GLOBALS['FORUM_DB']->connection_write != $GLOBALS['SITE_DB']->connection_write && get_forum_type() == 'ocf') {
$tags = array_merge($tags, $GLOBALS['FORUM_DB']->query_select('custom_comcode', array('tag_title', 'tag_description', 'tag_example', 'tag_parameters', 'tag_replace', 'tag_tag', 'tag_dangerous_tag', 'tag_block_tag', 'tag_textual_tag'), $wmap));
}
// From Comcode hooks
$hooks = find_all_hooks('systems', 'comcode');
foreach (array_keys($hooks) as $hook) {
require_code('hooks/systems/comcode/' . filter_naughty_harsh($hook));
$object = object_factory('Hook_comcode_' . filter_naughty_harsh($hook), true);
$tags[] = $object->get_tag();
}
if (!array_key_exists(0, $tags)) {
return paragraph(do_lang_tempcode('NONE_EM'), '', 'nothing_here');
}
$content = new ocp_tempcode();
foreach ($tags as $tag) {
$content->attach(do_template('CUSTOM_COMCODE_TAG_ROW', array('_GUID' => '28c257f5d0c596aa828fd9556b0df4a9', 'TITLE' => is_string($tag['tag_title']) ? $tag['tag_title'] : get_translated_text($tag['tag_title']), 'DESCRIPTION' => is_string($tag['tag_description']) ? $tag['tag_description'] : get_translated_text($tag['tag_description']), 'EXAMPLE' => $tag['tag_example'])));
}
return do_template('BLOCK_MAIN_CUSTOM_COMCODE_TAGS', array('_GUID' => 'b8d3436e6e5fe679ae9b0a368e607610', 'TAGS' => $content));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:35,代码来源:main_custom_comcode_tags.php
示例4: run
/**
* Standard modular run function for OcCLE hooks.
*
* @param array The options with which the command was called
* @param array The parameters with which the command was called
* @param array A reference to the OcCLE filesystem object
* @return array Array of stdcommand, stdhtml, stdout, and stderr responses
*/
function run($options, $parameters, &$occle_fs)
{
if (array_key_exists(0, $parameters)) {
// Load up the relevant block and grab its help output
$hooks = find_all_hooks('modules', 'admin_occle_commands');
$hook_return = NULL;
foreach (array_keys($hooks) as $hook) {
if ($hook == $parameters[0]) {
require_code('hooks/modules/admin_occle_commands/' . filter_naughty_harsh($hook));
$object = object_factory('Hook_' . filter_naughty_harsh($hook), true);
if (is_null($object)) {
continue;
}
$hook_return = $object->run(array('help' => NULL), array(), $occle_fs);
break;
}
}
if (!is_null($hook_return)) {
return array($hook_return[0], $hook_return[1], $hook_return[2], $hook_return[3]);
} else {
return array('', '', '', do_lang('NO_HELP'));
}
} else {
// Output a standard "how to use Occle" help page
return array('window.open(unescape("' . urlencode('http://ocportal.com/docs' . strval(ocp_version()) . '/pg/tut_occle') . '"),"occle_window1","");', '', do_lang('SUCCESS'), '');
}
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:35,代码来源:help.php
示例5: 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
示例6: get_num_unvalidated
/**
* Get the number of unvalidated items.
*
* @return array A pair: Number of major things, number of minor things
*/
function get_num_unvalidated()
{
$sum = 0;
$sum2 = 0;
$_hooks = find_all_hooks('modules', 'admin_unvalidated');
foreach (array_keys($_hooks) as $hook) {
require_code('hooks/modules/admin_unvalidated/' . filter_naughty_harsh($hook));
$object = object_factory('Hook_unvalidated_' . filter_naughty_harsh($hook), true);
if (is_null($object)) {
continue;
}
$info = $object->info();
if (is_null($info)) {
continue;
}
$db = array_key_exists('db', $info) ? $info['db'] : $GLOBALS['SITE_DB'];
$amount = $db->query_value($info['db_table'], 'COUNT(*)', array($info['db_validated'] => 0));
if (is_null($info) || array_key_exists('is_minor', $info) && $info['is_minor']) {
$sum2 += $amount;
} else {
$sum += $amount;
}
}
return array($sum, $sum2);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:30,代码来源:unvalidated.php
示例7: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
require_lang('unvalidated');
$GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/unvalidated';
$GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_censor';
$_title = get_page_title('UNVALIDATED_RESOURCES');
$out = new ocp_tempcode();
require_code('form_templates');
$_hooks = find_all_hooks('modules', 'admin_unvalidated');
foreach (array_keys($_hooks) as $hook) {
require_code('hooks/modules/admin_unvalidated/' . filter_naughty_harsh($hook));
$object = object_factory('Hook_unvalidated_' . filter_naughty_harsh($hook), true);
if (is_null($object)) {
continue;
}
$info = $object->info();
if (is_null($info)) {
continue;
}
$identifier_select = is_array($info['db_identifier']) ? implode(',', $info['db_identifier']) : $info['db_identifier'];
$db = array_key_exists('db', $info) ? $info['db'] : $GLOBALS['SITE_DB'];
$rows = $db->query('SELECT ' . $identifier_select . (array_key_exists('db_title', $info) ? ',' . $info['db_title'] : '') . ' FROM ' . $db->get_table_prefix() . $info['db_table'] . ' WHERE ' . $info['db_validated'] . '=0', 100);
$content = new ocp_tempcode();
foreach ($rows as $row) {
if (is_array($info['db_identifier'])) {
$id = '';
foreach ($info['db_identifier'] as $_id) {
if ($id != '') {
$id .= ':';
}
$id .= $row[$_id];
}
} else {
$id = $row[$info['db_identifier']];
}
if (array_key_exists('db_title', $info)) {
$title = $row[$info['db_title']];
if ($info['db_title_dereference']) {
$title = get_translated_text($title, $db);
}
// May actually be comcode (can't be certain), but in which case it will be shown as source
} else {
$title = '#' . (is_integer($id) ? strval($id) : $id);
}
if ($title == '') {
$title = '#' . strval($id);
}
$content->attach(form_input_list_entry(is_integer($id) ? strval($id) : $id, false, strip_comcode($title)));
}
$post_url = build_url(array('page' => $info['edit_module'], 'type' => $info['edit_type'], 'validated' => 1), get_module_zone($info['edit_module']), NULL, false, true);
$fields = form_input_list(do_lang_tempcode('EDIT'), do_lang_tempcode('DESCRIPTION_EDIT'), $info['edit_identifier'], $content);
if (!$content->is_empty()) {
// Could debate whether to include "'TARGET'=>'_blank',". However it does redirect back, so it's a nice linear process like this. If it was new window it could be more efficient, but also would confuse people with a lot of new windows opening and not closing.
$content = do_template('FORM', array('_GUID' => '51dcee39273a0fee29569190344f2e41', 'GET' => true, 'HIDDEN' => '', 'SUBMIT_NAME' => do_lang_tempcode('EDIT'), 'FIELDS' => $fields, 'URL' => $post_url, 'TEXT' => ''));
}
$out->attach(do_template('UNVALIDATED_SECTION', array('_GUID' => '838240008e190b9cbaa0280fbddd6baf', 'TITLE' => $info['title'], 'CONTENT' => $content)));
}
return do_template('UNVALIDATED_SCREEN', array('_GUID' => '4e971f1c8851b821af030b5c7bbcb3fb', 'TITLE' => $_title, 'SECTIONS' => $out));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:64,代码来源:admin_unvalidated.php
示例8: send_validation_request
/**
* Send (by e-mail) a validation request for a submitted item to the admin.
*
* @param ID_TEXT The validation request will say one of this type has been submitted. By convention it is the language code of what was done, e.g. ADD_DOWNLOAD
* @param ?ID_TEXT The table saved into (NULL: unknown)
* @param boolean Whether the ID field is not an integer
* @param ID_TEXT The validation request will say this ID has been submitted
* @param tempcode The validation request will link to this URL
* @param ?MEMBER Member doing the submitting (NULL: current member)
*/
function send_validation_request($type, $table, $non_integer_id, $id, $url, $member_id = NULL)
{
$good = NULL;
if (!is_null($table)) {
$_hooks = find_all_hooks('modules', 'admin_unvalidated');
foreach (array_keys($_hooks) as $hook) {
require_code('hooks/modules/admin_unvalidated/' . filter_naughty_harsh($hook));
$object = object_factory('Hook_unvalidated_' . filter_naughty_harsh($hook), true);
if (is_null($object)) {
continue;
}
$info = $object->info();
if (is_null($info)) {
continue;
}
if ($info['db_table'] == $table) {
$good = $info;
break;
}
}
}
$title = mixed();
$title = '';
if (!is_null($good) && !is_array($good['db_identifier'])) {
$db = array_key_exists('db', $good) ? $good['db'] : $GLOBALS['SITE_DB'];
$where = $good['db_identifier'] . '=' . $id;
if ($non_integer_id) {
$where = db_string_equal_to($good['db_identifier'], $id);
}
$rows = $db->query('SELECT ' . $good['db_identifier'] . (array_key_exists('db_title', $good) ? ',' . $good['db_title'] : '') . ' FROM ' . $db->get_table_prefix() . $good['db_table'] . ' WHERE ' . $where, 100);
if (array_key_exists('db_title', $good)) {
$title = $rows[0][$good['db_title']];
if ($good['db_title_dereference']) {
$title = get_translated_text($title, $db);
}
// May actually be comcode (can't be certain), but in which case it will be shown as source
} else {
$title = '#' . (is_integer($id) ? strval($id) : $id);
}
}
if ($title == '') {
$title = '#' . (is_integer($id) ? strval($id) : $id);
}
if (is_null($member_id)) {
$member_id = get_member();
}
require_lang('unvalidated');
$_type = do_lang($type, NULL, NULL, NULL, NULL, false);
if (!is_null($_type)) {
$type = $_type;
}
$comcode = do_template('VALIDATION_REQUEST', array('_GUID' => '1885be371b2ff7810287715ef2f7b948', 'USERNAME' => $GLOBALS['FORUM_DRIVER']->get_username($member_id), 'TYPE' => $type, 'ID' => $id, 'URL' => $url), get_site_default_lang());
require_code('notifications');
$subject = do_lang('UNVALIDATED_TITLE', $title, '', '', get_site_default_lang());
$message = $comcode->evaluate(get_site_default_lang(), false);
dispatch_notification('needs_validation', NULL, $subject, $message);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:67,代码来源:submit.php
示例9: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
// Loads up correct hook and returns rendering
require_lang('custom_comcode');
$type_id = $map['param'];
if (!file_exists(get_file_base() . '/sources/hooks/blocks/main_custom_gfx/' . filter_naughty_harsh($type_id) . '.php') && !file_exists(get_file_base() . '/sources_custom/hooks/blocks/main_custom_gfx/' . filter_naughty_harsh($type_id) . '.php')) {
return paragraph(do_lang_tempcode('NO_SUCH_RENDERER', $type_id));
}
require_code('hooks/blocks/main_custom_gfx/' . filter_naughty_harsh($type_id), true);
$object = object_factory('Hook_main_custom_gfx_' . $type_id);
return $object->run($map, $this);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:18,代码来源:main_custom_gfx.php
示例10: run
/**
* Standard modular run function for preview hooks.
*
* @return array A pair: The preview, the updated post Comcode
*/
function run()
{
// Find review, if there is one
$individual_review_ratings = array();
$review_rating = post_param('review_rating', '');
if ($review_rating != '') {
$individual_review_ratings[''] = array('REVIEW_TITLE' => '', 'REVIEW_RATING' => $review_rating);
}
$poster_name = $GLOBALS['FORUM_DRIVER']->get_username(get_member());
$post = comcode_to_tempcode(post_param('post'));
// OCF renderings of poster
static $hooks = NULL;
if (is_null($hooks)) {
$hooks = find_all_hooks('modules', 'topicview');
}
static $hook_objects = NULL;
if (is_null($hook_objects)) {
$hook_objects = array();
foreach (array_keys($hooks) as $hook) {
require_code('hooks/modules/topicview/' . filter_naughty_harsh($hook));
$object = object_factory('Hook_' . filter_naughty_harsh($hook), true);
if (is_null($object)) {
continue;
}
$hook_objects[$hook] = $object;
}
}
if (!is_guest()) {
require_code('ocf_members2');
$poster_details = ocf_show_member_box(get_member(), false, $hooks, $hook_objects, false);
} else {
$custom_fields = new ocp_tempcode();
$poster_details = new ocp_tempcode();
}
if (addon_installed('ocf_forum')) {
if (!is_guest()) {
$poster = do_template('OCF_POSTER_MEMBER', array('ONLINE' => true, 'ID' => strval(get_member()), 'POSTER_DETAILS' => $poster_details, 'PROFILE_URL' => $GLOBALS['FORUM_DRIVER']->member_profile_url(get_member(), false, true), 'POSTER_USERNAME' => $poster_name));
} else {
$poster = do_template('OCF_POSTER_GUEST', array('IP_LINK' => '', 'POSTER_DETAILS' => $poster_details, 'POSTER_USERNAME' => $poster_name));
}
} else {
$poster = make_string_tempcode(escape_html($poster_name));
// Should never happen actually, as applies discounts hook from even running
}
$highlight = false;
$datetime_raw = time();
$datetime = get_timezoned_date(time());
$poster_url = $GLOBALS['FORUM_DRIVER']->member_profile_url(get_member());
$title = post_param('title', '');
$tpl = do_template('POST', array('INDIVIDUAL_REVIEW_RATINGS' => $individual_review_ratings, 'HIGHLIGHT' => $highlight, 'TITLE' => $title, 'TIME_RAW' => strval($datetime_raw), 'TIME' => $datetime, 'POSTER_URL' => $poster_url, 'POSTER_NAME' => $poster_name, 'POST' => $post, 'POSTER_ID' => strval(get_member()), 'POSTER' => $poster, 'POSTER_DETAILS' => $poster_details, 'ID' => '', 'CHILDREN' => '', 'RATING' => '', 'EMPHASIS' => '', 'BUTTONS' => '', 'TOPIC_ID' => '', 'UNVALIDATED' => '', 'IS_SPACER_POST' => false, 'NUM_TO_SHOW_LIMIT' => '0'));
return array($tpl, NULL);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:57,代码来源:comments.php
示例11: run
/**
* Standard modular run function.
*
* @return array An array of tuples: The task row to show, the number of seconds until it is due (or NULL if not on a timer), the number of things to sort out (or NULL if not on a queue), The name of the config option that controls the schedule (or NULL if no option).
*/
function run()
{
$award_types = $GLOBALS['SITE_DB']->query_select('award_types', array('*'));
$out = array();
foreach ($award_types as $award) {
// Find out how many submissions we've had since the last award was given
if (!file_exists(get_file_base() . '/sources/hooks/systems/awards/' . filter_naughty_harsh($award['a_content_type']) . '.php') && !file_exists(get_file_base() . '/sources_custom/hooks/systems/awards/' . filter_naughty_harsh($award['a_content_type']) . '.php')) {
continue;
}
require_code('hooks/systems/awards/' . $award['a_content_type']);
$hook_object = object_factory('Hook_awards_' . $award['a_content_type'], true);
if (is_null($hook_object)) {
continue;
}
$details = $hook_object->info();
if (!is_null($details)) {
$date = $GLOBALS['SITE_DB']->query_value_null_ok('award_archive', 'date_and_time', array('a_type_id' => $award['id']), 'ORDER BY date_and_time DESC');
$seconds_ago = mixed();
$limit_hours = $award['a_update_time_hours'];
if (!is_null($date)) {
$seconds_ago = time() - $date;
$status = $seconds_ago > $limit_hours * 60 * 60 ? 0 : 1;
} else {
$status = 0;
}
$config_url = build_url(array('page' => 'admin_awards', 'type' => '_ed', 'id' => $award['id']), get_module_zone('admin_awards'));
$_status = $status == 0 ? do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_0') : do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_1');
$url = $details['add_url'];
if (is_object($url)) {
$url = $url->evaluate();
}
$url = str_replace('=!', '_ignore=1', $url);
$task = escape_html(get_translated_text($award['a_title']));
if (!is_null($date) && !is_null($details['date_field'])) {
$where = filter_naughty_harsh($details['date_field']) . '>' . strval(intval($date));
$num_queue = $details['connection']->query_value_null_ok_full('SELECT COUNT(*) FROM ' . $details['connection']->get_table_prefix() . str_replace('1=1', $where, $details['table']) . ' r WHERE ' . $where);
$_num_queue = integer_format($num_queue);
$num_new_since = do_lang_tempcode('NUM_NEW_SINCE', $_num_queue);
} else {
$num_new_since = new ocp_tempcode();
}
list($info, $seconds_due_in) = staff_checklist_time_ago_and_due($seconds_ago, $limit_hours);
$info->attach($num_new_since);
$tpl = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM', array('_GUID' => '4049affae5a6f38712ee3e0237a2e18e', 'CONFIG_URL' => $config_url, 'URL' => $url, 'STATUS' => $_status, 'TASK' => $task, 'INFO' => $info));
$out[] = array($tpl, $seconds_due_in, NULL, NULL);
}
}
return $out;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:54,代码来源:awards.php
示例12: trackback_script
/**
* Output the trackback script and handle trackbacks.
*/
function trackback_script()
{
if (get_option('is_on_trackbacks') == '0') {
return;
}
require_lang('trackbacks');
header('Content-type: text/xml');
$page = get_param('page');
$id = get_param_integer('id');
$mode = either_param('__mode', 'none');
$allow_trackbacks = true;
$hooks = find_all_hooks('systems', 'trackback');
foreach (array_keys($hooks) as $hook) {
if ($hook == $page) {
require_code('hooks/systems/trackback/' . filter_naughty_harsh($hook));
$object = object_factory('Hook_trackback_' . filter_naughty_harsh($hook), true);
if (is_null($object)) {
continue;
}
$allow_trackbacks = $object->run($id);
break;
}
}
if ($mode == 'rss') {
//List all the trackbacks to the specified page
$xml = get_trackbacks($page, strval($id), $allow_trackbacks, 'xml');
} else {
$time = get_param_integer('time');
if ($time > time() - 60 * 5) {
exit;
}
// Trackback link intentionally goes stale after 5 minutes, so it can't be statically stored and spam hammered
//Add a trackback for the specified page
$output = actualise_post_trackback($allow_trackbacks, $page, strval($id));
if ($output) {
$xml = do_template('TRACKBACK_XML_NO_ERROR', array());
} else {
$xml = do_template('TRACKBACK_XML_ERROR', array('_GUID' => 'ac5e34aeabf92712607e62e062407861', 'TRACKBACK_ERROR' => do_lang_tempcode('TRACKBACK_ERROR')));
}
}
$echo = do_template('TRACKBACK_XML_WRAPPER', array('_GUID' => 'cd8d057328569803a6cca9f8d37a0ac8', 'XML' => $xml));
$echo->evaluate_echo();
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:46,代码来源:feedback2.php
示例13: run
/**
* Standard modular run function for snippet hooks. Generates XHTML to insert into a page using AJAX.
*
* @return tempcode The snippet
*/
function run()
{
$member_id_viewing = get_member();
$member_id_of = get_param_integer('member_id');
$hook = filter_naughty_harsh(get_param('tab'));
require_lang('ocf');
// HACKHACK
$_GET['page'] = 'members';
$_GET['type'] = 'view';
$_GET['id'] = strval($member_id_of);
unset($_GET['snippet']);
unset($_GET['member_id']);
unset($_GET['tab']);
unset($_GET['url']);
unset($_GET['title']);
unset($_GET['utheme']);
global $RELATIVE_PATH, $ZONE;
$RELATIVE_PATH = get_module_zone('members');
$zones = $GLOBALS['SITE_DB']->query_select('zones', array('*'), array('zone_name' => $RELATIVE_PATH), '', 1);
$ZONE = $zones[0];
global $PAGE_NAME_CACHE;
$PAGE_NAME_CACHE = 'members';
global $RUNNING_SCRIPT_CACHE;
$RUNNING_SCRIPT_CACHE = array('index' => true);
require_code('hooks/systems/profiles_tabs/' . $hook);
$ob = object_factory('Hook_Profiles_Tabs_' . $hook);
if ($ob->is_active($member_id_of, $member_id_viewing)) {
global $CSSS, $JAVASCRIPTS;
$CSSS = array();
$JAVASCRIPTS = array();
$ret = $ob->render_tab($member_id_of, $member_id_viewing);
$out = new ocp_tempcode();
$out->attach(symbol_tempcode('CSS_TEMPCODE'));
$out->attach(symbol_tempcode('JS_TEMPCODE'));
$out->attach($ret[1]);
return $out;
}
return do_template('INLINE_WIP_MESSAGE', array('MESSAGE' => do_lang_tempcode('INTERNAL_ERROR')));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:44,代码来源:profile_tab.php
示例14: do_next_manager_hooked
/**
* Get the tempcode for a do next manager. A do next manager is a series of linked icons that are presented after performing an action. Modules that do not use do-next pages, usually use REFRESH_PAGE's.
*
* @param ID_TEXT The title of what we are doing (a language string)
* @param ?mixed The language code for the docs of the hook defined do-next manager that we're creating OR tempcode for it (NULL: none)
* @param ID_TEXT The menu 'type' we are doing (filters out any icons that don't match it)
* @param ?string The title to use for the main links (a language string) (NULL: same as title)
* @return tempcode The do next manager
*/
function do_next_manager_hooked($title, $text, $type, $main_title = NULL)
{
$links = array();
if (is_null($main_title)) {
$main_title = $title;
}
breadcrumb_set_self(do_lang_tempcode($title));
$hooks = find_all_hooks('systems', 'do_next_menus');
foreach (array_keys($hooks) as $hook) {
require_code('hooks/systems/do_next_menus/' . filter_naughty_harsh($hook));
$object = object_factory('Hook_do_next_menus_' . filter_naughty_harsh($hook), true);
if (is_null($object)) {
continue;
}
$info = $object->run(true);
foreach ($info as $i) {
if (is_null($i)) {
continue;
}
if ($i[0] == $type) {
array_shift($i);
$links[] = $i;
}
}
}
global $M_SORT_KEY;
$M_SORT_KEY = 2;
@usort($links, 'multi_sort');
if (!is_null($text)) {
if (strpos($text, ' ') === false) {
$_text = comcode_lang_string($text);
} else {
$_text = make_string_tempcode($text);
}
} else {
$_text = new ocp_tempcode();
}
return do_next_manager(is_null($text) ? NULL : get_page_title($title), $_text, $links, do_lang($main_title));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:48,代码来源:templates_donext.php
示例15: run
/**
* Standard modular run function for OcCLE hooks.
*
* @param array The options with which the command was called
* @param array The parameters with which the command was called
* @param array A reference to the OcCLE filesystem object
* @return array Array of stdcommand, stdhtml, stdout, and stderr responses
*/
function run($options, $parameters, &$occle_fs)
{
if (array_key_exists('h', $options) || array_key_exists('help', $options)) {
return array('', do_command_help('find_entry_points', array('h'), array(true)), '', '');
} else {
if (!array_key_exists(0, $parameters)) {
return array('', '', '', do_lang('MISSING_PARAM', '1', 'find_entry_points'));
}
// NOTE: this code assumes the search-string is contained within the zone:page portion of the entry point, not any part of the parameterisation
$entry_points = array();
$zones = find_all_zones();
require_all_lang();
foreach ($zones as $zone) {
$pages = find_all_pages_wrap($zone);
foreach ($pages as $page => $type) {
if (strpos($zone . ':' . $page, $parameters[0]) !== false) {
if ($type == 'modules' || $type == 'modules_custom') {
require_code(zone_black_magic_filterer(filter_naughty_harsh($zone) . '/pages/' . filter_naughty_harsh($type) . '/' . filter_naughty_harsh($page) . '.php'));
if (class_exists('Mx_' . filter_naughty_harsh($page))) {
$object = object_factory('Mx_' . filter_naughty_harsh($page), true);
} else {
$object = object_factory('Module_' . filter_naughty_harsh($page), true);
}
if (!is_null($object) && method_exists($object, 'get_entry_points')) {
$_entry_points = $object->get_entry_points();
foreach ($_entry_points as $key => $val) {
$entry_points[$zone . ':' . $page . ':' . $key] = do_lang($val);
}
}
} else {
$entry_points[$zone . ':' . $page] = $page;
}
}
}
}
return array('', do_template('OCCLE_ENTRY_POINTS', array('_GUID' => 'afaf0b0451ccbdae399dd56e39359c0e', 'ENTRY_POINTS' => $entry_points)), '', '');
}
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:46,代码来源:find_entry_points.php
示例16: find_addon_icon
/**
* Get an addon icon.
*
* @param ID_TEXT The name of the addon
* @return URLPATH Addon icon (blank: could not find one)
*/
function find_addon_icon($hook)
{
if ($hook == '') {
return '';
}
static $addon_icons_cache = array();
if (isset($addon_icons_cache[$hook])) {
return $addon_icons_cache[$hook];
}
$path = get_file_base() . '/sources_custom/hooks/systems/addon_registry/' . filter_naughty_harsh($hook) . '.php';
if (!file_exists($path)) {
$path = get_file_base() . '/sources/hooks/systems/addon_registry/' . filter_naughty_harsh($hook) . '.php';
}
if (!file_exists($path)) {
return '';
}
$hook_file = file_get_contents($path);
$matches = array();
if (preg_match('#function get_file_list\\(\\)\\s*\\{([^\\}]*)\\}#', $hook_file, $matches) != 0) {
if (!defined('HIPHOP_PHP')) {
$addon_files = eval($matches[1]);
} else {
require_code('hooks/systems/addon_registry/' . $hook);
$hook_ob = object_factory('Hook_addon_registry_' . $hook);
$addon_files = $hook_ob->get_file_list();
}
foreach ($addon_files as $file) {
if (substr($file, 0, 31) == 'themes/default/images/bigicons/') {
$addon_icons_cache[$hook] = find_theme_image('bigicons/' . basename($file, '.png'), false, true);
return $addon_icons_cache[$hook];
}
}
}
$addon_icons_cache[$hook] = '';
return '';
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:42,代码来源:addons_overview.php
示例17: get_product_dispatch_type
/**
* Function to return dispatch type of product. (this hook represents a cart order, so find all of it's sub products's dispatch type and decide cart order product's dispatch type - automatic or manual
*
* @param SHORT_TEXT Item ID
* @return SHORT_TEXT Dispatch type
*/
function get_product_dispatch_type($order_id)
{
$row = $GLOBALS['SITE_DB']->query_select('shopping_order_details', array('*'), array('order_id' => $order_id));
foreach ($row as $item) {
if (is_null($item['p_type'])) {
continue;
}
require_code('hooks/systems/ecommerce/' . filter_naughty_harsh($item['p_type']));
$object = object_factory('Hook_' . filter_naughty_harsh($item['p_type']));
//if any of the product's dispatch type is manual, return type as 'manual'
if ($object->get_product_dispatch_type() == 'manual') {
return 'manual';
}
}
//if none of product items have manual dispatch, return order dispatch as automatic.
return 'automatic';
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:23,代码来源:cart_orders.php
示例18: 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('PROFILE');
$order = 10;
$photo_url = $GLOBALS['FORUM_DRIVER']->get_member_row_field($member_id_of, 'm_photo_url');
if ($photo_url != '' && addon_installed('ocf_member_photos') && has_specific_permission($member_id_viewing, 'view_member_photos')) {
require_code('images');
$photo_thumb_url = $GLOBALS['FORUM_DRIVER']->get_member_row_field($member_id_of, 'm_photo_thumb_url');
$photo_thumb_url = ensure_thumbnail($photo_url, $photo_thumb_url, strpos($photo_url, 'uploads/photos') !== false ? 'photos' : 'ocf_photos', 'f_members', $member_id_of, 'm_photo_thumb_url');
if (url_is_local($photo_url)) {
$photo_url = get_complex_base_url($photo_url) . '/' . $photo_url;
}
if (url_is_local($photo_thumb_url)) {
$photo_thumb_url = get_complex_base_url($photo_thumb_url) . '/' . $photo_thumb_url;
}
} else {
$photo_url = '';
$photo_thumb_url = '';
}
$avatar_url = $GLOBALS['FORUM_DRIVER']->get_member_avatar_url($member_id_of);
$username = $GLOBALS['FORUM_DRIVER']->get_username($member_id_of);
// Things staff can do with this user
$modules = array();
if (has_specific_permission($member_id_viewing, 'warn_members') && has_actual_page_access($member_id_viewing, 'warnings') && addon_installed('ocf_warnings')) {
$redir_url = get_self_url(true);
$modules[] = array('usage', do_lang_tempcode('WARN_MEMBER'), build_url(array('page' => 'warnings', 'type' => 'ad', 'id' => $member_id_of, 'redirect' => $redir_url), get_module_zone('warnings')));
$modules[] = array('usage', do_lang_tempcode('PUNITIVE_HISTORY'), build_url(array('page' => 'warnings', 'type' => 'history', 'id' => $member_id_of), get_module_zone('warnings')));
}
if (has_specific_permission($member_id_viewing, 'view_content_history') && has_actual_page_access($member_id_viewing, 'admin_ocf_history')) {
$modules[] = !addon_installed('ocf_forum') ? NULL : array('usage', do_lang_tempcode('POST_HISTORY'), build_url(array('page' => 'admin_ocf_history', 'member_id' => $member_id_of), 'adminzone'));
|
请发表评论