PDA

View Full Version : Show Thread Enhancements - [AJAX] Threads Rating


mad@Max
08-19-2009, 10:00 PM
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:

$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:

$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:

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;

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

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:)

snowlion
08-20-2009, 08:10 PM
Database error in vBulletin 3.8.2:
Invalid SQL:
SELECT *
FROM threadrate
WHERE threadid = intval(1);
MySQL Error : FUNCTION lonely_forum.intval does not exist
Error Number : 1305
Request Date : Thursday, August 20th 2009 @ 04:09:03 PM
Error Date : Thursday, August 20th 2009 @ 04:09:03 PM
Script : http://www.bentinhyeu.info/forum/threadratinginfo.php?threadid=1
Referrer :
IP Address : 117.2.10.33
Username : Administrator
Classname : vB_Database
MySQL Version : 5.1.30


i upgraded and database error when click Edit/View Rating
:D

trotskid
08-20-2009, 09:04 PM
Version 1.5.2 (3.7.x) runs well on 3.8.3 :). Which is the difference between v2.0?

mad@Max
08-20-2009, 10:58 PM
snowlion, little fix. Archive is reuploaded. Just replace threadratinginfo.php
trotskid, how i said in first post, visually, all remained as before, but almost of code rewritten include php, javascript and html. Javascript rewritten to YUI, almost php code replaced into threadratinginfo.php and much better to-html :)

mad@Max
08-20-2009, 11:43 PM
Another fix:) Replace same file.

trotskid
08-21-2009, 12:21 AM
Update then and works fine, but doesn?t appear the 10 stars with the ten point system.

http://img38.imageshack.us/img38/8972/tr1t.jpg

JacquiiDesigns
08-21-2009, 12:40 AM
ha! I've just installed the previous version (3.7.x)
What are the differences between versions? Is this an upgraded code? Are there any enhancements/features for this version?

Thanks for the share.

Jacquii.

trotskid
08-21-2009, 12:44 AM
ha! I've just installed the previous version (3.7.x)
What are the differences between versions? Is this an upgraded code? Are there any enhancements/features for this version?

Thanks for the share.

Jacquii.

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

Which is the difference between v2.0?

how i said in first post, visually, all remained as before, but almost of code rewritten include php, javascript and html. Javascript rewritten to YUI, almost php code replaced into threadratinginfo.php and much better to-html :)

trotskid
08-21-2009, 01:42 AM
Well, I've installed the Thread rating out of 10 instead of 5 (https://vborg.vbsupport.ru/showthread.php?t=145110&highlight=rating) hack too and now works the ten point system with your addon (doesn't work in the default mode), but still doesn't appears the brown stars before rating. Also, in my style, appears now a second bar to show the default post rating. May be a problem with the latest addon..

http://img188.imageshack.us/img188/3918/tr3a.jpg

http://img518.imageshack.us/img518/8426/tr5i.jpg

Just trying :)

Faizan
08-21-2009, 01:54 AM
i will try....

choccyclaire
08-21-2009, 02:24 AM
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. :)

snowlion
08-21-2009, 03:17 AM
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. :D Original thread rate still work fine.
You must refresh to see "You have already rated this article" message.

choccyclaire
08-21-2009, 03:20 AM
^ I just noticed the above too.

mad@Max
08-21-2009, 11:23 AM
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?

trotskid
08-21-2009, 11:49 AM
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.

snowlion
08-21-2009, 12:11 PM
I'm using ver 3.8.2

mad@Max
08-21-2009, 12:28 PM
Ok, i did following (as it needed for ten point):
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?
$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.

trotskid
08-21-2009, 01:00 PM
Thank you, now works the ten point system, but still doesn't appear the 10 brown stars before rating :(

http://img30.imageshack.us/img30/6369/tr7j.jpg

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).

http://img193.imageshack.us/img193/1200/tr8y.jpg

mad@Max
08-21-2009, 01:08 PM
trotskid, have are you edited templates before?

trotskid
08-21-2009, 01:12 PM
Yeah, and the previous version (1.5.2) worked perfectly.

tldagent
08-21-2009, 01:48 PM
How can we make this similar to the current rating as shown above in vb.org? Meaning select a rating rather than stars just as they would have done previously?

snowlion
08-21-2009, 02:14 PM
snowlion, you are edit this string?

And i test this hack on 3.8.2, same work good. If you has edited templates of hack - revert it.


Reverted but nothing change :D

Yeah, and the previous version (1.5.2) worked perfectly.
i'm second this

Come2Daddy
08-21-2009, 03:06 PM
what is 10 point system??
and how can we enable 10 points system??

PaylaX
08-21-2009, 04:01 PM
bugs are very welcome:)

I'll wait.

Thanks for update

mad@Max
08-21-2009, 04:27 PM
PM me who have a problem with hack, because i don't see a reason why it doesn't work.

mad@Max
08-21-2009, 04:33 PM
what is 10 point system??
and how can we enable 10 points system??
Solution how did this https://vborg.vbsupport.ru/showthread.php?t=145110
I don't need this system, i simply executed the request:)
-----------
Added to first post: Difference between versions 1.x and 2.x: and TODO:

m2006
08-22-2009, 03:43 AM
thank you verymuch for nice mod

Chief Corn
08-22-2009, 12:16 PM
Does it plugin under $navbar? I have an article mod with its own showthread template, and it doesn't show up on there. It does work in my other forums though, but I installed it for use with the articles.

mad@Max
08-22-2009, 02:11 PM
It's output from showthread script, i don't know how it output the article mod.

mad@Max
08-24-2009, 11:13 PM
Version 2.5
In this version fixed all bugs (i hope:)).
And finally i made fully functionality with AJAX: rate, showing rating and deletion rating.

choccyclaire
08-24-2009, 11:26 PM
Thank you!

Do we need to overwrite the files or just upload the product?

mad@Max
08-24-2009, 11:34 PM
Overwrite all files (except img), and reimport product (better uninstall then install).

choccyclaire
08-24-2009, 11:41 PM
Brilliant. Works like a charm. :)

And I also like the box popup to view stats alteration.

mad@Max
08-24-2009, 11:47 PM
Archive is reuploaded (clean little mess after testing).
choccyclaire, i glad that you like:)

mad@Max
08-25-2009, 01:26 AM
Version 2.5.1
Fixed couple bugs with js. Edited the product and vbulletin_ajax_oneclick_showrate.js.

mad@Max
08-27-2009, 05:12 PM
Version 2.6
- navigation by page raters
- added video demo from youtube

wastemytime
08-27-2009, 06:24 PM
Nice Hack, but if i want to rate a Thread, nothing happens. I reverted Template, checked the Files and Uploads...

mad@Max
08-27-2009, 07:24 PM
Version of vB?

wastemytime
08-27-2009, 10:11 PM
3.8.4

mad@Max
08-27-2009, 11:55 PM
Hm, it tested on 3.8.2 and 3.8.4... Send me message to pm.

snowlion
08-28-2009, 04:17 PM
Latest version work great, thanks for nice mod :D

wastemytime
08-29-2009, 10:42 AM
Thansk to mad@Max it works perfect now.

I have one question. I thought about., to show the Option for ratings only for certain Threads. Exactly, only for specific Prefixes. Is this maybe possible with some conditional?

kruchczan
08-29-2009, 01:39 PM
Do not open first image :(

103813

Next images is ok

103814
103815

Please help :).

mad@Max
08-29-2009, 03:50 PM
wastemytime, need write a special condition.
kruchczan, i need look up on this. Send me pm.

kalisekj
10-26-2009, 10:05 PM
Very Nice Mod, Thank you! Now My users Can easily See how to Rate a Movie. Question Though any way to change the color of the bar from white?

Thank you!

Biggerfool
11-06-2009, 04:19 AM
I installed this on my forum but nothing changed. I followed all the steps and under the admin control panel added the mod but it looks no different than before. Any help? 3.8.4

Scalemotorcars
12-01-2009, 10:25 PM
Works except for the first star doesn't show up. The 2nd and 3rd are fine and rating seems to be working correctly.

Any ideals?

Scalemotorcars
12-02-2009, 01:51 AM
I installed this on my forum but nothing changed. I followed all the steps and under the admin control panel added the mod but it looks no different than before. Any help? 3.8.4

Did you go into the admincp and add the forums you want it used on. Look in the options tab near the bottom. :D

Scalemotorcars
12-02-2009, 06:55 PM
Works except for the first star doesn't show up. The 2nd and 3rd are fine and rating seems to be working correctly.

Any ideals?

Anyone have an ideal why the first star isnt showing?

Also a contribution to the hack with a star that looks a little more like the default.

Rickeo
12-02-2009, 07:23 PM
I am using a dark theme anyway to change the gray background to black.

Thanks

Rick

Scalemotorcars
12-02-2009, 08:16 PM
I am using a dark theme anyway to change the gray background to black.

Thanks

Rick

well while I wait on a reply go into the vbulletin_css folder and open the stars_rating.css

Open the Css in an editor and change the last part to this. (the #000000) is black. If you need another color you can easily change it. Hope that helps.


/* Style of box stars */
.quickajaxrating {
background: #000000;
border: 1px dashed #B53A25;
color: #000;
padding: 8px;
}

Rickeo
12-03-2009, 04:42 PM
Thank you so much :D:D:D

Scalemotorcars
12-03-2009, 09:57 PM
Thank you so much :D:D:D

Glad to help

Is the original Dev anywhere to be found? Anyone know the template or location that controls the Star Sprite?

Should be an easy fix but Ive seen this problem from other users. Anyone. Helloooooooo.........:D

Scalemotorcars
12-05-2009, 08:13 PM
Well no luck Ive messed with the CSS for hours. Anyone know a fix please PM me. Thanks... :up:

mad@Max
12-05-2009, 09:02 PM
Probably is problem in a width of stars, when you replace the original image.

Scalemotorcars
12-06-2009, 01:20 AM
I checked that. Problem was before the change and the new stars.png is exactly the same size.

reddyink
12-23-2009, 03:10 PM
Is it possible to inclue the rating to multiple ratings

I like content of thread * * * * * *
I like origniality of the thread * * * *

thanks

saviola8x
12-23-2009, 05:30 PM
please update for vb4.
thanks

Taurus1
01-02-2010, 08:34 AM
I love this man! Only problem is that the initial stars don't show up. When I hover where they should be, the green ones show, any help will be appreciated!! Thanks!!

Taurus1
01-08-2010, 02:15 PM
No support here. Disabled.

Charles_1
01-10-2010, 04:36 PM
Works except for the first star doesn't show up. The 2nd and 3rd are fine and rating seems to be working correctly.
I have to confirm this. The first star doesn't show up, everything else is OK. Some idea to solve it?

I am also using older version 1.5.2 in other installation of vBulletin and there is first star showing correctly.

chikkoo
01-25-2010, 02:29 PM
I have the same problem. If stars existing, it shows. If no starts existing as rating, then it does not even display the Outlines of the stars as shown in the 4th picture above.

Can someone tell me, how this got fixed?

Rather than PM replies, if u could post here it will be better for all.

It would be nice if the Thread title appears above the rating (like vborg rating old version)

Do not open first image :(

103813

Next images is ok

103814
103815

Please help :).

wastemytime, need write a special condition.
kruchczan, i need look up on this. Send me pm.

Taurus1
01-26-2010, 02:56 PM
Any help here please!!?? :(

ForumMonkeys
01-28-2010, 10:21 PM
In /upload/clientscript/vbulletin_css/stars_ratings.css find this CSS selector:

.star-rating li a

and add this line to get the first set of stars (gray) showing:

background: url(../../images/rating/stars.png);

:up:

Taurus1
01-30-2010, 11:15 AM
In /upload/clientscript/vbulletin_css/stars_ratings.css find this CSS selector:

.star-rating li aand add this line to get the first set of stars (gray) showing:

background: url(../../images/rating/stars.png);:up:

Thanks mate! But it don't work! Uninstalled!!

95% of the mods on here state that it is Supported....but no support at all....ridiculous!!

ForumMonkeys
01-30-2010, 02:42 PM
Works for me with the addition of that line. *shrug* ;)

Alecsmith
02-03-2010, 08:16 AM
how could i change star images?

ForumMonkeys
02-04-2010, 06:22 PM
This plugin uses CSS sprites for the star graphics. So you can find all the stars graphics in one image file.

jGas
02-06-2010, 02:38 PM
i really like this mod! it's the best for my users songs ratings =)

give it a look here: http://www.musicadigitale.net/forum/showthread.php?p=235497#post235497

i use it along with gars :D

the_ace
03-19-2010, 12:34 PM
this is a good rating system to use especially with the rating bug in 3.8.x

desi-boy
04-14-2010, 05:46 PM
can u make this 1 for vb4.0

Scalemotorcars
05-04-2010, 01:05 AM
Thanks mate! But it don't work! Uninstalled!!

95% of the mods on here state that it is Supported....but no support at all....ridiculous!!

Finally fixed. Thank you sir!!!! :up:

Acido
08-25-2010, 11:50 AM
Port it to vb4.x and get the MOTM pole position :P

s.sami
03-27-2011, 06:23 PM
i also have this problem "Do not open first image"

also cant rediceting to thread.

rigodiaz
05-05-2011, 03:14 AM
In /upload/clientscript/vbulletin_css/stars_ratings.css find this CSS selector:

.star-rating li a

and add this line to get the first set of stars (gray) showing:

background: url(../../images/rating/stars.png);

:up:
Thank you!

ru55ian
09-27-2011, 02:07 PM
Port it to vb4.x and get the MOTM pole position :P

I second that... please port to VB4

chikkoo
12-31-2012, 01:44 PM
I have this mod installed in my forum, but lately noticed that multiple votes by the same member.

How is it possible? How can I fix this loophole?

mindhunter77
03-16-2019, 02:38 PM
If I uninstall, then reinstall this version, will I lose all the ratings I have so far on the site?

mindhunter77
03-16-2019, 05:07 PM
Also, does anyone know how to disable ipv6 with this, people using ipV6 are unable to rate.