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


PHP qa_get函数代码示例

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


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

示例1: process_request

 public function process_request($request)
 {
     if ($request == 'facebook-login') {
         $app_id = qa_opt('facebook_app_id');
         $app_secret = qa_opt('facebook_app_secret');
         $tourl = qa_get('to');
         if (!strlen($tourl)) {
             $tourl = qa_path_absolute('');
         }
         if (strlen($app_id) && strlen($app_secret)) {
             require_once $this->directory . 'facebook.php';
             $facebook = new Facebook(array('appId' => $app_id, 'secret' => $app_secret, 'cookie' => true));
             $fb_userid = $facebook->getUser();
             if ($fb_userid) {
                 try {
                     $user = $facebook->api('/me?fields=email,name,verified,location,website,about,picture.width(250)');
                     if (is_array($user)) {
                         qa_log_in_external_user('facebook', $fb_userid, array('email' => @$user['email'], 'handle' => @$user['name'], 'confirmed' => @$user['verified'], 'name' => @$user['name'], 'location' => @$user['location']['name'], 'website' => @$user['website'], 'about' => @$user['bio'], 'avatar' => strlen(@$user['picture']['data']['url']) ? qa_retrieve_url($user['picture']['data']['url']) : null));
                     }
                 } catch (FacebookApiException $e) {
                 }
             } else {
                 qa_redirect_raw($facebook->getLoginUrl(array('redirect_uri' => $tourl)));
             }
         }
         qa_redirect_raw($tourl);
     }
 }
开发者ID:amiyasahu,项目名称:question2answer,代码行数:28,代码来源:qa-facebook-login-page.php

示例2: main_parts

 function main_parts($content)
 {
     if (qa_opt('buddypress_integration_enable') && $this->template == 'user' && !qa_get('tab')) {
         $content = $this->user_buddypress_form($content);
     }
     qa_html_theme_base::main_parts($content);
 }
开发者ID:NoahY,项目名称:q2a-buddypress,代码行数:7,代码来源:qa-bp-layer.php

示例3: donut_get_sub_navigation

 function donut_get_sub_navigation($page_type, $template = '')
 {
     require_once QA_INCLUDE_DIR . 'qa-app-q-list.php';
     require_once QA_INCLUDE_DIR . 'qa-app-format.php';
     require_once QA_INCLUDE_DIR . 'qa-app-admin.php';
     $sub_nav = array();
     switch ($page_type) {
         case 'questions':
             $sort = qa_get('sort');
             $sub_nav = donut_qs_sub_navigation($sort, array());
             break;
         case 'unanswered':
             $categoryslugs = qa_request_parts(1);
             $by = qa_get('by');
             $sub_nav = donut_unanswered_sub_navigation($by, $categoryslugs);
             break;
         case 'users':
             $sub_nav = donut_users_sub_navigation();
             break;
         case 'admin':
             $sub_nav = qa_admin_sub_navigation();
             break;
         default:
             break;
     }
     return $sub_nav;
 }
开发者ID:architbakliwal,项目名称:Q2A,代码行数:27,代码来源:qa-donut-utils.php

示例4: process_request

 function process_request($request)
 {
     // double check we are admin
     if (qa_get_logged_in_level() < QA_USER_LEVEL_ADMIN) {
         return;
     }
     if (qa_clicked('docancel')) {
         qa_redirect('admin/plugins');
     }
     $qa_content = qa_content_prepare();
     $qa_content['title'] = 'Widget Anywhere';
     $qa_content['custom'] = '<p><a href="' . qa_path('admin/plugins') . '#' . qa_html($this->anchor) . '">&laquo; back to plugin options</a></p>';
     $saved_msg = null;
     $editid = qa_get('editid');
     if (qa_post_text('dodelete')) {
         $this->delete_widget();
         qa_redirect('admin/plugins');
     } else {
         if (qa_clicked('save_button')) {
             // save widget
             $widget = $this->save_widget();
             $saved_msg = 'Widget saved.';
         } else {
             if (empty($editid)) {
                 // display blank form
                 $widget = array('id' => 0, 'title' => '', 'pages' => '', 'position' => '', 'ordering' => 1, 'content' => '');
             } else {
                 // load specified widget
                 $sql = 'SELECT * FROM ^' . $this->pluginkey . ' WHERE id=#';
                 $result = qa_db_query_sub($sql, $editid);
                 $widget = qa_db_read_one_assoc($result);
             }
         }
     }
     $sel_position = empty($widget['position']) ? null : @$this->positionlangs[$widget['position']];
     // set up page (template) list
     $widget_pages = explode(',', $widget['pages']);
     $sel_pages = array();
     $custom_pages = array();
     foreach ($widget_pages as $page) {
         if (strpos($page, 'custom:') === 0) {
             $custom_pages[] = substr($page, 7);
         } else {
             $sel_pages[] = $page;
         }
     }
     // $chkd = in_array('all', $sel_pages) ? 'checked' : '';
     // $pages_html = '<label><input type="checkbox" name="wpages_all" ' . $chkd . '> ' . qa_lang_html('admin/widget_all_pages') . '</label><br><br>';
     $pages_html = '';
     foreach ($this->templatelangkeys as $tmpl => $langkey) {
         $chkd = in_array($tmpl, $sel_pages) ? 'checked' : '';
         $pages_html .= '<label><input type="checkbox" name="wpages_' . $tmpl . '" ' . $chkd . '> ' . qa_lang_html($langkey) . '</label><br>';
     }
     $qa_content['form'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'tall', 'ok' => $saved_msg, 'fields' => array('title' => array('label' => 'Title', 'tags' => 'NAME="wtitle"', 'value' => qa_html($widget['title'])), 'position' => array('type' => 'select', 'label' => 'Position', 'tags' => 'NAME="wposition"', 'options' => $this->positionlangs, 'value' => $sel_position), 'all_pages' => array('type' => 'checkbox', 'id' => 'tb_pages_all', 'label' => qa_lang_html('admin/widget_all_pages'), 'tags' => 'NAME="wpages_all" ID="wpages_all"', 'value' => in_array('all', $sel_pages)), 'pages' => array('type' => 'custom', 'id' => 'tb_pages_list', 'label' => qa_lang_html('admin/widget_pages_explanation'), 'html' => $pages_html), 'show_custom_pages' => array('type' => 'checkbox', 'id' => 'tb_show_custom_pages', 'label' => 'Show on custom page(s)', 'tags' => 'NAME="cb_custom_pages" ID="cb_custom_pages"', 'value' => count($custom_pages) > 0), 'custom_pages' => array('id' => 'tb_custom_pages', 'label' => 'Page slugs', 'tags' => 'NAME="wpages_custom"', 'value' => qa_html(implode(',', $custom_pages)), 'note' => 'Separate multiple page slugs (URL fragments) with commas, e.g. <code>custom-page,other-page</code>'), 'ordering' => array('type' => 'number', 'label' => 'Order', 'tags' => 'NAME="wordering"', 'value' => qa_html($widget['ordering'])), 'content' => array('type' => 'textarea', 'label' => 'Content (HTML)', 'tags' => 'NAME="wcontent"', 'value' => qa_html($widget['content']), 'rows' => 12)), 'hidden' => array('wid' => $widget['id']), 'buttons' => array('save' => array('tags' => 'NAME="save_button"', 'label' => 'Save widget', 'value' => '1'), 'cancel' => array('tags' => 'NAME="docancel"', 'label' => qa_lang_html('main/cancel_button'))));
     if ($widget['id'] > 0) {
         $qa_content['form']['fields']['delete'] = array('tags' => 'NAME="dodelete"', 'label' => 'Delete widget', 'value' => 0, 'type' => 'checkbox');
     }
     qa_set_display_rules($qa_content, array('tb_pages_list' => '!wpages_all', 'tb_show_custom_pages' => '!wpages_all', 'tb_custom_pages' => 'cb_custom_pages && !wpages_all'));
     return $qa_content;
 }
开发者ID:siddiquinoor,项目名称:q2a-widget-anywhere,代码行数:60,代码来源:qa-widget-anywhere.php

示例5: qa_get_request_content

function qa_get_request_content()
{
    if (qa_opt('news_plugin_active')) {
        $requestlower = strtolower(qa_request());
        if ($requestlower && $requestlower === 'my-profile') {
            $userid = qa_get_logged_in_userid();
            if (!$userid) {
                qa_redirect();
            }
            $handles = qa_userids_to_handles(array($userid));
            $handle = $handles[$userid];
            qa_redirect(qa_path('user/' . $handle));
        } else {
            if ($requestlower && $requestlower === qa_opt('news_plugin_request')) {
                // send on cron
                if (qa_opt('news_plugin_send') && qa_get('cron') == qa_opt('news_plugin_cron_rand') && time() >= qa_opt('news_plugin_send_last') + 23 * 60 * 60) {
                    // minumum cron interval is 23 hours
                    qa_news_plugin_createNewsletter(true);
                    return false;
                } else {
                    if (qa_get('cron') == qa_opt('news_plugin_cron_rand')) {
                        if (!qa_opt('news_plugin_send')) {
                            error_log('Q2A Newsletter Recreate Error: sending newsletter not allowed via admin/plugins');
                        } else {
                            error_log('Q2A Newsletter Recreate Error: cron request before minimum time elapsed');
                        }
                        echo "false\n";
                        return false;
                    }
                }
                include qa_opt('news_plugin_loc');
                return false;
            } else {
                if (qa_opt('news_plugin_pdf') && $requestlower && $requestlower === qa_opt('news_plugin_request_pdf')) {
                    $pdf = file_get_contents(qa_opt('news_plugin_loc_pdf'));
                    header('Content-Description: File Transfer');
                    header('Cache-Control: public, must-revalidate, max-age=0');
                    // HTTP/1.1
                    header('Pragma: public');
                    header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
                    // Date in the past
                    header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
                    // force download dialog
                    header('Content-Type: application/force-download');
                    header('Content-Type: application/octet-stream', false);
                    header('Content-Type: application/download', false);
                    header('Content-Type: application/pdf', false);
                    // use the Content-Disposition header to supply a recommended filename
                    header('Content-Disposition: attachment; filename="' . basename(qa_opt('news_plugin_loc_pdf')) . '";');
                    header('Content-Transfer-Encoding: binary');
                    header('Content-Length: ' . strlen($pdf));
                    echo $pdf;
                    return false;
                }
            }
        }
    }
    return qa_get_request_content_base();
}
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:59,代码来源:qa-news-overrides.php

示例6: doctype

 function doctype()
 {
     qa_html_theme_base::doctype();
     $qw_notification_id = qa_get('ra_notification');
     if (isset($qw_notification_id)) {
         qw_set_notification_as_read($qw_notification_id);
     }
 }
开发者ID:rahularyan,项目名称:dude-theme,代码行数:8,代码来源:notification-layer.php

示例7: main_parts

 function main_parts($content)
 {
     $userid = qa_get_logged_in_userid();
     if (qa_opt('news_plugin_active') && $this->template == 'user' && qa_opt('news_plugin_send') && !qa_get('tab') && $content['raw']['userid'] == $userid) {
         $content['form-newsletter'] = $this->newsletterForm();
     }
     qa_html_theme_base::main_parts($content);
 }
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:8,代码来源:qa-news-layer.php

示例8: main_parts

 function main_parts($content)
 {
     if ($this->template == 'user' && qa_get('tab') == 'history' && qa_opt('event_logger_to_database') && qa_opt('user_act_list_active')) {
         $content = array();
         $content['form-activity-list'] = $this->user_activity_form();
     }
     qa_html_theme_base::main_parts($content);
 }
开发者ID:ruuttt,项目名称:question2answer_sandbox,代码行数:8,代码来源:qa-history-layer.php

示例9: main_parts

 function main_parts($content)
 {
     if (qa_opt('priv_active') && $this->template == 'user' && qa_get('tab') == 'privileges') {
         $content = array();
         $content['form-privileges-list'] = $this->user_priv_form();
         // this shouldn't happen
     }
     qa_html_theme_base::main_parts($content);
 }
开发者ID:NoahY,项目名称:q2a-privileges,代码行数:9,代码来源:qa-priv-layer.php

示例10: doctype

 function doctype()
 {
     parent::doctype();
     if (QA_FINAL_EXTERNAL_USERS) {
         return;
     }
     // check if logged in
     $handle = qa_get_logged_in_handle();
     if (isset($handle)) {
         if (qa_request() == '' && count($_GET) > 0) {
             // Check if we need to associate another provider
             $this->process_login();
         }
         // see if the account pages are accessed
         $tmpl = array('account', 'favorites');
         $user_pages = array('user', 'user-wall', 'user-activity', 'user-questions', 'user-answers');
         $logins_page = qa_request() == 'logins' && !qa_get('confirm');
         $urlhandle = qa_request_part(1);
         if (in_array($this->template, $tmpl) || $logins_page || in_array($this->template, $user_pages) && $handle == $urlhandle) {
             // add a navigation item
             $this->content['navigation']['sub']['logins'] = array('label' => qa_lang_html('plugin_open/my_logins_nav'), 'url' => qa_path_html('logins'), 'selected' => $logins_page);
             return;
         }
     } else {
         $title = qa_lang_html('plugin_open/login_title');
         $descr = qa_lang_html('plugin_open/login_description');
         // hide login/register links from navigation on any page
         if (qa_opt('open_login_hideform') == '1') {
             unset($this->content['navigation']['user']['login']);
             unset($this->content['navigation']['user']['register']);
         }
         // then check if login/register pages are accessed
         $tmpl = array('register', 'login');
         if (!in_array($this->template, $tmpl)) {
             return;
         }
         // hide regular login/register form on those pages only
         if (qa_opt('open_login_hideform') == '1') {
             $this->content['title'] = $title;
             $this->content['form'] = null;
         }
         // add some custom text
         if (!empty($this->content['custom'])) {
             $content = str_ireplace('<BR>', '', $this->content['custom']);
             $this->content['custom'] = "<div><p>{$descr}</p>{$content}</div>";
             if ($this->content['form'] != null) {
                 $this->content['custom'] = "<br /><br /><h1>{$title}</h1>{$this->content['custom']}";
             }
         }
     }
 }
开发者ID:microbye,项目名称:q2a-open-login,代码行数:51,代码来源:qa-open-layer.php

示例11: process_request

 function process_request($request)
 {
     $message = '';
     $url = '';
     if (is_array($_FILES) && count($_FILES)) {
         if (!qa_opt('wysiwyg_editor_upload_images')) {
             $message = qa_lang('users/no_permission');
         }
         require_once QA_INCLUDE_DIR . 'qa-app-upload.php';
         $upload = qa_upload_file_one(qa_opt('wysiwyg_editor_upload_max_size'), qa_get('qa_only_image') || !qa_opt('wysiwyg_editor_upload_all'), qa_get('qa_only_image') ? 600 : null, null);
         $message = @$upload['error'];
         $url = @$upload['bloburl'];
     }
     echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction(" . qa_js(qa_get('CKEditorFuncNum')) . ", " . qa_js($url) . ", " . qa_js($message) . ");</script>";
     return null;
 }
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:16,代码来源:qa-wysiwyg-upload.php

示例12: doctype

 function doctype()
 {
     if (@$this->content['error'] == qa_lang_html('main/page_not_found') && preg_match('/^[0-9]+\\//', $this->request) !== false) {
         $pid = preg_replace('/\\/.*/', '', $this->request);
         $merged = qa_db_read_one_assoc(qa_db_query_sub("SELECT ^posts.postid as postid,^posts.title as title FROM ^postmeta, ^posts WHERE ^postmeta.meta_key='merged_with' AND ^postmeta.post_id=# AND ^posts.postid=^postmeta.meta_value", $pid), true);
         if ($merged) {
             qa_redirect(qa_q_request($merged['postid'], $merged['title']), array('merged' => $pid));
         }
     } else {
         if (qa_get('merged')) {
             $this->content['error'] = str_replace('^post', qa_get('merged'), qa_opt('merge_question_merged'));
         }
     }
     if (qa_post_text('ajax_merge_get_from')) {
         return;
     }
     qa_html_theme_base::doctype();
 }
开发者ID:NoahY,项目名称:q2a-post-merge,代码行数:18,代码来源:qa-merge-layer.php

示例13: doctype

 function doctype()
 {
     if ($this->request == 'admin/permissions' && qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN) {
         $permits[] = 'signature_allow';
         $permits[] = 'signature_edit_allow';
         foreach ($permits as $optionname) {
             $value = qa_opt($optionname);
             $optionfield = array('id' => $optionname, 'label' => qa_lang_html('signature_plugin/' . $optionname) . ':', 'tags' => 'NAME="option_' . $optionname . '" ID="option_' . $optionname . '"', 'value' => $value, 'error' => qa_html(@$errors[$optionname]));
             $widest = QA_PERMIT_USERS;
             $narrowest = QA_PERMIT_ADMINS;
             $permitoptions = qa_admin_permit_options($widest, $narrowest, !QA_FINAL_EXTERNAL_USERS && qa_opt('confirm_user_emails'));
             if (count($permitoptions) > 1) {
                 qa_optionfield_make_select($optionfield, $permitoptions, $value, $value == QA_PERMIT_CONFIRMED ? QA_PERMIT_USERS : min(array_keys($permitoptions)));
             }
             $this->content['form']['fields'][$optionname] = $optionfield;
             $this->content['form']['fields'][$optionname . '_points'] = array('id' => $optionname . '_points', 'tags' => 'NAME="option_' . $optionname . '_points" ID="option_' . $optionname . '_points"', 'type' => 'number', 'value' => qa_opt($optionname . '_points'), 'prefix' => qa_lang_html('admin/users_must_have') . '&nbsp;', 'note' => qa_lang_html('admin/points'));
             $checkboxtodisplay[$optionname . '_points'] = '(option_' . $optionname . '==' . qa_js(QA_PERMIT_POINTS) . ') ||(option_' . $optionname . '==' . qa_js(QA_PERMIT_POINTS_CONFIRMED) . ')';
         }
         qa_set_display_rules($this->content, $checkboxtodisplay);
     }
     if (qa_opt('signatures_enable')) {
         // add user signature
         if ($this->template == 'user' && isset($this->content['form_activity']) && !qa_get('tab')) {
             $sig_form = $this->content['user_signature_form'];
             // from overrides
             // insert our form
             if (isset($this->content['q_list'])) {
                 // array splicing kungfu thanks to Stack Exchange
                 // This adds form-signature before q_list
                 $keys = array_keys($this->content);
                 $vals = array_values($this->content);
                 $insertBefore = array_search('q_list', $keys);
                 $keys2 = array_splice($keys, $insertBefore);
                 $vals2 = array_splice($vals, $insertBefore);
                 $keys[] = 'form-signature';
                 $vals[] = $sig_form;
                 $this->content = array_merge(array_combine($keys, $vals), array_combine($keys2, $vals2));
             } else {
                 $this->content['form-signature'] = $sig_form;
             }
         }
     }
     qa_html_theme_base::doctype();
 }
开发者ID:NoahY,项目名称:q2a-signatures,代码行数:44,代码来源:qa-sig-layer.php

示例14: process_request

 function process_request($request)
 {
     if ($request == 'facebook-login') {
         $app_id = qa_opt('facebook_app_id');
         $app_secret = qa_opt('facebook_app_secret');
         $tourl = qa_get('to');
         if (!strlen($tourl)) {
             $tourl = qa_path_absolute('');
         }
         if (strlen($app_id) && strlen($app_secret)) {
             if (!function_exists('json_decode')) {
                 // work around fact that PHP might not have JSON extension installed
                 require_once $this->directory . 'JSON.php';
                 function json_decode($json)
                 {
                     $decoder = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
                     return $decoder->decode($json);
                 }
             }
             require_once $this->directory . 'facebook.php';
             $facebook = new Facebook(array('appId' => $app_id, 'secret' => $app_secret, 'cookie' => true));
             $fb_userid = $facebook->getUser();
             if ($fb_userid) {
                 try {
                     $user = $facebook->api('/me?fields=email,name,verified,location,website,about,picture');
                     if (is_array($user)) {
                         qa_log_in_external_user('facebook', $fb_userid, array('email' => @$user['email'], 'handle' => @$user['name'], 'confirmed' => @$user['verified'], 'name' => @$user['name'], 'location' => @$user['location']['name'], 'website' => @$user['website'], 'about' => @$user['bio'], 'avatar' => strlen(@$user['picture']['data']['url']) ? qa_retrieve_url($user['picture']['data']['url']) : null));
                     }
                 } catch (FacebookApiException $e) {
                 }
             } else {
                 qa_redirect_raw($facebook->getLoginUrl(array('redirect_uri' => $tourl)));
             }
         }
         qa_redirect_raw($tourl);
     }
 }
开发者ID:netham91,项目名称:question2answer,代码行数:37,代码来源:qa-facebook-login-page.php

示例15: process_request

 function process_request($request)
 {
     $start = qa_get_start();
     $userid = qa_get_logged_in_userid();
     //	Prepare content for theme
     require_once QA_INCLUDE_DIR . 'qa-db-users.php';
     require_once QA_INCLUDE_DIR . 'qa-app-format.php';
     require_once QA_INCLUDE_DIR . 'qa-app-users.php';
     require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
     require_once QW_CONTROL_DIR . '/addons/social-login/cs-social-login-utils.php';
     if (QA_FINAL_EXTERNAL_USERS) {
         qa_fatal_error('User accounts are handled by external code');
     }
     if (!isset($userid)) {
         qa_redirect('login');
     }
     $qa_content = qa_content_prepare();
     $qa_content['title'] = qa_lang_html('notification/my_notification_settings');
     $qa_content['site_title'] = qa_opt('site_title');
     if (qa_clicked('save_notf_user_settings')) {
         $data_to_save = array('qw_mail_when_a_post' => !!qa_post_text('qw_mail_when_a_post'), 'qw_mail_when_related' => !!qa_post_text('qw_mail_when_related'), 'qw_mail_when_c_post' => !!qa_post_text('qw_mail_when_c_post'), 'qw_mail_when_q_reshow' => !!qa_post_text('qw_mail_when_q_reshow'), 'qw_mail_when_c_reshow' => !!qa_post_text('qw_mail_when_c_reshow'), 'qw_mail_when_a_select' => !!qa_post_text('qw_mail_when_a_select'), 'qw_mail_when_q_vote_up' => !!qa_post_text('qw_mail_when_q_vote_up'), 'qw_mail_when_q_vote_down' => !!qa_post_text('qw_mail_when_q_vote_down'), 'qw_mail_when_a_vote_up' => !!qa_post_text('qw_mail_when_a_vote_up'), 'qw_mail_when_a_vote_down' => !!qa_post_text('qw_mail_when_a_vote_down'), 'qw_mail_when_q_favorite' => !!qa_post_text('qw_mail_when_q_favorite'), 'qw_mail_when_u_favorite' => !!qa_post_text('qw_mail_when_u_favorite'), 'qw_mail_when_u_message' => !!qa_post_text('qw_mail_when_u_message'), 'qw_mail_when_u_wall_post' => !!qa_post_text('qw_mail_when_u_wall_post'), 'qw_mail_when_u_level' => !!qa_post_text('qw_mail_when_u_level'), 'qw_mail_when_q_post_user_fl' => !!qa_post_text('qw_mail_when_q_post_user_fl'), 'qw_mail_when_q_post_tag_fl' => !!qa_post_text('qw_mail_when_q_post_tag_fl'), 'qw_mail_when_q_post_cat_fl' => !!qa_post_text('qw_mail_when_q_post_cat_fl'), 'qw_mail_when_q_approve' => !!qa_post_text('qw_mail_when_q_approve'), 'qw_mail_when_q_reject' => !!qa_post_text('qw_mail_when_q_reject'), 'qw_mail_when_a_approve' => !!qa_post_text('qw_mail_when_a_approve'), 'qw_mail_when_a_reject' => !!qa_post_text('qw_mail_when_a_reject'), 'qw_mail_when_c_approve' => !!qa_post_text('qw_mail_when_c_approve'), 'qw_mail_when_c_reject' => !!qa_post_text('qw_mail_when_c_reject'));
         qw_save_notification_settings(json_encode($data_to_save), $userid);
         qa_redirect('notification-settings', array('state' => 'settings-saved'));
     }
     $disp_conf = qa_get('confirm');
     $preferences = qw_get_notification_settings($userid);
     // qw_log(print_r(qw_check_pref_for_event($userid , 'a_post') , true )) ;
     if (!$disp_conf) {
         // display some summary about the user
         $qa_content['form_profile'] = array('title' => qa_lang_html('notification/my_notification_settings'), 'tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '" CLASS="social-login-settings"', 'style' => 'wide', 'buttons' => array('check_all' => array('type' => 'button', 'tags' => 'name="check_all_notf_fields" id="check_all_notf_fields" ', 'label' => qa_lang_html('notification/check_all')), 'uncheck_all' => array('type' => 'button', 'tags' => 'name="un_check_all_notf_fields" id="un_check_all_notf_fields" ', 'label' => qa_lang_html('notification/uncheck_all')), 'save' => array('tags' => 'onClick="qa_show_waiting_after(this, false);"', 'label' => qa_lang_html('notification/save_settings'))), 'fields' => array('qw_mail_when_a_post' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_a_post_lable'), 'tags' => 'NAME="qw_mail_when_a_post"', 'value' => @$preferences['qw_mail_when_a_post'] ? true : false), 'qw_mail_when_related' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_related_lable'), 'tags' => 'NAME="qw_mail_when_related"', 'value' => @$preferences['qw_mail_when_related'] ? true : false), 'qw_mail_when_c_post' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_c_post_lable'), 'tags' => 'NAME="qw_mail_when_c_post"', 'value' => @$preferences['qw_mail_when_c_post'] ? true : false), 'qw_mail_when_q_reshow' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_q_reshow_lable'), 'tags' => 'NAME="qw_mail_when_q_reshow"', 'value' => @$preferences['qw_mail_when_q_reshow'] ? true : false), 'qw_mail_when_c_reshow' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_c_reshow_lable'), 'tags' => 'NAME="qw_mail_when_c_reshow"', 'value' => @$preferences['qw_mail_when_c_reshow'] ? true : false), 'qw_mail_when_a_select' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_a_select_lable'), 'tags' => 'NAME="qw_mail_when_a_select"', 'value' => @$preferences['qw_mail_when_a_select'] ? true : false), 'qw_mail_when_q_vote_up' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_q_vote_up_lable'), 'tags' => 'NAME="qw_mail_when_q_vote_up"', 'value' => @$preferences['qw_mail_when_q_vote_up'] ? true : false), 'qw_mail_when_q_vote_down' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_q_vote_down_lable'), 'tags' => 'NAME="qw_mail_when_q_vote_down"', 'value' => @$preferences['qw_mail_when_q_vote_down'] ? true : false), 'qw_mail_when_a_vote_up' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_a_vote_up_lable'), 'tags' => 'NAME="qw_mail_when_a_vote_up"', 'value' => @$preferences['qw_mail_when_a_vote_up'] ? true : false), 'qw_mail_when_a_vote_down' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_a_vote_down_lable'), 'tags' => 'NAME="qw_mail_when_a_vote_down"', 'value' => @$preferences['qw_mail_when_a_vote_down'] ? true : false), 'qw_mail_when_q_favorite' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_q_favorite_lable'), 'tags' => 'NAME="qw_mail_when_q_favorite"', 'value' => @$preferences['qw_mail_when_q_favorite'] ? true : false), 'qw_mail_when_u_favorite' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_u_favorite_lable'), 'tags' => 'NAME="qw_mail_when_u_favorite"', 'value' => @$preferences['qw_mail_when_u_favorite'] ? true : false), 'qw_mail_when_u_message' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_u_message_lable'), 'tags' => 'NAME="qw_mail_when_u_message"', 'value' => @$preferences['qw_mail_when_u_message'] ? true : false), 'qw_mail_when_u_wall_post' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_u_wall_post_lable'), 'tags' => 'NAME="qw_mail_when_u_wall_post"', 'value' => @$preferences['qw_mail_when_u_wall_post'] ? true : false), 'qw_mail_when_u_level' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_u_level_lable'), 'tags' => 'NAME="qw_mail_when_u_level"', 'value' => @$preferences['qw_mail_when_u_level'] ? true : false), 'qw_mail_when_q_post_user_fl' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_q_post_user_fl_lable'), 'tags' => 'NAME="qw_mail_when_q_post_user_fl"', 'value' => @$preferences['qw_mail_when_q_post_user_fl'] ? true : false), 'qw_mail_when_q_post_tag_fl' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_q_post_tag_fl_lable'), 'tags' => 'NAME="qw_mail_when_q_post_tag_fl"', 'value' => @$preferences['qw_mail_when_q_post_tag_fl'] ? true : false), 'qw_mail_when_q_post_cat_fl' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_q_post_cat_fl_lable'), 'tags' => 'NAME="qw_mail_when_q_post_cat_fl"', 'value' => @$preferences['qw_mail_when_q_post_cat_fl'] ? true : false), 'qw_mail_when_q_approve' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_q_approve_lable'), 'tags' => 'NAME="qw_mail_when_q_approve"', 'value' => @$preferences['qw_mail_when_q_approve'] ? true : false), 'qw_mail_when_q_reject' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_q_reject_lable'), 'tags' => 'NAME="qw_mail_when_q_reject"', 'value' => @$preferences['qw_mail_when_q_reject'] ? true : false), 'qw_mail_when_a_approve' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_a_approve_lable'), 'tags' => 'NAME="qw_mail_when_a_approve"', 'value' => @$preferences['qw_mail_when_a_approve'] ? true : false), 'qw_mail_when_a_reject' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_a_reject_lable'), 'tags' => 'NAME="qw_mail_when_a_reject"', 'value' => @$preferences['qw_mail_when_a_reject'] ? true : false), 'qw_mail_when_c_approve' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_c_approve_lable'), 'tags' => 'NAME="qw_mail_when_c_approve"', 'value' => @$preferences['qw_mail_when_c_approve'] ? true : false), 'qw_mail_when_c_reject' => array('type' => 'checkbox', 'label' => qa_lang_html('notification/mail_when_c_reject_lable'), 'tags' => 'NAME="qw_mail_when_c_reject"', 'value' => @$preferences['qw_mail_when_c_reject'] ? true : false)), 'hidden' => array('save_notf_user_settings' => '1'));
         if (qa_get_state() == 'settings-saved') {
             $qa_content['form_profile']['ok'] = qa_lang_html('notification/settings_saved');
         }
     }
     $qa_content['navigation']['sub'] = qa_account_sub_navigation();
     return $qa_content;
 }
开发者ID:rahularyan,项目名称:dude-theme,代码行数:37,代码来源:notification-settings.php


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