当前位置: 首页>>代码示例>>PHP>>正文


PHP get_timezoned_date函数代码示例

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


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

示例1: run

 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     $url = array_key_exists('param', $map) ? $map['param'] : 'http://ocportal.com/backend.php?type=rss&mode=news&filter=16,17,18,19,20';
     // http://channel9.msdn.com/Feeds/RSS/
     require_code('rss');
     $rss = new rss($url);
     if (!is_null($rss->error)) {
         return paragraph($rss->error, 'gfgrtyhyyfhd');
     }
     global $NEWS_CATS;
     $NEWS_CATS = $GLOBALS['SITE_DB']->query_select('news_categories', array('*'), array('nc_owner' => NULL));
     $NEWS_CATS = list_to_map('id', $NEWS_CATS);
     $_postdetailss = array();
     // Now for the actual stream contents
     $max = array_key_exists('max_entries', $map) ? intval($map['max_entries']) : 10;
     $content = new ocp_tempcode();
     foreach ($rss->gleamed_items as $i => $item) {
         if ($i >= $max) {
             break;
         }
         if (array_key_exists('full_url', $item)) {
             $full_url = $item['full_url'];
         } elseif (array_key_exists('guid', $item)) {
             $full_url = $item['guid'];
         } elseif (array_key_exists('comment_url', $item)) {
             $full_url = $item['comment_url'];
         } else {
             $full_url = '';
         }
         $_title = $item['title'];
         $date = array_key_exists('clean_add_date', $item) ? get_timezoned_date($item['clean_add_date']) : array_key_exists('add_date', $item) ? $item['add_date'] : '';
         $_postdetailss[] = array('DATE' => $date, 'FULL_URL' => $full_url, 'NEWS_TITLE' => $_title);
     }
     return do_template('BLOCK_BOTTOM_NEWS', array('_GUID' => '0fc123199c4d4b7af5a26706271b1f4f', 'POSTS' => $_postdetailss));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:41,代码来源:bottom_rss.php

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

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

示例4: run

 /**
  * Standard modular run function for award hooks. Renders a content box for an award/randomisation.
  *
  * @param  array		The database row for the content
  * @param  ID_TEXT	The zone to display in
  * @return tempcode	Results
  */
 function run($row, $zone)
 {
     $url = build_url(array('page' => 'news', 'type' => 'view', 'id' => $row['id']), $zone);
     $title = get_translated_tempcode($row['title']);
     $title_plain = get_translated_text($row['title']);
     $news_cat_rows = $GLOBALS['SITE_DB']->query_select('news_categories', array('nc_title', 'nc_img'), array('id' => $row['news_category']), '', 1);
     if (!array_key_exists(0, $news_cat_rows)) {
         warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
     }
     $news_cat_row = $news_cat_rows[0];
     $category = get_translated_text($news_cat_row['nc_title']);
     $img = find_theme_image($news_cat_row['nc_img']);
     if ($row['news_image'] != '') {
         $img = $row['news_image'];
         if (url_is_local($img)) {
             $img = get_base_url() . '/' . $img;
         }
     }
     $news = get_translated_tempcode($row['news']);
     if ($news->is_empty()) {
         $news = get_translated_tempcode($row['news_article']);
         $truncate = true;
     } else {
         $truncate = false;
     }
     $author_url = addon_installed('authors') ? build_url(array('page' => 'authors', 'type' => 'misc', 'id' => $row['author']), get_module_zone('authors')) : new ocp_tempcode();
     $author = $row['author'];
     require_css('news');
     $seo_bits = seo_meta_get_for('news', strval($row['id']));
     $map = array('_GUID' => 'jd89f893jlkj9832gr3uyg2u', 'TAGS' => get_loaded_tags('news', explode(',', $seo_bits[0])), 'TRUNCATE' => $truncate, 'AUTHOR' => $author, 'BLOG' => false, 'AUTHOR_URL' => $author_url, 'CATEGORY' => $category, 'IMG' => $img, 'NEWS' => $news, 'ID' => strval($row['id']), 'SUBMITTER' => strval($row['submitter']), 'DATE' => get_timezoned_date($row['date_and_time']), 'DATE_RAW' => strval($row['date_and_time']), 'FULL_URL' => $url, 'NEWS_TITLE' => $title, 'NEWS_TITLE_PLAIN' => $title_plain);
     if (get_option('is_on_comments') == '1' && !has_no_forum() && $row['allow_comments'] >= 1) {
         $map['COMMENT_COUNT'] = '1';
     }
     return put_in_standard_box(do_template('NEWS_PIECE_SUMMARY', $map));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:42,代码来源:news.php

示例5: 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('date', array('h'), array()), '', '');
     } else {
         return array('', '', get_timezoned_date(time(), true, true), '');
     }
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:16,代码来源:date.php

示例6: show_quiz_html

/**
 * Show a quiz box.
 *
 * @param  array			The database row
 * @param  string			The zone to show in
 * @return tempcode		The rendered quiz link
 */
function show_quiz_html($row, $zone = '_SEARCH')
{
    $date = get_timezoned_date($row['q_add_date']);
    $url = build_url(array('page' => 'quiz', 'type' => 'do', 'id' => $row['id']), $zone);
    $name = get_translated_text($row['q_name']);
    $start_text = get_translated_tempcode($row['q_start_text']);
    $timeout = is_null($row['q_timeout']) ? '' : display_time_period($row['q_timeout'] * 60);
    $redo_time = is_null($row['q_redo_time']) || $row['q_redo_time'] == 0 ? '' : display_time_period($row['q_redo_time'] * 60 * 60);
    return do_template('QUIZ_LINK', array('_TYPE' => $row['q_type'], 'POINTS' => strval($row['q_points_for_passing']), 'TIMEOUT' => $timeout, 'REDO_TIME' => $redo_time, 'TYPE' => do_lang_tempcode($row['q_type']), 'DATE' => $date, 'URL' => $url, 'NAME' => $name, 'START_TEXT' => $start_text));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:17,代码来源:quiz.php

示例7: choose

 /**
  * The UI to delete trackbacks.
  *
  * @return tempcode		The UI
  */
 function choose()
 {
     $title = get_page_title('MANAGE_TRACKBACKS');
     $trackback_rows = $GLOBALS['SITE_DB']->query_select('trackbacks', array('*'), NULL, 'ORDER BY id DESC', 1000);
     $trackbacks = '';
     foreach ($trackback_rows as $value) {
         $trackbacks .= static_evaluate_tempcode(do_template('TRACKBACK', array('ID' => strval($value['id']), 'TIME_RAW' => strval($value['trackback_time']), 'TIME' => get_timezoned_date($value['trackback_time']), 'URL' => $value['trackback_url'], 'TITLE' => $value['trackback_title'], 'EXCERPT' => $value['trackback_excerpt'], 'NAME' => $value['trackback_name'])));
     }
     return do_template('TRACKBACK_DELETE_SCREEN', array('_GUID' => '51f7e4c1976bcaf120758d2c86771289', 'TITLE' => $title, 'TRACKBACKS' => $trackbacks, 'LOTS' => count($trackback_rows) == 1000));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:15,代码来源:admin_trackbacks.php

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

示例9: 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 (!has_actual_page_access(get_member(), 'cms_booking')) {
         return array();
     }
     require_lang('booking');
     require_code('booking');
     require_code('booking2');
     $zone = get_module_zone('cms_booking');
     $request = get_member_booking_request($member_id);
     $links = array();
     foreach ($request as $i => $r) {
         $from = get_timezoned_date(mktime(0, 0, 0, $r['start_month'], $r['start_day'], $r['start_year']), false);
         $to = get_timezoned_date(mktime(0, 0, 0, $r['end_month'], $r['end_day'], $r['end_year']), false);
         $links[] = array('content', do_lang_tempcode('BOOKING_EDIT', $from, $to, get_translated_tempcode($GLOBALS['SITE_DB']->query_value('bookable', 'title', array('id' => $r['bookable_id'])))), build_url(array('page' => 'cms_booking', 'type' => '_eb', 'id' => strval($member_id) . '_' . strval($i)), $zone));
     }
     return $links;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:24,代码来源:booking.php

示例10: 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()
 {
     $last_cron = get_value('last_cron');
     if (is_null($last_cron) || intval($last_cron) < time() - 60 * 60 * 24) {
         $status = 0;
         $info = NULL;
         $url = brand_base_url() . '/docs' . strval(ocp_version()) . '/pg/tut_configuration';
     } else {
         $status = 1;
         $date = get_timezoned_date(intval($last_cron), true, true, false, true);
         $mails_sent = $GLOBALS['SITE_DB']->query_value_null_ok_full('SELECT COUNT(*) AS cnt FROM ' . get_table_prefix() . 'logged_mail_messages WHERE m_queued=0 AND m_date_and_time>' . strval(time() - 60 * 60 * 24));
         $mails_queued = $GLOBALS['SITE_DB']->query_value_null_ok_full('SELECT COUNT(*) AS cnt FROM ' . get_table_prefix() . 'logged_mail_messages WHERE m_queued=1');
         $info = do_lang_tempcode('LAST_RAN_AT', escape_html($date), escape_html(integer_format($mails_sent)), escape_html(integer_format($mails_queued)));
         $url = '';
     }
     $_status = $status == 0 ? do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_0') : do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_1');
     $tpl = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM', array('INFO' => $info, 'URL' => '', 'STATUS' => $_status, 'TASK' => urlise_lang(do_lang('NAG_SETUP_CRON'), $url)));
     return array(array($tpl, $status == 0 ? -1 : 0, 1, NULL));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:24,代码来源:cron.php

示例11: handle_commands

 /**
  * Handle hooks supported bot commands. Note multiple bots may support the same commands, and all respond. It is recommended all bots support the command 'help'.
  *
  * @param  AUTO_LINK		The ID of the chat room
  * @param  string			The command used. This is just the chat message, so you can encode and recognise your own parameter scheme if you like.
  * @return ?string		Bot reply (NULL: bot does not handle the command)
  */
 function handle_commands($room_id, $command)
 {
     switch ($command) {
         case 'help':
             $out = do_lang('CHAT_HELP_BOTMSG');
             return do_lang('CHAT_WEBSITE_HELPER_BOT', $out);
         case 'users_online':
             // On the site
             $count = 0;
             $members = get_online_members(true, NULL, $count);
             if (is_null($members)) {
                 return do_lang('TOO_MANY_USERS_ONLINE');
             }
             $guests = 0;
             $site_members = '';
             foreach ($members as $member) {
                 if (is_guest($member['the_user']) || is_null($member['cache_username'])) {
                     $guests++;
                 } else {
                     if ($site_members != '') {
                         $site_members .= ', ';
                     }
                     $site_members .= '{{' . $member['cache_username'] . '}}';
                 }
             }
             // In this room
             $room_members = get_chatters_in_room($room_id);
             $_room_members = '';
             foreach ($room_members as $room_member) {
                 if ($_room_members != '') {
                     $_room_members .= ', ';
                 }
                 $_room_members .= '{{' . $room_member . '}}';
             }
             // Show our complete result
             $out = do_lang('CHAT_USERSONLINE_BOTMSG', $site_members, $_room_members);
             return do_lang('CHAT_WEBSITE_HELPER_BOT', $out);
         case 'time':
             $out = do_lang('CHAT_TIME_BOTMSG', get_timezoned_date(time(), true, true, true, true));
             return do_lang('CHAT_WEBSITE_HELPER_BOT', $out);
     }
     return NULL;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:50,代码来源:default.php

示例12: run

 /**
  * Standard modular run function for CRON hooks. Searches for tasks to perform.
  */
 function run()
 {
     if (!defined('MAXIMUM_DIGEST_LENGTH')) {
         define('MAXIMUM_DIGEST_LENGTH', 1024 * 100);
         // 100KB
     }
     require_code('notifications');
     foreach (array(A_DAILY_EMAIL_DIGEST => 60 * 60 * 24, A_WEEKLY_EMAIL_DIGEST => 60 * 60 * 24 * 7, A_MONTHLY_EMAIL_DIGEST => 60 * 60 * 24 * 31) as $frequency => $timespan) {
         $start = 0;
         do {
             // Find where not tint-in-tin
             $members = $GLOBALS['SITE_DB']->query('SELECT DISTINCT d_to_member_id FROM ' . get_table_prefix() . 'digestives_consumed c JOIN ' . get_table_prefix() . 'digestives_tin t ON c.c_member_id=t.d_to_member_id AND c.c_frequency=' . strval($frequency) . ' WHERE c_time<' . strval(time() - $timespan) . ' AND c_frequency=' . strval($frequency), 100, $start);
             foreach ($members as $member) {
                 require_lang('notifications');
                 $to_member_id = $member['d_to_member_id'];
                 $to_name = $GLOBALS['FORUM_DRIVER']->get_username($to_member_id);
                 $to_email = $GLOBALS['FORUM_DRIVER']->get_member_email_address($to_member_id);
                 $messages = $GLOBALS['SITE_DB']->query_select('digestives_tin', array('d_subject', 'd_message', 'd_date_and_time'), array('d_to_member_id' => $to_member_id, 'd_frequency' => $frequency), 'ORDER BY d_date_and_time');
                 $GLOBALS['SITE_DB']->query_delete('digestives_tin', array('d_to_member_id' => $to_member_id, 'd_frequency' => $frequency));
                 $_message = '';
                 foreach ($messages as $message) {
                     if ($_message != '') {
                         $_message .= chr(10);
                     }
                     if (strlen($_message) + strlen($message['d_message']) < MAXIMUM_DIGEST_LENGTH) {
                         $_message .= do_lang('DIGEST_EMAIL_INDIVIDUAL_MESSAGE_WRAP', comcode_escape($message['d_subject']), $message['d_message'], array(comcode_escape(get_site_name()), get_timezoned_date($message['d_date_and_time'])));
                     } else {
                         $_message .= do_lang('DIGEST_ITEM_OMITTED', comcode_escape($message['d_subject']), get_timezoned_date($message['d_date_and_time']), array(comcode_escape(get_site_name())));
                     }
                 }
                 if ($_message != '') {
                     $wrapped_subject = do_lang('DIGEST_EMAIL_SUBJECT_' . strval($frequency), comcode_escape(get_site_name()));
                     $wrapped_message = do_lang('DIGEST_EMAIL_MESSAGE_WRAP', $_message, comcode_escape(get_site_name()));
                     require_code('mail');
                     mail_wrap($wrapped_subject, $wrapped_message, array($to_email), $to_name, get_option('staff_address'), get_site_name(), 3, NULL, true, A_FROM_SYSTEM_UNPRIVILEGED, false);
                     $GLOBALS['SITE_DB']->query_update('digestives_consumed', array('c_time' => time()), array('c_member_id' => $to_member_id, 'c_frequency' => $frequency), '', 1);
                 }
             }
             $start += 100;
         } while (count($members) == 100);
     }
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:45,代码来源:notification_digests.php

示例13: ocworld_messages_script

/**
 * Output the ocWorld messages script.
 */
function ocworld_messages_script()
{
    require_lang('ocworld');
    require_lang('chat');
    $member_id = get_member();
    $rows = $GLOBALS['SITE_DB']->query_select('w_members', array('location_realm', 'location_x', 'location_y'), array('id' => $member_id), '', 1);
    if (!array_key_exists(0, $rows)) {
        warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
    }
    list($realm, $x, $y) = array($rows[0]['location_realm'], $rows[0]['location_x'], $rows[0]['location_y']);
    $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'w_messages WHERE location_x=' . strval((int) $x) . ' AND location_y=' . strval((int) $y) . ' AND location_realm=' . strval((int) $realm) . ' AND (destination=' . strval((int) $member_id) . ' OR destination IS NULL OR originator_id=' . strval((int) $member_id) . ') ORDER BY m_datetime DESC');
    $messages = new ocp_tempcode();
    foreach ($rows as $myrow) {
        $message_sender = $GLOBALS['FORUM_DRIVER']->get_username($myrow['originator_id']);
        if (is_null($message_sender)) {
            $message_sender = do_lang('UNKNOWN');
        }
        $messages->attach(do_template('W_MESSAGE_' . (is_null($myrow['destination']) ? 'ALL' : 'TO'), array('MESSAGESENDER' => $message_sender, 'MESSAGE' => comcode_to_tempcode($myrow['m_message'], $myrow['originator_id']), 'DATETIME' => get_timezoned_date($myrow['m_datetime']))));
    }
    $css = do_template('CSS_NEED', array('_GUID' => '0c2b42583214051a3841d4654537b16f', 'CODE' => 'ocworld'));
    $tpl = do_template('W_MESSAGES', array('_GUID' => '05b40c794578d3221e2775895ecf8dbb', 'MESSAGES' => $messages, 'CSS' => $css));
    $tpl->evaluate_echo();
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:26,代码来源:ocworld_scripts.php

示例14: view

 /**
  * The UI to view a past newsletter.
  *
  * @return tempcode		The UI
  */
 function view()
 {
     $id = get_param_integer('id');
     $rows = $GLOBALS['SITE_DB']->query_select('newsletter_archive', array('*'), array('id' => $id));
     $time = get_timezoned_date($rows[0]['date_and_time']);
     $subject = $rows[0]['subject'];
     $message = $rows[0]['newsletter'];
     $language = $rows[0]['language'];
     $level = $rows[0]['importance_level'];
     /*require_code('lang2');
     		$language=lookup_language_full_name($rows[0]['language']);*/
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('MANAGE_NEWSLETTER')), array('_SELF:_SELF:archive', do_lang_tempcode('NEWSLETTER_ARCHIVE'))));
     breadcrumb_set_self($subject);
     require_code('templates_view_space');
     return view_space(get_page_title('NEWSLETTER'), array('DATE_TIME' => $time, 'LANGUAGE' => $language, 'SUBSCRIPTION_LEVEL' => integer_format($level), 'SUBJECT' => $subject, 'MESSAGE' => comcode_to_tempcode($message)));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:21,代码来源:admin_newsletter.php

示例15: show_video

 /**
  * The UI to show a video.
  *
  * @param  ?string		Alternate category name to use (NULL: use standard one). This is useful if you are overriding this code to show images in virtual galleries.
  * @param  ?tempcode		Breadcrumbs (NULL: derive in this function).
  * @return tempcode		The UI
  */
 function show_video($category_name = NULL, $tree = NULL)
 {
     $id = get_param_integer('id');
     if (get_param_integer('ajax', 0) == 1) {
         header('Content-type: text/xml');
     }
     list($sort, $sort_backwards, $sql_suffix_images, $sql_suffix_videos) = $this->get_sort_order();
     if (addon_installed('awards')) {
         require_code('awards');
         $awards = find_awards_for('video', strval($id));
     } else {
         $awards = array();
     }
     // Pic up some info
     $rows = $GLOBALS['SITE_DB']->query_select('videos', array('*'), array('id' => $id), '', 1);
     if (!array_key_exists(0, $rows)) {
         return warn_screen(get_page_title('ERROR_OCCURRED'), do_lang_tempcode('MISSING_RESOURCE'));
     }
     $myrow = $rows[0];
     $url = $myrow['url'];
     if (url_is_local($url)) {
         $url = get_custom_base_url() . '/' . $url;
     }
     $cat = $myrow['cat'];
     $GLOBALS['FEED_URL'] = find_script('backend') . '?mode=galleries&filter=' . urlencode($cat);
     if (get_value('no_individual_gallery_view') === '1' && $GLOBALS['SITE_DB']->query_value('galleries', 'flow_mode_interface', array('name' => $cat)) == '1') {
         require_code('site2');
         assign_refresh(build_url(array('page' => '_SELF', 'type' => 'misc', 'id' => $cat, 'probe_id' => $id, 'probe_type' => 'video'), '_SELF'), 0.0);
     }
     $true_category_name = get_translated_text($GLOBALS['SITE_DB']->query_value('galleries', 'fullname', array('name' => $cat)));
     if (is_null($category_name)) {
         $category_name = $true_category_name;
     }
     if (get_param_integer('slideshow', 0) == 1) {
         $title = get_page_title('VIEW_SLIDESHOW', true, array(escape_html($category_name)));
         global $EXTRA_HEAD;
         $EXTRA_HEAD->attach('<meta name="robots" content="noindex" />');
         // XHTMLXHTML
     } else {
         $title = get_page_title(get_translated_text($myrow['title']) == '' ? 'VIEW_VIDEO' : '_VIEW_VIDEO', true, array(escape_html(get_translated_text($myrow['title']))), NULL, $awards);
     }
     $root = get_param('root', 'root');
     seo_meta_load_for('video', strval($id));
     $thumb_url = $myrow['thumb_url'];
     if (url_is_local($thumb_url)) {
         $thumb_url = get_custom_base_url() . '/' . $thumb_url;
     }
     if (!has_category_access(get_member(), 'galleries', $cat)) {
         access_denied('CATEGORY_ACCESS');
     }
     // Views
     if (get_db_type() != 'xml') {
         $myrow['video_views']++;
         $GLOBALS['SITE_DB']->query_update('videos', array('video_views' => $myrow['video_views']), array('id' => $id), '', 1, NULL, false, true);
     }
     list($rating_details, $comment_details, $trackback_details) = embed_feedback_systems('videos', strval($id), $myrow['allow_rating'], $myrow['allow_comments'], $myrow['allow_trackbacks'], $myrow['validated'], $myrow['submitter'], build_url(array('page' => '_SELF', 'type' => 'video', 'id' => $id), '_SELF', NULL, false, false, true), get_translated_text($myrow['title']) == '' ? do_lang('VIEW_VIDEO_IN', $true_category_name) : get_translated_text($myrow['title']), get_value('comment_forum__videos'));
     // Validation
     if ($myrow['validated'] == 0) {
         if (!has_specific_permission(get_member(), 'jump_to_unvalidated')) {
             access_denied('SPECIFIC_PERMISSION', 'jump_to_unvalidated');
         }
         $warning_details = do_template('WARNING_TABLE', array('_GUID' => 'b32faacba974e648a67e5e91ffd3d8e5', 'WARNING' => do_lang_tempcode(get_param_integer('redirected', 0) == 1 ? 'UNVALIDATED_TEXT_NON_DIRECT' : 'UNVALIDATED_TEXT')));
     } else {
         $warning_details = new ocp_tempcode();
     }
     // Comments
     $comments = get_translated_tempcode($myrow['comments']);
     if (has_actual_page_access(NULL, 'cms_galleries', NULL, NULL) && has_edit_permission('mid', get_member(), $myrow['submitter'], 'cms_galleries', array('galleries', $cat))) {
         $edit_url = build_url(array('page' => 'cms_galleries', 'type' => '_ev', 'id' => $id), get_module_zone('cms_galleries'));
     } else {
         $edit_url = new ocp_tempcode();
     }
     $add_date = get_timezoned_date($myrow['add_date']);
     $edit_date = is_null($myrow['edit_date']) ? '' : get_timezoned_date($myrow['edit_date']);
     // Video HTML
     $video = show_gallery_media($url, $thumb_url, $myrow['video_width'], $myrow['video_height'], $myrow['video_length']);
     $extension = get_file_extension($url);
     require_code('mime_types');
     $mime_type = get_mime_type($extension);
     list($n, $x, $nav) = $this->build_set_navigation(db_string_equal_to('cat', $cat), '', $category_name, $id, $root, 'video', get_param_integer('slideshow', 0), get_param_integer('wide_high', 0), get_param_integer('start', 0), get_param_integer('max', get_default_gallery_max()), $cat, $sort, $sort_backwards, $sql_suffix_images, $sql_suffix_videos, get_param('select', '*'), get_param('video_select', '*'));
     $member_id = get_member_id_from_gallery_name($cat, NULL, true);
     if (get_forum_type() == 'ocf') {
         require_code('ocf_members');
         require_code('ocf_members2');
     }
     $member_details = is_null($member_id) || get_forum_type() != 'ocf' ? new ocp_tempcode() : ocf_show_member_box($member_id);
     $video_details = show_video_details($myrow);
     if (is_null($tree)) {
         $tree = gallery_breadcrumbs($cat, $root, false, get_module_zone('galleries'));
     }
     breadcrumb_add_segment($tree, do_lang_tempcode('VIEW_VIDEO'));
     $GLOBALS['META_DATA'] += array('created' => date('Y-m-d', $myrow['add_date']), 'creator' => $GLOBALS['FORUM_DRIVER']->get_username($myrow['submitter']), 'publisher' => '', 'modified' => is_null($myrow['edit_date']) ? '' : date('Y-m-d', $myrow['edit_date']), 'type' => 'Video', 'title' => get_translated_text($myrow['title']), 'identifier' => '_SEARCH:galleries:video:' . strval($id), 'description' => get_translated_text($myrow['comments']), 'image' => $thumb_url, 'video' => $url, 'video:height' => strval($myrow['video_height']), 'video:width' => strval($myrow['video_width']), 'video:type' => $mime_type);
     return do_template('GALLERY_ENTRY_SCREEN', array('_GUID' => '91e231906ed899513ec2db8a2974dddf', 'MEDIA_TYPE' => 'video', 'E_TITLE' => get_translated_text($myrow['title']), 'CAT' => $cat, 'SLIDESHOW' => get_param_integer('slideshow', 0) == 1, 'TRUE_GALLERY_TITLE' => $true_category_name, 'GALLERY_TITLE' => $category_name, 'MEMBER_ID' => is_null($member_id) ? '' : strval($member_id), 'ID' => strval($id), 'TAGS' => get_loaded_tags('videos'), 'TITLE' => $title, 'SUBMITTER' => strval($myrow['submitter']), 'URL' => $url, 'VIDEO_DETAILS' => $video_details, 'MEMBER_DETAILS' => $member_details, 'X' => integer_format($x), 'N' => integer_format($n), 'VIEWS' => integer_format($myrow['video_views']), 'ADD_DATE_RAW' => strval($myrow['add_date']), 'EDIT_DATE_RAW' => is_null($myrow['edit_date']) ? '' : strval($myrow['edit_date']), 'ADD_DATE' => $add_date, 'EDIT_DATE' => $edit_date, 'RATING_DETAILS' => $rating_details, 'TRACKBACK_DETAILS' => $trackback_details, 'COMMENT_DETAILS' => $comment_details, 'EDIT_URL' => $edit_url, 'NAV' => $nav, 'COMMENTS' => $comments, 'VIDEO' => $video, 'WARNING_DETAILS' => $warning_details));
//.........这里部分代码省略.........
开发者ID:erico-deh,项目名称:ocPortal,代码行数:101,代码来源:galleries.php


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