I have created this widget but doesn't work :(
<?php class qa_featured_widget { var $featured_questions; function allow_template($template) { $allow=false; switch ($template) { case 'activity': case 'qa': case 'questions': case 'hot': case 'ask': case 'categories': case 'question': case 'tag': case 'tags': case 'unanswered': case 'user': case 'users': case 'search': case 'account': case 'updates': case 'admin': case 'custom': $allow=true; break; } return $allow; } function allow_region($region) { return ($region=='side') || ($region=='full'); } function output_widget($region, $place, $themeobject, $template, $request, $qa_content) { require_once QA_INCLUDE_DIR.'qa-db-selects.php'; $userid=qa_get_logged_in_userid(); $cookieid=qa_cookie_get(); $query_q = 'SELECT * FROM ^posts, ^users WHERE ^posts.userid = ^users.userid AND ^posts.type="Q" ORDER BY ^posts.created DESC LIMIT '. qa_opt('q2am_number_of_questions'); $questions = qa_db_query_sub($query_q); $minscore=qa_match_to_min_score(qa_opt('match_related_qs')); foreach ($questions as $key => $question) if ($question<$this->featured_questions) unset($questions[$key]); if ($region=='side') { $title = $question['title']; $pid = $question['postid']; $themeobject->output(' <LI CLASS="qa-recent-q-item"><A HREF="'. qa_q_path_html($pid, $title) .'" title="'. $title .'" CLASS="qa-recent-widget-title">'.qa_html($title).'</A>'); } } }
<?php
class qa_featured_widget {
var $featured_questions;
function allow_template($template) { $allow=false; switch ($template) { case 'activity': case 'qa': case 'questions': case 'hot': case 'ask': case 'categories': case 'question': case 'tag': case 'tags': case 'unanswered': case 'user': case 'users': case 'search': case 'account': case 'updates': case 'admin': case 'custom': $allow=true; break; } return $allow; }
function allow_region($region) { return ($region=='side') || ($region=='full'); } function output_widget($region, $place, $themeobject, $template, $request, $qa_content) { require_once QA_INCLUDE_DIR.'qa-db-selects.php';
$userid=qa_get_logged_in_userid(); $cookieid=qa_cookie_get(); $query_q = 'SELECT * FROM ^posts, ^users WHERE ^posts.userid = ^users.userid AND ^posts.type="Q" ORDER BY ^posts.created DESC LIMIT '. qa_opt('q2am_number_of_questions'); $questions = qa_db_query_sub($query_q); $minscore=qa_match_to_min_score(qa_opt('match_related_qs'));
foreach ($questions as $key => $question) if ($question<$this->featured_questions) unset($questions[$key]);
if ($region=='side') { $title = $question['title']; $pid = $question['postid']; $themeobject->output(' <LI CLASS="qa-recent-q-item"><A HREF="'. qa_q_path_html($pid, $title) .'" title="'. $title .'" CLASS="qa-recent-widget-title">'.qa_html($title).'</A>'); } }
}
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask here, in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.