本文整理汇总了PHP中qa_lang_html_sub函数的典型用法代码示例。如果您正苦于以下问题:PHP qa_lang_html_sub函数的具体用法?PHP qa_lang_html_sub怎么用?PHP qa_lang_html_sub使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qa_lang_html_sub函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: qa_category_nav_to_browse
function qa_category_nav_to_browse(&$navigation, $categories, $categoryid, $favoritemap)
{
foreach ($navigation as $key => $navlink) {
$category = $categories[$navlink['categoryid']];
if (!$category['childcount']) {
unset($navigation[$key]['url']);
} elseif ($navlink['selected']) {
$navigation[$key]['state'] = 'open';
$navigation[$key]['url'] = qa_path_html('categories/' . qa_category_path_request($categories, $category['parentid']));
} else {
$navigation[$key]['state'] = 'closed';
}
if (@$favoritemap[$navlink['categoryid']]) {
$navigation[$key]['favorited'] = true;
}
$navigation[$key]['note'] = '';
$navigation[$key]['note'] .= ' - <a href="' . qa_path_html('questions/' . implode('/', array_reverse(explode('/', $category['backpath'])))) . '">' . ($category['qcount'] == 1 ? qa_lang_html_sub('main/1_question', '1', '1') : qa_lang_html_sub('main/x_questions', qa_format_number($category['qcount'], 0, true))) . '</a>';
if (strlen($category['content'])) {
$navigation[$key]['note'] .= qa_html(' - ' . $category['content']);
}
if (isset($navlink['subnav'])) {
qa_category_nav_to_browse($navigation[$key]['subnav'], $categories, $categoryid, $favoritemap);
}
}
}
示例2: output_count
function output_count($themeobject, $value, $langsingular, $langplural)
{
if ($value == 1) {
$themeobject->output(qa_lang_html_sub($langsingular, '<B>1</B>', '1'));
} else {
$themeobject->output(qa_lang_html_sub($langplural, '<B>' . number_format($value) . '</B>'));
}
}
示例3: logged_in
function logged_in()
{
qa_html_theme_base::logged_in();
if (qa_is_logged_in()) {
$userpoints = qa_get_logged_in_points();
$pointshtml = $userpoints == 1 ? qa_lang_html_sub('main/1_point', '1', '1') : qa_lang_html_sub('main/x_points', qa_html(number_format($userpoints)));
$this->output('<SPAN CLASS="qa-logged-in-points">', '(' . $pointshtml . ')', '</SPAN>');
}
}
示例4: output_count
function output_count($themeobject, $value, $langsingular, $langplural)
{
$themeobject->output('<P CLASS="qa-activity-count-item">');
if ($value == 1) {
$themeobject->output(qa_lang_html_sub($langsingular, '<SPAN CLASS="qa-activity-count-data">1</SPAN>', '1'));
} else {
$themeobject->output(qa_lang_html_sub($langplural, '<SPAN CLASS="qa-activity-count-data">' . number_format((int) $value) . '</SPAN>'));
}
$themeobject->output('</P>');
}
示例5: output_count
public function output_count($themeobject, $value, $langsingular, $langplural)
{
$themeobject->output('<p class="qa-activity-count-item">');
if ($value == 1) {
$themeobject->output(qa_lang_html_sub($langsingular, '<span class="qa-activity-count-data">1</span>', '1'));
} else {
$themeobject->output(qa_lang_html_sub($langplural, '<span class="qa-activity-count-data">' . number_format((int) $value) . '</span>'));
}
$themeobject->output('</p>');
}
示例6: output_count
public function output_count($themeobject, $value, $langsingular, $langplural)
{
require_once QA_INCLUDE_DIR . 'app/format.php';
$themeobject->output('<p class="qa-activity-count-item">');
if ($value == 1) {
$themeobject->output(qa_lang_html_sub($langsingular, '<span class="qa-activity-count-data">1</span>', '1'));
} else {
$themeobject->output(qa_lang_html_sub($langplural, '<span class="qa-activity-count-data">' . qa_format_number((int) $value, 0, true) . '</span>'));
}
$themeobject->output('</p>');
}
示例7: logged_in
function logged_in()
{
if (qa_is_logged_in()) {
// output user avatar to login bar
$this->output('<div class="qa-logged-in-avatar">', QA_FINAL_EXTERNAL_USERS ? qa_get_external_avatar_html(qa_get_logged_in_userid(), 24, true) : qa_get_user_avatar_html(qa_get_logged_in_flags(), qa_get_logged_in_email(), qa_get_logged_in_handle(), qa_get_logged_in_user_field('avatarblobid'), qa_get_logged_in_user_field('avatarwidth'), qa_get_logged_in_user_field('avatarheight'), 24, true), '</div>');
}
qa_html_theme_base::logged_in();
if (qa_is_logged_in()) {
// adds points count after logged in username
$userpoints = qa_get_logged_in_points();
$pointshtml = $userpoints == 1 ? qa_lang_html_sub('main/1_point', '1', '1') : qa_lang_html_sub('main/x_points', qa_html(number_format($userpoints)));
$this->output('<span class="qa-logged-in-points">', '(' . $pointshtml . ')', '</span>');
}
}
示例8: head_title
function head_title()
{
if (qa_opt('buddypress_integration_enable') && qa_opt('buddypress_display_names') && $this->template == 'user' && @$this->content['title']) {
$rest = str_replace('^', '(\\S+)', qa_lang_html('profile/user_x'));
$handle = preg_replace('|' . $rest . '|', '$1', $this->content['title']);
$name = bp_core_get_user_displayname($handle);
if ($name) {
$this->content['title'] = qa_lang_html_sub('profile/user_x', $name) . ' (@' . $handle . ')';
if (isset($this->content['form_activity'])) {
$this->content['form_activity']['title'] = qa_lang_html_sub('profile/activity_by_x', $name);
}
}
}
qa_html_theme_base::head_title();
}
示例9: process_request
public function process_request($request)
{
$requestparts = explode('/', qa_request());
$slugs = array_slice($requestparts, 1);
$countslugs = count($slugs);
$userid = qa_get_logged_in_userid();
$start = qa_get_start();
$count = qa_opt_if_loaded('page_size_activity');
$totalcount = qa_opt('cache_qcount');
$qspec = qa_db_posts_basic_selectspec($userid, false);
qa_db_add_selectspec_opost($qspec, 'ra', false, false);
qa_db_add_selectspec_ousers($qspec, 'rau', 'raup');
$qspec['source'] .= " JOIN (SELECT questionid, childid FROM ^homepage ORDER BY ^homepage.updated DESC) AS rcaq ON ^posts.postid=rcaq.questionid" . " LEFT JOIN ^posts AS ra ON childid=ra.postid" . (QA_FINAL_EXTERNAL_USERS ? "" : " LEFT JOIN ^users AS rau ON ra.userid=rau.userid") . " LEFT JOIN ^userpoints AS raup ON ra.userid=raup.userid LIMIT #,#";
array_push($qspec['columns'], 'childid');
array_push($qspec['arguments'], $start, $count);
$qspec['sortdesc'] = 'otime';
$query = 'SELECT ';
foreach ($qspec['columns'] as $columnas => $columnfrom) {
$query .= $columnfrom . (is_int($columnas) ? '' : ' AS ' . $columnas) . ', ';
}
$query = qa_db_apply_sub(substr($query, 0, -2) . (strlen(@$qspec['source']) ? ' FROM ' . $qspec['source'] : ''), @$qspec['arguments']);
$results = qa_db_read_all_assoc(qa_db_query_raw($query));
qa_db_post_select($results, $qspec);
list($categories, $categoryid) = qa_db_select_with_pending(qa_db_category_nav_selectspec($slugs, false, false, true), $countslugs ? qa_db_slugs_to_category_id_selectspec($slugs) : null);
$questions = qa_any_sort_and_dedupe($results);
// $questions=qa_any_sort_and_dedupe(array_merge($recentquestions,$recentanswers));
$pagesize = qa_opt('page_size_home');
if ($countslugs) {
if (!isset($categoryid)) {
return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
}
$categorytitlehtml = qa_html($categories[$categoryid]['title']);
$sometitle = qa_lang_html_sub('main/recent_qs_as_in_x', $categorytitlehtml);
$nonetitle = qa_lang_html_sub('main/no_questions_in_x', $categorytitlehtml);
} else {
$sometitle = qa_lang_html('main/recent_qs_as_title');
$nonetitle = qa_lang_html('main/no_questions_found');
}
require_once QA_INCLUDE_DIR . 'qa-app-q-list.php';
$qa_content = qa_q_list_page_content($questions, $pagesize, $start, $totalcount, $sometitle, $nonetitle, $categories, $categoryid, true, qa_opt('eql_homepage_url'), qa_opt('feed_for_qa') ? qa_opt('eql_homepage_url') : null, count($questions) < $pagesize ? qa_html_suggest_ask($categoryid) : qa_html_suggest_qs_tags(qa_using_tags(), qa_category_path_request($categories, $categoryid)), null, null);
return $qa_content;
}
示例10: send_default_emails
function send_default_emails($event, $userid, $handle, $cookieid, $params)
{
switch ($event) {
case 'q_queue':
case 'q_requeue':
if (qa_opt('moderate_notify_admin')) {
qw_send_notification(null, qa_opt('feedback_email'), null, $event == 'q_requeue' ? qa_lang('emails/remoderate_subject') : qa_lang('emails/moderate_subject'), $event == 'q_requeue' ? nl2br(qa_lang('emails/remoderate_body')) : nl2br(qa_lang('emails/moderate_body')), array('^p_handle' => isset($handle) ? $handle : (strlen($params['name']) ? $params['name'] : (strlen(@$oldquestion['name']) ? $oldquestion['name'] : qa_lang('main/anonymous'))), '^p_context' => trim(@$params['title'] . "\n\n" . $params['text']), '^url' => qa_q_path($params['postid'], $params['title'], true), '^a_url' => qa_path_absolute('admin/moderate')));
}
break;
case 'a_queue':
case 'a_requeue':
if (qa_opt('moderate_notify_admin')) {
qw_send_notification(null, qa_opt('feedback_email'), null, $event == 'a_requeue' ? qa_lang('emails/remoderate_subject') : qa_lang('emails/moderate_subject'), $event == 'a_requeue' ? nl2br(qa_lang('emails/remoderate_body')) : nl2br(qa_lang('emails/moderate_body')), array('^p_handle' => isset($handle) ? $handle : (strlen($params['name']) ? $params['name'] : (strlen(@$oldanswer['name']) ? $oldanswer['name'] : qa_lang('main/anonymous'))), '^p_context' => $params['text'], '^url' => qa_q_path($params['parentid'], $params['parent']['title'], true, 'A', $params['postid']), '^a_url' => qa_path_absolute('admin/moderate')));
}
break;
case 'c_queue':
case 'c_requeue':
if (qa_opt('moderate_notify_admin')) {
qw_send_notification(null, qa_opt('feedback_email'), null, $event == 'c_requeue' ? qa_lang('emails/remoderate_subject') : qa_lang('emails/moderate_subject'), $event == 'c_requeue' ? nl2br(qa_lang('emails/remoderate_body')) : nl2br(qa_lang('emails/moderate_body')), array('^p_handle' => isset($handle) ? $handle : (strlen($params['name']) ? $params['name'] : (strlen(@$oldcomment['name']) ? $oldcomment['name'] : (strlen(@$oldanswer['name']) ? $oldanswer['name'] : qa_lang('main/anonymous')))), '^p_context' => $params['text'], '^url' => qa_q_path($params['questionid'], $params['question']['title'], true, 'C', $params['postid']), '^a_url' => qa_path_absolute('admin/moderate')));
}
break;
case 'q_flag':
case 'a_flag':
case 'c_flag':
$flagcount = $params['flagcount'];
$oldpost = $params['oldpost'];
$notifycount = $flagcount - qa_opt('flagging_notify_first');
if ($notifycount >= 0 && $notifycount % qa_opt('flagging_notify_every') == 0) {
qw_send_notification(null, qa_opt('feedback_email'), null, qa_lang('emails/flagged_subject'), nl2br(qa_lang('emails/flagged_body')), array('^p_handle' => isset($oldpost['handle']) ? $oldpost['handle'] : (strlen($oldpost['name']) ? $oldpost['name'] : qa_lang('main/anonymous')), '^flags' => $flagcount == 1 ? qa_lang_html_sub('main/1_flag', '1', '1') : qa_lang_html_sub('main/x_flags', $flagcount), '^p_context' => trim(@$oldpost['title'] . "\n\n" . qa_viewer_text($oldpost['content'], $oldpost['format'])), '^url' => qa_q_path($params['questionid'], $params['question']['title'], true, $oldpost['basetype'], $oldpost['postid']), '^a_url' => qa_path_absolute('admin/flagged')));
}
break;
case 'u_register':
if (qa_opt('register_notify_admin')) {
qw_send_notification(null, qa_opt('feedback_email'), null, qa_lang('emails/u_registered_subject'), qa_opt('moderate_users') ? nl2br(qa_lang('emails/u_to_approve_body')) : nl2br(qa_lang('emails/u_registered_body')), array('^u_handle' => $handle, '^url' => qa_path_absolute('user/' . $handle), '^a_url' => qa_path_absolute('admin/approve')));
}
break;
}
}
示例11: process_request
function process_request($request)
{
$parts = explode('/', $request);
$tag = $parts[1];
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html_sub('useo/edit_desc_for_x', qa_html($tag));
if (qa_user_permit_error('useo_tag_desc_permit_edit')) {
$qa_content['error'] = qa_lang_html('users/no_permission');
return $qa_content;
}
require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
if (qa_clicked('dosave')) {
require_once QA_INCLUDE_DIR . 'qa-util-string.php';
$taglc = qa_strtolower($tag);
qa_db_tagmeta_set($taglc, 'title', qa_post_text('tagtitle'));
qa_db_tagmeta_set($taglc, 'description', qa_post_text('tagdesc'));
qa_db_tagmeta_set($taglc, 'icon', qa_post_text('tagicon'));
qa_redirect('tag/' . $tag);
}
$qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'tall', 'fields' => array(array('label' => 'Title:', 'type' => 'text', 'rows' => 2, 'tags' => 'NAME="tagtitle" ID="tagtitle"', 'value' => qa_html(qa_db_tagmeta_get($tag, 'title'))), array('label' => 'Description:', 'type' => 'text', 'rows' => 4, 'tags' => 'NAME="tagdesc" ID="tagdesc"', 'value' => qa_html(qa_db_tagmeta_get($tag, 'description'))), array('label' => 'Icon image:', 'type' => 'text', 'rows' => 1, 'tags' => 'NAME="tagicon" ID="tagicon"', 'value' => qa_html(qa_db_tagmeta_get($tag, 'icon')))), 'buttons' => array(array('tags' => 'NAME="dosave"', 'label' => qa_lang_html('useo/save_desc_button'))));
$qa_content['focusid'] = 'tagdesc';
return $qa_content;
}
示例12: process_request
function process_request($request)
{
$parts = explode('/', $request);
$categoryid = $parts[1];
$fullcategory = qa_db_select_with_pending(qa_db_full_category_selectspec($categoryid, true));
$slugs = explode('/', $fullcategory['backpath']);
$new_request = implode('/', array_reverse($slugs));
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html_sub('useo/edit_desc_for_x', qa_html($fullcategory['title']));
if (qa_user_permit_error('useo_cat_desc_permit_edit')) {
$qa_content['error'] = qa_lang_html('users/no_permission');
return $qa_content;
}
require_once QA_INCLUDE_DIR . 'qa-db-metas.php';
if (qa_clicked('dosave')) {
require_once QA_INCLUDE_DIR . 'qa-util-string.php';
qa_db_categorymeta_set($categoryid, 'useo_cat_title', qa_post_text('useo_cat_title'));
qa_db_categorymeta_set($categoryid, 'useo_cat_description', qa_post_text('useo_cat_description'));
qa_redirect($new_request);
}
$qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'tall', 'fields' => array(array('label' => 'Link Title:', 'type' => 'text', 'rows' => 2, 'tags' => 'NAME="useo_cat_title" ID="useo_cat_title"', 'value' => qa_html(qa_db_categorymeta_get($categoryid, 'useo_cat_title'))), array('label' => 'Description:', 'type' => 'text', 'rows' => 4, 'tags' => 'NAME="useo_cat_description" ID="useo_cat_description"', 'value' => qa_html(qa_db_categorymeta_get($categoryid, 'useo_cat_description')))), 'buttons' => array(array('tags' => 'NAME="dosave"', 'label' => qa_lang_html('useo/save_desc_button'))));
$qa_content['focusid'] = 'tagtitle';
return $qa_content;
}
示例13: qa_page_q_add_a_submit
$answerid = qa_page_q_add_a_submit($question, $answers, $usecaptcha, $in, $errors);
$countanswers = $question['acount'] + 1;
if (isset($answerid)) {
// If successful, page content will be updated via Ajax
$answer = qa_db_select_with_pending(qa_db_full_post_selectspec($userid, $answerid));
$question = $question + qa_page_q_post_rules($question, null, null, $childposts);
// array union
$answer = $answer + qa_page_q_post_rules($answer, $question, $answers, null);
$usershtml = qa_userids_handles_html(array($answer), true);
$a_view = qa_page_q_answer_view($question, $answer, false, $usershtml, false);
$themeclass = qa_load_theme_class(qa_get_site_theme(), 'ajax-answer', null, null);
echo "QA_AJAX_RESPONSE\n1\n";
// Send back whether the 'answer' button should still be visible
echo (int) qa_opt('allow_multi_answers') . "\n";
// Send back the count of answers
if ($countanswers == 1) {
echo qa_lang_html('question/1_answer_title') . "\n";
} else {
echo qa_lang_html_sub('question/x_answers_title', $countanswers) . "\n";
}
// Send back the HTML
$themeclass->a_list_item($a_view);
return;
}
}
}
echo "QA_AJAX_RESPONSE\n0\n";
// fall back to non-Ajax submission if there were any problems
/*
Omit PHP closing tag to help avoid accidental output
*/
示例14: qa_default_option
function qa_default_option($name)
{
if (qa_to_override(__FUNCTION__)) {
$args = func_get_args();
return qa_call_override(__FUNCTION__, $args);
}
$fixed_defaults = array('allow_change_usernames' => 1, 'allow_close_questions' => 1, 'allow_multi_answers' => 1, 'allow_private_messages' => 1, 'allow_self_answer' => 1, 'allow_view_q_bots' => 1, 'avatar_allow_gravatar' => 1, 'avatar_allow_upload' => 1, 'avatar_profile_size' => 200, 'avatar_q_list_size' => 0, 'avatar_q_page_a_size' => 40, 'avatar_q_page_c_size' => 20, 'avatar_q_page_q_size' => 50, 'avatar_store_size' => 400, 'avatar_users_size' => 30, 'captcha_on_anon_post' => 1, 'captcha_on_feedback' => 1, 'captcha_on_register' => 1, 'captcha_on_reset_password' => 1, 'captcha_on_unconfirmed' => 0, 'columns_tags' => 3, 'columns_users' => 2, 'comment_on_as' => 1, 'comment_on_qs' => 0, 'confirm_user_emails' => 1, 'do_ask_check_qs' => 0, 'do_complete_tags' => 1, 'do_count_q_views' => 1, 'do_example_tags' => 1, 'feed_for_activity' => 1, 'feed_for_qa' => 1, 'feed_for_questions' => 1, 'feed_for_unanswered' => 1, 'feed_full_text' => 1, 'feed_number_items' => 50, 'feed_per_category' => 1, 'feedback_enabled' => 1, 'flagging_hide_after' => 5, 'flagging_notify_every' => 2, 'flagging_notify_first' => 1, 'flagging_of_posts' => 1, 'follow_on_as' => 1, 'hot_weight_a_age' => 100, 'hot_weight_answers' => 100, 'hot_weight_q_age' => 100, 'hot_weight_views' => 100, 'hot_weight_votes' => 100, 'mailing_per_minute' => 500, 'match_ask_check_qs' => 3, 'match_example_tags' => 3, 'match_related_qs' => 3, 'max_copy_user_updates' => 10, 'max_len_q_title' => 120, 'max_num_q_tags' => 5, 'max_rate_ip_as' => 50, 'max_rate_ip_cs' => 40, 'max_rate_ip_flags' => 10, 'max_rate_ip_logins' => 20, 'max_rate_ip_messages' => 10, 'max_rate_ip_qs' => 20, 'max_rate_ip_registers' => 5, 'max_rate_ip_uploads' => 20, 'max_rate_ip_votes' => 600, 'max_rate_user_as' => 25, 'max_rate_user_cs' => 20, 'max_rate_user_flags' => 5, 'max_rate_user_messages' => 5, 'max_rate_user_qs' => 10, 'max_rate_user_uploads' => 10, 'max_rate_user_votes' => 300, 'max_store_user_updates' => 50, 'min_len_a_content' => 12, 'min_len_c_content' => 12, 'min_len_q_content' => 0, 'min_len_q_title' => 12, 'min_num_q_tags' => 0, 'moderate_notify_admin' => 1, 'moderate_points_limit' => 150, 'nav_ask' => 1, 'nav_qa_not_home' => 1, 'nav_questions' => 1, 'nav_tags' => 1, 'nav_unanswered' => 1, 'nav_users' => 1, 'neat_urls' => QA_URL_FORMAT_SAFEST, 'notify_users_default' => 1, 'page_size_activity' => 20, 'page_size_ask_check_qs' => 5, 'page_size_ask_tags' => 5, 'page_size_home' => 20, 'page_size_hot_qs' => 20, 'page_size_q_as' => 10, 'page_size_qs' => 20, 'page_size_related_qs' => 5, 'page_size_search' => 10, 'page_size_tag_qs' => 20, 'page_size_tags' => 30, 'page_size_una_qs' => 20, 'page_size_user_posts' => 20, 'page_size_users' => 20, 'pages_prev_next' => 3, 'permit_anon_view_ips' => QA_PERMIT_EDITORS, 'permit_close_q' => QA_PERMIT_EDITORS, 'permit_delete_hidden' => QA_PERMIT_MODERATORS, 'permit_edit_a' => QA_PERMIT_EXPERTS, 'permit_edit_c' => QA_PERMIT_EDITORS, 'permit_edit_q' => QA_PERMIT_EDITORS, 'permit_flag' => QA_PERMIT_CONFIRMED, 'permit_hide_show' => QA_PERMIT_EDITORS, 'permit_moderate' => QA_PERMIT_EXPERTS, 'permit_select_a' => QA_PERMIT_EXPERTS, 'permit_view_q_page' => QA_PERMIT_ALL, 'permit_vote_a' => QA_PERMIT_USERS, 'permit_vote_down' => QA_PERMIT_USERS, 'permit_vote_q' => QA_PERMIT_USERS, 'points_a_selected' => 30, 'points_a_voted_max_gain' => 20, 'points_a_voted_max_loss' => 5, 'points_base' => 100, 'points_multiple' => 10, 'points_post_a' => 4, 'points_post_q' => 2, 'points_q_voted_max_gain' => 10, 'points_q_voted_max_loss' => 3, 'points_select_a' => 3, 'q_urls_title_length' => 50, 'show_a_c_links' => 1, 'show_a_form_immediate' => 'if_no_as', 'show_c_reply_buttons' => 1, 'show_custom_welcome' => 1, 'show_fewer_cs_count' => 5, 'show_fewer_cs_from' => 10, 'show_full_date_days' => 7, 'show_message_history' => 1, 'show_selected_first' => 1, 'show_url_links' => 1, 'show_user_points' => 1, 'show_user_titles' => 1, 'show_when_created' => 1, 'site_theme' => 'Snow', 'smtp_port' => 25, 'sort_answers_by' => 'created', 'tags_or_categories' => 'tc', 'voting_on_as' => 1, 'voting_on_qs' => 1);
if (isset($fixed_defaults[$name])) {
$value = $fixed_defaults[$name];
} else {
switch ($name) {
case 'site_url':
$value = 'http://' . @$_SERVER['HTTP_HOST'] . strtr(dirname($_SERVER['SCRIPT_NAME']), '\\', '/') . '/';
break;
case 'site_title':
$value = qa_default_site_title();
break;
case 'site_theme_mobile':
$value = qa_opt('site_theme');
break;
case 'from_email':
// heuristic to remove short prefix (e.g. www. or qa.)
$parts = explode('.', @$_SERVER['HTTP_HOST']);
if (count($parts) > 2 && strlen($parts[0]) < 5 && !is_numeric($parts[0])) {
unset($parts[0]);
}
$value = 'no-reply@' . (count($parts) > 1 ? implode('.', $parts) : 'example.com');
break;
case 'email_privacy':
$value = qa_lang_html('options/default_privacy');
break;
case 'show_custom_sidebar':
$value = strlen(qa_opt('custom_sidebar')) ? true : false;
break;
case 'show_custom_header':
$value = strlen(qa_opt('custom_header')) ? true : false;
break;
case 'show_custom_footer':
$value = strlen(qa_opt('custom_footer')) ? true : false;
break;
case 'show_custom_in_head':
$value = strlen(qa_opt('custom_in_head')) ? true : false;
break;
case 'custom_sidebar':
$value = qa_lang_html_sub('options/default_sidebar', qa_html(qa_opt('site_title')));
break;
case 'editor_for_qs':
case 'editor_for_as':
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
$value = '-';
// to match none by default, i.e. choose based on who is best at editing HTML
qa_load_editor('', 'html', $value);
break;
case 'permit_post_q':
// convert from deprecated option if available
$value = qa_opt('ask_needs_login') ? QA_PERMIT_USERS : QA_PERMIT_ALL;
break;
case 'permit_post_a':
// convert from deprecated option if available
$value = qa_opt('answer_needs_login') ? QA_PERMIT_USERS : QA_PERMIT_ALL;
break;
case 'permit_post_c':
// convert from deprecated option if available
$value = qa_opt('comment_needs_login') ? QA_PERMIT_USERS : QA_PERMIT_ALL;
break;
case 'permit_retag_cat':
// convert from previous option that used to contain it too
$value = qa_opt('permit_edit_q');
break;
case 'points_vote_up_q':
case 'points_vote_down_q':
$oldvalue = qa_opt('points_vote_on_q');
$value = is_numeric($oldvalue) ? $oldvalue : 1;
break;
case 'points_vote_up_a':
case 'points_vote_down_a':
$oldvalue = qa_opt('points_vote_on_a');
$value = is_numeric($oldvalue) ? $oldvalue : 1;
break;
case 'points_per_q_voted_up':
case 'points_per_q_voted_down':
$oldvalue = qa_opt('points_per_q_voted');
$value = is_numeric($oldvalue) ? $oldvalue : 1;
break;
case 'points_per_a_voted_up':
case 'points_per_a_voted_down':
$oldvalue = qa_opt('points_per_a_voted');
$value = is_numeric($oldvalue) ? $oldvalue : 2;
break;
case 'captcha_module':
$captchamodules = qa_list_modules('captcha');
if (count($captchamodules)) {
$value = reset($captchamodules);
} else {
$value = '';
}
break;
case 'mailing_from_name':
$value = qa_opt('site_title');
break;
//.........这里部分代码省略.........
示例15: qa_html
if (qa_opt('show_home_description')) {
$qa_content['description'] = qa_html(qa_opt('home_description'));
}
$qa_content['custom'] = qa_opt('custom_home_content');
return $qa_content;
}
// If we got this far, it's a good old-fashioned Q&A listing page
require_once QA_INCLUDE_DIR . 'app/q-list.php';
qa_set_template('qa');
$questions = qa_any_sort_and_dedupe(array_merge($questions1, $questions2));
$pagesize = qa_opt('page_size_home');
if ($countslugs) {
if (!isset($categoryid)) {
return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
}
$categorytitlehtml = qa_html($categories[$categoryid]['title']);
$sometitle = qa_lang_html_sub('main/recent_qs_as_in_x', $categorytitlehtml);
$nonetitle = qa_lang_html_sub('main/no_questions_in_x', $categorytitlehtml);
} else {
$sometitle = qa_lang_html('main/recent_qs_as_title');
$nonetitle = qa_lang_html('main/no_questions_found');
}
// Prepare and return content for theme for Q&A listing page
$qa_content = qa_q_list_page_content($questions, $pagesize, 0, null, $sometitle, $nonetitle, $categories, $categoryid, true, $explicitqa ? 'qa/' : '', qa_opt('feed_for_qa') ? 'qa' : null, count($questions) < $pagesize ? qa_html_suggest_ask($categoryid) : qa_html_suggest_qs_tags(qa_using_tags(), qa_category_path_request($categories, $categoryid)), null, null);
if (!$explicitqa && !$countslugs && qa_opt('show_home_description')) {
$qa_content['description'] = qa_html(qa_opt('home_description'));
}
return $qa_content;
/*
Omit PHP closing tag to help avoid accidental output
*/