Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Sorry – this needs a fix (I’m still testing it). After:

    group by
    a.ID

    add:

    order by avg(b.rating_rating) desc

    I also noticed that my permalinka are not working (points to website root instead of posts).

    You can join wp_ratings table with wp_posts and then loop th posts. This is the code I use (I just copied it from my script). Put in your themes function.php. Then you can use the shortcode [wpb_most_rated] to display Most rated with images. Note that it may or not may work in your particular situation. Hope that helps.

    ///***** Most Rated articles *****/
    
    function wpb_most_rated_posts() {
    // start output buffering
    	ob_start();
    	?>
    	<div class="most-commented">
    		<?php
            // Run WP_Query
    		global $wpdb;
    
    		$query = '
    		    SELECT a.ID, a.post_title, a.guid, b.rating_id, b.rating_postid, b.rating_rating, sum(b.rating_rating)
    			FROM
    			'. $wpdb->posts .' a INNER JOIN '. $wpdb->ratings .' b ON a.ID = b.rating_postid
    			group by
    			a.ID
    		';
    
    		$results = $wpdb->get_results( $query, OBJECT );
    
    		 if ($results):
    		 global $post;
    		 foreach ($results as $post):
    		 setup_postdata($post); 
    
            //begin loop
    		?>
                <article class="cp-wrap cp-small clearfix">
                    <div class="cp-thumb-small">
                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php if (has_post_thumbnail()) { the_post_thumbnail('cp-thumb-small'); } else { echo '<img src="' . get_template_directory_uri() . '/images/placeholder-thumb-small.jpg' . '" alt="No Picture" />'; } ?></a>
                    </div>
                    <p class="entry-meta"><span class="updated"><?php echo get_the_date(); ?></span></p>
                    <h3 class="cp-title-small"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
                    <?php echo do_shortcode( '[ratings results="true"]' ); ?>
                    <span class="entry-meta-lower"><?php echo $comments; ?></span>
    			</article>
            	<hr class="mh-separator">
            <?php endforeach; ?>
    		<?php endif;
            // end loop
            ?>
    	</div>
    <?php
    
    // Turn off output buffering
    $output = ob_get_clean(); 
    
    //Return output
    return $output;
    }
    // Create shortcode
    add_shortcode('wpb_most_rated', 'wpb_most_rated_posts'); 
    
    //Enable shortcode execution in text widgets
    add_filter('widget_text', 'do_shortcode');

    EDIT: Of course you need to use your theme’s html.

    Thread Starter Tom2929

    (@mojmokotow)

    I guess I figured it out. I’ve added this function to my theme’s functions.php:

    function fsqm_quicklatex( $content ) {
        return quicklatex_parser( $content );
    }
    add_filter( 'ipt_uif_richtext', 'fsqm_quicklatex', 8 );
    add_filter( 'ipt_uif_label', 'fsqm_quicklatex', 8 );

    Just like that.
    Label is for question/answer labels, richtext for despription fields.
    It seems to work, but I need to do more testing ??

    Thread Starter Tom2929

    (@mojmokotow)

    Pavel, thanks for quick answer ?? I’ll ask them.

    Hi, great plugin ?? And sorry for my poor English.

    The cool feature would be to add some king of sorting and to automate the process of making the quizzes. It would be very useful for educational purposes.
    Simple example:
    Imagine teaching site with different kind of subiects (grouped in parent and child categories), for example ancien history, medieval history, Rome history, Cesar biography, medieval battles, importent dates in ancient history.
    Instead of making separate quizes for each one of them student would choose one, two or more topics and get the quiz (generated on the fly) based on questions from chosen categories.

    So admin should have the possibility to add questions separately from any particular quiz and to assign categories to them.
    The quiz would be generated automatically based on chosen categories.
    What do you think?

    Thread Starter Tom2929

    (@mojmokotow)

    Generally you’re right, but:

    <?php
    if (isset($_POST['trigger'])){
    $check = 'checked="checked"';
    }
    ?>
    
    <form action="#" method="post">
    <input type="checkbox" name="checked" <?php echo $check; ?> value="Obligatory/Or not">Obligatory/Or not</input>
    <input type="checkbox" name="trigger" value="Trigger">Need an invoice?</input>
    <input type="submit" name="submit" value="Submit"/>
    </form>

    This is a simple form in html and php. With the second checkbox I can decide if the first checkbox is or is not obligatory.
    But so far I have no idea how to make it work in woocommerce.

    Hi,
    I would like to start RateMyFace-like site. Does your plugin works with photos uploaded not by admin but by users?
    Rahul wrote:
    “The idea is showing random images on a page, and whenever any user clicks on any photo, the photo gets a +1 point and reloads the page to show more random pics.”

    I’m looking for something a bit different.
    The idea is showing random images on a page, and any user can rate any photo, the photo gets 1-10 rank and reloads the page to show more random pics.”
    I would be grateful for any sugestions ??

Viewing 7 replies - 1 through 7 (of 7 total)