Geeklog France
 

rating plugin

The rating plugin allow you to rate items (story, staticpage, comment…) and add review to items.

[file:54 Dowload Rating plugin]

Install

  • As with all Geeklog plugins, upload and unpack the tarball in the plugins directory of your Geeklog installation (the plugins directory is in the same directory as the config.php file).
  • Move the admin directory to public_html/admin/plugins and rename it rating
  • Move the public_html directory to public_html and rename it rating
  • Move the help directory to public_html
  • Open the config.php file in your favourite text editor and edit the settings to suit your needs. If you have no clue as to what your needs are, you should be OK with everything as is. Go to the plugins administration page in your setup, and install the plugin.

Upgrade

Upgrade 2.2beta to 2.3.0

  • Simply overwrite all existing files with the new files.
  • Goto the plugin Admin section and click on the edit button for the rating plugin. Then click on the update button to update to the latest version.

Upgrade 2.1beta to 2.2beta

  • Simply overwrite all existing files with the new files. You must update the config file.
  • Goto the plugin Admin section and click on the edit button for the rating plugin. Then click on the update button to update the database to the latest version.
  • WARNING, since there was a number of bugs dealing with security introduced with the last release this upgrade resets the owner of all rating totals with the owner Anonymous, to Admin and also resets all permissions (for both ratings and rating totals) to the defined defaults in the config.php at the bottom.

Upgrade 1.0b2 or 2.0beta to 2.1beta

  • Simply overwrite all existing files with the new files. You can keep the same config file.
  • Goto the plugin Admin section and click on the edit button for the rating plugin. Then click on the update button to update the database to the latest version.
  • If you have modified the Geeklog core files to included automated ratings after stories, this will need updating (see below)

Uninstall

  • Remove any code added to Geeklog from “Integration with Geeklog” (below)
  • From the plugin control panel, select the plugin and uninstall from there.
  • Then delete all the plugin files that you installed.

Integration with Geeklog

As this is a new plugin, and other plugin makers have not had time to allow their plugins to use the rating plugins functionality, at this point you have an installed rating plugin that can do absolutely nothing. You now need to modify your template files (See Templates below) to make Geeklog use the plugin.

Integration in other plugins is simple, and involves calling just one function that will return the HTML to incorporate into your page.

/* start rating code */
    if (function_exists('RATING_display_rating'))
    {
        $template->set_var('rating',  RATING_display_rating($A['id'], 'myplugin', $A['id'], 1, 5, CONST_FLAG_DEFAULT_RATING ) );
    }
 
/* end rating code */

The “function_exists” check is there to ensure that your site is not compromised should the rating plugin be uninstalled.

'rating' your template variable to replave with the rating HTML. You can grab the output of the function RATING_return_form directly if you prefer of course.
$A['id'] in this case, a unique identifier. You can set this to whatever unique id you like. Can be 'myplugin_' . $A['id']
'myplugin' the type of item you are rating. The statistics page will use this to separate out types of items being rated.
$A['id'] in this case, your item identifier.
1 minimum value for rating (usually 1)
5 maximum value for rating (usually 5, set this to 1 if using Diggs)
0 Function Flag, defines if the rating includes reviews and how it is displayed (see below for acceptable values).

If you have any questions, drop a message in the forum on on the main Geeklog site. There is a rating plugin thread here: http://www.geeklog.net/forum/index.php/

Templates

You need to customise your themes. This simply requires that you add

{rating}

wherever you want to have a rating appear. The files you will probably want to edit are (within each theme directory):

  • featuredstorytext.thtml
  • storytext.thtml
  • comment/comments.thtml
  • profile.thtml

Autotagging

You can automatically add a rating option to any story or staticpage etc. that supports autotags. The format is

[ rating : id min max function_flag ]

idis any random (unique) key to use to tag the autotag
min minimum possible score
max maximum possible score
function_flagdefines if the rating includes reviews and how it is displayed

The problem with autotags is that there is no way to access story ids, so when looking at the statistics page, there is no way to link back to the original story/staticpage/etc.

We have over come this by allowing you to manually add the id of the item the rating is linked too in the admin page. If you have modified the core files you will not have to worry about this for those particular ratings.

Function Flag

The Function Flag is made up of multiple values added together.

Value Description Geeklog Defined Constant
0 Default setting, allows backwards compatibility CONST_FLAG_DEFAULT_RATING
1 Display Rating as stars CONST_FLAG_RATING_AS_STARS
2 Display Rating as text CONST_FLAG_RATING_AS_TEXT
1024 Display a Digg type rating CONST_FLAG_RATING_AS_DIGG
4 Show existing user rating CONST_FLAG_SHOW_TOTALS
8 Show Average or Diggs Text CONST_FLAG_SHOW_LABEL
16 Show View Review Button (if any ratings/reviews exist)CONST_FLAG_REVIEWS_VIEW
32 Show Add Review buttonCONST_FLAG_REVIEWS_ADD
64 Rating is a view only (No Adding)CONST_FLAG_RATING_VIEW
128 User Rating interface as text ([1] [2] [3] …)CONST_FLAG_RATE_AS_TEXT
256 User Rating interface as starsCONST_FLAG_RATE_AS_STARS
512 User Rating interface as a dropdown list and save buttonCONST_FLAG_RATE_AS_COMBO

Please see the docs that are accessable from the Admin Rating area for more information.

Feedback

Please email or post feedback in the threads mentioned above. In particular, if you are a plugin developer and would like to enable your plugin to use the rating plugin functionality, please drop a line.

Authors

Euan McKay & Tom Homer

History

Version 2.3.1 Dec. 15th 2010

  • Updated version by ::ben to support paypal plugin (Needed rating conf values)
  • New star color
  • Fix template bug on Edit page
  • Fix language bug on Edit page for save and delete action.
  • Fix template bug for admin menu
  • Fix search issue

Version 2.3.0 July 16th 2007

Connecté en tant que : Guest (Guest)
plugins/rating.txt · Dernière modification: 2010/12/15 14:11 par ::Ben
 

Download geeklog

Last version 1.8.1

Espace Membre





Devenir membre
Enregistrez-vous

Mot de passe oublié ?

Change language

Categories

  • Geeklog (38)
  • Plugins (53)
  • Thèmes (17)
  • My cart

    Votre panier (0 article)

    Votre panier est vide!

    0.00 EUR

    Visual Theme Switcher

    Test out available themes by selecting from one of the 6 available themes or give the Visual Switcher a try:

    Follow us on twitter

    En ligne

    Visiteurs: 9