vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Show Thread Enhancements - [AJAX] Threads Rating (https://vborg.vbsupport.ru/showthread.php?t=221364)

mad@Max 08-19-2009 10:00 PM

[AJAX] Threads Rating
 
1 Attachment(s)
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:)

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/thr...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

Quote:

Originally Posted by JacquiiCooke (Post 1871339)
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.

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

Quote:

Originally Posted by trotskid (Post 1871267)
Which is the difference between v2.0?

Quote:

Originally Posted by mad@Max (Post 1871301)
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 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....


All times are GMT. The time now is 03:08 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01177 seconds
  • Memory Usage 1,757KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete