• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP qa_cookie_get函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: qa_cookie_get_create

function qa_cookie_get_create()
{
    require_once QA_INCLUDE_DIR . 'qa-db-cookies.php';
    $cookieid = qa_cookie_get();
    if (isset($cookieid) && qa_db_cookie_exists($cookieid)) {
    } else {
        $cookieid = qa_db_cookie_create(qa_remote_ip_address());
    }
    setcookie('qa_id', $cookieid, time() + 86400 * 365, '/', QA_COOKIE_DOMAIN);
    return $cookieid;
}
开发者ID:TheProjecter,项目名称:microprobe,代码行数:11,代码来源:qa-app-cookies.php


示例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;
}
开发者ID:kosmoluna,项目名称:question2answer,代码行数:53,代码来源:q-list.php


示例3: 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;
}
开发者ID:nikhilkumar80,项目名称:question2answer,代码行数:13,代码来源:favorites.php


示例4: qa_cookie_get_create

function qa_cookie_get_create()
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    require_once QA_INCLUDE_DIR . 'qa-db-cookies.php';
    $cookieid = qa_cookie_get();
    if (isset($cookieid) && qa_db_cookie_exists($cookieid)) {
    } else {
        $cookieid = qa_db_cookie_create(qa_remote_ip_address());
    }
    setcookie('qa_id', $cookieid, time() + 86400 * 365, '/', QA_COOKIE_DOMAIN);
    $_COOKIE['qa_id'] = $cookieid;
    return $cookieid;
}
开发者ID:gogupe,项目名称:question2answer-releases,代码行数:16,代码来源:qa-app-cookies.php


示例5: qa_complete_reset_user

function qa_complete_reset_user($userid)
{
    require_once QA_INCLUDE_DIR . 'qa-util-string.php';
    require_once QA_INCLUDE_DIR . 'qa-app-options.php';
    require_once QA_INCLUDE_DIR . 'qa-app-emails.php';
    require_once QA_INCLUDE_DIR . 'qa-app-cookies.php';
    require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
    $password = qa_random_alphanum(max(QA_MIN_PASSWORD_LEN, QA_NEW_PASSWORD_LEN));
    $userinfo = qa_db_select_with_pending(qa_db_user_account_selectspec($userid, true));
    if (!qw_send_notification($userid, $userinfo['email'], $userinfo['handle'], qa_lang('emails/new_password_subject'), nl2br(qa_lang('emails/new_password_body')), array('^password' => $password, '^url' => qa_opt('site_url')))) {
        qa_fatal_error('Could not send new password - password not reset');
    }
    qa_db_user_set_password($userid, $password);
    // do this last, to be safe
    qa_db_user_set($userid, 'emailcode', '');
    // so can't be reused
    qa_report_event('u_reset', $userid, $userinfo['handle'], qa_cookie_get(), array('email' => $userinfo['email']));
}
开发者ID:rahularyan,项目名称:dude-theme,代码行数:18,代码来源:overrides.php


示例6: get_user_activity

 function get_user_activity($handle, $limit = 10)
 {
     $userid = qa_handle_to_userid($handle);
     require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
     require_once QA_INCLUDE_DIR . 'qa-app-format.php';
     $identifier = QA_FINAL_EXTERNAL_USERS ? $userid : $handle;
     list($useraccount, $questions, $answerqs, $commentqs, $editqs) = qa_db_select_with_pending(QA_FINAL_EXTERNAL_USERS ? null : qa_db_user_account_selectspec($handle, false), qa_db_user_recent_qs_selectspec($userid, $identifier, $limit), qa_db_user_recent_a_qs_selectspec($userid, $identifier), qa_db_user_recent_c_qs_selectspec($userid, $identifier), qa_db_user_recent_edit_qs_selectspec($userid, $identifier));
     if (!QA_FINAL_EXTERNAL_USERS && !is_array($useraccount)) {
         // check the user exists
         return include QA_INCLUDE_DIR . 'qa-page-not-found.php';
     }
     //	Get information on user references
     $questions = qa_any_sort_and_dedupe(array_merge($questions, $answerqs, $commentqs, $editqs));
     $questions = array_slice($questions, 0, $limit);
     $usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions), false);
     $htmldefaults = qa_post_html_defaults('Q');
     $htmldefaults['whoview'] = false;
     $htmldefaults['voteview'] = false;
     $htmldefaults['avatarsize'] = 0;
     foreach ($questions as $question) {
         $qa_content[] = qa_any_to_q_html_fields($question, $userid, qa_cookie_get(), $usershtml, null, array('voteview' => false) + qa_post_html_options($question, $htmldefaults));
     }
     $output = '<div class="user-activities">';
     $output .= '<ul>';
     if (isset($qa_content)) {
         foreach ($qa_content as $qs) {
             $icon = 'icon-time undefined';
             $output .= '<li class="activity-item">';
             $output .= '<div class="list-right">';
             $output .= '<div class="type pull-left ' . $icon . '"></div>';
             $output .= '<div class="what"><a class="what-task" href="' . @$qs['url'] . '">' . $qs['what'] . '</a>';
             $output .= '<a href="' . $qs['url'] . '">' . $qs['title'] . '</a> </div>';
             $output .= '<strong class="when">' . implode(' ', $qs['when']) . '</strong>';
             $output .= '</div>';
             $output .= '</li>';
         }
     } else {
         $output .= '<li>' . qa_lang('cleanstrap/no_activity_yet') . '</li>';
     }
     $output .= '</ul>';
     $output .= '</div>';
     return $output;
 }
开发者ID:microbye,项目名称:CleanStrap,代码行数:43,代码来源:widget_user_activity.php


示例7: output_widget

 function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
 {
     $widget_opt = @$themeobject->current_widget['param']['options'];
     require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
     if (@$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, (int) $widget_opt['count']));
     $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 (@$themeobject->current_widget['param']['locations']['show_title']) {
         $themeobject->output('<h3 class="widget-title">' . qa_lang('cleanstrap/related_questions') . '</h3>');
     }
     $themeobject->output('<div class="ra-rq-widget">');
     $themeobject->output('<ul>');
     foreach ($questions as $p) {
         $timeCode = qa_when_to_html($p['created'], 7);
         $when = @$timeCode['prefix'] . @$timeCode['data'] . @$timeCode['suffix'];
         $themeobject->output('<li>' . cs_get_post_avatar($p, $p['userid'], 30, true));
         $themeobject->output('<div class="post-content">');
         $themeobject->output('<a class="title" href="' . qa_q_path_html($p['postid'], $p['title']) . '">' . qa_html($p['title']) . '</a>');
         $themeobject->output('<div class="meta">');
         $themeobject->output('<span>' . qa_lang_sub('cleanstrap/x_answers', $p['acount']) . '</span>');
         $themeobject->output('<span class="time icon-time">' . $when . '</span>');
         $themeobject->output('<span class="vote-count icon-thumbs-up2">' . qa_lang_sub('cleanstrap/x_votes', $p['netvotes']) . '</span>');
         $themeobject->output('</div>');
         $themeobject->output('</div>');
         $themeobject->output('</li>');
     }
     $themeobject->output('</ul>');
     $themeobject->output('</div>');
 }
开发者ID:microbye,项目名称:CleanStrap,代码行数:41,代码来源:widget_related_questions.php


示例8: process_request

 function process_request($request)
 {
     require_once QA_INCLUDE_DIR . 'qa-app-format.php';
     require_once QA_INCLUDE_DIR . 'qa-app-posts.php';
     require_once QA_INCLUDE_DIR . 'qa-db-post-create.php';
     require_once QA_INCLUDE_DIR . 'mp-db-users.php';
     // report that we entered this page
     qa_report_event('page_enter', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array('params' => $_SERVER['QUERY_STRING']));
     // create the editor and update its content
     qa_get_post_content('editor', 'content', $ineditor, $incontent, $informat, $intext);
     $editorname = isset($ineditor) ? $ineditor : qa_opt('editor_for_qs');
     $editor = qa_load_editor(@$incontent, @$informat, $editorname);
     // retrieve variable data
     $innotify = qa_post_text('notify') ? true : false;
     // handle creation of annoucement
     if (qa_post_text('docreate')) {
         //retrieve data
         $title = qa_post_text('title');
         $content = $incontent;
         $format = $informat;
         // validate data
         // handle create work
         // actual create process is in file mp-app-posts.php
         $postid = qa_post_create('AN', null, $title, $content, $format, mp_get_categoryid(), null, qa_get_logged_in_userid(), $innotify);
         // redirect page
         qa_redirect('mp-announcements-page');
         // our work is done here
     }
     $qa_content = qa_content_prepare();
     // if the user is not logged in, request user to login
     if (!qa_get_logged_in_userid()) {
         $qa_content['error'] = qa_insert_login_links('Please ^1log in^2 or ^3register^4 first.', $request);
         return $qa_content;
     }
     $qa_content['title'] = 'Create Announcement';
     $qa_content['form_newannouncement'] = array('tags' => 'METHOD="POST" ACTION="' . qa_self_html() . '"', 'style' => 'tall', 'fields' => array('title' => array('label' => qa_lang_html('announcements/a_title_label'), 'tags' => 'NAME="title"', 'value' => qa_html(qa_post_text('title')), 'error' => qa_html(@$errors['title'])), 'content' => array_merge($editor->get_field($qa_content, @$incontent, @$informat, 'content', 12, false), array('label' => qa_lang_html('announcements/a_content_label'), 'error' => qa_html(@$errors['content']))), 'notify' => array('label' => 'Send email notification to all registered students', 'tags' => 'NAME="notify"', 'type' => 'checkbox', 'value' => qa_html($innotify))), 'buttons' => array('ok' => array('tags' => 'NAME="docreate"', 'label' => 'Create Announcement', 'value' => '1')), 'hidden' => array('hiddenfield' => '1', 'editor' => qa_html($editorname)));
     // create the sub menu for navigation
     $qa_content['navigation']['sub'] = mp_announcements_sub_navigation();
     $qa_content['navigation']['sub']['create']['selected'] = true;
     return $qa_content;
 }
开发者ID:TheProjecter,项目名称:microprobe,代码行数:41,代码来源:mp-announcements-create-page.php


示例9: 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);
     }
 }
开发者ID:swuit,项目名称:swuit-q2a,代码行数:36,代码来源:qa-widget-related-qs.php


示例10: output_widget

 function output_widget($region, $place, $themeobject, $template, $request, $qa_content)
 {
     require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
     if (@$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() . '"'), 'qs' => array());
         $options = 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, $options);
         }
         $themeobject->q_list_and_form($q_list);
     }
 }
开发者ID:mathjoy,项目名称:math-duodaa,代码行数:36,代码来源:qa-widget-related-qs.php


示例11: qa_page_q_add_c_submit

function qa_page_q_add_c_submit($question, $parent, $commentsfollows, $usecaptcha, &$in, &$errors)
{
    $parentid = $parent['postid'];
    $prefix = 'c' . $parentid . '_';
    $in = array('name' => qa_post_text($prefix . 'name'), 'notify' => qa_post_text($prefix . 'notify') !== null, 'email' => qa_post_text($prefix . 'email'), 'queued' => qa_user_moderation_reason(qa_user_level_for_post($parent)) !== false);
    qa_get_post_content($prefix . 'editor', $prefix . 'content', $in['editor'], $in['content'], $in['format'], $in['text']);
    $errors = array();
    if (!qa_check_form_security_code('comment-' . $parent['postid'], qa_post_text($prefix . 'code'))) {
        $errors['content'] = qa_lang_html('misc/form_security_again');
    } else {
        $filtermodules = qa_load_modules_with('filter', 'filter_comment');
        foreach ($filtermodules as $filtermodule) {
            $oldin = $in;
            $filtermodule->filter_comment($in, $errors, $question, $parent, null);
            qa_update_post_text($in, $oldin);
        }
        if ($usecaptcha) {
            qa_captcha_validate_post($errors);
        }
        if (empty($errors)) {
            $testwords = implode(' ', qa_string_to_words($in['content']));
            foreach ($commentsfollows as $comment) {
                if ($comment['basetype'] == 'C' && $comment['parentid'] == $parentid && !$comment['hidden']) {
                    if (implode(' ', qa_string_to_words($comment['content'])) == $testwords) {
                        $errors['content'] = qa_lang_html('question/duplicate_content');
                    }
                }
            }
        }
        if (empty($errors)) {
            $userid = qa_get_logged_in_userid();
            $handle = qa_get_logged_in_handle();
            $cookieid = isset($userid) ? qa_cookie_get() : qa_cookie_get_create();
            // create a new cookie if necessary
            $commentid = qa_comment_create($userid, $handle, $cookieid, $in['content'], $in['format'], $in['text'], $in['notify'], $in['email'], $question, $parent, $commentsfollows, $in['queued'], $in['name']);
            return $commentid;
        }
    }
    return null;
}
开发者ID:swuit,项目名称:swuit-q2a,代码行数:40,代码来源:question-submit.php


示例12: qa_lang_html

$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
            $htmlfields['url'] = $htmlfields['what_url'];
        }
        $htmlfields['what_2'] = qa_lang_html('main/hidden');
        if (@$htmloptions['whenview']) {
            $updated = @$question[isset($question['opostid']) ? 'oupdated' : 'updated'];
            if (isset($updated)) {
                $htmlfields['when_2'] = qa_when_to_html($updated, @$htmloptions['fulldatedays']);
            }
        }
        $buttons = array();
        $posttype = qa_strtolower(isset($question['obasetype']) ? $question['obasetype'] : $question['basetype']);
        if (!qa_user_post_permit_error('permit_hide_show', $question)) {
            // Possible values for popup: reshow_q_popup, reshow_a_popup, reshow_c_popup
开发者ID:kosmoluna,项目名称:question2answer,代码行数:31,代码来源:admin-hidden.php


示例13: array

 }
 $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();
 $qdefaults = qa_post_html_defaults('Q');
 foreach ($results as $result) {
     if (!isset($result['question'])) {
         // if we have any non-question results, display with less statistics
         $qdefaults['voteview'] = false;
         $qdefaults['answersview'] = false;
         $qdefaults['viewsview'] = false;
         break;
     }
 }
 foreach ($results as $result) {
     if (isset($result['question'])) {
         $fields = qa_post_html_fields($result['question'], $userid, qa_cookie_get(), $usershtml, null, qa_post_html_options($result['question'], $qdefaults));
     } elseif (isset($result['url'])) {
         $fields = array('what' => qa_html($result['url']), 'meta_order' => qa_lang_html('main/meta_order'));
     } else {
         continue;
     }
     // nothing to show here
     if (isset($qdefaults['blockwordspreg'])) {
         $result['title'] = qa_block_words_replace($result['title'], $qdefaults['blockwordspreg']);
     }
     $fields['title'] = qa_html($result['title']);
     $fields['url'] = qa_html($result['url']);
     $qa_content['q_list']['qs'][] = $fields;
 }
 $qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $start + $gotcount, qa_opt('pages_prev_next'), array('q' => $inquery), $gotcount >= $count);
 if (qa_opt('feed_for_search')) {
开发者ID:gogupe,项目名称:question2answer-releases,代码行数:31,代码来源:qa-page-search.php


示例14: qa_post_text

	More about this license: http://www.question2answer.org/license.php
*/
require_once QA_INCLUDE_DIR . 'app/messages.php';
require_once QA_INCLUDE_DIR . 'app/users.php';
require_once QA_INCLUDE_DIR . 'app/cookies.php';
require_once QA_INCLUDE_DIR . 'db/selects.php';
$message = qa_post_text('message');
$tohandle = qa_post_text('handle');
$morelink = qa_post_text('morelink');
$touseraccount = qa_db_select_with_pending(qa_db_user_account_selectspec($tohandle, false));
$loginuserid = qa_get_logged_in_userid();
$errorhtml = qa_wall_error_html($loginuserid, $touseraccount['userid'], $touseraccount['flags']);
if ($errorhtml || !strlen($message) || !qa_check_form_security_code('wall-' . $tohandle, qa_post_text('code'))) {
    echo "QA_AJAX_RESPONSE\n0";
} else {
    $messageid = qa_wall_add_post($loginuserid, qa_get_logged_in_handle(), qa_cookie_get(), $touseraccount['userid'], $touseraccount['handle'], $message, '');
    $touseraccount['wallposts']++;
    // won't have been updated
    $usermessages = qa_db_select_with_pending(qa_db_recent_messages_selectspec(null, null, $touseraccount['userid'], true, qa_opt('page_size_wall')));
    $usermessages = qa_wall_posts_add_rules($usermessages, 0);
    $themeclass = qa_load_theme_class(qa_get_site_theme(), 'wall', null, null);
    echo "QA_AJAX_RESPONSE\n1\n";
    echo 'm' . $messageid . "\n";
    // element in list to be revealed
    foreach ($usermessages as $message) {
        $themeclass->message_item(qa_wall_post_view($message));
    }
    if ($morelink && $touseraccount['wallposts'] > count($usermessages)) {
        $themeclass->message_item(qa_wall_view_more_link($tohandle, count($usermessages)));
    }
}
开发者ID:Trideon,项目名称:gigolo,代码行数:31,代码来源:wallpost.php


示例15: or

	of the License, or (at your option) any later version.
	
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	More about this license: http://www.question2answer.org/license.php
*/
if (!defined('QA_VERSION')) {
    // don't allow this page to be requested directly from browser
    header('Location: ../');
    exit;
}
// report that we entered this page
qa_report_event('page_enter', qa_get_logged_in_userid(), qa_get_logged_in_handle(), qa_cookie_get(), array('params' => $_SERVER['QUERY_STRING'], 'path' => $_SERVER['SCRIPT_NAME']));
require_once QA_INCLUDE_DIR . 'qa-db-selects.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
//	Get popular tags
$populartags = qa_db_select_with_pending(qa_db_popular_tags_selectspec($qa_start));
$tagcount = qa_opt('cache_tagcount');
$pagesize = qa_opt('page_size_tags');
//	Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('main/popular_tags');
$qa_content['ranking'] = array('items' => array(), 'rows' => ceil($pagesize / qa_opt('columns_tags')), 'type' => 'tags');
if (count($populartags)) {
    $output = 0;
    foreach ($populartags as $word => $count) {
        $qa_content['ranking']['items'][] = array('label' => qa_tag_html($word), 'count' => number_format($count));
        if (++$output >= $pagesize) {
开发者ID:TheProjecter,项目名称:microprobe,代码行数:31,代码来源:qa-page-tags.php


示例16: list

list($questions, $tagword) = qa_db_select_with_pending(qa_db_tag_recent_qs_selectspec($userid, $tag, $start, false, qa_opt_if_loaded('page_size_tag_qs')), qa_db_tag_word_selectspec($tag));
$pagesize = qa_opt('page_size_tag_qs');
$questions = array_slice($questions, 0, $pagesize);
$usershtml = qa_userids_handles_html($questions);
//	Prepare content for theme
$qa_content = qa_content_prepare(true);
$qa_content['title'] = qa_lang_html_sub('main/questions_tagged_x', qa_html($tag));
if (isset($userid) && isset($tagword)) {
    $favoritemap = qa_get_favorite_non_qs_map();
    $favorite = @$favoritemap['tag'][qa_strtolower($tagword['word'])];
    $qa_content['favorite'] = qa_favorite_form(QA_ENTITY_TAG, $tagword['wordid'], $favorite, qa_lang_sub($favorite ? 'main/remove_x_favorites' : 'main/add_tag_x_favorites', $tagword['word']));
}
if (!count($questions)) {
    $qa_content['q_list']['title'] = qa_lang_html('main/no_questions_found');
}
$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();
foreach ($questions as $postid => $question) {
    $qa_content['q_list']['qs'][] = qa_post_html_fields($question, $userid, qa_cookie_get(), $usershtml, null, qa_post_html_options($question));
}
$qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $tagword['tagcount'], qa_opt('pages_prev_next'));
if (empty($qa_content['page_links'])) {
    $qa_content['suggest_next'] = qa_html_suggest_qs_tags(true);
}
if (qa_opt('feed_for_tag_qs')) {
    $qa_content['feed'] = array('url' => qa_path_html(qa_feed_request('tag/' . $tag)), 'label' => qa_lang_html_sub('main/questions_tagged_x', qa_html($tag)));
}
return $qa_content;
/*
	Omit PHP closing tag to help avoid accidental output
*/
开发者ID:netham91,项目名称:question2answer,代码行数:31,代码来源:qa-page-tag.php


示例17: qa_set_logged_in_user

 function qa_set_logged_in_user($userid, $handle = '', $remember = false, $source = null)
 {
     if (qa_to_override(__FUNCTION__)) {
         $args = func_get_args();
         return qa_call_override(__FUNCTION__, $args);
     }
     require_once QA_INCLUDE_DIR . 'app/cookies.php';
     qa_start_session();
     if (isset($userid)) {
         qa_set_session_user($userid, $source);
         // PHP sessions time out too quickly on the server side, so we also set a cookie as backup.
         // Logging in from a second browser will make the previous browser's 'Remember me' no longer
         // work - I'm not sure if this is the right behavior - could see it either way.
         require_once QA_INCLUDE_DIR . 'db/selects.php';
         $userinfo = qa_db_single_select(qa_db_user_account_selectspec($userid, true));
         // if we have logged in before, and are logging in the same way as before, we don't need to change the sessioncode/source
         // this means it will be possible to automatically log in (via cookies) to the same account from more than one browser
         if (empty($userinfo['sessioncode']) || $source !== $userinfo['sessionsource']) {
             $sessioncode = qa_db_user_rand_sessioncode();
             qa_db_user_set($userid, 'sessioncode', $sessioncode);
             qa_db_user_set($userid, 'sessionsource', $source);
         } else {
             $sessioncode = $userinfo['sessioncode'];
         }
         qa_db_user_logged_in($userid, qa_remote_ip_address());
         qa_set_session_cookie($handle, $sessioncode, $remember);
         qa_report_event('u_login', $userid, $userinfo['handle'], qa_cookie_get());
     } else {
         $olduserid = qa_get_logged_in_userid();
         $oldhandle = qa_get_logged_in_handle();
         qa_clear_session_cookie();
         qa_clear_session_user();
         qa_report_event('u_logout', $olduserid, $oldhandle, qa_cookie_get());
     }
 }
开发者ID:kosmoluna,项目名称:question2answer,代码行数:35,代码来源:users.php


示例18: qa_db_message_create

            require_once QA_INCLUDE_DIR . 'qa-app-emails.php';
            if (qa_opt('show_message_history')) {
                $messageid = qa_db_message_create($loginuserid, $toaccount['userid'], $inmessage, '', false);
            } else {
                $messageid = null;
            }
            $fromhandle = qa_get_logged_in_handle();
            $canreply = !(qa_get_logged_in_flags() & QA_USER_FLAGS_NO_MESSAGES);
            $more = strtr(qa_lang($canreply ? 'emails/private_message_reply' : 'emails/private_message_info'), array('^f_handle' => $fromhandle, '^url' => qa_path_absolute($canreply ? 'message/' . $fromhandle : 'user/' . $fromhandle)));
            $subs = array('^message' => $inmessage, '^f_handle' => $fromhandle, '^f_url' => qa_path_absolute('user/' . $fromhandle), '^more' => $more, '^a_url' => qa_path_absolute('account'));
            if (qa_send_notification($toaccount['userid'], $toaccount['email'], $toaccount['handle'], qa_lang('emails/private_message_subject'), qa_lang('emails/private_message_body'), $subs)) {
                $messagesent = true;
            } else {
                $pageerror = qa_lang_html('main/general_error');
            }
            qa_report_event('u_message', $loginuserid, qa_get_logged_in_handle(), qa_cookie_get(), array('userid' => $toaccount['userid'], 'handle' => $toaccount['handle'], 'messageid' => $messageid, 'message' => $inmessage));
            if ($messagesent && qa_opt('show_message_history')) {
                // show message as part of general history
                qa_redirect(qa_request(), array('state' => 'message-sent'));
            }
        }
    }
}
//	Prepare content for theme
$qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('misc/private_message_title');
$qa_content['error'] = @$pageerror;
$qa_content['form_message'] = array('tags' => 'method="post" action="' . qa_self_html() . '"', 'style' => 'tall', 'fields' => array('message' => array('type' => $messagesent ? 'static' : '', 'label' => qa_lang_html_sub('misc/message_for_x', qa_get_one_user_html($handle, false)), 'tags' => 'name="message" id="message"', 'value' => qa_html(@$inmessage, $messagesent), 'rows' => 8, 'note' => qa_lang_html_sub('misc/message_explanation', qa_html(qa_opt('site_title'))), 'error' => qa_html(@$errors['message']))), 'buttons' => array('send' => array('tags' => 'onclick="qa_show_waiting_after(this, false);"', 'label' => qa_lang_html('main/send_button'))), 'hidden' => array('domessage' => '1', 'code' => qa_get_form_security_code('message-' . $handle)));
$qa_content['focusid'] = 'message';
if ($messagesent) {
    $qa_content['form_message']['ok'] = qa_lang_html('misc/message_sent');
开发者ID:gogupe,项目名称:question2answer-releases,代码行数:31,代码来源:qa-page-message.php


示例19: or

	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.
	
	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	More about this license: http://www.question2answer.org/license.php
*/
require_once QA_INCLUDE_DIR . 'qa-app-users.php';
require_once QA_INCLUDE_DIR . 'qa-app-cookies.php';
require_once QA_INCLUDE_DIR . 'qa-app-favorites.php';
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
$entitytype = qa_post_text('entitytype');
$entityid = qa_post_text('entityid');
$setfavorite = qa_post_text('favorite');
$userid = qa_get_logged_in_userid();
if (!qa_check_form_security_code('favorite-' . $entitytype . '-' . $entityid, qa_post_text('code'))) {
    echo "QA_AJAX_RESPONSE\n0\n" . qa_lang('misc/form_security_reload');
} elseif (isset($userid)) {
    $cookieid = qa_cookie_get();
    qa_user_favorite_set($userid, qa_get_logged_in_handle(), $cookieid, $entitytype, $entityid, $setfavorite);
    $favoriteform = qa_favorite_form($entitytype, $entityid, $setfavorite, qa_lang($setfavorite ? 'main/remove_favorites' : 'main/add_favorites'));
    $themeclass = qa_load_theme_class(qa_get_site_theme(), 'ajax-favorite', null, null);
    echo "QA_AJAX_RESPONSE\n1\n";
    $themeclass->favorite_inner_html($favoriteform);
}
/*
	Omit PHP closing tag to help avoid accidental output
*/
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:31,代码来源:qa-ajax-favorite.php


示例20: qa_complete_reset_user

function qa_complete_reset_user($userid)
{
    if (qa_to_override(__FUNCTION__)) {
        $args = func_get_args();
        return qa_call_override(__FUNCTION__, $args);
    }
    require_once QA_INCLUDE_DIR . 'util/string.php';
    require_once QA_INCLUDE_DIR . 'app/options.php';
    require_once QA_INCLUDE_DIR . 'app/emails.php';
    require_once QA_INCLUDE_DIR . 'app/cookies.php';
    require_once QA_INCLUDE_DIR . 'db/selects.php';
    $password = qa_random_alphanum(max(QA_MIN_PASSWORD_LEN, QA_NEW_PASSWORD_LEN));
    $userinfo = qa_db_select_with_pending(qa_db_user_account_selectspec($userid, true));
    if (!qa_send_notification($userid, $userinfo['email'], $userinfo['handle'], qa_lang('emails/new_password_subject'), qa_lang('emails/new_password_body'), array('^password' => $password, '^url' => qa_opt('site_url')))) {
        qa_fatal_error('Could not send new password - password not reset');
    }
    qa_db_user_set_password($userid, $password);
    // do this last, to be safe
    qa_db_user_set($userid, 'emailcode', '');
    // so can't be reused
    qa_report_event('u_reset', $userid, $userinfo['handle'], qa_cookie_get(), array('email' => $userinfo['email']));
}
开发者ID:s

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP qa_db_add_table_prefix函数代码示例发布时间:2022-05-15
下一篇:
PHP qa_content_prepare函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap