本文整理匯總了PHP中qa_get_form_security_code函數的典型用法代碼示例。如果您正苦於以下問題:PHP qa_get_form_security_code函數的具體用法?PHP qa_get_form_security_code怎麽用?PHP qa_get_form_security_code使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了qa_get_form_security_code函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: it_q_list_page_content
function it_q_list_page_content($questions, $pagesize, $start, $count, $sometitle, $nonetitle, $navcategories, $categoryid, $categoryqcount, $categorypathprefix, $feedpathprefix, $suggest, $pagelinkparams = null, $categoryparams = null, $dummy = null)
{
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
require_once QA_INCLUDE_DIR . 'qa-app-updates.php';
$userid = qa_get_logged_in_userid();
// Chop down to size, get user information for display
if (isset($pagesize)) {
$questions = array_slice($questions, 0, $pagesize);
}
$usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));
$qa_content['q_list']['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'hidden' => array('code' => qa_get_form_security_code('vote')));
$qa_content['q_list']['qs'] = array();
if (count($questions)) {
$qa_content['title'] = $sometitle;
$defaults = qa_post_html_defaults('Q');
foreach ($questions as $question) {
$qa_content['q_list']['qs'][] = qa_any_to_q_html_fields($question, $userid, it_cookie_get(), $usershtml, null, qa_post_html_options($question, $defaults));
}
} else {
$qa_content['title'] = $nonetitle;
}
if (isset($count) && isset($pagesize)) {
$qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $count, qa_opt('pages_prev_next'), $pagelinkparams);
}
return $qa_content;
}
示例2: qa_q_list_page_content
function qa_q_list_page_content($questions, $pagesize, $start, $count, $sometitle, $nonetitle, $navcategories, $categoryid, $categoryqcount, $categorypathprefix, $feedpathprefix, $suggest, $pagelinkparams = null, $categoryparams = null, $dummy = null)
{
if (qa_to_override(__FUNCTION__)) {
$args = func_get_args();
return qa_call_override(__FUNCTION__, $args);
}
require_once QA_INCLUDE_DIR . 'app/format.php';
require_once QA_INCLUDE_DIR . 'app/updates.php';
$userid = qa_get_logged_in_userid();
// Chop down to size, get user information for display
if (isset($pagesize)) {
$questions = array_slice($questions, 0, $pagesize);
}
$usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));
// Prepare content for theme
$qa_content = qa_content_prepare(true, array_keys(qa_category_path($navcategories, $categoryid)));
$qa_content['q_list']['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'hidden' => array('code' => qa_get_form_security_code('vote')));
$qa_content['q_list']['qs'] = array();
if (count($questions)) {
$qa_content['title'] = $sometitle;
$defaults = qa_post_html_defaults('Q');
if (isset($categorypathprefix)) {
$defaults['categorypathprefix'] = $categorypathprefix;
}
foreach ($questions as $question) {
$fields = qa_any_to_q_html_fields($question, $userid, qa_cookie_get(), $usershtml, null, qa_post_html_options($question, $defaults));
if (!empty($fields['raw']['closedbyid'])) {
$fields['closed'] = array('state' => qa_lang_html('main/closed'));
}
$qa_content['q_list']['qs'][] = $fields;
}
} else {
$qa_content['title'] = $nonetitle;
}
if (isset($userid) && isset($categoryid)) {
$favoritemap = qa_get_favorite_non_qs_map();
$categoryisfavorite = @$favoritemap['category'][$navcategories[$categoryid]['backpath']];
$qa_content['favorite'] = qa_favorite_form(QA_ENTITY_CATEGORY, $categoryid, $categoryisfavorite, qa_lang_sub($categoryisfavorite ? 'main/remove_x_favorites' : 'main/add_category_x_favorites', $navcategories[$categoryid]['title']));
}
if (isset($count) && isset($pagesize)) {
$qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $count, qa_opt('pages_prev_next'), $pagelinkparams);
}
if (empty($qa_content['page_links'])) {
$qa_content['suggest_next'] = $suggest;
}
if (qa_using_categories() && count($navcategories) && isset($categorypathprefix)) {
$qa_content['navigation']['cat'] = qa_category_navigation($navcategories, $categoryid, $categorypathprefix, $categoryqcount, $categoryparams);
}
if (isset($feedpathprefix) && (qa_opt('feed_per_category') || !isset($categoryid))) {
$qa_content['feed'] = array('url' => qa_path_html(qa_feed_request($feedpathprefix . (isset($categoryid) ? '/' . qa_category_path_request($navcategories, $categoryid) : ''))), 'label' => strip_tags($sometitle));
}
return $qa_content;
}
示例3: nav_user_search
function nav_user_search()
{
if (!qa_is_logged_in()) {
$login = @$this->content['navigation']['user']['login'];
if (isset($login) && !QA_FINAL_EXTERNAL_USERS) {
$this->output('<!--[Begin: login form]-->', '<form id="qa-loginform" action="' . $login['url'] . '" method="post">', '<input type="text" id="qa-userid" name="emailhandle" placeholder="' . trim(qa_lang_html(qa_opt('allow_login_email_only') ? 'users/email_label' : 'users/email_handle_label'), ':') . '" />', '<input type="password" id="qa-password" name="password" placeholder="' . trim(qa_lang_html('users/password_label'), ':') . '" />', '<div id="qa-rememberbox"><input type="checkbox" name="remember" id="qa-rememberme" value="1"/>', '<label for="qa-rememberme" id="qa-remember">' . qa_lang_html('users/remember') . '</label></div>', '<input type="hidden" name="code" value="' . qa_html(qa_get_form_security_code('login')) . '"/>', '<input type="submit" value="' . $login['label'] . '" id="qa-login" name="dologin" />', '</form>', '<!--[End: login form]-->');
unset($this->content['navigation']['user']['login']);
// removes regular navigation link to log in page
}
}
qa_html_theme_base::nav_user_search();
}
示例4: nav_user_search
public function nav_user_search()
{
if (!qa_is_logged_in()) {
if (isset($this->content['navigation']['user']['login']) && !QA_FINAL_EXTERNAL_USERS) {
$login = $this->content['navigation']['user']['login'];
$this->output('<form class="qam-login-form" action="' . $login['url'] . '" method="post">', '<input type="text" class="qam-login-text" name="emailhandle" dir="auto" placeholder="' . trim(qa_lang_html(qa_opt('allow_login_email_only') ? 'users/email_label' : 'users/email_handle_label'), ':') . '"/>', '<input type="password" class="qam-login-text" name="password" dir="auto" placeholder="' . trim(qa_lang_html('users/password_label'), ':') . '"/>', '<div class="qam-rememberbox"><input type="checkbox" name="remember" id="qam-rememberme" value="1"/>', '<label for="qam-rememberme" class="qam-remember">' . qa_lang_html('users/remember') . '</label></div>', '<input type="hidden" name="code" value="' . qa_html(qa_get_form_security_code('login')) . '"/>', '<input type="submit" value="' . qa_lang_html('users/login_button') . '" class="qa-form-tall-button qa-form-tall-button-login" name="dologin"/>', '</form>');
// remove regular navigation link to log in page
unset($this->content['navigation']['user']['login']);
}
}
qa_html_theme_base::nav_user_search();
}
示例5: qa_favorite_q_list_view
function qa_favorite_q_list_view($questions, $usershtml)
{
$q_list = array('qs' => array());
if (count($questions) === 0) {
return $q_list;
}
$q_list['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'hidden' => array('code' => qa_get_form_security_code('vote')));
$defaults = qa_post_html_defaults('Q');
foreach ($questions as $question) {
$q_list['qs'][] = qa_post_html_fields($question, qa_get_logged_in_userid(), qa_cookie_get(), $usershtml, null, qa_post_html_options($question, $defaults));
}
return $q_list;
}
示例6: admin_form
public function admin_form(&$qa_content)
{
$saved = false;
$error = false;
if (qa_clicked(self::RESET_BTN)) {
if (qa_check_form_security_code('donut/admin_options', qa_post_text('code'))) {
if (donut_reset_all_options()) {
$saved = true;
qa_opt('donut_defaults_set_ok', 1);
}
} else {
$error = qa_lang_html('admin/form_security_expired');
}
}
$form = array('ok' => $saved ? donut_lang('options_reset') : null, 'fields' => array('simple_note' => array('type' => 'static', 'label' => donut_lang('admin_notes'), 'error' => $error)), 'buttons' => array(array('label' => qa_lang_html('admin/reset_options_button'), 'tags' => 'NAME="' . self::RESET_BTN . '"')), 'hidden' => array('code' => qa_get_form_security_code('donut/admin_options')));
return $form;
}
示例7: output_widget
public function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
{
require_once QA_INCLUDE_DIR . 'db/selects.php';
if (!isset($qa_content['q_view']['raw']['type']) || $qa_content['q_view']['raw']['type'] != 'Q') {
// question might not be visible, etc...
return;
}
$questionid = $qa_content['q_view']['raw']['postid'];
$userid = qa_get_logged_in_userid();
$cookieid = qa_cookie_get();
$questions = qa_db_single_select(qa_db_related_qs_selectspec($userid, $questionid, qa_opt('page_size_related_qs')));
$minscore = qa_match_to_min_score(qa_opt('match_related_qs'));
foreach ($questions as $key => $question) {
if ($question['score'] < $minscore) {
unset($questions[$key]);
}
}
$titlehtml = qa_lang_html(count($questions) ? 'main/related_qs_title' : 'main/no_related_qs_title');
if ($region == 'side') {
$themeobject->output('<div class="qa-related-qs">', '<h2 style="margin-top:0; padding-top:0;">', $titlehtml, '</h2>');
$themeobject->output('<ul class="qa-related-q-list">');
foreach ($questions as $question) {
$themeobject->output('<li class="qa-related-q-item">' . '<a href="' . qa_q_path_html($question['postid'], $question['title']) . '">' . qa_html($question['title']) . '</a>' . '</li>');
}
$themeobject->output('</ul>', '</div>');
} else {
$themeobject->output('<h2>', $titlehtml, '</h2>');
$q_list = array('form' => array('tags' => 'method="post" action="' . qa_self_html() . '"', 'hidden' => array('code' => qa_get_form_security_code('vote'))), 'qs' => array());
$defaults = qa_post_html_defaults('Q');
$usershtml = qa_userids_handles_html($questions);
foreach ($questions as $question) {
$q_list['qs'][] = qa_post_html_fields($question, $userid, $cookieid, $usershtml, null, qa_post_html_options($question, $defaults));
}
$themeobject->q_list_and_form($q_list);
}
}
示例8: qa_post_text
$inmessage = qa_post_text('message');
if (!strlen($inmessage)) {
$errors['message'] = qa_lang('profile/post_wall_empty');
} elseif (!qa_check_form_security_code('wall-' . $useraccount['handle'], qa_post_text('code'))) {
$errors['message'] = qa_lang_html('misc/form_security_again');
} elseif (!$wallposterrorhtml) {
qa_wall_add_post($loginuserid, qa_get_logged_in_handle(), qa_cookie_get(), $useraccount['userid'], $useraccount['handle'], $inmessage, '');
qa_redirect(qa_request());
}
}
// Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html_sub('profile/wall_for_x', $userhtml);
$qa_content['error'] = @$errors['page'];
$qa_content['script_rel'][] = 'qa-content/qa-user.js?' . QA_VERSION;
$qa_content['message_list'] = array('tags' => 'id="wallmessages"', 'form' => array('tags' => 'name="wallpost" method="post" action="' . qa_self_html() . '"', 'style' => 'tall', 'hidden' => array('qa_click' => '', 'handle' => qa_html($useraccount['handle']), 'start' => qa_html($start), 'code' => qa_get_form_security_code('wall-' . $useraccount['handle']))), 'messages' => array());
if ($start == 0) {
// only allow posting on first page
if ($wallposterrorhtml) {
$qa_content['message_list']['error'] = $wallposterrorhtml;
} else {
$qa_content['message_list']['form']['fields'] = array('message' => array('tags' => 'name="message" id="message"', 'value' => qa_html(@$inmessage, false), 'rows' => 2, 'error' => qa_html(@$errors['message'])));
$qa_content['message_list']['form']['buttons'] = array('post' => array('tags' => 'name="dowallpost" onclick="return qa_submit_wall_post(this, false);"', 'label' => qa_lang_html('profile/post_wall_button')));
}
}
foreach ($usermessages as $message) {
$qa_content['message_list']['messages'][] = qa_wall_post_view($message);
}
$qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $count, qa_opt('pages_prev_next'));
// Sub menu for navigation in user pages
$ismyuser = isset($loginuserid) && $loginuserid == (QA_FINAL_EXTERNAL_USERS ? $userid : $useraccount['userid']);
示例9: qa_content_prepare
// Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('admin/admin_title') . ' - ' . qa_lang_html('admin/stats_title');
$qa_content['error'] = qa_admin_page_error();
$qa_content['form'] = array('style' => 'wide', 'fields' => array('q2a_version' => array('label' => qa_lang_html('admin/q2a_version'), 'value' => qa_html(QA_VERSION)), 'q2a_date' => array('label' => qa_lang_html('admin/q2a_build_date'), 'value' => qa_html(QA_BUILD_DATE)), 'q2a_latest' => array('label' => qa_lang_html('admin/q2a_latest_version'), 'type' => 'custom', 'html' => '<iframe src="http://www.question2answer.org/question2answer-latest.php?version=' . urlencode(QA_VERSION) . '&language=' . urlencode(qa_opt('site_language')) . '" width="100" height="16" style="vertical-align:middle; border:0; background:transparent;" allowTransparency="true" scrolling="no" frameborder="0"></iframe>'), 'break0' => array('type' => 'blank'), 'db_version' => array('label' => qa_lang_html('admin/q2a_db_version'), 'value' => qa_html(qa_opt('db_version'))), 'db_size' => array('label' => qa_lang_html('admin/q2a_db_size'), 'value' => qa_html(number_format(qa_db_table_size() / 1048576, 1) . ' MB')), 'break1' => array('type' => 'blank'), 'php_version' => array('label' => qa_lang_html('admin/php_version'), 'value' => qa_html(phpversion())), 'mysql_version' => array('label' => qa_lang_html('admin/mysql_version'), 'value' => qa_html(qa_db_mysql_version())), 'break2' => array('type' => 'blank'), 'qcount' => array('label' => qa_lang_html('admin/total_qs'), 'value' => qa_html(number_format($qcount))), 'qcount_users' => array('label' => qa_lang_html('admin/from_users'), 'value' => qa_html(number_format($qcount - $qcount_anon))), 'qcount_anon' => array('label' => qa_lang_html('admin/from_anon'), 'value' => qa_html(number_format($qcount_anon))), 'break3' => array('type' => 'blank'), 'acount' => array('label' => qa_lang_html('admin/total_as'), 'value' => qa_html(number_format($acount))), 'acount_users' => array('label' => qa_lang_html('admin/from_users'), 'value' => qa_html(number_format($acount - $acount_anon))), 'acount_anon' => array('label' => qa_lang_html('admin/from_anon'), 'value' => qa_html(number_format($acount_anon))), 'break4' => array('type' => 'blank'), 'ccount' => array('label' => qa_lang_html('admin/total_cs'), 'value' => qa_html(number_format($ccount))), 'ccount_users' => array('label' => qa_lang_html('admin/from_users'), 'value' => qa_html(number_format($ccount - $ccount_anon))), 'ccount_anon' => array('label' => qa_lang_html('admin/from_anon'), 'value' => qa_html(number_format($ccount_anon))), 'break5' => array('type' => 'blank'), 'users' => array('label' => qa_lang_html('admin/users_registered'), 'value' => QA_FINAL_EXTERNAL_USERS ? '' : qa_html(number_format(qa_db_count_users()))), 'users_active' => array('label' => qa_lang_html('admin/users_active'), 'value' => qa_html(number_format((int) qa_opt('cache_userpointscount')))), 'users_posted' => array('label' => qa_lang_html('admin/users_posted'), 'value' => qa_html(number_format(qa_db_count_active_users('posts')))), 'users_voted' => array('label' => qa_lang_html('admin/users_voted'), 'value' => qa_html(number_format(qa_db_count_active_users('uservotes'))))));
if (QA_FINAL_EXTERNAL_USERS) {
unset($qa_content['form']['fields']['users']);
} else {
unset($qa_content['form']['fields']['users_active']);
}
foreach ($qa_content['form']['fields'] as $index => $field) {
if (empty($field['type'])) {
$qa_content['form']['fields'][$index]['type'] = 'static';
}
}
$qa_content['form_2'] = array('tags' => 'method="post" action="' . qa_path_html('admin/recalc') . '"', 'title' => qa_lang_html('admin/database_cleanup'), 'style' => 'basic', 'buttons' => array('recount_posts' => array('label' => qa_lang_html('admin/recount_posts'), 'tags' => 'name="dorecountposts" onclick="return qa_recalc_click(this.name, this, ' . qa_js(qa_lang_html('admin/recount_posts_stop')) . ', \'recount_posts_note\');"', 'note' => '<span id="recount_posts_note">' . qa_lang_html('admin/recount_posts_note') . '</span>'), 'reindex_content' => array('label' => qa_lang_html('admin/reindex_content'), 'tags' => 'name="doreindexcontent" onclick="return qa_recalc_click(this.name, this, ' . qa_js(qa_lang_html('admin/reindex_content_stop')) . ', \'reindex_content_note\');"', 'note' => '<span id="reindex_content_note">' . qa_lang_html('admin/reindex_content_note') . '</span>'), 'recalc_points' => array('label' => qa_lang_html('admin/recalc_points'), 'tags' => 'name="dorecalcpoints" onclick="return qa_recalc_click(this.name, this, ' . qa_js(qa_lang_html('admin/recalc_stop')) . ', \'recalc_points_note\');"', 'note' => '<span id="recalc_points_note">' . qa_lang_html('admin/recalc_points_note') . '</span>'), 'refill_events' => array('label' => qa_lang_html('admin/refill_events'), 'tags' => 'name="dorefillevents" onclick="return qa_recalc_click(this.name, this, ' . qa_js(qa_lang_html('admin/recalc_stop')) . ', \'refill_events_note\');"', 'note' => '<span id="refill_events_note">' . qa_lang_html('admin/refill_events_note') . '</span>'), 'recalc_categories' => array('label' => qa_lang_html('admin/recalc_categories'), 'tags' => 'name="dorecalccategories" onclick="return qa_recalc_click(this.name, this, ' . qa_js(qa_lang_html('admin/recalc_stop')) . ', \'recalc_categories_note\');"', 'note' => '<span id="recalc_categories_note">' . qa_lang_html('admin/recalc_categories_note') . '</span>'), 'delete_hidden' => array('label' => qa_lang_html('admin/delete_hidden'), 'tags' => 'name="dodeletehidden" onclick="return qa_recalc_click(this.name, this, ' . qa_js(qa_lang_html('admin/delete_stop')) . ', \'delete_hidden_note\');"', 'note' => '<span id="delete_hidden_note">' . qa_lang_html('admin/delete_hidden_note') . '</span>')), 'hidden' => array('code' => qa_get_form_security_code('admin/recalc')));
if (!qa_using_categories()) {
unset($qa_content['form_2']['buttons']['recalc_categories']);
}
if (defined('QA_BLOBS_DIRECTORY')) {
if (qa_db_has_blobs_in_db()) {
$qa_content['form_2']['buttons']['blobs_to_disk'] = array('label' => qa_lang_html('admin/blobs_to_disk'), 'tags' => 'name="doblobstodisk" onclick="return qa_recalc_click(this.name, this, ' . qa_js(qa_lang_html('admin/blobs_stop')) . ', \'blobs_to_disk_note\');"', 'note' => '<span id="blobs_to_disk_note">' . qa_lang_html('admin/blobs_to_disk_note') . '</span>');
}
if (qa_db_has_blobs_on_disk()) {
$qa_content['form_2']['buttons']['blobs_to_db'] = array('label' => qa_lang_html('admin/blobs_to_db'), 'tags' => 'name="doblobstodb" onclick="return qa_recalc_click(this.name, this, ' . qa_js(qa_lang_html('admin/blobs_stop')) . ', \'blobs_to_db_note\');"', 'note' => '<span id="blobs_to_db_note">' . qa_lang_html('admin/blobs_to_db_note') . '</span>');
}
}
$qa_content['script_rel'][] = 'qa-content/qa-admin.js?' . QA_VERSION;
$qa_content['script_var']['qa_warning_recalc'] = qa_lang('admin/stop_recalc_warning');
$qa_content['navigation']['sub'] = qa_admin_sub_navigation();
return $qa_content;
示例10: foreach
foreach ($postids as $postid) {
qa_post_set_hidden($postid, true, $userid);
}
qa_redirect(qa_request());
}
}
}
// Combine sets of questions and get information for users
$questions = qa_any_sort_by_date(array_merge($qs, $qs_queued, $qs_hidden, $a_qs, $a_queued_qs, $a_hidden_qs, $c_qs, $c_queued_qs, $c_hidden_qs, $edit_qs));
$usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));
$hostname = gethostbyaddr($ip);
// Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html_sub('main/ip_address_x', qa_html($ip));
$qa_content['error'] = @$pageerror;
$qa_content['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'style' => 'wide', 'fields' => array('host' => array('type' => 'static', 'label' => qa_lang_html('misc/host_name'), 'value' => qa_html($hostname))), 'hidden' => array('code' => qa_get_form_security_code('ip-' . $ip)));
if ($blockable) {
require_once QA_INCLUDE_DIR . 'qa-app-limits.php';
$blockipclauses = qa_block_ips_explode(qa_opt('block_ips_write'));
$matchclauses = array();
foreach ($blockipclauses as $blockipclause) {
if (qa_block_ip_match($ip, $blockipclause)) {
$matchclauses[] = $blockipclause;
}
}
if (count($matchclauses)) {
$qa_content['form']['fields']['status'] = array('type' => 'static', 'label' => qa_lang_html('misc/matches_blocked_ips'), 'value' => qa_html(implode("\n", $matchclauses), true));
$qa_content['form']['buttons']['unblock'] = array('tags' => 'name="dounblock"', 'label' => qa_lang_html('misc/unblock_ip_button'));
if (count($questions) && !qa_user_maximum_permit_error('permit_hide_show')) {
$qa_content['form']['buttons']['hideall'] = array('tags' => 'name="dohideall" onclick="qa_show_waiting_after(this, false);"', 'label' => qa_lang_html('misc/hide_all_ip_button'));
}
示例11: qa_path_html
?>
</tt>
<a href="<?php
echo qa_path_html('admin/stats');
?>
"><?php
echo qa_lang_html('admin/admin_title') . ' - ' . qa_lang_html('admin/stats_title');
?>
</a>
</body>
</html>
<?php
qa_exit();
} elseif (isset($state)) {
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('admin/admin_title');
$qa_content['error'] = qa_lang_html('misc/form_security_again');
$qa_content['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'style' => 'wide', 'buttons' => array('recalc' => array('tags' => 'name="' . qa_html($state) . '"', 'label' => qa_lang_html('misc/form_security_again'))), 'hidden' => array('code' => qa_get_form_security_code('admin/recalc')));
return $qa_content;
} else {
require_once QA_INCLUDE_DIR . 'app/format.php';
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('admin/admin_title');
$qa_content['error'] = qa_lang_html('main/page_not_found');
return $qa_content;
}
/*
Omit PHP closing tag to help avoid accidental output
*/
示例12: session_start
<?php
session_start();
require_once '../bmf/bk_base.php';
require_once '../bmf/qa_base.php';
require_once QA_INCLUDE_DIR . 'app/users.php';
$securitycode = qa_get_form_security_code('ask');
?>
<!DOCTYPE html>
<!-- saved from url=(0029)http://beimeifang.net/?qa=ask -->
<html g_init="6793"><!-- Powered by Question2Answer - http://www.question2answer.org/ -->
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="0">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>提一個問題</title>
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/donut.css">
<link rel="stylesheet" type="text/css" href="css/donut-responsive.css">
<link media="all" rel="stylesheet" href="css/common.css" type="text/css">
<script>
var qa_wysiwyg_editor_config = {
toolbar: [
{ name: 'basic', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript' ] },
示例13: qa_lang
} else {
$pageerror = qa_lang('users/login_limit');
}
} else {
$inemailhandle = qa_get('e');
}
// Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('users/login_title');
$qa_content['error'] = @$pageerror;
if (empty($inemailhandle) || isset($errors['emailhandle'])) {
$forgotpath = qa_path('forgot');
} else {
$forgotpath = qa_path('forgot', array('e' => $inemailhandle));
}
$forgothtml = '<a href="' . qa_html($forgotpath) . '">' . qa_lang_html('users/forgot_link') . '</a>';
$qa_content['form'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'style' => 'tall', 'ok' => $passwordsent ? qa_lang_html('users/password_sent') : ($emailexists ? qa_lang_html('users/email_exists') : null), 'fields' => array('email_handle' => array('label' => qa_opt('allow_login_email_only') ? qa_lang_html('users/email_label') : qa_lang_html('users/email_handle_label'), 'tags' => 'name="emailhandle" id="emailhandle"', 'value' => qa_html(@$inemailhandle), 'error' => qa_html(@$errors['emailhandle'])), 'password' => array('type' => 'password', 'label' => qa_lang_html('users/password_label'), 'tags' => 'name="password" id="password"', 'value' => qa_html(@$inpassword), 'error' => empty($errors['password']) ? '' : qa_html(@$errors['password']) . ' - ' . $forgothtml, 'note' => $passwordsent ? qa_lang_html('users/password_sent') : $forgothtml), 'remember' => array('type' => 'checkbox', 'label' => qa_lang_html('users/remember_label'), 'tags' => 'name="remember"', 'value' => @$inremember ? true : false)), 'buttons' => array('login' => array('label' => qa_lang_html('users/login_button'))), 'hidden' => array('dologin' => '1', 'code' => qa_get_form_security_code('login')));
$loginmodules = qa_load_modules_with('login', 'login_html');
foreach ($loginmodules as $module) {
ob_start();
$module->login_html(qa_opt('site_url') . qa_get('to'), 'login');
$html = ob_get_clean();
if (strlen($html)) {
@($qa_content['custom'] .= '<br>' . $html . '<br>');
}
}
$qa_content['focusid'] = isset($inemailhandle) && !isset($errors['emailhandle']) ? 'password' : 'emailhandle';
return $qa_content;
/*
Omit PHP closing tag to help avoid accidental output
*/
示例14: qa_userids_handles_html
}
}
}
// Get information for users
$usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));
// Create list of actual hidden postids and see which ones have dependents
$qhiddenpostid = array();
foreach ($questions as $key => $question) {
$qhiddenpostid[$key] = isset($question['opostid']) ? $question['opostid'] : $question['postid'];
}
$dependcounts = qa_db_postids_count_dependents($qhiddenpostid);
// Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('admin/recent_hidden_title');
$qa_content['error'] = isset($pageerror) ? $pageerror : qa_admin_page_error();
$qa_content['q_list'] = array('form' => array('tags' => 'method="post" action="' . qa_self_html() . '"', 'hidden' => array('code' => qa_get_form_security_code('admin/click'))), 'qs' => array());
if (count($questions)) {
foreach ($questions as $key => $question) {
$elementid = 'p' . $qhiddenpostid[$key];
$htmloptions = qa_post_html_options($question);
$htmloptions['voteview'] = false;
$htmloptions['tagsview'] = !isset($question['opostid']);
$htmloptions['answersview'] = false;
$htmloptions['viewsview'] = false;
$htmloptions['updateview'] = false;
$htmloptions['contentview'] = true;
$htmloptions['flagsview'] = true;
$htmloptions['elementid'] = $elementid;
$htmlfields = qa_any_to_q_html_fields($question, $userid, qa_cookie_get(), $usershtml, null, $htmloptions);
if (isset($htmlfields['what_url'])) {
// link directly to relevant content
示例15: foreach
}
// Other profile fields
foreach ($userfields as $userfield) {
$value = @$inprofile[$userfield['fieldid']];
if (!isset($value)) {
$value = @$userprofile[$userfield['title']];
}
$label = trim(qa_user_userfield_label($userfield), ':');
if (strlen($label)) {
$label .= ':';
}
$qa_content['form_profile']['fields'][$userfield['title']] = array('label' => qa_html($label), 'tags' => 'name="field_' . $userfield['fieldid'] . '"', 'value' => qa_html($value), 'error' => qa_html(@$errors[$userfield['fieldid']]), 'rows' => $userfield['flags'] & QA_FIELD_FLAGS_MULTI_LINE ? 8 : null, 'type' => $isblocked ? 'static' : 'text');
}
// Raw information for plugin layers to access
$qa_content['raw']['account'] = $useraccount;
$qa_content['raw']['profile'] = $userprofile;
$qa_content['raw']['points'] = $userpoints;
// Change password form
$qa_content['form_password'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'style' => 'wide', 'title' => qa_lang_html('users/change_password'), 'fields' => array('old' => array('label' => qa_lang_html('users/old_password'), 'tags' => 'name="oldpassword"', 'value' => qa_html(@$inoldpassword), 'type' => 'password', 'error' => qa_html(@$errors['oldpassword'])), 'new_1' => array('label' => qa_lang_html('users/new_password_1'), 'tags' => 'name="newpassword1"', 'type' => 'password', 'error' => qa_html(@$errors['password'])), 'new_2' => array('label' => qa_lang_html('users/new_password_2'), 'tags' => 'name="newpassword2"', 'type' => 'password', 'error' => qa_html(@$errors['newpassword2']))), 'buttons' => array('change' => array('label' => qa_lang_html('users/change_password'))), 'hidden' => array('dochangepassword' => '1', 'code' => qa_get_form_security_code('password')));
if (!$haspassword) {
$qa_content['form_password']['fields']['old']['type'] = 'static';
$qa_content['form_password']['fields']['old']['value'] = qa_lang_html('users/password_none');
}
if (qa_get_state() == 'password-changed') {
$qa_content['form_profile']['ok'] = qa_lang_html('users/password_changed');
}
$qa_content['navigation']['sub'] = qa_user_sub_navigation($useraccount['handle'], 'account', true);
return $qa_content;
/*
Omit PHP closing tag to help avoid accidental output
*/