Results 1 to 4 of 4

Thread: vBA Dynamics - Enhanced Article Rating System

  1. #1
    Join Date
    Dec 2007

    Default vBA Dynamics - Enhanced Article Rating System

    Good morning everyone!

    This is part 2 that contains a complex rating system for Dynamics.

    Important Notes:

    A. Please note that one field is added to the entries table and one existing field is altered.

    B. This rating system only applies to articles from Dynamics - it does not modify or alter the rating behavio[u]r for the forums.

    C. This modification is released to be used ONLY for Dynamics. The code/ideas/formulas from this mod cannot be used in other applications or projects without permission from myself or Maribal Inc.

    Detailed description:

    As we know, the rating system in VB [and Dynamics] is using the [average] function - to calculate all votes/values. This system can be abused and the average can vary greatly if someone leaves a low vote or has something against the author..

    Plus, an article which is newer in the system and has 3 votes of 5 - compared to another article which is one year old - also with 3 votes of 5 - appear equal.. when in fact they should be clearly differentiated using other elements.

    This mod enhances the article rating system with the addition of several new elements:

    1. Number of votes for an article [total]
    2. Average rating for the article
    3. Average of the average rating for ALL articles in the system
    4. Number of FULL [REAL] reads [all pages of an article]
    5. Number of hits [displays] for an article
    6. Scale of rating [variable - so we are not limited to only votes values of 1-5 we can also use 1-10 or 1, 3, 5]
    7. Maximum number of hits vs max number of reads for ALL articles
    8. Number of comments - for an article
    9. Maximum number of comments for all articles
    10. Date of the articles

    The formula we've come up from all the elements above will give you a number - from 1 to 5 with 2 decimals.. 5.00 being the highest possible [and very difficult to attain..].

    The result of the calculation we found it to be very fair and it is protecting the article system from exploits like 9 votes of value 5 and 2 votes of value 1 [therefore, average very low].

    Installation instructions:

    1. SQL table changes:

    [change this to your table names if different/more instances/etc]

    a. Adds a new field that will hold the _real_ number of reads of an article:

    ALTER TABLE `adv_dyna_entries` ADD `reads_nr` INT NOT NULL DEFAULT '0';

    b. Alters the [votetotal] field to have decimals:

    ALTER TABLE `adv_dyna_entries` CHANGE `votetotal` `votetotal` DECIMAL( 10, 5 ) UNSIGNED NOT NULL DEFAULT '0'

    2. Plugins

    Copy the plugins folder and all its content to the ROOT of your domain - the directory of, NOT! Set permissions of debug.txt to 0666 (needed only for debugging purposes)

    Using CP Admin go to Plugins & Products > Add New Plugin and enter/select in form as follows:

    Product: vBulletin
    Hook Location: vba_dyna_functions_saveentry_rate_entry
    Title: Weighed rating
    Execution Order: 1
    Plugin PHP Code: include(DIR . '/../plugins/vba_dyna_functions_saveentry_rate_entry.php');
    Plugin is Active: Yes

    Plugins for updating articles reads number after the last page is viewed or after a printable version is requested.

    Product: vBulletin
    Hook Location: vba_dyna_showentry_start
    Title: Increment complete reads on last page
    Execution Order: 1
    Plugin PHP Code: include(DIR . '/../plugins/vba_dyna_showentry_start.php');
    Plugin is Active: Yes

    Product: vBulletin
    Hook Location: vba_dyna_misc_printerfriendly
    Title: Increment complete reads on last page
    Execution Order: 1
    Plugin PHP Code: include(DIR . '/../plugins/vba_dyna_misc_printerfriendly.php');
    Plugin is Active: Yes


  2. #2
    Join Date
    Aug 2007


    Thank you for rating system. You have added the most critical missing piece to vb dyna.

  3. #3
    Join Date
    Jul 2009


    Hey! Just installed this onto a Dynamics portal.. right now, none of our articles have any posts to them (because so far all of them are admin articles that users are not allowed to post to). Line 154 causes an error because there is no check to make sure that $max_posts isn't zero. This is going to cause a problem for us because we have a Dynamics portal where users will not be allowed to reply to posted articles, but where ratings are still desired. The fix is simple (or at least the one we have decided on works for us), but I though I'd post it here as fixing it in the official release might be a good idea.

    Line 154, the change we made:
    $comments_factor = $max_comments > 0 ? ($comments / $max_comments) * ES_RATING_SC * $K3 : 0;
    Just a suggestion..

  4. #4
    Join Date
    Aug 2005
    Durham, UK


    I'm not sure I understand how this works. I've installed it, but when I give a download a 5-star rating, only 1 star shows with an average of only 0.79 or this normal?
    Sim Fans UK - Sims downloads and discussion

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. vBA Dynamics Rating Options/Box Revisited
    By aproape in forum Modifications
    Replies: 6
    Last Post: 10-22-2009, 04:49 PM
  2. Advanced Rating System (I'm paying)
    By etterra in forum Module & Modification Discussion & Requests
    Replies: 9
    Last Post: 09-18-2008, 05:33 AM
  3. Improvements to article rating scheme?
    By xopek in forum Feedback & Suggestions
    Replies: 0
    Last Post: 05-01-2008, 04:15 PM
  4. Article system for vBa?
    By pyd in forum Module & Modification Discussion & Requests
    Replies: 5
    Last Post: 12-03-2007, 06:05 PM
  5. Article system
    By Luke86 in forum "How Do I..." Questions
    Replies: 1
    Last Post: 06-26-2007, 02:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts