本文整理汇总了PHP中qa_q_path_html函数的典型用法代码示例。如果您正苦于以下问题:PHP qa_q_path_html函数的具体用法?PHP qa_q_path_html怎么用?PHP qa_q_path_html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qa_q_path_html函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cs_user_post_list
function cs_user_post_list($handle, $type, $limit)
{
$userid = qa_handle_to_userid($handle);
require_once QA_INCLUDE_DIR . 'qa-app-posts.php';
$post = qa_db_read_all_assoc(qa_db_query_sub('SELECT * FROM ^posts INNER JOIN ^users ON ^posts.userid=^users.userid WHERE ^posts.type=$ and ^posts.userid=# ORDER BY ^posts.created DESC LIMIT #', $type, $userid, $limit));
$output = '<ul class="question-list users-post-widget post-type-' . $type . '">';
if (count($post) > 0) {
foreach ($post as $p) {
if ($type == 'Q') {
$what = qa_lang_html('cleanstrap/asked');
} elseif ($type == 'A') {
$what = qa_lang_html('cleanstrap/answered');
} elseif ('C') {
$what = qa_lang_html('cleanstrap/commented');
}
$handle = $p['handle'];
$output .= '<li id="q-list-' . $p['postid'] . '" class="question-item">';
if ($type == 'Q') {
$output .= '<div class="big-ans-count pull-left">' . $p['acount'] . '<span>' . qa_lang_html('cleanstrap/ans') . '</span></div>';
} elseif ($type == 'A') {
$output .= '<div class="big-ans-count pull-left icon-answer"></div>';
} elseif ($type == 'C') {
$output .= '<div class="big-ans-count pull-left icon-comment icon-comments"></div>';
}
$output .= '<div class="list-right">';
$timeCode = qa_when_to_html(strtotime($p['created']), 7);
$when = @$timeCode['prefix'] . @$timeCode['data'] . @$timeCode['suffix'];
if ($type == 'Q') {
$output .= '<h5><a href="' . qa_q_path_html($p['postid'], $p['title']) . '" title="' . $p['title'] . '">' . qa_html($p['title']) . '</a></h5>';
} elseif ($type == 'A') {
$output .= '<h5><a href="' . cs_post_link($p['parentid']) . '#a' . $p['postid'] . '">' . cs_truncate(strip_tags($p['content']), 300) . '</a></h5>';
} else {
$output .= '<h5><a href="' . cs_post_link($p['parentid']) . '#c' . $p['postid'] . '">' . cs_truncate(strip_tags($p['content']), 300) . '</a></h5>';
}
$output .= '<div class="list-date"><span class="icon-clock">' . $when . '</span>';
$output .= '<span class="icon-thumbs-up2">' . qa_lang_sub('cleanstrap/x_votes', $p['netvotes']) . '</span></div>';
$output .= '</div>';
$output .= '</li>';
}
} else {
if ($type == 'Q') {
$what = 'questions';
} elseif ($type == 'A') {
$what = 'answers';
} elseif ('C') {
$what = 'comments';
}
$output .= '<li class="no-post-found">' . qa_lang('cleanstrap/no_' . $what) . ' </li>';
}
$output .= '</ul>';
echo $output;
}
示例2: carousel_item
function carousel_item($type, $limit, $col_item = 1)
{
require_once QA_INCLUDE_DIR . 'qa-app-posts.php';
$post = qa_db_query_sub('SELECT * FROM ^postmetas, ^posts INNER JOIN ^users ON ^posts.userid=^users.userid WHERE ^posts.type=$ and ( ^postmetas.postid = ^posts.postid and ^postmetas.title = "featured_question" ) ORDER BY ^posts.created DESC LIMIT #', $type, $limit);
$output = '<div class="item"><div class="row">';
$i = 1;
while ($p = mysql_fetch_array($post)) {
if ($type == 'Q') {
$what = qa_lang('cleanstrap/asked');
} elseif ($type == 'A') {
$what = qa_lang('cleanstrap/answered');
} elseif ('C') {
$what = qa_lang('cleanstrap/commented');
}
$handle = $p['handle'];
if ($type == 'Q') {
$link_header = '<a href="' . qa_q_path_html($p['postid'], $p['title']) . '" title="' . $p['title'] . '">';
} elseif ($type == 'A') {
$link_header = '<a href="' . cs_post_link($p['parentid']) . '#a' . $p['postid'] . '">';
} else {
$link_header = '<a href="' . cs_post_link($p['parentid']) . '#c' . $p['postid'] . '">';
}
$output .= '<div class="slider-item col-sm-' . 12 / $col_item . '">';
$output .= '<div class="slider-item-inner">';
$featured_img = get_featured_thumb($p['postid']);
if ($featured_img) {
$output .= $link_header . '<div class="featured-image">' . $featured_img . '</div></a>';
}
if ($type == 'Q') {
$output .= '<div class="big-ans-count pull-left">' . $p['acount'] . '<span> ans</span></div>';
} elseif ($type == 'A') {
$output .= '<div class="big-ans-count pull-left vote">' . $p['netvotes'] . '<span>' . qa_lang('cleanstrap/vote') . '</span></div>';
}
$output .= '<h5>' . $link_header . cs_truncate(qa_html($p['title']), 50) . '</a></h5>';
$output .= '<div class="meta">';
$when = qa_when_to_html(strtotime($p['created']), 7);
$avatar = cs_get_avatar($handle, 15, false);
if ($avatar) {
$output .= '<img src="' . $avatar . '" />';
}
$output .= '<span class="icon-time">' . implode(' ', $when) . '</span>';
$output .= '<span class="vote-count">' . $p['netvotes'] . ' ' . qa_lang('cleanstrap/votes') . '</span></div>';
$output .= '</div>';
$output .= '</div>';
if ($col_item == $i) {
$output .= '</div></div><div class="item active"><div class="row">';
}
$i++;
}
$output .= '</div></div>';
return $output;
}
示例3: cs_post_list
function cs_post_list($type, $limit, $return = false)
{
$posts = qa_db_read_all_assoc(qa_db_query_sub('SELECT ^posts.* , ^users.* FROM ^posts, ^users WHERE ^posts.userid=^users.userid AND ^posts.type=$ ORDER BY ^posts.created DESC LIMIT #', $type, $limit));
$output = '<ul class="posts-list">';
foreach ($posts as $p) {
if ($type == 'Q') {
$what = qa_lang_html('cleanstrap/asked');
} elseif ($type == 'A') {
$what = qa_lang_html('cleanstrap/answered');
} elseif ('C') {
$what = qa_lang_html('cleanstrap/commented');
}
$handle = $p['handle'];
$timeCode = qa_when_to_html(strtotime($p['created']), 7);
$when = @$timeCode['prefix'] . @$timeCode['data'] . @$timeCode['suffix'];
$output .= '<li>';
$output .= cs_get_post_avatar($p, $p['userid'], 30, true);
$output .= '<div class="post-content">';
if ($type == 'Q') {
$output .= '<a class="title question" href="' . qa_q_path_html($p['postid'], $p['title']) . '" title="' . $p['title'] . '">' . qa_html($p['title']) . '</a>';
} elseif ($type == 'A') {
$output .= '<a class="title" href="' . cs_post_link($p['parentid']) . '#a' . $p['postid'] . '">' . cs_truncate(strip_tags($p['content']), 100) . '</a>';
} else {
$output .= '<a class="title" href="' . cs_post_link($p['parentid']) . '#c' . $p['postid'] . '">' . cs_truncate(strip_tags($p['content']), 100) . '</a>';
}
$output .= '<div class="meta">';
//$output .= '<span><a href="' . qa_path_html('user/' . $handle) . '">' . cs_name($handle) . '</a> ' . $what . '</span>';
if ($type == 'Q') {
$output .= '<span>' . qa_lang_sub('cleanstrap/x_answers', $p['acount']) . '</span>';
}
$output .= '<span class="time icon-time">' . $when . '</span>';
$output .= '<span class="vote-count icon-thumbs-up2">' . qa_lang_sub('cleanstrap/x_votes', $p['netvotes']) . '</span>';
$output .= '</div>';
$output .= '</div>';
$output .= '</li>';
}
$output .= '</ul>';
if ($return) {
return $output;
}
echo $output;
}
示例4: 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>');
}
示例5: get_next_q
function get_next_q()
{
$myurl = $this->request;
$myurlpieces = explode("/", $myurl);
$myurl = $myurlpieces[0];
if (is_numeric($myurl)) {
$query_n = "SELECT ^posts.*,^categories.position\n\tFROM ^posts INNER JOIN ^categories ON ^posts.categoryid = ^categories.categoryid\n\tWHERE postid = {$myurl}\n\tAND type='Q'\n\tLIMIT 1";
$current_q = qa_db_query_sub($query_n);
while ($current_link = qa_db_read_one_assoc($current_q, true)) {
$categoryid = $current_link['categoryid'];
$categoryposition = $current_link['position'];
}
$combinedid = $categoryposition * 1000000 - $myurl;
$query_n = "SELECT ^posts.* \n\tFROM ^posts INNER JOIN ^categories ON ^posts.categoryid = ^categories.categoryid\n\tWHERE position*1000000-postid > {$combinedid} \n\tAND type='Q'\n\tORDER BY position*1000000-postid ASC\n\tLIMIT 1";
$next_q = qa_db_query_sub($query_n);
while ($next_link = qa_db_read_one_assoc($next_q, true)) {
$title = $next_link['title'];
$pid = $next_link['postid'];
$this->output('
<A HREF="' . qa_q_path_html($pid, $title) . '" title="' . $title . '" STYLE="float:right;padding-right:20px">Next Action <img style="border:0px;width:50px" src="../qa-theme/GreenTheme-CATO/next.png"/></A>', '');
}
}
}
示例6: 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);
}
}
示例7: 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);
}
}
示例8: q_title_list
public function q_title_list($q_list, $attrs = null)
{
$this->output('<ul class="qa-q-title-list">');
foreach ($q_list as $q) {
$this->output('<li class="qa-q-title-item">', '<a href="' . qa_q_path_html($q['postid'], $q['title']) . '" ' . $attrs . '>' . qa_html($q['title']) . '</a>', '</li>');
}
$this->output('</ul>');
}
示例9: cs_post_link
function cs_post_link($id)
{
$type = mysql_result(qa_db_query_sub('SELECT type FROM ^posts WHERE postid = "' . $id . '"'), 0);
if ($type == 'A') {
$id = mysql_result(qa_db_query_sub('SELECT parentid FROM ^posts WHERE postid = "' . $id . '"'), 0);
}
$post = qa_db_query_sub('SELECT title FROM ^posts WHERE postid = "' . $id . '"');
return qa_q_path_html($id, mysql_result($post, 0));
}
示例10: qa_page_q_question_view
function qa_page_q_question_view($question, $parentquestion, $closepost, $usershtml, $formrequested)
{
$questionid = $question['postid'];
$userid = qa_get_logged_in_userid();
$cookieid = qa_cookie_get();
$htmloptions = qa_post_html_defaults('Q', true);
$htmloptions['answersview'] = false;
// answer count is displayed separately so don't show it here
$htmloptions['avatarsize'] = qa_opt('avatar_q_page_q_size');
$q_view = qa_post_html_fields($question, $userid, $cookieid, $usershtml, null, $htmloptions);
$q_view['main_form_tags'] = 'METHOD="POST" ACTION="' . qa_self_html() . '"';
// Buttons for operating on the question
if (!$formrequested) {
// don't show if another form is currently being shown on page
$clicksuffix = ' onClick="qa_show_waiting_after(this, false);"';
// add to operations that write to database
$buttons = array();
if ($question['editbutton']) {
$buttons['edit'] = array('tags' => 'NAME="q_doedit"', 'label' => qa_lang_html('question/edit_button'), 'popup' => qa_lang_html('question/edit_q_popup'));
}
$hascategories = qa_using_categories();
if ($question['retagcatbutton']) {
$buttons['retagcat'] = array('tags' => 'NAME="q_doedit"', 'label' => qa_lang_html($hascategories ? 'question/recat_button' : 'question/retag_button'), 'popup' => qa_lang_html($hascategories ? qa_using_tags() ? 'question/retag_cat_popup' : 'question/recat_popup' : 'question/retag_popup'));
}
if ($question['flagbutton']) {
$buttons['flag'] = array('tags' => 'NAME="q_doflag"' . $clicksuffix, 'label' => qa_lang_html($question['flagtohide'] ? 'question/flag_hide_button' : 'question/flag_button'), 'popup' => qa_lang_html('question/flag_q_popup'));
}
if ($question['unflaggable']) {
$buttons['unflag'] = array('tags' => 'NAME="q_dounflag"' . $clicksuffix, 'label' => qa_lang_html('question/unflag_button'), 'popup' => qa_lang_html('question/unflag_popup'));
}
if ($question['clearflaggable']) {
$buttons['clearflags'] = array('tags' => 'NAME="q_doclearflags"' . $clicksuffix, 'label' => qa_lang_html('question/clear_flags_button'), 'popup' => qa_lang_html('question/clear_flags_popup'));
}
if ($question['closeable']) {
$buttons['close'] = array('tags' => 'NAME="q_doclose"', 'label' => qa_lang_html('question/close_button'), 'popup' => qa_lang_html('question/close_q_popup'));
}
if ($question['reopenable']) {
$buttons['reopen'] = array('tags' => 'NAME="q_doreopen"' . $clicksuffix, 'label' => qa_lang_html('question/reopen_button'));
}
if ($question['moderatable']) {
$buttons['approve'] = array('tags' => 'NAME="q_doapprove"' . $clicksuffix, 'label' => qa_lang_html('question/approve_button'));
$buttons['reject'] = array('tags' => 'NAME="q_doreject"' . $clicksuffix, 'label' => qa_lang_html('question/reject_button'));
}
if ($question['hideable']) {
$buttons['hide'] = array('tags' => 'NAME="q_dohide"' . $clicksuffix, 'label' => qa_lang_html('question/hide_button'), 'popup' => qa_lang_html('question/hide_q_popup'));
}
if ($question['reshowable']) {
$buttons['reshow'] = array('tags' => 'NAME="q_doreshow"' . $clicksuffix, 'label' => qa_lang_html('question/reshow_button'));
}
if ($question['deleteable']) {
$buttons['delete'] = array('tags' => 'NAME="q_dodelete"' . $clicksuffix, 'label' => qa_lang_html('question/delete_button'), 'popup' => qa_lang_html('question/delete_q_popup'));
}
if ($question['claimable']) {
$buttons['claim'] = array('tags' => 'NAME="q_doclaim"' . $clicksuffix, 'label' => qa_lang_html('question/claim_button'));
}
if ($question['answerbutton']) {
// don't show if shown by default
$buttons['answer'] = array('tags' => 'NAME="q_doanswer" ID="q_doanswer" onClick="return qa_toggle_element(\'anew\')"', 'label' => qa_lang_html('question/answer_button'), 'popup' => qa_lang_html('question/answer_q_popup'));
}
if ($question['commentbutton']) {
$buttons['comment'] = array('tags' => 'NAME="q_docomment" onClick="return qa_toggle_element(\'c' . $questionid . '\')"', 'label' => qa_lang_html('question/comment_button'), 'popup' => qa_lang_html('question/comment_q_popup'));
}
$q_view['form'] = array('style' => 'light', 'buttons' => $buttons, 'hidden' => array('qa_click' => ''));
}
// Information about the question of the answer that this question follows on from (or a question directly)
if (isset($parentquestion)) {
$q_view['follows'] = array('label' => qa_lang_html($question['parentid'] == $parentquestion['postid'] ? 'question/follows_q' : 'question/follows_a'), 'title' => qa_html(qa_block_words_replace($parentquestion['title'], qa_get_block_words_preg())), 'url' => qa_q_path_html($parentquestion['postid'], $parentquestion['title'], false, $question['parentid'] == $parentquestion['postid'] ? 'Q' : 'A', $question['parentid']));
}
// Information about the question that this question is a duplicate of (if appropriate)
if (isset($closepost)) {
if ($closepost['basetype'] == 'Q') {
$q_view['closed'] = array('label' => qa_lang_html('question/closed_as_duplicate'), 'content' => qa_html(qa_block_words_replace($closepost['title'], qa_get_block_words_preg())), 'url' => qa_q_path_html($closepost['postid'], $closepost['title']));
} elseif ($closepost['type'] == 'NOTE') {
$viewer = qa_load_viewer($closepost['content'], $closepost['format']);
$q_view['closed'] = array('label' => qa_lang_html('question/closed_with_note'), 'content' => $viewer->get_html($closepost['content'], $closepost['format'], array('blockwordspreg' => qa_get_block_words_preg())));
}
}
// Extra value display
if (strlen(@$question['extra']) && qa_opt('extra_field_active') && qa_opt('extra_field_display')) {
$q_view['extra'] = array('label' => qa_html(qa_opt('extra_field_label')), 'content' => qa_html(qa_block_words_replace($question['extra'], qa_get_block_words_preg())));
}
return $q_view;
}
示例11: qa_other_to_q_html_fields
function qa_other_to_q_html_fields($question, $userid, $cookieid, $usershtml, $dummy, $options)
{
if (qa_to_override(__FUNCTION__)) {
$args = func_get_args();
return qa_call_override(__FUNCTION__, $args);
}
require_once QA_INCLUDE_DIR . 'app/updates.php';
$fields = qa_post_html_fields($question, $userid, $cookieid, $usershtml, null, $options);
switch ($question['obasetype'] . '-' . @$question['oupdatetype']) {
case 'Q-':
$langstring = 'main/asked';
break;
case 'Q-' . QA_UPDATE_VISIBLE:
if (@$question['opersonal']) {
$langstring = $question['hidden'] ? 'misc/your_q_hidden' : 'misc/your_q_reshown';
} else {
$langstring = $question['hidden'] ? 'main/hidden' : 'main/reshown';
}
break;
case 'Q-' . QA_UPDATE_CLOSED:
if (@$question['opersonal']) {
$langstring = isset($question['closedbyid']) ? 'misc/your_q_closed' : 'misc/your_q_reopened';
} else {
$langstring = isset($question['closedbyid']) ? 'main/closed' : 'main/reopened';
}
break;
case 'Q-' . QA_UPDATE_TAGS:
$langstring = @$question['opersonal'] ? 'misc/your_q_retagged' : 'main/retagged';
break;
case 'Q-' . QA_UPDATE_CATEGORY:
$langstring = @$question['opersonal'] ? 'misc/your_q_recategorized' : 'main/recategorized';
break;
case 'A-':
$langstring = @$question['opersonal'] ? 'misc/your_q_answered' : 'main/answered';
break;
case 'A-' . QA_UPDATE_SELECTED:
$langstring = @$question['opersonal'] ? 'misc/your_a_selected' : 'main/answer_selected';
break;
case 'A-' . QA_UPDATE_VISIBLE:
if (@$question['opersonal']) {
$langstring = $question['ohidden'] ? 'misc/your_a_hidden' : 'misc/your_a_reshown';
} else {
$langstring = $question['ohidden'] ? 'main/hidden' : 'main/answer_reshown';
}
break;
case 'A-' . QA_UPDATE_CONTENT:
$langstring = @$question['opersonal'] ? 'misc/your_a_edited' : 'main/answer_edited';
break;
case 'Q-' . QA_UPDATE_FOLLOWS:
$langstring = @$question['opersonal'] ? 'misc/your_a_questioned' : 'main/asked_related_q';
break;
case 'C-':
$langstring = 'main/commented';
break;
case 'C-' . QA_UPDATE_C_FOR_Q:
$langstring = @$question['opersonal'] ? 'misc/your_q_commented' : 'main/commented';
break;
case 'C-' . QA_UPDATE_C_FOR_A:
$langstring = @$question['opersonal'] ? 'misc/your_a_commented' : 'main/commented';
break;
case 'C-' . QA_UPDATE_FOLLOWS:
$langstring = @$question['opersonal'] ? 'misc/your_c_followed' : 'main/commented';
break;
case 'C-' . QA_UPDATE_TYPE:
$langstring = @$question['opersonal'] ? 'misc/your_c_moved' : 'main/comment_moved';
break;
case 'C-' . QA_UPDATE_VISIBLE:
if (@$question['opersonal']) {
$langstring = $question['ohidden'] ? 'misc/your_c_hidden' : 'misc/your_c_reshown';
} else {
$langstring = $question['ohidden'] ? 'main/hidden' : 'main/comment_reshown';
}
break;
case 'C-' . QA_UPDATE_CONTENT:
$langstring = @$question['opersonal'] ? 'misc/your_c_edited' : 'main/comment_edited';
break;
case 'Q-' . QA_UPDATE_CONTENT:
default:
$langstring = @$question['opersonal'] ? 'misc/your_q_edited' : 'main/edited';
break;
}
$fields['what'] = qa_lang_html($langstring);
if (@$question['opersonal']) {
$fields['what_your'] = true;
}
if ($question['obasetype'] != 'Q' || @$question['oupdatetype'] == QA_UPDATE_FOLLOWS) {
$fields['what_url'] = qa_q_path_html($question['postid'], $question['title'], false, $question['obasetype'], $question['opostid']);
}
if (@$options['contentview'] && !empty($question['ocontent'])) {
$viewer = qa_load_viewer($question['ocontent'], $question['oformat']);
$fields['content'] = $viewer->get_html($question['ocontent'], $question['oformat'], array('blockwordspreg' => @$options['blockwordspreg'], 'showurllinks' => @$options['showurllinks'], 'linksnewwindow' => @$options['linksnewwindow']));
}
if (@$options['whenview']) {
$fields['when'] = qa_when_to_html($question['otime'], @$options['fulldatedays']);
}
if (@$options['whoview']) {
$isbyuser = qa_post_is_by_user(array('userid' => $question['ouserid'], 'cookieid' => @$question['ocookieid']), $userid, $cookieid);
$fields['who'] = qa_who_to_html($isbyuser, $question['ouserid'], $usershtml, @$options['ipview'] ? @$question['oip'] : null, false, @$question['oname']);
if (isset($question['opoints'])) {
if (@$options['pointsview']) {
//.........这里部分代码省略.........
示例12: get_full_post
//.........这里部分代码省略.........
break;
case 'Q-' . QA_UPDATE_CATEGORY:
$langstring = 'main/recategorized';
break;
case 'A-':
$langstring = 'main/answered';
break;
case 'A-' . QA_UPDATE_SELECTED:
$langstring = 'main/answer_selected';
break;
case 'A-' . QA_UPDATE_VISIBLE:
$langstring = $post['ohidden'] ? 'main/hidden' : 'main/answer_reshown';
break;
case 'A-' . QA_UPDATE_CONTENT:
$langstring = 'main/answer_edited';
break;
case 'Q-' . QA_UPDATE_FOLLOWS:
$langstring = 'main/asked_related_q';
break;
case 'C-':
$langstring = 'main/commented';
break;
case 'C-' . QA_UPDATE_TYPE:
$langstring = 'main/comment_moved';
break;
case 'C-' . QA_UPDATE_VISIBLE:
$langstring = $post['ohidden'] ? 'main/hidden' : 'main/comment_reshown';
break;
case 'C-' . QA_UPDATE_CONTENT:
$langstring = 'main/comment_edited';
break;
case 'Q-' . QA_UPDATE_CONTENT:
default:
$langstring = 'main/edited';
break;
}
$fields['what_2'] = qa_lang_html($langstring);
if ($post['obasetype'] != 'Q' || @$post['oupdatetype'] == QA_UPDATE_FOLLOWS) {
$fields['what_2_url'] = qa_q_path_html($post['postid'], $post['title'], false, $post['obasetype'], $post['opostid']);
}
if (@$options['contentview'] && !empty($post['ocontent'])) {
$viewer = qa_load_viewer($post['ocontent'], $post['oformat']);
$fields['content_2'] = $viewer->get_html($post['ocontent'], $post['oformat'], array('blockwordspreg' => @$options['blockwordspreg'], 'showurllinks' => @$options['showurllinks'], 'linksnewwindow' => @$options['linksnewwindow']));
}
if (@$options['whenview']) {
$fields['when_2'] = qa_when_to_html($post['otime'], @$options['fulldatedays']);
}
if (@$options['whoview']) {
$isbyuser = qa_post_is_by_user(array('userid' => $post['ouserid'], 'cookieid' => @$post['ocookieid']), $userid, $cookieid);
$fields['who_2'] = qa_who_to_html($isbyuser, $post['ouserid'], $usershtml, @$options['ipview'] ? @$post['oip'] : null, false);
if (isset($post['opoints'])) {
if (@$options['pointsview']) {
$fields['who_2']['points'] = $post['opoints'] == 1 ? qa_lang_html_sub_split('main/1_point', '1', '1') : qa_lang_html_sub_split('main/x_points', qa_html(number_format($post['opoints'])));
}
if (isset($options['pointstitle'])) {
$fields['who_2']['title'] = qa_get_points_title_html($post['opoints'], $options['pointstitle']);
}
}
if (isset($post['olevel'])) {
$fields['who_2']['level'] = qa_html(qa_user_level_string($post['olevel']));
}
}
} else {
if (@$options['updateview'] && isset($post['updated']) && ($post['updatetype'] != QA_UPDATE_SELECTED || $isselected) && (!isset($post['created']) || $post['hidden'] && $post['updatetype'] == QA_UPDATE_VISIBLE || isset($post['closedbyid']) && $post['updatetype'] == QA_UPDATE_CLOSED || abs($post['updated'] - $post['created']) > 300 || $post['lastuserid'] != $post['userid'])) {
switch ($post['updatetype']) {
case QA_UPDATE_TYPE:
case QA_UPDATE_PARENT:
$langstring = 'main/moved';
break;
case QA_UPDATE_CATEGORY:
$langstring = 'main/recategorized';
break;
case QA_UPDATE_VISIBLE:
$langstring = $post['hidden'] ? 'main/hidden' : 'main/reshown';
break;
case QA_UPDATE_CLOSED:
$langstring = isset($post['closedbyid']) ? 'main/closed' : 'main/reopened';
break;
case QA_UPDATE_TAGS:
$langstring = 'main/retagged';
break;
case QA_UPDATE_SELECTED:
$langstring = 'main/selected';
break;
default:
$langstring = 'main/edited';
break;
}
$fields['what_2'] = qa_lang_html($langstring);
if (@$options['whenview']) {
$fields['when_2'] = qa_when_to_html($post['updated'], @$options['fulldatedays']);
}
if (isset($post['lastuserid']) && @$options['whoview']) {
$fields['who_2'] = qa_who_to_html(isset($userid) && $post['lastuserid'] == $userid, $post['lastuserid'], $usershtml, @$options['ipview'] ? $post['lastip'] : null, false);
}
}
}
$fields['avatar'] = $this->get_post_avatar($post);
return $fields;
}
示例13: cs_ajax_get_question_suggestion
function cs_ajax_get_question_suggestion()
{
$query = strip_tags($_REQUEST['start_with']);
$relatedquestions = qa_db_select_with_pending(qa_db_search_posts_selectspec(null, qa_string_to_words($query), null, null, null, null, 0, false, 10));
//print_r($relatedquestions);
if (isset($relatedquestions) && !empty($relatedquestions)) {
$data = array();
foreach ($relatedquestions as $k => $q) {
$data[$k]['title'] = $q['title'];
$data[$k]['blob'] = cs_get_avatar($q['handle'], 30, false);
$data[$k]['url'] = qa_q_path_html($q['postid'], $q['title']);
$data[$k]['tags'] = $q['tags'];
$data[$k]['answers'] = $q['acount'];
}
echo json_encode($data);
}
die;
}
示例14: array
break;
}
}
} else {
$exampletags = array();
}
// Output the response header and example tags
echo "QA_AJAX_RESPONSE\n1\n";
echo strtr(qa_html(implode(',', $exampletags)), "\r\n", ' ') . "\n";
// Collect and output the list of related questions
if ($doaskcheck) {
require_once QA_INCLUDE_DIR . 'qa-app-format.php';
$count = 0;
$minscore = qa_match_to_min_score(qa_opt('match_ask_check_qs'));
$maxcount = qa_opt('page_size_ask_check_qs');
foreach ($relatedquestions as $question) {
if ($question['score'] < $minscore) {
break;
}
if (!$count) {
echo qa_lang_html('question/ask_same_q') . '<BR/>';
}
echo strtr('<A HREF="' . qa_q_path_html($question['postid'], $question['title']) . '" TARGET="_blank">' . qa_html($question['title']) . '</A><BR/>', "\r\n", ' ') . "\n";
if (++$count >= $maxcount) {
break;
}
}
}
/*
Omit PHP closing tag to help avoid accidental output
*/
示例15: isset
case 'C-' . QA_UPDATE_TYPE:
$langstring = 'misc/feed_c_moved_prefix';
break;
case 'C-' . QA_UPDATE_VISIBLE:
$langstring = $question['ohidden'] ? 'misc/feed_hidden_prefix' : 'misc/feed_c_reshown_prefix';
break;
case 'C-' . QA_UPDATE_CONTENT:
$langstring = 'misc/feed_c_edited_prefix';
break;
case 'Q-' . QA_UPDATE_CONTENT:
default:
$langstring = 'misc/feed_edited_prefix';
break;
}
$titleprefix = isset($langstring) ? qa_lang($langstring) : '';
$urlhtml = qa_q_path_html($question['postid'], $question['title'], true, @$question['obasetype'], @$question['opostid']);
}
if (isset($blockwordspreg)) {
$question['title'] = qa_block_words_replace($question['title'], $blockwordspreg);
}
// Build the inner XML structure for each item
$lines[] = '<item>';
$lines[] = '<title>' . qa_html($titleprefix . $question['title']) . '</title>';
$lines[] = '<link>' . $urlhtml . '</link>';
if (isset($htmlcontent)) {
$lines[] = '<description>' . qa_html($htmlcontent) . '</description>';
}
// qa_html() a second time to put HTML code inside XML wrapper
if (isset($question['categoryname'])) {
$lines[] = '<category>' . qa_html($question['categoryname']) . '</category>';
}