本文整理汇总了PHP中ocp_tempcode::is_empty方法的典型用法代码示例。如果您正苦于以下问题:PHP ocp_tempcode::is_empty方法的具体用法?PHP ocp_tempcode::is_empty怎么用?PHP ocp_tempcode::is_empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ocp_tempcode
的用法示例。
在下文中一共展示了ocp_tempcode::is_empty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
if (!addon_installed('downloads')) {
return new ocp_tempcode();
}
require_lang('downloads');
require_code('downloads_stats');
$bits = new ocp_tempcode();
if (get_option('downloads_show_stats_count_total', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'ff2bd884d88ddc8c5a81cff897f99a5a', 'KEY' => do_lang_tempcode('COUNT_TOTAL'), 'VALUE' => integer_format(get_num_archive_downloads()))));
}
if (get_option('downloads_show_stats_count_archive', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '3d221f2145581a3af51c8948f28b7ac7', 'KEY' => do_lang_tempcode('COUNT_ARCHIVE'), 'VALUE' => get_download_archive_size())));
}
if (get_option('downloads_show_stats_count_downloads', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '47c544ef053f9be47e2c48c3a694da1c', 'KEY' => do_lang_tempcode('COUNT_DOWNLOADS'), 'VALUE' => integer_format(get_num_downloads_downloaded()))));
}
if (get_option('downloads_show_stats_count_bandwidth', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'b2589ae83652953ece220267043d75c9', 'KEY' => do_lang_tempcode('COUNT_BANDWIDTH'), 'VALUE' => clean_file_size(get_download_bandwidth()))));
}
if ($bits->is_empty()) {
return new ocp_tempcode();
}
$files = do_template('BLOCK_SIDE_STATS_SECTION', array('_GUID' => '99ae3f35b3e5eda18901e97ac385d99c', 'SECTION' => do_lang_tempcode('SECTION_DOWNLOADS'), 'CONTENT' => $bits));
return $files;
}
示例3: get_page_warning_details
/**
* A page is not validated, so show a warning.
*
* @param ID_TEXT The zone the page is being loaded from
* @param ID_TEXT The codename of the page
* @param tempcode The edit URL (blank if no edit access)
* @return tempcode The warning
*/
function get_page_warning_details($zone, $codename, $edit_url)
{
$warning_details = new ocp_tempcode();
if (!has_specific_permission(get_member(), 'jump_to_unvalidated')) {
access_denied('SPECIFIC_PERMISSION', 'jump_to_unvalidated');
}
$uv_warning = do_lang_tempcode(get_param_integer('redirected', 0) == 1 ? 'UNVALIDATED_TEXT_NON_DIRECT' : 'UNVALIDATED_TEXT');
// Wear sun cream
if (!$edit_url->is_empty()) {
$menu_links = $GLOBALS['SITE_DB']->query('SELECT DISTINCT i_menu FROM ' . get_table_prefix() . 'menu_items WHERE ' . db_string_equal_to('i_url', $zone . ':' . $codename) . ' OR ' . db_string_equal_to('i_url', '_SEARCH:' . $codename));
if (count($menu_links) != 0) {
$menu_items_linking = new ocp_tempcode();
foreach ($menu_links as $menu_link) {
if (!$menu_items_linking->is_empty()) {
$menu_items_linking->attach(do_lang_tempcode('LIST_SEP'));
}
$menu_edit_url = build_url(array('page' => 'admin_menus', 'type' => 'edit', 'id' => $menu_link['i_menu']), get_module_zone('admin_menus'));
$menu_items_linking->attach(hyperlink($menu_edit_url, $menu_link['i_menu'], false, true));
}
$uv_warning = do_lang_tempcode('UNVALIDATED_TEXT_STAFF', $menu_items_linking);
}
}
$warning_details->attach(do_template('WARNING_TABLE', array('WARNING' => $uv_warning)));
return $warning_details;
}
示例4: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
require_code('downloads');
require_css('downloads');
require_lang('downloads');
require_code('ocfiltering');
$number = array_key_exists('param', $map) ? intval($map['param']) : 10;
$filter = array_key_exists('filter', $map) ? $map['filter'] : '*';
$zone = array_key_exists('zone', $map) ? $map['zone'] : get_module_zone('downloads');
$sql_filter = ocfilter_to_sqlfragment($filter, 'p.category_id', 'download_categories', 'parent_id', 'p.category_id', 'id');
// Note that the parameters are fiddled here so that category-set and record-set are the same, yet SQL is returned to deal in an entirely different record-set (entries' record-set)
$rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . get_table_prefix() . 'download_downloads p WHERE validated=1 AND (' . $sql_filter . ') ORDER BY add_date DESC', $number);
$title = do_lang_tempcode('RECENT', make_string_tempcode(integer_format($number)), do_lang_tempcode('SECTION_DOWNLOADS'));
if (array_key_exists('title', $map) && $map['title'] != '') {
$title = protect_from_escaping(escape_html($map['title']));
}
$out = new ocp_tempcode();
foreach ($rows as $i => $row) {
if ($i != 0) {
$out->attach(do_template('BLOCK_SEPARATOR'));
}
$out->attach(get_download_html($row, true, true, $zone));
}
if ($out->is_empty()) {
if (has_actual_page_access(NULL, 'cms_downloads', NULL, NULL) && has_submit_permission('mid', get_member(), get_ip_address(), 'cms_downloads')) {
$submit_url = build_url(array('page' => 'cms_downloads', 'type' => 'ad', 'redirect' => SELF_REDIRECT), get_module_zone('cms_downloads'));
} else {
$submit_url = new ocp_tempcode();
}
return do_template('BLOCK_NO_ENTRIES', array('_GUID' => '74399763a51102bdd6e6d92c2c11354f', 'HIGH' => false, 'TITLE' => $title, 'MESSAGE' => do_lang_tempcode('NO_DOWNLOADS_YET'), 'ADD_NAME' => do_lang_tempcode('ADD_DOWNLOAD'), 'SUBMIT_URL' => $submit_url));
}
return do_template('BLOCK_MAIN_RECENT_DOWNLOADS', array('_GUID' => '257fa1b83d1b6fe3acbceb2b618e6d7f', 'TITLE' => $title, 'CONTENT' => $out, 'NUMBER' => integer_format($number)));
}
示例5: lookup_member_page
/**
* Get information about the specified member.
*
* @param mixed The member for whom we are getting the page
* @param ?string The member's name (by reference) (NULL: unknown)
* @param ?AUTO_LINK The member's ID (by reference) (NULL: unknown)
* @param ?string The member's IP (by reference) (NULL: unknown)
* @return array The member's stats rows
*/
function lookup_member_page($member, &$name, &$id, &$ip)
{
if (!addon_installed('stats')) {
return array();
}
if (is_numeric($member)) {
// From member ID
$name = $GLOBALS['FORUM_DRIVER']->get_username(intval($member));
if (is_null($name)) {
return array();
}
$id = intval($member);
$ip = $GLOBALS['FORUM_DRIVER']->get_member_ip($id);
if (is_null($ip)) {
$ip = '127.0.0.1';
}
} elseif (strpos($member, '.') !== false || strpos($member, ':') !== false) {
// From IP
$ids = wrap_probe_ip($member);
$ip = $member;
if (is_null($ip)) {
$ip = '127.0.0.1';
}
if (count($ids) == 0) {
return array();
} else {
$id = $ids[0]['id'];
}
if (count($ids) != 1) {
$also = new ocp_tempcode();
foreach ($ids as $t => $_id) {
if ($t != 0) {
if (!$also->is_empty()) {
$also->attach(do_lang('LIST_SEP'));
}
$also->attach($GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($_id['id']));
}
}
attach_message(do_lang_tempcode('MEMBERS_ALSO_ON_IP', $also), 'inform');
}
$name = $GLOBALS['FORUM_DRIVER']->get_username($id);
if (is_null($name)) {
$name = do_lang('UNKNOWN');
}
} else {
// From name
$id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($member);
$name = $member;
if (is_null($id)) {
return array();
}
$ip = $GLOBALS['FORUM_DRIVER']->get_member_ip($id);
if (is_null($ip)) {
$ip = '127.0.0.1';
}
}
return $GLOBALS['SITE_DB']->query('SELECT ip,MAX(date_and_time) AS date_and_time FROM ' . get_table_prefix() . 'stats WHERE the_user=' . strval((int) $id) . ' GROUP BY ip ORDER BY date_and_time DESC');
}
示例6: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
if (!addon_installed('quizzes')) {
return new ocp_tempcode();
}
require_lang('quiz');
$bits = new ocp_tempcode();
if (get_option('quiz_show_stats_count_total_open', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('QUIZZES'), 'VALUE' => integer_format($GLOBALS['SITE_DB']->query_value('quizzes', 'COUNT(*)')))));
}
if ($bits->is_empty()) {
return new ocp_tempcode();
}
$section = do_template('BLOCK_SIDE_STATS_SECTION', array('SECTION' => do_lang_tempcode('QUIZZES'), 'CONTENT' => $bits));
return $section;
}
示例7: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
if (get_forum_type() != 'none') {
$bits = new ocp_tempcode();
if (get_option('forum_show_stats_count_members', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'a2dbcdec813d5a5edbb416bf087b4a97', 'KEY' => do_lang_tempcode('COUNT_MEMBERS'), 'VALUE' => integer_format($GLOBALS['FORUM_DRIVER']->get_members()))));
}
if (get_forum_type() == 'ocf') {
if (get_option('forum_show_stats_count_members_new_today', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'fd2e149f6921836e3c2ea1039644e2e7', 'KEY' => do_lang_tempcode('MEMBERS_NEW_TODAY'), 'VALUE' => integer_format($GLOBALS['FORUM_DB']->query_value_null_ok_full('SELECT COUNT(*) FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_members WHERE m_join_time>' . strval(time() - 60 * 60 * 24))))));
}
if (get_option('forum_show_stats_count_members_new_this_week', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '10128b288dec4a578517de75cc9e404d', 'KEY' => do_lang_tempcode('MEMBERS_NEW_THIS_WEEK'), 'VALUE' => integer_format($GLOBALS['FORUM_DB']->query_value_null_ok_full('SELECT COUNT(*) FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_members WHERE m_join_time>' . strval(time() - 60 * 60 * 24 * 7))))));
}
if (get_option('forum_show_stats_count_members_new_this_month', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'b2dbcdec813d5a5edbb416bf087b4a97', 'KEY' => do_lang_tempcode('MEMBERS_NEW_THIS_MONTH'), 'VALUE' => integer_format($GLOBALS['FORUM_DB']->query_value_null_ok_full('SELECT COUNT(*) FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_members WHERE m_join_time>' . strval(time() - 60 * 60 * 24 * 31))))));
}
if (get_option('forum_show_stats_count_members_active_today', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'cc9760b2ed9e985e96b53c91c511e84e', 'KEY' => do_lang_tempcode('MEMBERS_ACTIVE_TODAY'), 'VALUE' => integer_format($GLOBALS['FORUM_DB']->query_value_null_ok_full('SELECT COUNT(*) FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_members WHERE m_last_visit_time>' . strval(time() - 60 * 60 * 24))))));
}
if (get_option('forum_show_stats_count_members_active_this_week', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'dc9760b2ed9e985e96b53c91c511e84e', 'KEY' => do_lang_tempcode('MEMBERS_ACTIVE_THIS_WEEK'), 'VALUE' => integer_format($GLOBALS['FORUM_DB']->query_value_null_ok_full('SELECT COUNT(*) FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_members WHERE m_last_visit_time>' . strval(time() - 60 * 60 * 24 * 7))))));
}
if (get_option('forum_show_stats_count_members_active_this_month', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'ec9760b2ed9e985e96b53c91c511e84e', 'KEY' => do_lang_tempcode('MEMBERS_ACTIVE_THIS_MONTH'), 'VALUE' => integer_format($GLOBALS['FORUM_DB']->query_value_null_ok_full('SELECT COUNT(*) FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_members WHERE m_last_visit_time>' . strval(time() - 60 * 60 * 24 * 31))))));
}
}
if (!has_no_forum()) {
if (get_option('forum_show_stats_count_topics', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '2e0fe7ccbb15052743c94aab6a3654bc', 'KEY' => do_lang_tempcode('COUNT_TOPICS'), 'VALUE' => integer_format($GLOBALS['FORUM_DRIVER']->get_topics()))));
}
if (get_option('forum_show_stats_count_posts', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'de7e97b855cfbc4d60d069ca3f652b17', 'KEY' => do_lang_tempcode('COUNT_POSTS'), 'VALUE' => integer_format($GLOBALS['FORUM_DRIVER']->get_num_forum_posts()))));
}
if (get_option('forum_show_stats_count_posts_today', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '8649eee4a70ce0383c5534da43e2b58c', 'KEY' => do_lang_tempcode('COUNT_POSTSTODAY'), 'VALUE' => integer_format($GLOBALS['FORUM_DRIVER']->get_num_new_forum_posts()))));
}
}
if ($bits->is_empty()) {
return new ocp_tempcode();
}
$forums = do_template('BLOCK_SIDE_STATS_SECTION', array('_GUID' => '52cd616760efe17adcec4b97e1305301', 'SECTION' => do_lang_tempcode('FORUM_SLASH_COMMUNITY'), 'CONTENT' => $bits));
} else {
$forums = new ocp_tempcode();
}
return $forums;
}
示例8: authors_script
/**
* Shows an HTML page of all authors clickably.
*/
function authors_script()
{
require_lang('authors');
global $NON_CANONICAL_PARAMS;
$NON_CANONICAL_PARAMS[] = 'max';
$start = get_param_integer('start', 0);
$max = get_param_integer('max', 300);
$author_fields = $GLOBALS['SITE_DB']->query('SELECT m_name,m_table FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'db_meta WHERE m_name LIKE \'' . db_encode_like('%author') . '\'');
$rows = array();
foreach ($author_fields as $field) {
if ($field['m_table'] != 'addons' && $field['m_table'] != 'blocks' && $field['m_table'] != 'modules') {
$rows_new = $GLOBALS['SITE_DB']->query('SELECT DISTINCT ' . $field['m_name'] . ' AS author FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . $field['m_table'] . ' WHERE ' . db_string_not_equal_to($field['m_name'], '') . ' ORDER BY ' . $field['m_name'], $max + $start);
foreach ($rows_new as $a) {
if (!array_key_exists($a['author'], $rows) || $field['m_table'] == 'authors') {
$rows[$a['author']] = $field['m_table'];
}
}
}
}
$rows = array_unique($rows);
$field_name = get_param('field_name');
$content = new ocp_tempcode();
$i = 0;
foreach ($rows as $author => $table) {
if ($i >= $start && $i < $start + $max) {
if ($table == 'authors') {
$content->attach(do_template('AUTHOR_POPUP_WINDOW_DEFINED', array('_GUID' => 'cffa9926cebd3ec2920677266a3299ea', 'FIELD_NAME' => $field_name, 'AUTHOR' => $author)));
} else {
$content->attach(do_template('AUTHOR_POPUP_WINDOW_UNDEFINED', array('_GUID' => '6210be6d1eef4bc2bda7f49947301f97', 'FIELD_NAME' => $field_name, 'AUTHOR' => $author)));
}
}
$i++;
}
if ($content->is_empty()) {
$content = paragraph(do_lang_tempcode('NO_ENTRIES'), 'dfids09fi;lk;3');
}
if ($i >= $start + $max) {
$keep = symbol_tempcode('KEEP');
$next_link = find_script('authors') . '?field_name=' . urlencode($field_name) . '&start=' . strval($start + $max) . '&max=' . strval($max) . $keep->evaluate();
} else {
$next_link = NULL;
}
$echo = do_template('STYLED_HTML_WRAP', array('_GUID' => 'ab8d8c9d276530d82ddd84202aacf32f', 'TITLE' => do_lang_tempcode('CHOOSE_AUTHOR'), 'NEXT_LINK' => $next_link, 'CONTENT' => $content));
$echo->evaluate_echo();
}
示例9: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
if (!addon_installed('news')) {
return new ocp_tempcode();
}
require_lang('news');
$bits = new ocp_tempcode();
if (get_option('news_show_stats_count_total_posts', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('COUNT_POSTS'), 'VALUE' => integer_format($GLOBALS['SITE_DB']->query_value('news', 'COUNT(*)')))));
}
if (get_option('news_show_stats_count_blogs', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('BLOGS'), 'VALUE' => integer_format($GLOBALS['SITE_DB']->query_value_null_ok_full('SELECT COUNT(*) FROM ' . get_table_prefix() . 'news_categories WHERE nc_owner IS NOT NULL')))));
}
if ($bits->is_empty()) {
return new ocp_tempcode();
}
$section = do_template('BLOCK_SIDE_STATS_SECTION', array('SECTION' => do_lang_tempcode('NEWS'), 'CONTENT' => $bits));
return $section;
}
示例10: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
if (!addon_installed('cedi')) {
return new ocp_tempcode();
}
require_code('cedi_stats');
require_lang('cedi');
$bits = new ocp_tempcode();
if (get_option('cedi_show_stats_count_pages', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '8bbd18d5169c4e5449b252880ecda716', 'KEY' => do_lang_tempcode('COUNT_PAGES'), 'VALUE' => integer_format(get_num_cedi_pages()))));
}
if (get_option('cedi_show_stats_count_posts', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'd8cf3d5aabc18777f609760010303ace', 'KEY' => do_lang_tempcode('COUNT_POSTS'), 'VALUE' => integer_format(get_num_cedi_posts()))));
}
if ($bits->is_empty()) {
return new ocp_tempcode();
}
$cedi = do_template('BLOCK_SIDE_STATS_SECTION', array('_GUID' => 'ea19e51db4e62958843ace808016af1e', 'SECTION' => do_lang_tempcode('CEDI'), 'CONTENT' => $bits));
return $cedi;
}
示例11: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
if (!addon_installed('filedump')) {
return new ocp_tempcode();
}
if (!file_exists(get_custom_file_base() . '/uploads/filedump')) {
return new ocp_tempcode();
}
require_lang('filedump');
require_code('files2');
$bits = new ocp_tempcode();
if (get_option('filedump_show_stats_count_total_files', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('COUNT_FILES'), 'VALUE' => integer_format(count(get_directory_contents(get_custom_file_base() . '/uploads/filedump'))))));
}
if (get_option('filedump_show_stats_count_total_space', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('DISK_USAGE'), 'VALUE' => clean_file_size(get_directory_size(get_custom_file_base() . '/uploads/filedump')))));
}
if ($bits->is_empty()) {
return new ocp_tempcode();
}
$section = do_template('BLOCK_SIDE_STATS_SECTION', array('SECTION' => do_lang_tempcode('FILE_DUMP'), 'CONTENT' => $bits));
return $section;
}
示例12: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
if (!addon_installed('chat')) {
return new ocp_tempcode();
}
require_code('chat_stats');
require_lang('chat');
$bits = new ocp_tempcode();
if (get_option('chat_show_stats_count_users', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '904a46b83a84728243f3fd655705cc04', 'KEY' => do_lang_tempcode('COUNT_CHATTERS'), 'VALUE' => integer_format(get_num_chatters()))));
}
if (get_option('chat_show_stats_count_rooms', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'adf12b729fd23b6fa7115758a64155c6', 'KEY' => do_lang_tempcode('ROOMS'), 'VALUE' => integer_format(get_num_chatrooms()))));
}
if (get_option('chat_show_stats_count_messages', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '0e86e89171ddd8225ac41e14b18ecdb0', 'KEY' => do_lang_tempcode('COUNT_CHATPOSTS'), 'VALUE' => integer_format(get_num_chatposts()))));
}
if ($bits->is_empty()) {
return new ocp_tempcode();
}
$chat = do_template('BLOCK_SIDE_STATS_SECTION', array('_GUID' => '4d688c45e01ed34f257fd03100a6be6d', 'SECTION' => do_lang_tempcode('SECTION_CHAT'), 'CONTENT' => $bits));
return $chat;
}
示例13: ad
/**
* UI to add an invoice.
*
* @return tempcode The interface.
*/
function ad()
{
$title = get_page_title('CREATE_INVOICE');
breadcrumb_set_parents(array(array('_SEARCH:admin_ecommerce:ecom_usage', do_lang_tempcode('ECOMMERCE')), array('_SELF:_SELF:misc', do_lang_tempcode('INVOICES'))));
require_code('form_templates');
$to = get_param('to', '');
$products = find_all_products();
$list = new ocp_tempcode();
foreach ($products as $product => $details) {
if ($details[0] == PRODUCT_INVOICE) {
$text = do_lang_tempcode('CUSTOM_PRODUCT_' . $product);
if ($details[1] != '?') {
$text->attach(escape_html(' (' . $details[1] . ' ' . get_option('currency') . ')'));
}
$list->attach(form_input_list_entry($product, false, $text));
}
}
if ($list->is_empty()) {
inform_exit(do_lang_tempcode('NOTHING_TO_INVOICE_FOR'));
}
$fields = new ocp_tempcode();
$fields->attach(form_input_list(do_lang_tempcode('PRODUCT'), '', 'product', $list));
$fields->attach(form_input_username(do_lang_tempcode('USERNAME'), do_lang_tempcode('DESCRIPTION_INVOICE_FOR'), 'to', $to, true));
$fields->attach(form_input_float(do_lang_tempcode('AMOUNT'), do_lang_tempcode('INVOICE_AMOUNT_TEXT', escape_html(get_option('currency'))), 'amount', NULL, false));
$fields->attach(form_input_line(do_lang_tempcode('INVOICE_SPECIAL'), do_lang_tempcode('DESCRIPTION_INVOICE_SPECIAL'), 'special', '', false));
$fields->attach(form_input_text(do_lang_tempcode('INVOICE_NOTE'), do_lang_tempcode('DESCRIPTION_INVOICE_NOTE'), 'note', '', false));
$post_url = build_url(array('page' => '_SELF', 'type' => '_ad'), '_SELF');
$submit_name = do_lang_tempcode('CREATE_INVOICE');
return do_template('FORM_SCREEN', array('HIDDEN' => '', 'TITLE' => $title, 'URL' => $post_url, 'FIELDS' => $fields, 'SUBMIT_NAME' => $submit_name, 'TEXT' => do_lang_tempcode('DESCRIPTION_INVOICE_PAGE')));
}
示例14: strval
/**
* Show value statistics for a custom profile field (show).
*
* @return tempcode The statistics
*/
function _stats()
{
$title = get_page_title('CUSTOM_PROFILE_FIELD_STATS');
breadcrumb_set_parents(array());
$f_name = 'field_' . strval(get_param_integer('id'));
$_a = get_input_date('start');
$a = is_null($_a) ? '1=1' : 'm_join_time>' . strval((int) $_a);
$_b = get_input_date('end');
$b = is_null($_b) ? '1=1' : 'm_join_time<' . strval((int) $_b);
$members_in_range = $GLOBALS['FORUM_DB']->query('SELECT ' . $f_name . ',COUNT(' . $f_name . ') AS cnt FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_members m LEFT JOIN ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_member_custom_fields f ON m.id=f.mf_member_id WHERE ' . $a . ' AND ' . $b . ' GROUP BY ' . $f_name . ' ORDER BY cnt', 300);
if (count($members_in_range) == 300) {
attach_message(do_lang_tempcode('TOO_MUCH_CHOOSE__TOP_ONLY', escape_html(integer_format(300))), 'warn');
}
$lines = new ocp_tempcode();
foreach ($members_in_range as $row) {
if (!is_null($row[$f_name])) {
$val = $row[$f_name];
if ($val == STRING_MAGIC_NULL) {
continue;
}
$lines->attach(do_template('OCF_CPF_STATS_LINE', array('CNT' => integer_format($row['cnt']), 'VAL' => is_integer($val) ? integer_format($val) : $val)));
}
}
if ($lines->is_empty()) {
warn_exit(do_lang_tempcode('NO_DATA'));
}
return do_template('OCF_CPF_STATS_SCREEN', array('_GUID' => 'bb7be7acf936cd008e16bd515f7f39ac', 'TITLE' => $title, 'STATS' => $lines));
}
示例15: step_4
//.........这里部分代码省略.........
if (post_param('db_type') != 'xml') {
$options->attach(make_option(do_lang_tempcode('TABLE_PREFIX'), example('TABLE_PREFIX_EXAMPLE', 'TABLE_PREFIX_TEXT'), 'table_prefix', $table_prefix));
} else {
$hidden->attach(form_input_hidden('table_prefix', $table_prefix));
}
$admin_password = '';
$options->attach(make_option(do_lang_tempcode('MASTER_PASSWORD'), example('', 'CHOOSE_ADMIN_PASSWORD'), 'admin_password', $admin_password, true));
$options->attach(make_tick(do_lang_tempcode('USE_PERSISTENT'), example('', 'USE_PERSISTENT_TEXT'), 'use_persistent', $use_persistent ? 1 : 0));
// $options->attach(make_tick(do_lang_tempcode('MULTI_LANG'),example('','MULTI_LANG_TEXT'),'multi_lang',true));
require_lang('config');
$options->attach(make_tick(do_lang_tempcode('SEND_ERROR_EMAILS_OCPRODUCTS'), example('', 'CONFIG_OPTION_send_error_emails_ocproducts'), 'allow_reports_default', 1));
$sections->attach(do_template('INSTALLER_STEP_4_SECTION', array('_GUID' => 'f051465e86a7a53ec078e0d9de773993', 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => $text, 'OPTIONS' => $options)));
$hidden = new ocp_tempcode();
$forum_text = new ocp_tempcode();
if ($forum_type == 'ocf' || $forum_type == 'none') {
$forum_title = do_lang_tempcode('FORUM_SETTINGS');
} else {
$_forum_type = do_lang('FORUM_CLASS_' . preg_replace('#\\d+$#', '', $forum_type), NULL, NULL, NULL, NULL, false);
if (is_null($_forum_type)) {
$_forum_type = ucwords($forum_type);
}
$forum_title = do_lang_tempcode('_FORUM_SETTINGS', escape_html($_forum_type));
}
$forum_options = new ocp_tempcode();
$use_msn = post_param_integer('use_msn', 0);
if ($use_msn == 0) {
$use_msn = post_param_integer('use_multi_db', 0);
}
$forum_type = post_param('forum_type');
if ($forum_type != 'none') {
if ($use_msn == 1) {
if ($forum_type != 'ocf') {
$forum_text = do_lang_tempcode('AUTODETECT');
}
$forum_options->attach(make_option(do_lang_tempcode('DATABASE_NAME'), new ocp_tempcode(), 'db_forums', $db_forums, false, true));
if (!$GLOBALS['DB_STATIC_OBJECT']->db_is_flat_file_simple()) {
$forum_options->attach(make_option(do_lang_tempcode('DATABASE_HOST'), example('', 'DATABASE_HOST_TEXT'), 'db_forums_host', $db_forums_host, false, true));
$forum_options->attach(make_option(do_lang_tempcode('DATABASE_USERNAME'), new ocp_tempcode(), 'db_forums_user', $db_forums_user, false, true));
$forum_options->attach(make_option(do_lang_tempcode('DATABASE_PASSWORD'), new ocp_tempcode(), 'db_forums_password', $db_forums_password, true));
} else {
$hidden->attach(form_input_hidden('db_forums_host', 'localhost'));
$hidden->attach(form_input_hidden('db_forums_user', ''));
$hidden->attach(form_input_hidden('db_forums_password', ''));
}
$hidden->attach(form_input_hidden('use_msn', strval($use_msn)));
}
if ($forum_type != 'ocf' || $use_msn == 1) {
$forum_options->attach(make_option(do_lang_tempcode('BASE_URL'), example('FORUM_BASE_URL_EXAMPLE', 'BASE_URL_TEXT_FORUM'), 'board_prefix', $board_prefix, false, true));
}
}
foreach ($specifics as $specific) {
if ($specific['name'] == 'clear_existing_forums_on_install') {
$hidden->attach(form_input_hidden('clear_existing_forums_on_install', 'yes'));
} elseif ($specific['name'] == 'ocf_table_prefix' && $use_msn == 0) {
// Nothing
} else {
$forum_options->attach(make_option(is_object($specific['title']) ? $specific['title'] : make_string_tempcode($specific['title']), is_object($specific['description']) ? $specific['description'] : make_string_tempcode($specific['description']), $specific['name'], array_key_exists($specific['name'], $SITE_INFO) ? $SITE_INFO[$specific['name']] : $specific['default'], strpos($specific['name'], 'password') !== false));
}
}
$text = $use_msn == 1 ? do_lang_tempcode($forum_type == 'ocf' ? 'DUPLICATE_OCF' : 'DUPLICATE') : new ocp_tempcode();
$options = make_option(do_lang_tempcode('DATABASE_NAME'), new ocp_tempcode(), 'db_site', $db_site, false, true);
if (!$GLOBALS['DB_STATIC_OBJECT']->db_is_flat_file_simple()) {
$options->attach(make_option(do_lang_tempcode('DATABASE_HOST'), example('', 'DATABASE_HOST_TEXT'), 'db_site_host', $db_site_host, false, true));
$options->attach(make_option(do_lang_tempcode('DATABASE_USERNAME'), new ocp_tempcode(), 'db_site_user', $db_site_user, false, true));
$options->attach(make_option(do_lang_tempcode('DATABASE_PASSWORD'), new ocp_tempcode(), 'db_site_password', $db_site_password, true));
} else {
$hidden->attach(form_input_hidden('db_site_host', 'localhost'));
$hidden->attach(form_input_hidden('db_site_user', ''));
$hidden->attach(form_input_hidden('db_site_password', ''));
}
if ($use_msn == 0 && $forum_type != 'ocf') {
$forum_options->attach($options);
$sections->attach(do_template('INSTALLER_STEP_4_SECTION', array('HIDDEN' => $hidden, 'TITLE' => $forum_title, 'TEXT' => $forum_text, 'OPTIONS' => $forum_options)));
} else {
$title = do_lang_tempcode('OCPORTAL_SETTINGS');
if (!$forum_options->is_empty()) {
$sections->attach(do_template('INSTALLER_STEP_4_SECTION', array('_GUID' => '232b69a995f384275c1cd9269a42c3b8', 'HIDDEN' => '', 'TITLE' => $forum_title, 'TEXT' => $forum_text, 'OPTIONS' => $forum_options)));
}
$sections->attach(do_template('INSTALLER_STEP_4_SECTION', array('_GUID' => '15e0f275f78414b6c4fe7775a1cacb23', 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => $text, 'OPTIONS' => $options)));
}
$title = do_lang_tempcode('COOKIE_SETTINGS');
$text = new ocp_tempcode();
$options = new ocp_tempcode();
$hidden = new ocp_tempcode();
$options->attach(make_option(do_lang_tempcode('COOKIE'), example('COOKIE_EXAMPLE', 'COOKIE_TEXT'), 'user_cookie', $member_cookie, false, true));
$options->attach(make_option(do_lang_tempcode('COOKIE_PASSWORD'), example('COOKIE_PASSWORD_EXAMPLE', 'COOKIE_PASSWORD_TEXT'), 'pass_cookie', $pass_cookie, false, true));
$options->attach(make_option(do_lang_tempcode('COOKIE_DOMAIN'), example('COOKIE_DOMAIN_EXAMPLE', 'COOKIE_DOMAIN_TEXT'), 'cookie_domain', $cookie_domain));
$options->attach(make_option(do_lang_tempcode('COOKIE_PATH'), example('COOKIE_PATH_EXAMPLE', 'COOKIE_PATH_TEXT'), 'cookie_path', $cookie_path));
$options->attach(make_option(do_lang_tempcode('COOKIE_DAYS'), example('COOKIE_DAYS_EXAMPLE', 'COOKIE_DAYS_TEXT'), 'cookie_days', $cookie_days, false, true));
$temp = do_template('INSTALLER_STEP_4_SECTION', array('_GUID' => '3b9ea022164801f4b60780a4a966006f', 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => $text, 'OPTIONS' => $options));
$sections->attach(do_template('INSTALLER_STEP_4_SECTION_HIDE', array('_GUID' => '42eb3d44bcf8ef99987b6daa9e6530aa', 'TITLE' => $title, 'CONTENT' => $temp)));
$js = do_template('JAVASCRIPT');
$js->attach(chr(10));
$js->attach(do_template('JAVASCRIPT_AJAX'));
$message = paragraph(do_lang_tempcode('BASIC_CONFIG'));
if ($forum_type != 'none' && $forum_type != 'ocf') {
$message->attach(paragraph(do_lang_tempcode('FORUM_DRIVER_NATIVE_LOGIN')));
}
return do_template('INSTALLER_STEP_4', array('_GUID' => '73c3ac0a7108709b74b2e89cae30be12', 'JS' => $js, 'MESSAGE' => $message, 'LANG' => $LANG, 'DB_TYPE' => post_param('db_type'), 'FORUM_TYPE' => $forum_type, 'BOARD_PATH' => $board_path, 'SECTIONS' => $sections, 'MAX' => strval(post_param_integer('max', 1000))));
}