Subscribe via Feedburner Flickr Images Youtube Profile LinkedIn Profile
GD Custom Posts And Taxonomies Tools

How To: Set and use multi ratings

Thumbnail for How To: Set and use multi ratings

Setting and using multi ratings system is much different than standard ratings used for posts, pages or comments. And since this feature is new, here is the step by step tutorial on how to start using it.

There are still some things missing from current multi rating implementation that will help you in using it.

tut mr enable 300x137 How To: Set and use multi ratings

Enable Multi Ratings

1. Enable Multi Ratings

First thing you need to do is to make sure that multi ratings feature is active. Go to the plugin settings panel, and on the general tab find plugin features section. There you need to check Multi Ratings checkbox, and click save settings button. This will enable the multi ratings, and all the panels and settings tab for them will be visible.

Also, on the general page there are adnimistation settings at the top with 3 display checkbox that you need to enable if you want to set custom CSS classes for multi rating block.

tut mr settings 300x110 How To: Set and use multi ratings

Settings

2. Multi Ratings Settings

Since we are on settings panel, we might wanna check out the settings multi ratings use. You can choose rating stars and their size for rating blocks for starters. After that you have rating text that will be rendered above rating block with stars. You can use HTML formating for the rating text. Don’t be fulled by the size of the field, there is no limit on the content you can insert here. Bu don’t go to far either.

After that you can add 4 CSS classes that will be applied to different rating block elements.  Main class is the one added to whole rating block. Inside that block there is a HTML table with all rating elements, and one CSS class is applied there. Rating text can also have custom CSS and the rating submit button another class. You can add more than one class per field, you just sepparate them with empty space.

Vote message is pretty much self explanatory, and also displays the preview of what you have choosen.

tut mr set 300x163 How To: Set and use multi ratings

New Set

3. Creating Multi Ratings Set

Now go to the Multi Sets panel, it’s time to create your first set. Click on the Add New Multi Rating Set button, and an empty form will appear. Give your set a name, write a shor description and than set the number of stars you want for the ratings. Now you need to add elements to the set. You can see that each element has a name and weight. Weight is used to calculate average rating for the set as a whole and different weights mean that element will have different impact on that calculated rating.

Most important thing about this step is that once the set is created you can’t change number of stars or number of elements one set has. It will be way to complicated to change saved info once the ratings are logged in the database. So think about what you need in the set before creating it.

After the set is saved, if everything is ok, it should appear on the multi sets lists with all the valid elements listed. Each set will get unique ID that you can use later if you want to insert the shortcode manually or to call function for insertion.

tut mr tinymce 267x300 How To: Set and use multi ratings

Inserting shortcode

4. Inserting multi ratings block into the post

Finally, you can add rating to a post or page. Right now there is no means for autoinsertion, so you need to add it yourself. There are two methods for this, one using shortcode and the other by php function call.

Shortcode

This is easier to do, and you can even use rich tinyMCE3 editor on the post edit page to do it. Editor plugin has a black/yellow star icon. When you click on it you will get popup dialog like one on the right. Select multi shortcode from the list, and a Multi Rating tab will appear. There you can select your rating set, and click insert. Popup will close, and a shortcode will be inserted in the post. Shortcode has only one parameter right now and that parameter is set ID. Inserted code will look like this (without spaces after [ and before ] signs):

[ starratingmulti id="1" ]

You can add shortcode anywhere in the post. Further more you can add 2 or more different sets in the same post.

PHP Function

If you want to integrate multi rating block call directly into the theme. Important thing is that this must be done within the WordPress post loop so that plugin can identify the post. This function is very simple, and requiers multi set id as a parameter:

wp_gdsr_render_multi(1)

By default this function will echo the rating block into the HTML. But this function has a second parameter that can change this and return rendered block as a string instead of echoing it. Just add second parameter as false if you want to get rendered string.

5. Conclusion

If everything is set right, and you didn;t missed something, you should be able to see working rating block in the post.

GD Star Rating
a WordPress rating system

Share this:

del.icio.us DiGG Google StumbleUpon Google Buzz Microsoft Live MiXX RSS PDF
How To: Set and use multi ratings, 7.5 out of 10 based on 278 ratings

46 Responses to “How To: Set and use multi ratings”

  1. mr realsurf | March 8, 2009 at 1:17 PM

    Hi again,
    I’m sorry but I don’t know too much about error detecting with Firebug. But apparently the server was having problems when you tried to visit the page. Page loading times are around the 10-12s mark here in Australia where the server is located.

    I tried deactivating a custom plugin that I thought might be causing a problem, but it made no difference.

    I created a new sample post and inserted two different multisets. But I still get the same behaviour. The odd thing is that the GDstar post rating on the same post does work as expected.

    Thank you again in advance for any advice you may be able to offer me as to how I might track down the problem.

    GD Star Rating
    a WordPress rating system
    • MillaN | March 8, 2009 at 1:42 PM

      All ratings use the same file to send the votes, and the voting procedure is the same in every way. I have never seen behavior like this, but something is definitly slowing donw the response. Maybe your mysql server is set with short time out and the delays caused by the website or some plugin in wordpress are the real problem. I don’t know much about setting the servers, so I can’t offer you some proctical solution for this.

      GD Star Rating
      a WordPress rating system
      • mr realsurf | March 8, 2009 at 9:11 PM

        My server admin sent this along: WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ ‘rvw’, 1)’ at line 1 for query INSERT IN
        TO wp_aw5uzk_gdsr_multis_values (id, source, item_id) VALUES (, ‘rvw’, 1) made by include, do_meta_boxes, call_user_func, GDStarRa
        ting->editbox_post_mur, GDStarRating->blog_multi_review_editor, GDSRDBMulti->add_empty_review_values,

        Does this suggest anything to you? I will ask about the mysql timeout setting.

        GD Star Rating
        a WordPress rating system
        • MillaN | March 8, 2009 at 9:23 PM

          Yes, something is wrong with the multi ratings tables. Missing id for this query suggests that tables are not created properly. This suggest problem with gdsr_multis_data table: either is missing or invalid. What mySQL you are using?

          GD Star Rating
          a WordPress rating system
          • mr realsurf | March 9, 2009 at 6:25 AM

            Hi again,
            I am using 5.0.67 MySQL Community Edition.

            GD Star Rating
            a WordPress rating system

Comments are closed.

www.dev4Press.com

Dev4Press is a premium service dedicated to developing of high quality plugins and themes for WordPress, custom development and consulting. Follow this link to find out more...

Feedburner Feedburner updates

Sign up to receive all latest news about GD Star Rating directly to your email.
GD Simple Widgets