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


PHP breadcrumb_set_self函数代码示例

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


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

示例1: run

 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     require_lang('bulkupload');
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/bulkuploadassistant';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_adv_comcode';
     $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_BULK_UPLOAD');
     $title = get_page_title('BULK_UPLOAD');
     $parameter = post_param('parameter', '');
     require_code('form_templates');
     if ($parameter == '') {
         $post_url = build_url(array('page' => '_SELF'), '_SELF');
         $text = paragraph(do_lang_tempcode('BULK_UPLOAD_HELP'));
         $submit_name = do_lang_tempcode('BULK_UPLOAD');
         $fields = form_input_line(do_lang_tempcode('DIRECTORY'), do_lang_tempcode('DIRECTORY_BULK'), 'parameter', 'uploads/attachments/' . date('Y-m-d', utctime_to_usertime()), true);
         return do_template('FORM_SCREEN', array('_GUID' => '77a2ca460745145d8a1d18cf24971fea', 'SKIP_VALIDATION' => true, 'HIDDEN' => '', 'FIELDS' => $fields, 'URL' => $post_url, 'TITLE' => $title, 'TEXT' => $text, 'SUBMIT_NAME' => $submit_name));
     } else {
         breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('BULK_UPLOAD'))));
         breadcrumb_set_self(do_lang_tempcode('_RESULTS'));
         $out = $this->do_dir(get_custom_file_base() . '/' . filter_naughty($parameter, true));
         if ($out->is_empty()) {
             inform_exit(do_lang_tempcode('NO_FILES'));
         }
         return do_template('BULK_HELPER_RESULTS_SCREEN', array('_GUID' => '5d373553cf21a58f15006bd4e600a9ee', 'TITLE' => $title, 'RESULTS' => $out));
     }
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:30,代码来源:admin_bulkupload.php

示例2: actual

 /**
  * The actualiser for LDAP synchronisation.
  *
  * @return tempcode		The UI
  */
 function actual()
 {
     $title = get_page_title('LDAP_SYNC');
     $all_ldap_groups = ocf_get_all_ldap_groups();
     foreach ($all_ldap_groups as $group) {
         if (post_param_integer('add_group_' . str_replace(' ', '_space_', $group), 0) == 1) {
             ocf_make_group($group, 0, 0, 0, '');
         }
     }
     $all_ocp_groups = $GLOBALS['FORUM_DRIVER']->get_usergroup_list();
     foreach ($all_ocp_groups as $id => $group) {
         if (post_param_integer('delete_group_' . strval($id), 0) == 1) {
             ocf_delete_group($id);
         }
     }
     $all_ldap_members = $GLOBALS['FORUM_DB']->query_select('f_members', array('id'), array('m_password_compat_scheme' => 'ldap'));
     require_code('ocf_groups_action');
     require_code('ocf_groups_action2');
     foreach ($all_ldap_members as $row) {
         $id = $row['id'];
         if (post_param_integer('delete_member_' . strval($id), 0) == 1) {
             ocf_delete_member($id);
         }
     }
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('LDAP_SYNC'))));
     breadcrumb_set_self(do_lang_tempcode('DONE'));
     $url = build_url(array('page' => '_SELF', 'type' => 'misc'), '_SELF');
     return redirect_screen($title, $url, do_lang_tempcode('SUCCESS'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:34,代码来源:admin_ocf_ldap.php

示例3: apply

 /**
  * The actualiser to apply to join a usergroup.
  *
  * @return tempcode		The UI
  */
 function apply()
 {
     $id = post_param_integer('id', NULL);
     if (is_null($id)) {
         $_id = get_param('id');
         if (is_numeric($_id)) {
             $id = intval($_id);
         } else {
             $id = $GLOBALS['FORUM_DB']->query_value_null_ok('f_groups g LEFT JOIN ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'translate t ON t.id=g.g_name', 'g.id', array('text_original' => $_id));
             if (is_null($id)) {
                 warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
             }
         }
         if ($id == db_get_first_id()) {
             warn_exit(do_lang_tempcode('INTERNAL_ERROR'));
         }
         $_leader = ocf_get_group_property($id, 'group_leader');
         $free_access = ocf_get_group_property($id, 'open_membership') == 1;
         $name = ocf_get_group_name($id);
         $title = get_page_title('_APPLY_TO_GROUP', true, array(escape_html($name)));
         $post_url = build_url(array('page' => '_SELF', 'type' => get_param('type')), '_SELF', NULL, true);
         $hidden = form_input_hidden('id', strval($id));
         if ($free_access) {
             $text = do_lang_tempcode('ABOUT_TO_APPLY_FREE_ACCESS', escape_html($name));
         } else {
             if (is_null($_leader) || is_null($GLOBALS['FORUM_DRIVER']->get_username($_leader))) {
                 $text = do_lang_tempcode('ABOUT_TO_APPLY_STAFF', escape_html($name), escape_html(get_site_name()));
             } else {
                 $leader_username = $GLOBALS['FORUM_DRIVER']->get_username($_leader);
                 if (is_null($leader_username)) {
                     $leader_username = do_lang('UNKNOWN');
                 }
                 $leader_url = $GLOBALS['FORUM_DRIVER']->member_profile_url($_leader, false, true);
                 $text = do_lang_tempcode('ABOUT_TO_APPLY_LEADER', escape_html($name), escape_html($leader_username), escape_html($leader_url));
             }
         }
         return do_template('YESNO_SCREEN', array('_GUID' => 'ceafde00ade4492c65ed2e6e2309a0e7', 'TITLE' => $title, 'TEXT' => $text, 'URL' => $post_url, 'HIDDEN' => $hidden));
     }
     if ($id == db_get_first_id()) {
         warn_exit(do_lang_tempcode('INTERNAL_ERROR'));
     }
     $_name = $GLOBALS['FORUM_DB']->query_value('f_groups', 'g_name', array('id' => $id));
     $name = get_translated_text($_name, $GLOBALS['FORUM_DB']);
     $title = get_page_title('_APPLY_TO_GROUP', true, array(escape_html($name)));
     $free_access = ocf_get_group_property($id, 'open_membership') == 1;
     if (is_guest()) {
         access_denied('I_ERROR');
     }
     require_code('ocf_groups');
     if (ocf_get_group_property($id, 'open_membership') == 1) {
         return $this->add_to(true, $GLOBALS['FORUM_DRIVER']->get_username(get_member()));
     }
     ocf_member_ask_join_group($id, get_member());
     breadcrumb_set_self(do_lang_tempcode('DONE'));
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('USERGROUPS')), array('_SELF:_SELF:view:id=' . strval($id), do_lang_tempcode('USERGROUP', escape_html($name)))));
     $url = build_url(array('page' => '_SELF', 'type' => 'view', 'id' => $id), '_SELF');
     return redirect_screen($title, $url, do_lang_tempcode('AWAITING_GROUP_LEADER'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:63,代码来源:groups.php

示例4: misc

 /**
  * The do-next manager for order module
  * 
  * @return tempcode		The UI
  */
 function misc()
 {
     breadcrumb_set_self(do_lang_tempcode('ORDERS'));
     breadcrumb_set_parents(array(array('_SEARCH:admin_ecommerce:ecom_usage', do_lang_tempcode('ECOMMERCE'))));
     require_code('templates_donext');
     return do_next_manager(get_page_title('ORDERS'), comcode_lang_string('DOC_ECOMMERCE'), array(array('show_orders', array('_SELF', array('type' => 'show_orders'), '_SELF'), do_lang('SHOW_ORDERS')), array('undispatched', array('_SELF', array('type' => 'show_orders', 'filter' => 'undispatched'), '_SELF'), do_lang('UNDISPATCHED_ORDERS'))), do_lang('ORDERS'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:12,代码来源:admin_orders.php

示例5: __survey_results

 /**
  * View a single filled-in survey.
  *
  * @return tempcode	The result of execution.
  */
 function __survey_results()
 {
     $title = get_page_title('SURVEY_RESULTS');
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/survey_results';
     require_code('templates_view_space');
     $id = get_param_integer('id');
     // entry ID
     $fields = new ocp_tempcode();
     $rows = $GLOBALS['SITE_DB']->query_select('quiz_entries', array('q_time', 'q_member'), array('id' => $id), '', 1);
     if (!array_key_exists(0, $rows)) {
         warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
     }
     $member_id = $rows[0]['q_member'];
     $username = $GLOBALS['FORUM_DRIVER']->get_username($member_id);
     if (is_null($username)) {
         $username = do_lang('UNKNOWN');
     }
     $date = get_timezoned_date($rows[0]['q_time']);
     $question_rows = $GLOBALS['SITE_DB']->query_select('quiz_questions q LEFT JOIN ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'quiz_entry_answer a ON q.id=a.q_question', array('q.id', 'q_question_text', 'q_answer', 'q_quiz'), array('q_entry' => $id), 'ORDER BY q.id');
     foreach ($question_rows as $q) {
         $quiz_id = $q['q_quiz'];
         $answer = $q['q_answer'];
         if (is_numeric($answer)) {
             $answer_rows = $GLOBALS['SITE_DB']->query_select('quiz_question_answers', array('q_answer_text'), array('q_question' => $q['id'], 'id' => intval($answer)), 'ORDER BY id');
             if (array_key_exists(0, $answer_rows)) {
                 $answer = get_translated_text($answer_rows[0]['q_answer_text']);
             }
         }
         $fields->attach(view_space_field(get_translated_text($q['q_question_text']), $answer));
     }
     breadcrumb_set_parents(array(array('_SELF:_SELF', do_lang_tempcode('MANAGE_QUIZZES')), array('_SELF:_SELF:_survey_results:id=' . strval($quiz_id), do_lang_tempcode('SURVEY_RESULTS'))));
     breadcrumb_set_self(do_lang_tempcode('RESULT'));
     $member_url = get_base_url();
     if (!is_guest($member_id)) {
         $member_url = $GLOBALS['FORUM_DRIVER']->member_profile_url($member_id, false, true);
         if (is_object($member_url)) {
             $member_url = $member_url->evaluate();
         }
     }
     return do_template('VIEW_SPACE_SCREEN', array('_GUID' => '02b4dd6d52feaf3844e631e56395c4da', 'TITLE' => $title, 'TEXT' => do_lang_tempcode('SURVEY_WAS_ENTERED_AS_FOLLOWS', escape_html($username), escape_html($member_url), escape_html($date)), 'FIELDS' => $fields));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:46,代码来源:admin_quiz.php

示例6: interface_code

 /**
  * The UI to translate code.
  *
  * @return tempcode		The UI
  */
 function interface_code()
 {
     $lang = filter_naughty_harsh(get_param('lang', ''));
     $lang_new = get_param('lang_new', $lang);
     if ($lang_new != '') {
         require_code('type_validation');
         if (!is_alphanumeric($lang_new, true)) {
             warn_exit(do_lang_tempcode('BAD_CODENAME'));
         }
         if (strlen($lang_new) > 5) {
             warn_exit(do_lang_tempcode('INVALID_LANG_CODE'));
         }
         $lang = $lang_new;
     }
     if ($lang == '') {
         $title = get_page_title('TRANSLATE_CODE');
         $GLOBALS['HELPER_PANEL_TEXT'] = comcode_lang_string('DOC_FIND_LANG_STRING_TIP');
         return $this->choose_lang($title, true, true, do_lang_tempcode('CHOOSE_EDIT_LIST_LANG_FILE'));
     }
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('CHOOSE'))));
     breadcrumb_set_self(do_lang_tempcode('TRANSLATE_CODE'));
     $base_lang = fallback_lang();
     $map_a = get_file_base() . '/lang/langs.ini';
     $map_b = get_custom_file_base() . '/lang_custom/langs.ini';
     $search = get_param('search', '', true);
     if ($search != '') {
         $title = get_page_title('TRANSLATE_CODE');
         require_code('form_templates');
         $fields = new ocp_tempcode();
         global $LANGUAGE;
         foreach ($LANGUAGE[user_lang()] as $key => $value) {
             if (strpos(strtolower($value), strtolower($search)) !== false) {
                 $fields->attach(form_input_text($key, '', 'l_' . $key, str_replace('\\n', chr(10), $value), false));
             }
         }
         if ($fields->is_empty()) {
             inform_exit(do_lang_tempcode('NO_ENTRIES'));
         }
         $post_url = build_url(array('page' => '_SELF', 'type' => '_code2'), '_SELF');
         $hidden = new ocp_tempcode();
         $hidden->attach(form_input_hidden('redirect', get_self_url(true)));
         $hidden->attach(form_input_hidden('lang', $lang));
         return do_template('FORM_SCREEN', array('_GUID' => '2d7356fd2c4497ceb19450e65331c9c5', 'TITLE' => $title, 'HIDDEN' => $hidden, 'FIELDS' => $fields, 'URL' => $post_url, 'TEXT' => '', 'SUBMIT_NAME' => do_lang('TRANSLATE_CODE')));
     }
     $lang_file = get_param('lang_file');
     if (!file_exists($map_b)) {
         $map_b = $map_a;
     }
     $map = better_parse_ini_file($map_b);
     $title = get_page_title('_TRANSLATE_CODE', true, array(escape_html($lang_file), escape_html(array_key_exists($lang, $map) ? $map[$lang] : $lang)));
     // Upgrade to custom if not there yet (or maybe we are creating a new lang - same difference)
     $custom_dir = get_custom_file_base() . '/lang_custom/' . $lang;
     if (!file_exists($custom_dir)) {
         require_code('abstract_file_manager');
         force_have_afm_details();
         afm_make_directory('lang_custom/' . $lang, true);
         $cached_dir = get_custom_file_base() . '/lang_cached/' . $lang;
         if (!file_exists($cached_dir)) {
             afm_make_directory('lang_cached/' . $lang, true);
         }
         // Make comcode page dirs
         $zones = find_all_zones();
         foreach ($zones as $zone) {
             $_special_dir = get_custom_file_base() . '/' . $zone . '/pages/comcode_custom/' . $lang;
             if (!file_exists($_special_dir)) {
                 afm_make_directory($zone . ($zone == '' ? '' : '/') . 'pages/comcode_custom/' . $lang, true);
             }
             $_special_dir = get_custom_file_base() . '/' . $zone . '/pages/html_custom/' . $lang;
             if (!file_exists($_special_dir)) {
                 afm_make_directory($zone . ($zone == '' ? '' : '/') . 'pages/html_custom/' . $lang, true);
             }
         }
         // Make templates_cached dirs
         require_code('themes2');
         $themes = find_all_themes();
         foreach (array_keys($themes) as $theme) {
             $_special_dir = get_custom_file_base() . '/themes/' . $theme . '/templates_cached/' . $lang;
             if (!file_exists($_special_dir)) {
                 afm_make_directory('themes/' . $theme . '/templates_cached/' . $lang, true);
             }
         }
     }
     // Get some stuff
     $for_lang = get_lang_file_map($lang, $lang_file);
     $for_base_lang = get_lang_file_map($base_lang, $lang_file, true);
     $descriptions = get_lang_file_descriptions($base_lang, $lang_file);
     // Make our translation page
     $lines = '';
     $intertrans = $this->get_intertran_conv($lang);
     $actions = new ocp_tempcode();
     $next = 0;
     $trans_lot = '';
     $delimit = chr(10) . '=-=-=-=-=-=-=-=-' . chr(10);
     foreach ($for_base_lang as $name => $old) {
         if (array_key_exists($name, $for_lang)) {
//.........这里部分代码省略.........
开发者ID:erico-deh,项目名称:ocPortal,代码行数:101,代码来源:admin_lang.php

示例7: module_do_delete_folder

 /**
  * The actualiser for deleting a folder.
  *
  * @return tempcode	The UI.
  */
 function module_do_delete_folder()
 {
     $title = get_page_title('FILEDUMP_DELETE_FOLDER');
     $file = filter_naughty(get_param('file'));
     $place = filter_naughty(get_param('place'));
     breadcrumb_set_parents(array(array('_SELF:_SELF', do_lang_tempcode('FILE_DUMP'))));
     if (post_param_integer('confirmed', 0) != 1) {
         $url = get_self_url();
         $text = do_lang_tempcode('CONFIRM_DELETE', $file);
         breadcrumb_set_self(do_lang_tempcode('CONFIRM'));
         $hidden = build_keep_post_fields();
         $hidden->attach(form_input_hidden('confirmed', '1'));
         return do_template('CONFIRM_SCREEN', array('_GUID' => '55cd4cafa3bf8285028da9862508d811', 'TITLE' => $title, 'FIELDS' => $hidden, 'PREVIEW' => $text, 'URL' => $url));
     }
     $ret = @rmdir(get_custom_file_base() . '/uploads/filedump' . $place . $file);
     sync_file('uploads/filedump/' . $place . $file);
     if ($ret) {
         $return_url = build_url(array('page' => '_SELF', 'type' => 'misc', 'place' => $place), '_SELF');
         log_it('FILEDUMP_DELETE_FOLDER', $file, $place);
         return redirect_screen($title, $return_url, do_lang_tempcode('SUCCESS'));
     } else {
         warn_exit(do_lang_tempcode('FOLDER_DELETE_ERROR'));
     }
     return new ocp_tempcode();
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:30,代码来源:filedump.php

示例8: view

 function view()
 {
     $id = NULL;
     $name = '';
     $image = '';
     $cure = '';
     $cure_price = 0;
     $immunization = '';
     $immunization_price = 0;
     $spread_rate = 0;
     $points_per_spread = 10;
     $enabled = do_lang_tempcode('DISEASE_DISABLED');
     $id = get_param_integer('id', 0);
     if ($id > 0) {
         $rows = $GLOBALS['SITE_DB']->query_select('diseases', array('*'), array('id' => $id));
         if (isset($rows[0]['id']) && $rows[0]['id'] > 0) {
             $id = $rows[0]['id'];
             $name = $rows[0]['name'];
             $image = $rows[0]['image'];
             $cure = $rows[0]['cure'];
             $cure_price = $rows[0]['cure_price'];
             $immunization = $rows[0]['immunisation'];
             $immunization_price = $rows[0]['immunisation_price'];
             $spread_rate = $rows[0]['spread_rate'];
             $points_per_spread = $rows[0]['points_per_spread'];
             $enabled = $rows[0]['enabled'] == 1 ? do_lang_tempcode('DISEASE_ENABLED') : do_lang_tempcode('DISEASE_DISABLED');
         }
     }
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('OCDEADPEOPLE_TITLE'))));
     breadcrumb_set_self(do_lang_tempcode('VIEW_DISEASE'));
     require_code('templates_view_space');
     return view_space(get_page_title('VIEW_DISEASE'), array('NAME' => $name, 'IMAGE' => $image, 'CURE' => $cure, 'CURE_PRICE' => integer_format($cure_price), 'IMMUNIZATION' => $immunization, 'IMMUNIZATION_PRICE' => integer_format($immunization_price), 'SPREAD_RATE' => integer_format($spread_rate), 'POINTS_PER_SPREAD' => integer_format($points_per_spread), 'ENABLED' => $enabled));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:33,代码来源:admin_ocdeadpeople.php

示例9: _do_quiz


//.........这里部分代码省略.........
                     $correct_answer = make_string_tempcode(escape_html(get_translated_text($a['q_answer_text'])));
                 }
                 if (post_param_integer($name, -1) == $a['id']) {
                     $results[$i] = get_translated_text($a['q_answer_text']);
                     if ($a['q_is_correct'] == 1) {
                         $was_right = true;
                         $marks++;
                         break;
                     }
                     $correct_explanation = $a['q_explanation'];
                 }
             }
             $GLOBALS['SITE_DB']->query_insert('quiz_entry_answer', array('q_entry' => $entry_id, 'q_question' => $question['id'], 'q_answer' => post_param($name, '')));
             if (!array_key_exists($i, $results)) {
                 $results[$i] = '/';
             }
             if (!$was_right) {
                 $correction = array($question['id'], get_translated_text($question['q_question_text']), $correct_answer, $results[$i]);
                 if (!is_null($correct_explanation)) {
                     $explanation = get_translated_text($correct_explanation);
                     if ($explanation != '') {
                         $correction[] = $explanation;
                     }
                 }
                 $corrections[] = $correction;
             }
         }
     }
     $mail_title = do_lang('EMAIL_TITLE', do_lang($quiz['q_type']), $GLOBALS['FORUM_DRIVER']->get_username(get_member()), strval($entry_id), get_site_default_lang());
     $_corrections = new ocp_tempcode();
     $_corrections_to_show = new ocp_tempcode();
     foreach ($corrections as $correction) {
         $this_correction = new ocp_tempcode();
         $this_correction->attach(do_lang('QUIZ_MISTAKE', is_object($correction[1]) ? $correction[1]->evaluate() : $correction[1], is_object($correction[3]) ? $correction[3]->evaluate() : $correction[3], array(is_object($correction[2]) ? $correction[2]->evaluate() : $correction[2], array_key_exists(4, $correction) ? $correction[4] : '')));
         if (array_key_exists(4, $correction)) {
             $_corrections_to_show->attach($this_correction);
         }
         $_corrections->attach($this_correction);
     }
     $_answers = new ocp_tempcode();
     foreach ($results as $i => $result) {
         $_answers->attach(do_lang('QUIZ_RESULT', get_translated_text($questions[$i]['q_question_text']), is_null($result) ? '' : $result));
     }
     $_unknowns = new ocp_tempcode();
     foreach ($unknowns as $unknown) {
         $_unknowns->attach(do_lang('QUIZ_UNKNOWN', $unknown[0], $unknown[1]));
     }
     require_code('notifications');
     // Award points?
     if ($out_of == 0) {
         $out_of = 1;
     }
     $minimum_percentage = intval(round(100.0 * $marks / $out_of));
     $maximum_percentage = intval(round(100.0 * ($marks + $potential_extra_marks) / $out_of));
     if (addon_installed('points') && $quiz['q_points_for_passing'] != 0 && ($quiz['q_type'] != 'TEST' || $minimum_percentage >= $quiz['q_percentage'])) {
         require_code('points2');
         $points_difference = $quiz['q_points_for_passing'];
         system_gift_transfer(do_lang('POINTS_COMPLETED_QUIZ', get_translated_text($quiz['q_name'])), $points_difference, get_member());
     } else {
         $points_difference = 0;
     }
     // Give them their result if it is a test.
     if ($quiz['q_type'] == 'TEST') {
         $result = new ocp_tempcode();
         $result->attach(paragraph(do_lang_tempcode('MARKS_OUT_OF', float_format($marks) . ($potential_extra_marks == 0 ? '' : '-' . float_format($marks + $potential_extra_marks)), integer_format($out_of), strval($minimum_percentage) . ($potential_extra_marks == 0 ? '' : '-' . strval($maximum_percentage))), 'trete9r0itre'));
         $result2 = do_lang_tempcode('MAIL_MARKS_OUT_OF', float_format($marks) . ($potential_extra_marks == 0 ? '' : '-' . float_format($marks + $potential_extra_marks)), integer_format($out_of), strval($minimum_percentage) . ($potential_extra_marks == 0 ? '' : '-' . strval($maximum_percentage)));
         if ($minimum_percentage >= $quiz['q_percentage']) {
             $result->attach(paragraph(do_lang_tempcode('TEST_PASS'), '4tfdhdhghh'));
             $result2->attach(do_lang_tempcode('MAIL_TEST_PASS'));
             syndicate_described_activity('quiz:ACTIVITY_PASSED_TEST', get_translated_text($quiz['q_name']), '', '', '_SEARCH:quiz:do:' . strval($id), '', '', 'quizzes');
         } elseif ($maximum_percentage < $quiz['q_percentage']) {
             $result->attach(paragraph(do_lang_tempcode('TEST_FAIL'), '5yrgdgsdg'));
             $result2->attach(do_lang_tempcode('MAIL_TEST_FAIL'));
         } else {
             $result->attach(paragraph(do_lang_tempcode('TEST_UNKNOWN'), 'yteyrthrt'));
             $result2->attach(do_lang_tempcode('MAIL_TEST_UNKNOWN'));
         }
         // Send mail about the result to the staff: include result and corrections, and unknowns
         $mail = do_template('QUIZ_TEST_ANSWERS_MAIL', array('_GUID' => 'a0f8f47cdc1ef83b59c93135ebb5c114', 'UNKNOWNS' => $_unknowns, 'CORRECTIONS' => $_corrections, 'RESULT' => $result2, 'USERNAME' => $GLOBALS['FORUM_DRIVER']->get_username(get_member())));
         dispatch_notification('quiz_results', strval($id), $mail_title, $mail->evaluate(get_site_default_lang()));
     } elseif ($quiz['q_type'] == 'COMPETITION') {
         $result = comcode_to_tempcode($_corrections->evaluate());
         syndicate_described_activity('quiz:ACTIVITY_ENTERED_COMPETITION', get_translated_text($quiz['q_name']), '', '', '_SEARCH:quiz:do:' . strval($id), '', '', 'quizzes');
     } else {
         $result = paragraph(do_lang_tempcode('SURVEY_THANKYOU'), '4rtyrthgf');
         $_answers = do_template('QUIZ_ANSWERS_MAIL', array('_GUID' => '381f392c8e491b6e078bcae34adc45e8', 'ANSWERS' => $_answers, 'MEMBER_PROFILE_URL' => is_guest() ? '' : $GLOBALS['FORUM_DRIVER']->member_profile_url(get_member(), false, true), 'USERNAME' => $GLOBALS['FORUM_DRIVER']->get_username(get_member())));
         // Send mail of answers to the staff
         dispatch_notification('quiz_results', strval($id), $mail_title, $_answers->evaluate(get_site_default_lang()));
         syndicate_described_activity('quiz:ACTIVITY_FILLED_SURVEY', get_translated_text($quiz['q_name']), '', '', '_SEARCH:quiz:do:' . strval($id), '', '', 'quizzes');
     }
     // Store results for entry
     $GLOBALS['SITE_DB']->query_update('quiz_entries', array('q_results' => intval(round($marks))), array('id' => $entry_id), '', 1);
     breadcrumb_set_self(do_lang_tempcode('DONE'));
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', make_string_tempcode(escape_html(get_translated_text($quiz['q_name']))))));
     // Show end text
     $title = get_page_title(do_lang_tempcode('THIS_WITH', do_lang_tempcode($quiz['q_type']), make_string_tempcode(escape_html(get_translated_text($quiz['q_name'])))), false);
     $fail_text = get_translated_tempcode($quiz['q_end_text_fail']);
     $message = $quiz['q_type'] != 'TEST' || $minimum_percentage >= $quiz['q_percentage'] || $fail_text->is_empty() ? get_translated_tempcode($quiz['q_end_text']) : get_translated_tempcode($quiz['q_end_text_fail']);
     return do_template('QUIZ_DONE_SCREEN', array('_GUID' => 'fa783f087eca7f8f577b134ec0bdc4ce', 'CORRECTIONS_TO_SHOW' => comcode_to_tempcode($_corrections_to_show->evaluate()), 'POINTS_DIFFERENCE' => strval($points_difference), 'RESULT' => $result, 'TITLE' => $title, 'TYPE' => $quiz['q_type'], 'MESSAGE' => $message));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:101,代码来源:quiz.php

示例10: do_import


//.........这里部分代码省略.........
     $object = object_factory('Hook_' . filter_naughty_harsh($importer));
     // Get data
     $old_base_dir = either_param('old_base_dir');
     if (method_exists($object, 'verify_base_path') && !$object->verify_base_path($old_base_dir)) {
         warn_exit(do_lang_tempcode('BAD_IMPORT_PATH', escape_html($old_base_dir)));
     }
     if (method_exists($object, 'probe_db_access')) {
         list($db_name, $db_user, $db_password, $db_table_prefix) = $object->probe_db_access(either_param('old_base_dir'));
     } else {
         $db_name = either_param('db_name');
         $db_user = either_param('db_user');
         $db_password = either_param('db_password');
         $db_table_prefix = either_param('db_table_prefix');
     }
     if ($db_name == get_db_site() && $importer == 'ocp_merge' && $db_table_prefix == $GLOBALS['SITE_DB']->get_table_prefix()) {
         warn_exit(do_lang_tempcode('IMPORT_SELF_NO'));
     }
     $import_source = is_null($db_name) ? NULL : new database_driver($db_name, get_db_site_host(), $db_user, $db_password, $db_table_prefix);
     // Some preliminary tests
     $happy = get_param_integer('happy', 0);
     if (method_exists($object, 'pre_import_tests') && $happy == 0) {
         $ui = $object->pre_import_tests($import_source, $db_table_prefix, $old_base_dir);
         if (!is_null($ui)) {
             return $ui;
         }
     }
     // Save data
     $GLOBALS['SITE_DB']->query_delete('import_session', array('imp_session' => get_session_id()), '', 1);
     $GLOBALS['SITE_DB']->query_insert('import_session', array('imp_hook' => '', 'imp_old_base_dir' => $old_base_dir, 'imp_db_name' => is_null($db_name) ? '' : $db_name, 'imp_db_user' => is_null($db_user) ? '' : $db_user, 'imp_db_table_prefix' => is_null($db_table_prefix) ? '' : $db_table_prefix, 'imp_refresh_time' => $refresh_time, 'imp_session' => get_session_id()));
     $info = $object->info();
     $_import_list = $info['import'];
     $out = new ocp_tempcode();
     $parts_done = collapse_2d_complexity('imp_id', 'imp_session', $GLOBALS['SITE_DB']->query_select('import_parts_done', array('imp_id', 'imp_session'), array('imp_session' => get_session_id())));
     $import_last = '-1';
     if (get_forum_type() != 'ocf') {
         require_code('forum/ocf');
         $GLOBALS['OCF_DRIVER'] = new forum_driver_ocf();
         $GLOBALS['OCF_DRIVER']->connection = $GLOBALS['SITE_DB'];
         $GLOBALS['OCF_DRIVER']->MEMBER_ROWS_CACHED = array();
     }
     $_import_list[] = 'ocf_switch';
     $all_skipped = true;
     $lang_array = array();
     $hooks = find_all_hooks('modules', 'admin_import_types');
     foreach (array_keys($hooks) as $hook) {
         require_code('hooks/modules/admin_import_types/' . filter_naughty_harsh($hook));
         $_hook = object_factory('Hook_admin_import_types_' . filter_naughty_harsh($hook));
         $lang_array += $_hook->run();
     }
     foreach ($_import_list as $import) {
         $import_this = either_param_integer('import_' . $import, 0);
         if ($import_this == 1) {
             $dependency = NULL;
             if (array_key_exists('dependencies', $info) && array_key_exists($import, $info['dependencies'])) {
                 foreach ($info['dependencies'][$import] as $_dependency) {
                     if (!array_key_exists($_dependency, $parts_done) && isset($lang_array[$_dependency])) {
                         $dependency = $_dependency;
                     }
                 }
             }
             if (is_null($dependency)) {
                 if ($import == 'ocf_switch') {
                     $out->attach($this->ocf_switch());
                 } else {
                     $function_name = 'import_' . $import;
                     ocf_over_local();
                     $func_output = call_user_func_array(array($object, $function_name), array($import_source, $db_table_prefix, $old_base_dir));
                     if (!is_null($func_output)) {
                         $out->attach($func_output);
                     }
                     ocf_over_msn();
                 }
                 $parts_done[$import] = get_session_id();
                 $import_last = $import;
                 $all_skipped = false;
                 $GLOBALS['SITE_DB']->query_delete('import_parts_done', array('imp_id' => $import, 'imp_session' => get_session_id()), '', 1);
                 $GLOBALS['SITE_DB']->query_insert('import_parts_done', array('imp_id' => $import, 'imp_session' => get_session_id()));
             } else {
                 $out->attach(do_template('IMPORT_MESSAGE', array('_GUID' => 'b2a853f5fb93beada51a3eb8fbd1575f', 'MESSAGE' => do_lang_tempcode('IMPORT_OF_SKIPPED', escape_html($import), escape_html($dependency)))));
             }
         }
     }
     if (!$all_skipped) {
         $lang_code = 'SUCCESS';
         if (count($GLOBALS['ATTACHED_MESSAGES_RAW']) != 0) {
             $lang_code = 'SOME_ERRORS_OCCURRED';
         }
         $out->attach(do_template('IMPORT_MESSAGE', array('_GUID' => '4c4860d021814ffd1df6e21e712c7b44', 'MESSAGE' => do_lang_tempcode($lang_code))));
     }
     log_it('IMPORT');
     // Quick and simple decacheing. No need to be smart about this.
     delete_value('ocf_member_count');
     delete_value('ocf_topic_count');
     delete_value('ocf_post_count');
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('IMPORT')), array('_SELF:_SELF:session', do_lang_tempcode('IMPORT_SESSION')), array('_SELF:_SELF:hook:importer=' . $importer . ':session=' . get_param('session'), do_lang_tempcode('IMPORT'))));
     breadcrumb_set_self(do_lang_tempcode('START'));
     $back_url = build_url(array('page' => '_SELF', 'type' => 'hook', 'importer' => get_param('importer'), 'just' => $import_last), '_SELF');
     $_GET['just'] = $import_last;
     return $this->choose_actions($out);
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:101,代码来源:admin_import.php

示例11: set_page_access

 /**
  * The actualiser to set page access.
  *
  * @return tempcode		The UI
  */
 function set_page_access()
 {
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/permissionstree';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_permissions';
     $title = get_page_title('PAGE_ACCESS');
     // Delete to cleanup
     $zone = post_param('zone');
     $GLOBALS['SITE_DB']->query('DELETE FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'group_page_access WHERE page_name NOT LIKE \'' . db_encode_like('%:%') . '\' AND ' . db_string_equal_to('zone_name', $zone));
     $groups = $GLOBALS['FORUM_DRIVER']->get_usergroup_list(false, true);
     //	$zones=find_all_zones();
     $admin_groups = $GLOBALS['FORUM_DRIVER']->get_super_admin_groups();
     $zones = array($zone);
     foreach ($zones as $zone) {
         $pages = find_all_pages_wrap($zone);
         foreach (array_keys($pages) as $page) {
             foreach (array_keys($groups) as $id) {
                 if (in_array($id, $admin_groups)) {
                     continue;
                 }
                 $val = post_param_integer('p_' . $zone . '__' . $page . '__' . strval($id), 0);
                 if ($val == 0) {
                     $GLOBALS['SITE_DB']->query_insert('group_page_access', array('zone_name' => $zone, 'page_name' => $page, 'group_id' => $id));
                 }
             }
         }
     }
     breadcrumb_set_parents(array(array('_SELF:_SELF:page', do_lang_tempcode('CHOOSE')), array('_SELF:_SELF:page:zone=' . $zone, do_lang_tempcode('PAGE_ACCESS'))));
     breadcrumb_set_self(do_lang_tempcode('DONE'));
     decache('main_sitemap');
     $GLOBALS['SITE_DB']->query_delete('cache');
     if (function_exists('persistant_cache_empty')) {
         persistant_cache_empty();
     }
     // Show it worked / Refresh
     $url = build_url(array('page' => '_SELF', 'type' => 'page'), '_SELF');
     return redirect_screen($title, $url, do_lang_tempcode('SUCCESS'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:42,代码来源:admin_permissions.php

示例12: _move


//.........这里部分代码省略.........
         if (substr($key, 0, 6) == 'page__' && $val === '1') {
             $page = substr($key, 6);
             $page_details = _request_page($page, $zone, NULL, NULL, true);
             if ($page_details === false) {
                 warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
             }
             $pages[$page] = strtolower($page_details[0]);
             if (array_key_exists(3, $page_details)) {
                 $pages[$page] .= '/' . $page_details[3];
             }
         }
     }
     $afm_needed = false;
     foreach ($pages as $page => $type) {
         if (post_param_integer('page__' . $page, 0) == 1) {
             if ($type != 'comcode_custom') {
                 $afm_needed = true;
             }
         }
     }
     if ($afm_needed) {
         require_code('abstract_file_manager');
         force_have_afm_details();
     }
     $cannot_move = new ocp_tempcode();
     foreach ($pages as $page => $type) {
         if (!is_string($page)) {
             $page = strval($page);
         }
         if (post_param_integer('page__' . $page, 0) == 1) {
             if (substr($type, 0, 7) == 'modules') {
                 $_page = $page . '.php';
             } elseif (substr($type, 0, 7) == 'comcode') {
                 $_page = $page . '.txt';
             } elseif (substr($type, 0, 4) == 'html') {
                 $_page = $page . '.htm';
             }
             if (file_exists(zone_black_magic_filterer(get_custom_file_base() . '/' . filter_naughty($new_zone) . ($new_zone != '' ? '/' : '') . 'pages/' . filter_naughty($type) . '/' . $_page))) {
                 if (!$cannot_move->is_empty()) {
                     $cannot_move->attach(do_lang_tempcode('LIST_SEP'));
                 }
                 $cannot_move->attach(do_lang_tempcode('PAGE_WRITE', escape_html($page)));
                 continue;
             }
         }
     }
     $moved_something = NULL;
     foreach ($pages as $page => $type) {
         if (!is_string($page)) {
             $page = strval($page);
         }
         if (post_param_integer('page__' . $page, 0) == 1) {
             $moved_something = $page;
             if (substr($type, 0, 7) == 'modules') {
                 $_page = $page . '.php';
             } elseif (substr($type, 0, 7) == 'comcode') {
                 $_page = $page . '.txt';
             } elseif (substr($type, 0, 4) == 'html') {
                 $_page = $page . '.htm';
             }
             if (file_exists(zone_black_magic_filterer(get_custom_file_base() . '/' . filter_naughty($new_zone) . ($new_zone != '' ? '/' : '') . 'pages/' . filter_naughty($type) . '/' . $_page))) {
                 continue;
             }
             if (file_exists(zone_black_magic_filterer(get_custom_file_base() . '/' . filter_naughty($zone) . ($zone != '' ? '/' : '') . 'pages/' . filter_naughty($type) . '/' . $_page))) {
                 if ($afm_needed) {
                     afm_move(zone_black_magic_filterer(filter_naughty($zone) . ($zone != '' ? '/' : '') . 'pages/' . filter_naughty($type) . '/' . $_page, true), zone_black_magic_filterer(filter_naughty($new_zone) . ($new_zone != '' ? '/' : '') . 'pages/' . filter_naughty($type) . '/' . $_page, true));
                 } else {
                     rename(zone_black_magic_filterer(get_custom_file_base() . '/' . filter_naughty($zone) . ($zone != '' ? '/' : '') . 'pages/' . filter_naughty($type) . '/' . $_page), zone_black_magic_filterer(get_custom_file_base() . '/' . filter_naughty($new_zone) . ($new_zone != '' ? '/' : '') . 'pages/' . filter_naughty($type) . '/' . $_page));
                 }
             }
             // If a non-overridden one is there too, need to move that too
             if (strpos($type, '_custom') !== false && file_exists(zone_black_magic_filterer(get_custom_file_base() . '/' . filter_naughty($zone) . ($zone != '' ? '/' : '') . 'pages/' . filter_naughty(str_replace('_custom', '', $type)) . '/' . $_page)) && !file_exists(zone_black_magic_filterer(get_custom_file_base() . '/' . filter_naughty($new_zone) . ($new_zone != '' ? '/' : '') . 'pages/' . filter_naughty(str_replace('_custom', '', $type)) . '/' . $_page))) {
                 if ($afm_needed) {
                     afm_move(zone_black_magic_filterer(filter_naughty($zone) . ($zone != '' ? '/' : '') . 'pages/' . filter_naughty(str_replace('_custom', '', $type)) . '/' . $_page, true), zone_black_magic_filterer(filter_naughty($new_zone) . ($new_zone != '' ? '/' : '') . 'pages/' . filter_naughty(str_replace('_custom', '', $type)) . '/' . $_page, true));
                 } else {
                     rename(zone_black_magic_filterer(get_custom_file_base() . '/' . filter_naughty($zone) . ($zone != '' ? '/' : '') . 'pages/' . filter_naughty(str_replace('_custom', '', $type)) . '/' . $_page), zone_black_magic_filterer(get_custom_file_base() . '/' . filter_naughty($new_zone) . ($new_zone != '' ? '/' : '') . 'pages/' . filter_naughty(str_replace('_custom', '', $type)) . '/' . $_page));
                 }
             }
             log_it('MOVE_PAGES', $page);
         }
     }
     if (is_null($moved_something)) {
         warn_exit(do_lang_tempcode('NOTHING_SELECTED'));
     }
     persistant_cache_empty();
     require_lang('addons');
     if ($cannot_move->is_empty()) {
         $message = do_lang_tempcode('SUCCESS');
     } else {
         $message = do_lang_tempcode('WOULD_NOT_OVERWRITE_BUT_SUCCESS', $cannot_move);
     }
     breadcrumb_set_self(do_lang_tempcode('DONE'));
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('PAGES')), array('_SELF:_SELF:move', do_lang_tempcode('MOVE_PAGES'))));
     decache('main_sitemap');
     if (has_js()) {
         return inform_screen($title, $message);
         // Came from site-tree editor, so want to just close this window when done
     }
     return $this->do_next_manager($title, $moved_something, $new_zone, new ocp_tempcode());
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:101,代码来源:admin_sitetree.php

示例13: choose

 /**
  * Choose product step.
  *
  * @param  tempcode	The page title.
  * @return tempcode	The result of execution.
  */
 function choose($title)
 {
     breadcrumb_set_self(do_lang_tempcode('PURCHASING'));
     /*if (is_guest())
     		{
     			$register=$GLOBALS['FORUM_DRIVER']->join_url();
     			if (is_object($register)) $register=$register->evaluate();
     			$_redirect=build_url(array('page'=>'_SELF','type'=>'misc'),'_SELF');
     			$redirect=$_redirect->evaluate();
     			$_login=build_url(array('page'=>'login','redirect'=>$redirect));
     			$login=$_login->evaluate();
     			return $this->wrap(do_template('PURCHASE_WIZARD_STAGE_GUEST',array('_GUID'=>'accf475a1457f73d7280b14d774acc6e','TITLE'=>$title,'TEXT'=>do_lang_tempcode('PURCHASE_NOT_LOGGED_IN_2',escape_html($register),escape_html($login)))),$title,NULL);
     		}*/
     $url = build_url(array('page' => '_SELF', 'type' => 'message', 'id' => get_param_integer('id', -1)), '_SELF', NULL, true, true);
     require_code('form_templates');
     $list = new ocp_tempcode();
     $filter = get_param('filter', '');
     $products = find_all_products();
     foreach ($products as $product => $details) {
         if ($filter != '') {
             if (!is_string($product) || substr($product, 0, strlen($filter)) != $filter) {
                 continue;
             }
         }
         if (($details[0] == PRODUCT_PURCHASE_WIZARD || $details[0] == PRODUCT_SUBSCRIPTION || $details[0] == PRODUCT_CATALOGUE) && method_exists($details[count($details) - 1], 'is_available') && $details[count($details) - 1]->is_available($product, get_member())) {
             require_code('currency');
             $currency = get_option('currency');
             $price = currency_convert(floatval($details[1]), $currency, NULL, true);
             $description = $details[4];
             if (strpos($details[4], strpos($details[4], '.') === false ? preg_replace('#\\.00($|[^\\d])#', '', $price) : $price) === false) {
                 $description .= ' (' . $price . ')';
             }
             $list->attach(form_input_list_entry($product, false, protect_from_escaping($description)));
         }
     }
     if ($list->is_empty()) {
         inform_exit(do_lang_tempcode('NO_CATEGORIES'));
     }
     $fields = form_input_list(do_lang_tempcode('PRODUCT'), '', 'product', $list, NULL, true);
     return $this->wrap(do_template('PURCHASE_WIZARD_STAGE_CHOOSE', array('_GUID' => '47c22d48313ff50e6323f05a78342eae', 'FIELDS' => $fields, 'TITLE' => $title)), $title, $url, true);
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:47,代码来源:purchase.php

示例14: _import_wordpress

 /**
  * The actualiser to import wordpress blog
  *
  * @return tempcode		The UI
  */
 function _import_wordpress()
 {
     check_specific_permission('mass_import', NULL, NULL, 'cms_news');
     $title = get_page_title('IMPORT_WP_DB');
     require_code('rss');
     require_code('news');
     require_code('news2');
     $GLOBALS['LAX_COMCODE'] = true;
     require_code('uploads');
     is_swf_upload(true);
     $is_validated = post_param_integer('wp_auto_validate', 0);
     $to_own_account = post_param_integer('wp_add_to_own', 0);
     //Wordpress post xml file importing method
     if (get_param('method') == 'xml') {
         $rss_url = post_param('xml_url', NULL);
         if (array_key_exists('file_novalidate', $_FILES)) {
             if (is_swf_upload(true) && array_key_exists('file_novalidate', $_FILES) || array_key_exists('file_novalidate', $_FILES) && is_uploaded_file($_FILES['file_novalidate']['tmp_name'])) {
                 $rss_url = $_FILES['file_novalidate']['tmp_name'];
             } else {
                 warn_exit(do_lang_tempcode('IMPROPERLY_FILLED_IN'));
             }
         } else {
             warn_exit(do_lang_tempcode('IMPROPERLY_FILLED_IN'));
         }
         $rss = new rss($rss_url, true);
         if (!is_null($rss->error)) {
             warn_exit($rss->error);
         }
         $cat_id = NULL;
         $NEWS_CATS = $GLOBALS['SITE_DB']->query_select('news_categories', array('*'), array('nc_owner' => NULL));
         $NEWS_CATS = list_to_map('id', $NEWS_CATS);
         $extra_post_data = array();
         foreach ($rss->gleamed_items as $item) {
             if (!array_key_exists('category', $item)) {
                 $item['category'] = do_lang('NC_general');
             }
             $extra_post_data[] = $item;
             foreach ($NEWS_CATS as $_cat => $news_cat) {
                 if (get_translated_text($news_cat['nc_title']) == $item['category']) {
                     $cat_id = $_cat;
                 }
             }
             //Check for existing owner categories, if not create blog category for creator
             if ($to_own_account == 0) {
                 $creator = $item['author'];
                 $submitter_id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($creator);
             } else {
                 $submitter_id = get_member();
             }
             //if(is_null($submitter_id))	continue;	//Skip importing posts of nonexisting users
             $owner_category_id = $GLOBALS['SITE_DB']->query_value_null_ok('news_categories', 'id', array('nc_owner' => $submitter_id));
             if (is_null($cat_id)) {
                 $cat_id = add_news_category($item['category'], 'newscats/general', '', NULL);
                 $NEWS_CATS = $GLOBALS['SITE_DB']->query_select('news_categories', array('*'), array('nc_owner' => NULL));
                 $NEWS_CATS = list_to_map('id', $NEWS_CATS);
             }
             // Add news
             add_news($item['title'], html_to_comcode($item['news']), NULL, $is_validated, 1, 1, 1, '', array_key_exists('news_article', $item) ? html_to_comcode($item['news_article']) : '', $owner_category_id, array($cat_id), NULL, $submitter_id, 0, time(), NULL, '');
         }
         if (url_is_local($rss_url)) {
             // Means it is a temp file
             @unlink($rss_url);
         }
     } elseif (get_param('method') == 'db') {
         import_wordpress_db();
     }
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('MANAGE_BLOGS')), array('_SELF:_SELF:import_wordpress', do_lang_tempcode('IMPORT_WORDPRESS'))));
     breadcrumb_set_self(do_lang_tempcode('DONE'));
     return inform_screen($title, do_lang_tempcode('IMPORT_WORDPRESS_DONE'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:75,代码来源:cms_blogs.php

示例15: _clear

 /**
  * The actualiser to clear statistics.
  *
  * @return tempcode		The UI
  */
 function _clear()
 {
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/statistics_clear';
     // Let's clear out the saved graphs
     $handle = opendir(get_custom_file_base() . '/data_custom/modules/admin_stats/');
     if ($handle !== false) {
         while (false !== ($file = readdir($handle))) {
             if ($file != '.' && $file != '..' && $file != 'index.html' && $file != 'Thumbs.db' && $file != 'Thumbs.db:encryptable' && $file != '.htaccess' && $file != 'IP_Country.txt' && !is_dir($file)) {
                 $path = get_custom_file_base() . '/data_custom/modules/admin_stats/' . $file;
                 @unlink($path) or intelligent_write_error($path);
                 sync_file('data_custom/modules/admin_stats/' . $file);
             }
         }
         if (post_param('clear') == 'all') {
             // Clear ALL of the data stored stats in the db
             $GLOBALS['SITE_DB']->query_delete('hackattack');
             $GLOBALS['SITE_DB']->query_delete('failedlogins');
             $GLOBALS['SITE_DB']->query_delete('stats');
             $GLOBALS['SITE_DB']->query_delete('usersonline_track');
         }
     }
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('SITE_STATISTICS')), array('_SELF:_SELF:clear', do_lang_tempcode('CLEAR_STATISTICS'))));
     breadcrumb_set_self(do_lang_tempcode('DONE'));
     return inform_screen(get_page_title('CLEAR_STATISTICS'), do_lang_tempcode('SUCCESS'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:30,代码来源:admin_stats.php


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