Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.8k views
in Plugins by
Hey everyone, I am using featured questions plugin and it's working perfect , but also I want to display selected featured questions in sidebar ,,, is it possible??

 

thanks for answers
Q2A version: 1.6.3

4 Answers

0 votes
by
I have created witget but can not show the featured questions pls help
0 votes
by
I need this too
0 votes
by
by
I met an error:
mysql_fetch_assoc() expects parameter 1 to be resource, object given in q2am-featured-question-widget.php on line 447, 371.
 How could I solve this problem.
by
replace mysql_fetch_assoc() with mysqli_fetch_assoc()
by
Thanks for your help. It works well now.
by
I met an error when I enabled Featured Questions plugin:
<code>Undefined index: part in qa-base.php(595) : eval()'d code on line 189</code>
 Could you please give me solution to fix this ?
Many thanks
by
send pm to me
by
I fixed it by changing the configuration of php
display_errors = Off
+1 vote
by

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>');
    
            }
        }


    }

...