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


PHP do_template函数代码示例

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


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

示例1: run

 /**
  * Standard modular run function.
  *
  * @return tempcode	Results
  */
 function run()
 {
     $dbs_bak = $GLOBALS['NO_DB_SCOPE_CHECK'];
     $GLOBALS['NO_DB_SCOPE_CHECK'] = true;
     // Find known paths
     $known_urls = array();
     $urlpaths = $GLOBALS['SITE_DB']->query_select('db_meta', array('m_name', 'm_table'), array('m_type' => 'URLPATH'));
     $base_url = get_custom_base_url();
     foreach ($urlpaths as $urlpath) {
         $ofs = $GLOBALS['SITE_DB']->query_select($urlpath['m_table'], array($urlpath['m_name']));
         foreach ($ofs as $of) {
             $url = $of[$urlpath['m_name']];
             if (url_is_local($url)) {
                 $known_urls[rawurldecode($url)] = 1;
             } else {
                 if (substr($url, 0, strlen($base_url)) == $base_url) {
                     $known_urls[substr($url, strlen($base_url) + 1)] = 1;
                 }
             }
         }
     }
     $all_files = $this->do_dir('uploads');
     $orphaned = array();
     foreach ($all_files as $file) {
         if (!array_key_exists($file, $known_urls)) {
             $orphaned[] = array('URL' => get_custom_base_url() . '/' . str_replace('%2F', '/', rawurlencode($file)));
         }
     }
     $GLOBALS['NO_DB_SCOPE_CHECK'] = $dbs_bak;
     return do_template('CLEANUP_ORPHANED_UPLOADS', array('_GUID' => '21049d738f67554cff0891d343c02ad3', 'FOUND' => $orphaned));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:36,代码来源:orphaned_uploads.php

示例2: _redirect_screen

/**
 * Redirect the user - transparently, storing a message that will be shown on their destination page.
 *
 * @param  tempcode		Title to display on redirect page
 * @param  mixed			Destination URL (may be Tempcode)
 * @param  mixed			Message to show (may be Tempcode)
 * @param  boolean		For intermediatory hops, don't mark so as to read status messages - save them up for the next hop (which will not be intermediatory)
 * @param  ID_TEXT		Code of message type to show
 * @set    warn inform fatal
 * @return tempcode		Redirection message (likely to not actually be seen due to instant redirection)
 */
function _redirect_screen($title, $url, $text, $intermediatory_hop = false, $msg_type = 'inform')
{
    if (is_object($url)) {
        $url = $url->evaluate();
    }
    global $FORCE_META_REFRESH, $ATTACHED_MESSAGES_RAW;
    $special_page_type = get_param('special_page_type', 'view');
    if ($special_page_type == 'view' && $GLOBALS['NON_PAGE_SCRIPT'] == 0 && !headers_sent() && !$FORCE_META_REFRESH) {
        foreach ($ATTACHED_MESSAGES_RAW as $message) {
            $GLOBALS['SITE_DB']->query_insert('messages_to_render', array('r_session_id' => get_session_id(), 'r_message' => is_object($message[0]) ? $message[0]->evaluate() : escape_html($message[0]), 'r_type' => $message[1], 'r_time' => time()));
        }
        $_message = is_object($text) ? $text->evaluate() : escape_html($text);
        if ($_message != '' && (count($ATTACHED_MESSAGES_RAW) == 0 || $_message != do_lang('SUCCESS') && $_message != do_lang('REDIRECTING'))) {
            $GLOBALS['SITE_DB']->query_insert('messages_to_render', array('r_session_id' => get_session_id(), 'r_message' => $_message, 'r_type' => $msg_type, 'r_time' => time()));
        }
        if (!$intermediatory_hop) {
            $hash_pos = strpos($url, '#');
            if ($hash_pos !== false) {
                $hash_bit = substr($url, $hash_pos);
                $url = substr($url, 0, $hash_pos);
            } else {
                $hash_bit = '';
            }
            $url .= (strpos($url, '?') === false ? '?' : '&') . 'redirected=1' . $hash_bit;
        }
    }
    require_code('site2');
    assign_refresh($url, 0.0);
    return do_template('REDIRECT_SCREEN', array('_GUID' => '44ce3d1ffc6536b299ed0944e8ca7253', 'URL' => $url, 'TITLE' => $title, 'TEXT' => $text));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:41,代码来源:templates_redirect_screen.php

示例3: 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('cedi')) {
         return NULL;
     }
     if (!has_actual_page_access(get_member(), 'cedi')) {
         return NULL;
     }
     $filters = ocfilter_to_sqlfragment($_filters, 'id', 'seedy_children', 'parent_id', 'parent_id', 'child_id');
     $content = new ocp_tempcode();
     $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'seedy_pages WHERE ' . $filters . ' AND add_date>' . strval((int) $cutoff) . ' ORDER BY add_date DESC', $max);
     foreach ($rows as $row) {
         $id = strval($row['id']);
         if (!has_category_access(get_member(), 'seedy_page', strval($row['id']))) {
             continue;
         }
         $author = '';
         $news_date = date($date_string, $row['add_date']);
         $edit_date = '';
         $news_title = xmlentities(escape_html(get_translated_text($row['title'])));
         $_summary = get_translated_tempcode($row['description']);
         $summary = xmlentities($_summary->evaluate());
         $news = '';
         $category = '';
         $category_raw = '';
         $view_url = build_url(array('page' => 'cedi', 'type' => 'misc', 'id' => $row['id'] == db_get_first_id() ? NULL : $row['id']), get_module_zone('cedi'), NULL, false, false, true);
         $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('cedi');
     return array($content, do_lang('CEDI_PAGES'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:43,代码来源:cedi.php

示例4: run

 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     require_lang('google_search');
     $out = new ocp_tempcode();
     //return do_template('BLOCK_MAIN_GOOGLE_SEARCH_REULTS',array('TITLE'=>do_lang_tempcode('BLOCK_GOOGLE_TITLE'),'CONTENT'=>$out));
     return do_template('BLOCK_MAIN_GOOGLE_SEARCH_REULTS', array('TITLE' => '', 'CONTENT' => $out));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:13,代码来源:main_google_results.php

示例5: run

 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     require_lang('chat');
     require_css('side_blocks');
     $room_id = array_key_exists('param', $map) ? intval($map['param']) : NULL;
     $num_messages = array_key_exists('max', $map) ? intval($map['max']) : 5;
     if (is_null($room_id)) {
         $room_id = $GLOBALS['SITE_DB']->query_value_null_ok('chat_rooms', 'MIN(id)', array('is_im' => 0));
         if (is_null($room_id)) {
             return new ocp_tempcode();
         }
     }
     $room_check = $GLOBALS['SITE_DB']->query_select('chat_rooms', array('*'), array('id' => $room_id), '', 1);
     if (!array_key_exists(0, $room_check)) {
         return new ocp_tempcode();
     }
     require_code('chat');
     if (!check_chatroom_access($room_check[0], true)) {
         global $DO_NOT_CACHE_THIS;
         // We don't cache against access, so we have a problem and can't cache
         $DO_NOT_CACHE_THIS = true;
         return new ocp_tempcode();
     }
     $content = NULL;
     if (get_value('no_frames') === '1') {
         $content = shoutbox_script(true, $room_id, $num_messages);
     }
     return do_template('BLOCK_SIDE_SHOUTBOX_IFRAME', array('CONTENT' => $content, 'ROOM_ID' => strval($room_id), 'NUM_MESSAGES' => strval($num_messages)));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:35,代码来源:side_shoutbox.php

示例6: 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)
 {
     require_lang('activities');
     require_code('activities');
     list(, $whereville) = find_activities(get_member(), $_filters == '' ? 'all' : 'some_members', $_filters == '' ? NULL : array_map('intval', explode(',', $_filters)));
     $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . get_table_prefix() . 'activities WHERE (' . $whereville . ') AND a_time>' . strval($cutoff) . ' ORDER BY a_time DESC', $max, 0);
     $content = new ocp_tempcode();
     foreach ($rows as $row) {
         $id = strval($row['id']);
         $author = $GLOBALS['FORUM_DRIVER']->get_username($row['a_member_id']);
         if (is_null($author)) {
             $author = do_lang('UNKNOWN');
         }
         $news_date = date($date_string, $row['a_time']);
         $edit_date = '';
         list($_title, ) = render_activity($row);
         $news_title = xmlentities($_title->evaluate());
         $summary = xmlentities('');
         $news = '';
         $category = '';
         $category_raw = '';
         $view_url = build_url(array('page' => 'members', 'type' => 'view', 'id' => $row['a_member_id']), get_module_zone('members'), NULL, false, false, true);
         $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)));
     }
     return array($content, do_lang('ACTIVITIES_TITLE'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:38,代码来源:activities.php

示例7: run

 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     require_lang('leader_board');
     require_code('points');
     require_css('points');
     $title = get_page_title('POINT_LEADERBOARD');
     $start_date = intval(get_option('leaderboard_start_date'));
     $weeks = $GLOBALS['SITE_DB']->query('SELECT DISTINCT date_and_time FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'leader_board WHERE date_and_time>=' . strval($start_date) . ' ORDER BY date_and_time DESC');
     if (count($weeks) == 0) {
         warn_exit(do_lang_tempcode('NO_ENTRIES'));
     }
     $first_week = $weeks[count($weeks) - 1]['date_and_time'];
     $weeks = collapse_1d_complexity('date_and_time', $weeks);
     $out = new ocp_tempcode();
     foreach ($weeks as $week) {
         $rows = collapse_2d_complexity('lb_member', 'lb_points', $GLOBALS['SITE_DB']->query_select('leader_board', array('lb_member', 'lb_points'), array('date_and_time' => $week)));
         $week_tpl = new ocp_tempcode();
         foreach ($rows as $member => $points) {
             $points_url = build_url(array('page' => 'points', 'type' => 'member', 'id' => $member), get_module_zone('points'));
             $profile_url = $GLOBALS['FORUM_DRIVER']->member_profile_url($member, false, true);
             $name = $GLOBALS['FORUM_DRIVER']->get_username($member);
             if (is_null($name)) {
                 $name = do_lang('UNKNOWN');
             }
             $week_tpl->attach(do_template('POINTS_LEADERBOARD_ROW', array('_GUID' => '6d323b4b5abea0e82a14cb4745c4af4f', 'POINTS_URL' => $points_url, 'PROFILE_URL' => $profile_url, 'POINTS' => integer_format($points), 'NAME' => $name, 'ID' => strval($member))));
         }
         $nice_week = intval(($week - $first_week) / (7 * 24 * 60 * 60) + 1);
         $out->attach(do_template('POINTS_LEADERBOARD_WEEK', array('_GUID' => '3a0f71bf20f9098e5711e85cf25f6549', 'WEEK' => integer_format($nice_week), 'ROWS' => $week_tpl)));
     }
     return do_template('POINTS_LEADERBOARD_SCREEN', array('_GUID' => 'bab5f7b661435b83800532d3eebd0d54', 'TITLE' => $title, 'WEEKS' => $out));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:36,代码来源:leader_board.php

示例8: run

 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     if (!addon_installed('calendar')) {
         return new ocp_tempcode();
     }
     require_lang('calendar');
     $bits = new ocp_tempcode();
     if (get_option('calendar_show_stats_count_events', true) == '1') {
         $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS'), 'VALUE' => integer_format($GLOBALS['SITE_DB']->query_value('calendar_events', 'COUNT(*)')))));
     }
     if (get_option('calendar_show_stats_count_events_this_week', true) == '1') {
         require_code('calendar');
         $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 7));
         $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS_THIS_WEEK'), 'VALUE' => integer_format(count($events)))));
     }
     if (get_option('calendar_show_stats_count_events_this_month', true) == '1') {
         require_code('calendar');
         $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 31));
         $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS_THIS_MONTH'), 'VALUE' => integer_format(count($events)))));
     }
     if (get_option('calendar_show_stats_count_events_this_year', true) == '1') {
         require_code('calendar');
         $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 365));
         $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS_THIS_YEAR'), 'VALUE' => integer_format(count($events)))));
     }
     if ($bits->is_empty()) {
         return new ocp_tempcode();
     }
     $section = do_template('BLOCK_SIDE_STATS_SECTION', array('SECTION' => do_lang_tempcode('CALENDAR'), 'CONTENT' => $bits));
     return $section;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:36,代码来源:stats_calendar.php

示例9: action

 /**
  * Standard interface stage of pointstore item purchase.
  *
  * @return tempcode		The UI
  */
 function action()
 {
     $class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));
     if (get_option('is_on_' . $class . '_buy') == '0') {
         return new ocp_tempcode();
     }
     $title = get_page_title('TOPIC_PINNING');
     $cost = intval(get_option($class));
     $next_url = build_url(array('page' => '_SELF', 'type' => 'action_done', 'id' => $class), '_SELF');
     $points_left = available_points(get_member());
     // Check points
     if ($points_left < $cost && !has_specific_permission(get_member(), 'give_points_self')) {
         return warn_screen($title, do_lang_tempcode('_CANT_AFFORD', integer_format($cost), integer_format($points_left)));
     }
     require_code('form_templates');
     $fields = new ocp_tempcode();
     if (get_forum_type() == 'ocf') {
         $fields->attach(form_input_tree_list(do_lang_tempcode('FORUM_TOPIC'), '', 'select_topic_id', NULL, 'choose_forum_topic', array(), false));
         $fields->attach(form_input_integer(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('FORUM_TOPIC')), do_lang_tempcode('DESCRIPTION_FORUM_TOPIC_ID'), 'manual_topic_id', NULL, false));
     } else {
         $fields->attach(form_input_integer(do_lang_tempcode('FORUM_TOPIC'), do_lang_tempcode('ENTER_TOPIC_ID_MANUALLY'), 'manual_topic_id', NULL, false));
     }
     $text = do_lang_tempcode('PIN_TOPIC_A', integer_format($cost), integer_format($points_left - $cost));
     return do_template('FORM_SCREEN', array('_GUID' => '8cabf882d5cbe4d354cc6efbcf92ebf9', 'TITLE' => $title, 'TEXT' => $text, 'URL' => $next_url, 'FIELDS' => $fields, 'HIDDEN' => '', 'SUBMIT_NAME' => do_lang_tempcode('PURCHASE'), 'JAVASCRIPT' => 'standardAlternateFields(\'select_topic_id\',\'manual_topic_id\');'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:30,代码来源:topic_pin.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()
 {
     if (!addon_installed('iotds')) {
         return array();
     }
     if (get_option('iotd_update_time') == '') {
         return array();
     }
     require_lang('iotds');
     $date = $GLOBALS['SITE_DB']->query_value_null_ok('iotd', 'date_and_time', array('is_current' => 1));
     $limit_hours = intval(get_option('iotd_update_time'));
     $seconds_ago = mixed();
     if (!is_null($date)) {
         $seconds_ago = time() - $date;
         $status = $seconds_ago > $limit_hours * 60 * 60 ? 0 : 1;
     } else {
         $status = 0;
     }
     $_status = $status == 0 ? do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_0') : do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_1');
     $config_row = $GLOBALS['SITE_DB']->query_select('config', array('the_page', 'section'), array('the_name' => 'iotd_update_time'), '', 1);
     if (array_key_exists(0, $config_row)) {
         $_config_url = build_url(array('page' => 'admin_config', 'type' => 'category', 'id' => $config_row[0]['the_page']), get_module_zone('admin_config'));
         $config_url = $_config_url->evaluate();
         $config_url .= '#group_' . $config_row[0]['section'];
     } else {
         $config_url = NULL;
     }
     $url = build_url(array('page' => 'cms_iotds', 'type' => 'ed'), get_module_zone('cms_iotds'));
     $num_queue = $this->get_num_iotd_queue();
     list($info, $seconds_due_in) = staff_checklist_time_ago_and_due($seconds_ago, $limit_hours);
     $info->attach(do_lang_tempcode('NUM_QUEUE', integer_format($num_queue)));
     $tpl = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM', array('_GUID' => '5c55aed7bedca565c8aa553548b88e64', 'CONFIG_URL' => $config_url, 'URL' => $url, 'STATUS' => $_status, 'TASK' => do_lang_tempcode('PT_choose_iotd'), 'INFO' => $info));
     return array(array($tpl, $seconds_due_in, NULL, 'iotd_update_time'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:39,代码来源:iotds.php

示例11: run

 /**
  * Standard modular run function for OcCLE notification hooks.
  *
  * @param  ?integer	The "current" time on which to base queries (NULL: now)
  * @return ~array		Array of section, type and message responses (false: nothing)
  */
 function run($timestamp = NULL)
 {
     if (!addon_installed('chat')) {
         return false;
     }
     if (!is_null(get_value('occle_watched_chatroom'))) {
         require_lang('chat');
         if (is_null($timestamp)) {
             $timestamp = time();
         }
         $room = intval(get_value('occle_watched_chatroom'));
         $room_messages = $GLOBALS['SITE_DB']->query('SELECT COUNT(*) AS cnt FROM ' . get_table_prefix() . 'chat_messages WHERE room_id=' . strval($room) . ' AND date_and_time>=' . strval((int) $timestamp));
         if (!array_key_exists(0, $room_messages)) {
             return false;
         }
         if ($room_messages[0]['cnt'] > 0) {
             $rooms = array();
             $messages = $room_messages[0]['cnt'];
             $room_data = $GLOBALS['SITE_DB']->query_value_null_ok('chat_rooms', 'room_name', array('id' => $room));
             if (is_null($room_data)) {
                 return false;
             }
             // Selected room deleted
             $rooms[$room_data] = build_url(array('page' => 'chat', 'type' => 'room', 'id' => $room), get_module_zone('chat'));
             return array(do_lang('SECTION_CHAT'), do_lang('NEW_MESSAGES'), do_template('OCCLE_CHAT_NOTIFICATION', array('MESSAGE_COUNT' => integer_format($messages), 'ROOMS' => $rooms)));
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:38,代码来源:chat.php

示例12: 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()
 {
     if (!addon_installed('backup')) {
         return array();
     }
     if (get_option('backup_time', true) == '') {
         return array();
     }
     $limit_hours = intval(get_option('backup_time', true));
     require_lang('backups');
     $date = intval(get_value('last_backup'));
     $seconds_ago = mixed();
     if ($date != 0) {
         $seconds_ago = time() - $date;
         $status = intval($seconds_ago) > $limit_hours * 60 * 60 ? 0 : 1;
     } else {
         $status = 0;
     }
     $_status = $status == 0 ? do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_0') : do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_1');
     $config_row = $GLOBALS['SITE_DB']->query_select('config', array('the_page', 'section'), array('the_name' => 'backup_time'), '', 1);
     if (array_key_exists(0, $config_row)) {
         $_config_url = build_url(array('page' => 'admin_config', 'type' => 'category', 'id' => $config_row[0]['the_page']), get_module_zone('admin_config'));
         $config_url = $_config_url->evaluate();
         $config_url .= '#group_' . $config_row[0]['section'];
     } else {
         $config_url = NULL;
     }
     $url = build_url(array('page' => 'admin_backup', 'type' => 'misc'), 'adminzone');
     list($info, $seconds_due_in) = staff_checklist_time_ago_and_due($seconds_ago, $limit_hours);
     $tpl = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM', array('_GUID' => '432685ec6c9f7548ce8b488b6ce00030', 'CONFIG_URL' => $config_url, 'URL' => $url, 'STATUS' => $_status, 'TASK' => do_lang_tempcode('BACKUP'), 'INFO' => $info));
     return array(array($tpl, $seconds_due_in, NULL, 'backup_time'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:37,代码来源:backup.php

示例13: 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)
 {
     unset($zone);
     require_code('ocf_groups');
     $url = build_url(array('page' => 'groups', 'type' => 'view', 'id' => $row['id']), get_module_zone('groups'));
     return put_in_standard_box(do_template('SIMPLE_PREVIEW_BOX', array('SUMMARY' => get_translated_text($row['g_name'], $GLOBALS['FORUM_DB']), 'URL' => $url)), ocf_get_group_name($row['id']));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:14,代码来源:group.php

示例14: 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()
 {
     if (!addon_installed('ocf_forum')) {
         return array();
     }
     if (get_forum_type() != 'ocf') {
         return array();
     }
     require_lang('ocf_config');
     $forum_id = $GLOBALS['FORUM_DRIVER']->forum_id_from_name(get_option('reported_posts_forum'));
     if (is_null($forum_id)) {
         return array();
     }
     $where = 't_forum_id=' . strval($forum_id) . ' AND t_is_open=1';
     $query = 'SELECT COUNT(*) FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_topics WHERE ' . $where;
     $outstanding = $GLOBALS['FORUM_DB']->query_value_null_ok_full($query);
     if ($outstanding > 0) {
         $status = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_0', array('_GUID' => 'e578142633c6f3d37776e82a869deb91'));
     } else {
         $status = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_1', array('_GUID' => 'f578142633c6f3d37776e82a869deb91'));
     }
     $url = $GLOBALS['FORUM_DRIVER']->forum_url($forum_id);
     $tpl = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM', array('URL' => $url, 'STATUS' => $status, 'TASK' => do_lang_tempcode('REPORTED_POSTS_FORUM'), 'INFO' => do_lang_tempcode('NUM_QUEUE', escape_html(integer_format($outstanding)))));
     return array(array($tpl, NULL, $outstanding, NULL));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:30,代码来源:reported_posts.php

示例15: do_netlink

/**
 * Get a netlink block / direct to a netlink site.
 *
 * @param  URLPATH		The URL we grab our netlink from. If this is not blank, instead of getting a netlink block, we direct to a netlink site.
 * @return tempcode		The netlink block
 */
function do_netlink($redir_url = '')
{
    header('Content-type: text/plain; charset=' . get_charset());
    // If we are redirecting
    if ($redir_url != '') {
        if (strpos($redir_url, chr(10)) !== false || strpos($redir_url, chr(13)) !== false) {
            log_hack_attack_and_exit('HEADER_SPLIT_HACK');
        }
        header('Location: ' . $redir_url);
        exit;
    }
    // Ok we're displaying a netlink, which will be dumped right into the body of the reading site
    //  - this isn't actually a weburl that is actually displayed, its loaded by ocPortal and embedded-inline
    // For all the names in our network
    require_code('textfiles');
    $lines = explode(chr(10), read_text_file('netlink', NULL, true));
    if (count($lines) == 0) {
        return new ocp_tempcode();
    }
    $content = new ocp_tempcode();
    foreach ($lines as $line) {
        $parts = explode('=', $line, 2);
        if (count($parts) != 2) {
            continue;
        }
        $name = rtrim($parts[0]);
        $url = trim($parts[1]);
        // Are we looking at the source site in the network?
        $selected = strtolower($url) == strtolower(get_param('source', ''));
        $content->attach(form_input_list_entry(base64_encode($url), $selected, $name));
    }
    return do_template('NETLINK', array('_GUID' => '180321222dc5dc99a231597c803f0726', 'CONTENT' => $content));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:39,代码来源:multi_site_networks.php


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