• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_guest函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_guest函数的典型用法代码示例。如果您正苦于以下问题:PHP is_guest函数的具体用法?PHP is_guest怎么用?PHP is_guest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_guest函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: render_tab

 /**
  * Standard modular render function for profile tabs edit 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 tuple: The tab title, the tab body text (may be blank), the tab fields, extra Javascript (may be blank) the suggested tab order, hidden fields (optional) (NULL: if $leave_to_ajax_if_possible was set)
  */
 function render_tab($member_id_of, $member_id_viewing, $leave_to_ajax_if_possible = false)
 {
     $title = do_lang_tempcode('DELETE_MEMBER');
     $order = 200;
     // Actualiser
     $delete_account = post_param_integer('delete', 0);
     if ($delete_account == 1) {
         if (is_guest($member_id_of)) {
             warn_exit(do_lang_tempcode('INTERNAL_ERROR'));
         }
         ocf_delete_member($member_id_of);
         inform_exit(do_lang_tempcode('SUCCESS'));
     }
     if ($leave_to_ajax_if_possible) {
         return NULL;
     }
     // UI fields
     $username = $GLOBALS['FORUM_DRIVER']->get_username($member_id_of);
     $text = do_lang_tempcode('_DELETE_MEMBER' . ($member_id_of == get_member() ? '_SUICIDAL' : ''), escape_html($username));
     $fields = new ocp_tempcode();
     require_code('form_templates');
     $fields->attach(form_input_tick(do_lang_tempcode('DELETE'), do_lang_tempcode('DESCRIPTION_DELETE'), 'delete', false));
     $javascript = '';
     return array($title, $fields, $text, $javascript, $order);
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:33,代码来源:delete.php


示例2: run

 /**
  * Standard modular run function for newsletter hooks.
  *
  * @param  TIME				The time that the entries found must be newer than
  * @param  LANGUAGE_NAME	The language the entries found must be in
  * @param  string				Category filter to apply
  * @param  BINARY				Whether to use full article instead of summary
  * @return array				Tuple of result details
  */
 function run($cutoff_time, $lang, $filter, $in_full = 1)
 {
     if (!addon_installed('news')) {
         return array();
     }
     require_lang('news');
     $new = new ocp_tempcode();
     require_code('ocfiltering');
     $or_list = ocfilter_to_sqlfragment($filter, 'news_category');
     $or_list_2 = ocfilter_to_sqlfragment($filter, 'news_entry_category');
     $rows = $GLOBALS['SITE_DB']->query('SELECT title,news,news_article,id,date_and_time,submitter FROM ' . get_table_prefix() . 'news LEFT JOIN ' . get_table_prefix() . 'news_category_entries ON news_entry=id WHERE validated=1 AND date_and_time>' . strval((int) $cutoff_time) . ' AND ((' . $or_list . ') OR (' . $or_list_2 . ')) ORDER BY date_and_time DESC', 300);
     if (count($rows) == 300) {
         return array();
     }
     $rows = remove_duplicate_rows($rows, 'id');
     foreach ($rows as $row) {
         $_url = build_url(array('page' => 'news', 'type' => 'view', 'id' => $row['id']), get_module_zone('news'), NULL, false, false, true);
         $url = $_url->evaluate();
         $name = get_translated_text($row['title'], NULL, $lang);
         $description = get_translated_text($row[$in_full == 1 ? 'news_article' : 'news'], NULL, $lang);
         if ($description == '') {
             $description = get_translated_text($row[$in_full == 1 ? 'news' : 'news_article'], NULL, $lang);
         }
         $member_id = is_guest($row['submitter']) ? NULL : strval($row['submitter']);
         $new->attach(do_template('NEWSLETTER_NEW_RESOURCE_FCOMCODE', array('_GUID' => '4eaf5ec00db1f0b89cef5120c2486521', 'MEMBER_ID' => $member_id, 'URL' => $url, 'NAME' => $name, 'DESCRIPTION' => $description)));
     }
     return array($new, do_lang('NEWS', '', '', '', $lang));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:37,代码来源:news.php


示例3: run

 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     if (get_forum_type() != 'ocf') {
         warn_exit(do_lang_tempcode('NO_OCF'));
     } else {
         ocf_require_all_forum_stuff();
     }
     require_code('ocf_forumview');
     if (is_guest()) {
         access_denied('NOT_AS_GUEST');
     }
     require_css('ocf');
     $type = get_param('type', 'misc');
     if ($type == 'misc') {
         list($title, $content) = $this->new_posts();
     } elseif ($type == 'unread') {
         list($title, $content) = $this->unread_topics();
     } elseif ($type == 'recently_read') {
         list($title, $content) = $this->recently_read();
     } else {
         $title = new ocp_tempcode();
         $content = new ocp_tempcode();
     }
     $ret = ocf_wrapper($title, do_template('OCF_VFORUM', array('_GUID' => '8dca548982d65500ab1800ceec2ddc61', 'CONTENT' => $content)));
     return $ret;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:31,代码来源:vforums.php


示例4: get_content

 function get_content()
 {
     if ($this->content !== NULL) {
         return $this->content;
     }
     if (!isloggedin() || is_guest($this->context)) {
         return $this->content;
     }
     $this->content = new stdClass();
     $this->content->footer = '';
     $this->content->icons = array();
     if (!$this->import_checklist_plugin()) {
         $this->content->items = array(get_string('nochecklistplugin', 'block_checklist'));
         return $this->content;
     }
     if (!empty($this->config->checklistoverview)) {
         return $this->show_checklist_overview();
     }
     if (!empty($this->config->checklistid)) {
         return $this->show_single_checklist($this->config->checklistid);
     }
     // No checklist configured.
     $this->content->items = array(get_string('nochecklist', 'block_checklist'));
     return $this->content;
 }
开发者ID:POETGroup,项目名称:moodle-block_checklist,代码行数:25,代码来源:block_checklist.php


示例5: ocf_may_attach_poll

/**
 * Find whether a member may attach a poll to a detailed topic.
 *
 * @param  AUTO_LINK The topic.
 * @param  ?MEMBER	The topic owner (NULL: ask the DB for it).
 * @param  ?boolean  Whether the topic already has a poll (NULL: ask the DB for it).
 * @param  ?MEMBER	The forum the topic is in (NULL: ask the DB for it).
 * @param  ?MEMBER	The member we are checking for (NULL: current member).
 * @return boolean	The answer.
 */
function ocf_may_attach_poll($topic_id, $topic_owner = NULL, $has_poll_already = NULL, $forum_id = NULL, $member_id = NULL)
{
    if (is_null($topic_owner)) {
        $topic_info = $GLOBALS['FORUM_DB']->query_select('f_topics', array('*'), array('id' => $topic_id), '', 1);
        if (!array_key_exists(0, $topic_info)) {
            warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
        }
        $topic_owner = $topic_info[0]['t_cache_first_member_id'];
        $has_poll_already = !is_null($topic_info[0]['t_poll_id']);
        $forum_id = $topic_info[0]['t_forum_id'];
    }
    if (is_null($member_id)) {
        $member_id = get_member();
    }
    if ($has_poll_already) {
        return false;
    }
    if ($topic_owner == $member_id && !is_guest($member_id)) {
        return true;
    }
    if (ocf_may_moderate_forum($forum_id, $member_id)) {
        return true;
    }
    return false;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:35,代码来源:ocf_polls.php


示例6: 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


示例7: run

 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     unset($map);
     if (get_forum_type() != 'ocf') {
         return new ocp_tempcode();
     }
     if (is_guest()) {
         return new ocp_tempcode();
     }
     require_css('side_blocks');
     ocf_require_all_forum_stuff();
     require_code('ocf_notifications');
     // Only show what's new in week. Some forums may want to tweak this, but forums themselves only mark unread topics for a week.
     $rows = ocf_get_pp_rows();
     //		if (count($rows)==0) return new ocp_tempcode();
     require_lang('ocf');
     $out = new ocp_tempcode();
     foreach ($rows as $topic) {
         $topic_url = build_url(array('page' => 'topicview', 'id' => $topic['id'], 'type' => 'findpost'), get_module_zone('topicview'));
         $topic_url->attach('#post_' . strval($topic['id']));
         $title = $topic['t_cache_first_title'];
         $date = get_timezoned_date($topic['t_cache_last_time'], true);
         $username = $topic['t_cache_last_username'];
         $member_link = $GLOBALS['OCF_DRIVER']->member_profile_url($topic['t_cache_last_member_id'], false, true);
         $num_posts = $topic['t_cache_num_posts'];
         $out->attach(do_template('TOPIC_LIST', array('_GUID' => '55ae21a9f8d67ba6237c118a18b9657b', 'USER_LINK' => $member_link, 'TOPIC_LINK' => $topic_url, 'TITLE' => $title, 'DATE' => $date, 'DATE_RAW' => strval($topic['t_cache_last_time']), 'USERNAME' => $username, 'NUM_POSTS' => integer_format($num_posts))));
     }
     $send_url = build_url(array('page' => 'topics', 'type' => 'new_pt', 'redirect' => SELF_REDIRECT), get_module_zone('topics'));
     if (!ocf_may_make_personal_topic()) {
         $send_url = new ocp_tempcode();
     }
     $view_url = build_url(array('page' => 'members', 'type' => 'view', 'id' => get_member()), get_module_zone('members'), NULL, true, false, false, 'tab__pts');
     return do_template('BLOCK_SIDE_OCF_PERSONAL_TOPICS', array('_GUID' => '9376cd47884a78f3d1914c176b67ee28', 'SEND_URL' => $send_url, 'VIEW_URL' => $view_url, 'CONTENT' => $out, 'FORUM_NAME' => do_lang_tempcode('PERSONAL_TOPICS')));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:40,代码来源:side_ocf_personal_topics.php


示例8: 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


示例9: run

 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     require_lang('bookmarks');
     require_code('bookmarks');
     require_css('bookmarks');
     if (is_guest()) {
         access_denied('NOT_AS_GUEST');
     }
     // Decide what we're doing
     $type = get_param('type', 'misc');
     if ($type == 'misc') {
         return $this->manage_bookmarks();
     }
     if ($type == '_manage') {
         return $this->_manage_bookmarks();
     }
     if ($type == '_edit') {
         return $this->_edit_bookmark();
     }
     if ($type == 'ad') {
         return $this->ad();
     }
     if ($type == '_ad') {
         return $this->_ad();
     }
     return new ocp_tempcode();
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:32,代码来源:bookmarks.php


示例10: run

 /**
  * Standard modular run function for realtime-rain hooks.
  *
  * @param  TIME			Start of time range.
  * @param  TIME			End of time range.
  * @return array			A list of template parameter sets for rendering a 'drop'.
  */
 function run($from, $to)
 {
     $drops = array();
     if (has_actual_page_access(get_member(), 'chat')) {
         require_code('chat');
         $rows = $GLOBALS['SITE_DB']->query('SELECT ip_address,the_message,user_id AS member_id,date_and_time AS timestamp,room_id FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'chat_messages WHERE system_message=0 AND date_and_time BETWEEN ' . strval($from) . ' AND ' . strval($to));
         foreach ($rows as $row) {
             if (!check_chatroom_access($row['room_id'], true)) {
                 continue;
             }
             $timestamp = $row['timestamp'];
             $member_id = $row['member_id'];
             $message = get_translated_text($row['the_message']);
             if (strpos($message, '[private') !== false) {
                 continue;
             }
             $message = strip_comcode($message);
             if ($message == '') {
                 continue;
             }
             $drops[] = rain_get_special_icons($row['ip_address'], $timestamp, NULL, $message) + array('TYPE' => 'chat', 'FROM_MEMBER_ID' => strval($member_id), 'TO_MEMBER_ID' => NULL, 'TITLE' => rain_truncate_for_title($message), 'IMAGE' => is_guest($member_id) ? rain_get_country_image($row['ip_address']) : $GLOBALS['FORUM_DRIVER']->get_member_avatar_url($member_id), 'TIMESTAMP' => strval($timestamp), 'RELATIVE_TIMESTAMP' => strval($timestamp - $from), 'TICKER_TEXT' => $message, 'URL' => build_url(array('page' => 'points', 'type' => 'member', 'id' => $member_id), '_SEARCH'), 'IS_POSITIVE' => false, 'IS_NEGATIVE' => false, 'FROM_ID' => 'member_' . strval($member_id), 'TO_ID' => NULL, 'GROUP_ID' => 'room_' . strval($row['room_id']));
         }
     }
     return $drops;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:32,代码来源:chat.php


示例11: require_capability

 /**
  * Do any security checks needed for the passed action
  *
  * @param string $action
  */
 public function require_capability($action)
 {
     global $PAGE;
     require_capability('mod/hsuforum:viewdiscussion', $PAGE->context);
     if (is_guest($PAGE->context)) {
         print_error('noguest');
     }
 }
开发者ID:cdsmith-umn,项目名称:moodle-mod_hsuforum,代码行数:13,代码来源:export_controller.php


示例12: run

 /**
  * Standard modular run function for RSS hooks.
  *
  * @param  string			A list of categories we accept from
  * @param  TIME			Cutoff time, before which we do not show results from
  * @param  string			Prefix that represents the template set we use
  * @set    RSS_ ATOM_
  * @param  string			The standard format of date to use for the syndication type represented in the prefix
  * @param  integer		The maximum number of entries to return, ordering by date
  * @return ?array			A pair: The main syndication section, and a title (NULL: error)
  */
 function run($_filters, $cutoff, $prefix, $date_string, $max)
 {
     if (!addon_installed('tickets')) {
         return NULL;
     }
     if (!has_actual_page_access(get_member(), 'tickets')) {
         return NULL;
     }
     if (is_guest()) {
         return NULL;
     }
     require_code('tickets');
     require_code('tickets2');
     $ticket_types = ocfilter_to_idlist_using_callback($_filters, '', NULL, NULL, NULL, NULL, false);
     if (count($ticket_types) != 0) {
         $rows = array();
         foreach ($ticket_types as $ticket_type) {
             if (!has_category_access(get_member(), 'tickets', get_translated_text($ticket_type))) {
                 continue;
             }
             $rows = array_merge($rows, get_tickets(get_member(), $ticket_type, false, false, true));
         }
     } else {
         $rows = get_tickets(get_member(), NULL, false, false, true);
     }
     require_code('feedback');
     $content = new ocp_tempcode();
     foreach ($rows as $i => $row) {
         if ($i == $max) {
             break;
         }
         if ($row['lasttime'] < $cutoff) {
             continue;
         }
         $ticket_id = extract_topic_identifier($row['description']);
         $ticket_type = $GLOBALS['SITE_DB']->query_value_null_ok('tickets', 'ticket_type', array('ticket_id' => $ticket_id));
         $author = $row['firstusername'];
         $date = date($date_string, $row['firsttime']);
         $edit_date = date($date_string, $row['lasttime']);
         $title = xmlentities($row['firsttitle']);
         $summary = xmlentities($row['firstpost']->evaluate());
         $category = '';
         $category_raw = '';
         if (!is_null($ticket_type)) {
             $category = get_translated_text($ticket_type);
             $category_raw = strval($ticket_type);
         }
         $view_url = build_url(array('page' => 'tickets', 'type' => 'ticket', 'id' => $ticket_id), get_module_zone('tickets'), NULL, false, false, true);
         if ($prefix == 'RSS_' && get_option('is_on_comments') == '1') {
             $if_comments = do_template('RSS_ENTRY_COMMENTS', array('_GUID' => 'b4f25f5cf68304f8d402bb06851489d6', 'COMMENT_URL' => $view_url, 'ID' => strval($ticket_id)));
         } else {
             $if_comments = new ocp_tempcode();
         }
         $content->attach(do_template($prefix . 'ENTRY', array('VIEW_URL' => $view_url, 'SUMMARY' => $summary, 'EDIT_DATE' => $edit_date, 'IF_COMMENTS' => $if_comments, 'TITLE' => $title, 'CATEGORY_RAW' => $category_raw, 'CATEGORY' => $category, 'AUTHOR' => $author, 'ID' => $ticket_id, 'NEWS' => '', 'DATE' => $date)));
     }
     require_lang('tickets');
     return array($content, do_lang('SUPPORT_TICKETS'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:69,代码来源:tickets.php


示例13: get_entry_points

 /**
  * Standard modular entry-point finder function.
  *
  * @return ?array	A map of entry points (type-code=>language-code) (NULL: disabled).
  */
 function get_entry_points()
 {
     if (get_forum_type() == 'ocf') {
         return array();
     }
     if (is_guest()) {
         return array();
     }
     return array('misc' => 'NOTIFICATIONS');
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:15,代码来源:notifications.php


示例14: run

 /**
  * Standard modular run function for snippet hooks. Generates XHTML to insert into a page using AJAX.
  *
  * @return tempcode  The snippet
  */
 function run()
 {
     if (!is_guest()) {
         require_code('menus');
         $built = build_stored_menu('popup', '_bookmarks');
         if (is_null($built)) {
             return new ocp_tempcode();
         }
         return $built;
     }
     return new ocp_tempcode();
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:17,代码来源:bookmarks_menu.php


示例15: 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


示例16: run

 /**
  * Standard modular run function for realtime-rain hooks.
  *
  * @param  TIME			Start of time range.
  * @param  TIME			End of time range.
  * @return array			A list of template parameter sets for rendering a 'drop'.
  */
 function run($from, $to)
 {
     $drops = array();
     if (has_actual_page_access(get_member(), 'admin_ocf_join') && get_forum_type() == 'ocf') {
         $rows = $GLOBALS['FORUM_DB']->query('SELECT i_email_address,i_inviter AS member_id,i_time AS timestamp FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_invites WHERE i_time BETWEEN ' . strval($from) . ' AND ' . strval($to));
         foreach ($rows as $row) {
             $timestamp = $row['timestamp'];
             $member_id = $row['member_id'];
             $invited_member = $GLOBALS['FORUM_DB']->query_value_null_ok('f_members', 'id', array('m_email_address' => $row['i_email_address']));
             $drops[] = rain_get_special_icons(NULL, $timestamp) + array('TYPE' => 'recommend', 'FROM_MEMBER_ID' => strval($member_id), 'TO_MEMBER_ID' => is_null($invited_member) ? '' : strval($invited_member), 'TITLE' => do_lang('RECOMMEND_SITE'), 'IMAGE' => is_guest($member_id) ? find_theme_image('recommend') : $GLOBALS['FORUM_DRIVER']->get_member_avatar_url($member_id), 'TIMESTAMP' => strval($timestamp), 'RELATIVE_TIMESTAMP' => strval($timestamp - $from), 'TICKER_TEXT' => NULL, 'URL' => build_url(array('page' => 'points', 'type' => 'member', 'id' => $member_id), '_SEARCH'), 'IS_POSITIVE' => true, 'IS_NEGATIVE' => false, 'FROM_ID' => 'member_' . strval($member_id), 'TO_ID' => is_null($invited_member) ? '' : 'member_' . strval($invited_member), 'GROUP_ID' => NULL);
         }
     }
     return $drops;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:21,代码来源:recommend.php


示例17: run

 /**
  * Standard modular run function for realtime-rain hooks.
  *
  * @param  TIME			Start of time range.
  * @param  TIME			End of time range.
  * @return array			A list of template parameter sets for rendering a 'drop'.
  */
 function run($from, $to)
 {
     $drops = array();
     if (has_actual_page_access(get_member(), 'admin_security')) {
         $rows = $GLOBALS['SITE_DB']->query('SELECT id,reason,ip,the_user AS member_id,date_and_time AS timestamp FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'hackattack WHERE date_and_time BETWEEN ' . strval($from) . ' AND ' . strval($to));
         foreach ($rows as $row) {
             require_lang('security');
             $timestamp = $row['timestamp'];
             $member_id = $row['member_id'];
             $drops[] = rain_get_special_icons($row['ip'], $timestamp) + array('TYPE' => 'security', 'FROM_MEMBER_ID' => strval($member_id), 'TO_MEMBER_ID' => NULL, 'TITLE' => rain_truncate_for_title(do_lang('HACKER_DETECTED', do_lang($row['reason']))), 'IMAGE' => is_guest($member_id) ? rain_get_country_image($row['ip']) : $GLOBALS['FORUM_DRIVER']->get_member_avatar_url($member_id), 'TIMESTAMP' => strval($timestamp), 'RELATIVE_TIMESTAMP' => strval($timestamp - $from), 'TICKER_TEXT' => NULL, 'URL' => build_url(array('page' => 'admin_security', 'type' => 'view', 'id' => $row['id']), '_SEARCH'), 'IS_POSITIVE' => false, 'IS_NEGATIVE' => true, 'FROM_ID' => 'member_' . strval($member_id), 'TO_ID' => NULL, 'GROUP_ID' => 'hack_type_' . $row['reason']);
         }
     }
     return $drops;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:21,代码来源:security.php


示例18: 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)
 {
     require_lang('ocgifts');
     if (is_guest()) {
         return array();
     }
     if (!has_actual_page_access(get_member(), 'pointstore', get_module_zone('pointstore'))) {
         return array();
     }
     if ($member_id == get_member()) {
         return array();
     }
     return array(array('contact', do_lang_tempcode('GIFT_GIFT'), build_url(array('page' => 'pointstore', 'type' => 'action', 'id' => 'ocgifts', 'username' => $GLOBALS['FORUM_DRIVER']->get_username($member_id)), get_module_zone('pointstore'))));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:20,代码来源:gifts.php


示例19: run

 /**
  * Standard modular run function for search results.
  *
  * @param  string			Search string
  * @param  boolean		Whether to only do a META (tags) search
  * @param  ID_TEXT		Order direction
  * @param  integer		Start position in total results
  * @param  integer		Maximum results to return in total
  * @param  boolean		Whether only to search titles (as opposed to both titles and content)
  * @param  string			Where clause that selects the content according to the main search string (SQL query fragment) (blank: full-text search)
  * @param  SHORT_TEXT	Username/Author to match for
  * @param  ?MEMBER		Member-ID to match for (NULL: unknown)
  * @param  TIME			Cutoff date
  * @param  string			The sort type (gets remapped to a field in this function)
  * @set    title add_date
  * @param  integer		Limit to this number of results
  * @param  string			What kind of boolean search to do
  * @set    or and
  * @param  string			Where constraints known by the main search code (SQL query fragment)
  * @param  string			Comma-separated list of categories to search under
  * @param  boolean		Whether it is a boolean search
  * @return array			List of maps (template, orderer)
  */
 function run($content, $only_search_meta, $direction, $max, $start, $only_titles, $content_where, $author, $author_id, $cutoff, $sort, $limit_to, $boolean_operator, $where_clause, $search_under, $boolean_search)
 {
     unset($limit_to);
     require_lang('calendar');
     $remapped_orderer = '';
     switch ($sort) {
         case 'title':
             $remapped_orderer = 'e_title';
             break;
         case 'add_date':
             $remapped_orderer = 'e_add_date';
             break;
     }
     // Calculate our where clause (search)
     $where_clause .= ' AND ';
     $where_clause .= '(e_is_public=1';
     if (!is_guest()) {
         $where_clause .= ' OR e_submitter=' . strval(get_member());
     }
     $where_clause .= ')';
     $sq = build_search_submitter_clauses('e_submitter', $author_id, $author);
     if (is_null($sq)) {
         return array();
     } else {
         $where_clause .= $sq;
     }
     if (!is_null($cutoff)) {
         $where_clause .= ' AND ';
         $where_clause .= 'e_add_date>' . strval(intval($cutoff));
     }
     $where_clause .= ' AND ';
     $where_clause .= 'e_type<>' . strval(db_get_first_id());
     if (!has_specific_permission(get_member(), 'see_unvalidated')) {
         $where_clause .= ' AND ';
         $where_clause .= 'validated=1';
     }
     // Calculate and perform query
     $rows = get_search_rows('event', 'id', $content, $boolean_search, $boolean_operator, $only_search_meta, $direction, $max, $start, $only_titles, 'calendar_events r', array('r.e_title', 'r.e_content'), $where_clause, $content_where, $remapped_orderer, 'r.*', NULL, 'calendar', 'e_type');
     $out = array();
     foreach ($rows as $i => $row) {
         $out[$i]['data'] = $row;
         unset($rows[$i]);
         if ($remapped_orderer != '' && array_key_exists($remapped_orderer, $row)) {
             $out[$i]['orderer'] = $row[$remapped_orderer];
         } elseif (substr($remapped_orderer, 0, 7) == '_rating') {
             $out[$i]['orderer'] = $row['compound_rating'];
         }
     }
     return $out;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:73,代码来源:calendar.php


示例20: run

 /**
  * Standard modular run function for RSS hooks.
  *
  * @param  string			A list of categories we accept from
  * @param  TIME			Cutoff time, before which we do not show results from
  * @param  string			Prefix that represents the template set we use
  * @set    RSS_ ATOM_
  * @param  string			The standard format of date to use for the syndication type represented in the prefix
  * @param  integer		The maximum number of entries to return, ordering by date
  * @return ?array			A pair: The main syndication section, and a title (NULL: error)
  */
 function run($_filters, $cutoff, $prefix, $date_string, $max)
 {
     if (!addon_installed('ocf_forum')) {
         return NULL;
     }
     if (get_forum_type() != 'ocf') {
         return NULL;
     }
     if (!has_actual_page_access(get_member(), 'forumview')) {
         return NULL;
     }
     $filters = ocfilter_to_sqlfragment($_filters, 'p_topic_id', 'f_forums', 'f_parent_forum', 'p_cache_forum_id', 'id', true, true, $GLOBALS['FORUM_DB']);
     $cutoff = max($cutoff, time() - 60 * 60 * 24 * 60);
     if (!is_guest()) {
         $filters .= ' AND (p_poster<>' . strval(get_member()) . ')';
     }
     $rows = $GLOBALS['FORUM_DB']->query('SELECT * FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_posts WHERE p_time>' . strval($cutoff) . (!has_specific_permission(get_member(), 'see_unvalidated') ? ' AND p_validated=1 ' : '') . ' AND ' . $filters . ' ORDER BY p_time DESC,id DESC', $max);
     $categories = list_to_map('id', $GLOBALS['FORUM_DB']->query('SELECT id,t_cache_first_title,t_pt_from,t_pt_to FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_topics WHERE t_cache_last_time>' . strval((int) $cutoff)));
     $content = new ocp_tempcode();
     foreach ($rows as $row) {
         if (!array_key_exists($row['p_topic_id'], $categories)) {
             continue;
         }
         $category = $categories[$row['p_topic_id']]['t_cache_first_title'];
         if ((!is_null($row['p_cache_forum_id']) || $categories[$row['p_topic_id']]['t_pt_from'] == get_member() || $categories[$row['p_topic_id']]['t_pt_to'] == get_member()) && (is_null($row['p_intended_solely_for']) || $row['p_intended_solely_for'] == get_member()) && has_category_access(get_member(), 'forums', strval($row['p_cache_forum_id']))) {
             $id = strval($row['id']);
             $author = $row['p_poster_name_if_guest'];
             $news_date = date($date_string, $row['p_time']);
             $edit_date = is_null($row['p_last_edit_time']) ? '' : date($date_string, $row['p_last_edit_time']);
             if ($edit_date == $news_date) {
                 $edit_date = '';
             }
             $news_title = xmlentities($row['p_title']);
             $_summary = get_translated_tempcode($row['p_post'], $GLOBALS['FORUM_DB']);
             $summary = xmlentities($_summary->evaluate());
             $news = '';
             $category_raw = strval($row['p_topic_id']);
             $view_url = build_url(array('page' => 'topicview', 'type' => 'findpost', 'id' => $row['id']), get_module_zone('forumview'), NULL, false, false, true);
             if ($prefix == 'RSS_') {
                 $if_comments = do_template('RSS_ENTRY_COMMENTS', array('_GUID' => 'ed06bc8f174a5427e1789820666fdd81', 'COMMENT_URL' => $view_url, 'ID' => strval($row['p_topic_id'])));
             } else {
                 $if_comments = new ocp_tempcode();
             }
             $content->attach(do_template($prefix . 'ENTRY', array('VIEW_URL' => $view_url, 'SUMMARY' => $summary, 'EDIT_DATE' => $edit_date, 'IF_COMMENTS' => $if_comments, 'TITLE' => $news_title, 'CATEGORY_RAW' => $category_raw, 'CATEGORY' => $category, 'AUTHOR' => $author, 'ID' => $id, 'NEWS' => $news, 'DATE' => $news_date)));
         }
     }
     require_lang('ocf');
     return array($content, do_lang('FORUM_TOPICS'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:60,代码来源:ocf_topicview.php



注:本文中的is_guest函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_hash函数代码示例发布时间:2022-05-15
下一篇:
PHP is_graph_allowed函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap