Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

Reply
 
Thread Tools
[AJAX] Threads Rating Details »»
[AJAX] Threads Rating
Version: 2.6, by mad@Max mad@Max is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.8.x Rating:
Released: 08-19-2009 Last Update: 08-26-2009 Installs: 58
DB Changes Uses Plugins Auto-Templates
Re-useable Code Additional Files  
No support by the author.

Description:
This is a rewritten version of this version https://vborg.vbsupport.ru/showthread.php?t=185117. Functionality is same, but working it little bit by another way

Difference between versions 1.x and 2.x:

- much better code (php, js, html)
- eliminated one query on showthread

Compatibility:
3.7.x - 3.8.x

Features:
  • choose forums, where a rating threads to display it is necessary or not necessary
  • view rating statistic
    • choose groups with view permission
    • choose groups with view permission
  • allow/deny rate self threads
  • allow choose 10 point system
  • navigation by page raters
  • fully realisation with AJAX

Install:

Extract all files from folder "Upload" in forum root directory

Find in file threadrate.php on youre server:

PHP Code:
        $xml->add_tag('voteavg'process_replacement_vars("$vbphrase[rating]: <img class=\"inlineimg\" src=\"$stylevar[imgdir_rating]/rating_$thread[rating].gif\" alt=\"" construct_phrase($vbphrase['thread_rating_x_votes_y_average'], $thread['votenum'], $thread['voteavg']) . "\" border=\"0\" />")); 
Replace with:

PHP Code:
        $currate = ($thread['voteavg']*25 px);
        
$xml->add_tag('voteavg'process_replacement_vars("<table cellpadding=\"$stylevar[cellpadding]\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr><td align=\"right\" width=\"45%\" nowrap=\"nowrap\"><div><strong>$vbphrase[trate_currate]</strong></div></td><td align=\"left\" width=\"55%\" nowrap=\"nowrap\"><ul class=\"star-rating\" title=\"" construct_phrase($vbphrase['thread_rating_x_votes_y_average'], $thread['votenum'], $thread['voteavg']) . "\"><li class=\"current-rating\" style=\"width:$currate;\"></li></td></tr></table>")); 
Using the Product Manager, upload the Product that came with this modification.

###############################

For ten point system:

Open: threadrate.php

Find:

PHP Code:
if ($vbulletin->GPC['vote'] < OR $vbulletin->GPC['vote'] > 5
Replace with:

PHP Code:
if ($vbulletin->GPC['vote'] < OR $vbulletin->GPC['vote'] > 10
--------------------------------------------------------

Open: /includes/class_dm_threadrate.php

Find:

PHP Code:
var $max_vote 5
Replace with:

PHP Code:
var $max_vote 10
###############################

Admincp > Plugins and Products > Manage Products > [Add/Import Product] >

product-trate.xml

Update:

Uninstall old mod and replace all files with newest, import product (latest)

Enjoy!

DEMO http://www.youtube.com/watch?v=A3zRjkjQD6k

PS Sorry, the screenshots in russian, but I think, and so everything is clear

Click Install, if you like this mod

Download Now

File Type: zip [AJAX] Threads Rating En v2.0.zip (15.7 KB, 97 views)
File Type: zip [AJAX] Threads Rating En v2.6.zip (18.2 KB, 444 views)

Screenshots

File Type: jpg trbitdel.JPG (16.6 KB, 0 views)
File Type: jpg trset.JPG (89.6 KB, 0 views)
File Type: jpg trshow.JPG (16.2 KB, 0 views)
File Type: gif tratevid.gif (337.2 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
Artes_Marciales

Comments
  #12  
Old 08-21-2009, 02:24 AM
choccyclaire choccyclaire is offline
 
Join Date: Jan 2008
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lovely thanks. Much better idea to have css as file too. Handier if people have many styles and want to mess with the colour of rating box quicker.
Reply With Quote
  #13  
Old 08-21-2009, 03:17 AM
snowlion snowlion is offline
 
Join Date: Mar 2005
Location: STY
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I replaced all files, reimported product and after that: others member can't use ajax rate after a member voted, ajax rating don't clickable. Original thread rate still work fine.
You must refresh to see "You have already rated this article" message.
Reply With Quote
  #14  
Old 08-21-2009, 03:20 AM
choccyclaire choccyclaire is offline
 
Join Date: Jan 2008
Posts: 235
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^ I just noticed the above too.
Reply With Quote
  #15  
Old 08-21-2009, 11:23 AM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For those who use ten point system - fixed bug with it (the little typo). I just doesn't test ten system.
snowlion, which version of vb you are using?
Reply With Quote
  #16  
Old 08-21-2009, 11:49 AM
trotskid trotskid is offline
 
Join Date: Feb 2009
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mad@Max View Post
For those who use ten point system - fixed bug with it (the little typo). I just doesn't test ten system.
Doesn't work and the brown stars still doesn't appear before rating.
Reply With Quote
  #17  
Old 08-21-2009, 12:11 PM
snowlion snowlion is offline
 
Join Date: Mar 2005
Location: STY
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm using ver 3.8.2
Reply With Quote
  #18  
Old 08-21-2009, 12:28 PM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, i did following (as it needed for ten point):
Quote:
Open: threadrate.php

Find:

if ($vbulletin->GPC['vote'] < 1 OR $vbulletin->GPC['vote'] > 5)

Replace with:

if ($vbulletin->GPC['vote'] < 1 OR $vbulletin->GPC['vote'] > 10)

--------------------------------------------------------

Open: /includes/class_dm_threadrate.php

Find:

var $max_vote = 5;

Replace with:

var $max_vote = 10;
And i test the 10 point system on my forum (ex http://mixplay.ru/showthread.php?t=1520), so all working good

snowlion, you are edit this string?
PHP Code:
        $xml->add_tag('voteavg'process_replacement_vars("$vbphrase[rating]: <img class=\"inlineimg\" src=\"$stylevar[imgdir_rating]/rating_$thread[rating].gif\" alt=\"" construct_phrase($vbphrase['thread_rating_x_votes_y_average'], $thread['votenum'], $thread['voteavg']) . "\" border=\"0\" />")); 
And i test this hack on 3.8.2, same work good. If you has edited templates of hack - revert it.
Reply With Quote
  #19  
Old 08-21-2009, 01:00 PM
trotskid trotskid is offline
 
Join Date: Feb 2009
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, now works the ten point system, but still doesn't appear the 10 brown stars before rating



Another thing is that it's not possible to vote in the default mode with ten point system, and you always can emit a vote (to change it).

Reply With Quote
  #20  
Old 08-21-2009, 01:08 PM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

trotskid, have are you edited templates before?
Reply With Quote
  #21  
Old 08-21-2009, 01:12 PM
trotskid trotskid is offline
 
Join Date: Feb 2009
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, and the previous version (1.5.2) worked perfectly.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05313 seconds
  • Memory Usage 2,361KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (6)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete