Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

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

Category: Show Thread Enhancements - Version: 3.7.x Rating:
Released: 07-11-2008 Last Update: 01-14-2009 Installs: 145
Uses Plugins Auto-Templates
Code Changes Additional Files  
No support by the author.

This mod merge of three old mods:
vB.org Rating System Replica
[AJAX] Your One Click Thread Ratings
Who Rated This Thread / Delete Who Rated

Futures:
- Now it is not necessary to delete elements from a template
- You can choose id forums, where a rating threads to display it is necessary or not necessary
- On click rating icon in the threads you get info about voting
- You can delete vote from thread rating
- 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.

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

product-trate.xml

Update:

Uninstall old mod and import product (v1.3)

Upload stars.png in folder your style, by default /images/rating/

Enjoy!

DEMO
www.mixplay.ru/forum.php // choose any thread
user: Test
pass: 123456

Thread Rating T?rk?e 1.4.1.zip

Click Install, if you like this mod

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #152  
Old 10-15-2008, 11:00 PM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hm, no, go in the trate template, find all $stylevar[imgdir_rating]/stars.png, and then replace founded items on
HTML Code:
<if condition="in_array($thread[forumid], array(1,2,3,4,...,N)">$stylevar[imgdir_rating]/black_stars.png<else />$stylevar[imgdir_rating]/stars.png</if>
Where 1,2,3,4,...,N forums with different stars. But resolution of different image must be like stars.png.
Must be work
Reply With Quote
  #153  
Old 10-16-2008, 01:49 AM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mod is updated.
Fixed problem when rating not displaying after voting (on some forums).
Quick fix for those who have this problem. In template trate find
HTML Code:
    <if condition="$show['ratethread'] && $threadinfo['vote']==NULL">
replace with
HTML Code:
    <if condition="$show['ratethread']">
Added hand setting, info in first post.
Reply With Quote
  #154  
Old 10-16-2008, 11:50 AM
acast acast is offline
 
Join Date: Aug 2008
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mad@Max View Post
Hm, no, go in the trate template, find all $stylevar[imgdir_rating]/stars.png, and then replace founded items on
HTML Code:
<if condition="in_array($thread[forumid], array(1,2,3,4,...,N)">$stylevar[imgdir_rating]/black_stars.png<else />$stylevar[imgdir_rating]/stars.png</if>
Where 1,2,3,4,...,N forums with different stars. But resolution of different image must be like stars.png.
Must be work
Hi friend, thank you for helping me. I have this code in showthread:

Code:
<if condition="$rated">
<span id="threadrating_current"><if condition="$show['rating']">$vbphrase[rating]: <img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$thread[rating].gif" alt="<phrase 1="$thread[votenum]" 2="$thread[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" border="0" /></if></span>
<else />
<div align="left"><span class="ratetext">$vbphrase[rate_this_thread] -  <em>$thread[title]</em>.</span></div>
<a name="goto_threadrating"></a>
And this one in threadbit:

Code:
<if condition="$show['threadratings'] AND $show['threadrating']"><span style="float:$stylevar[right]"><img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$thread[rating].gif" border="0" alt="<phrase 1="$thread[votenum]" 2="$thread[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" /></span></if>
My images for ratings are called:

http://www.XXX/enlighten/rating/rating_1.gif
http://www.XXX.com/enlighten/rating/rating_2.gif


... Up to five rating_5.gif


How can i change it so in the template?
Reply With Quote
  #155  
Old 10-16-2008, 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

Use the last version of mod.
Reply With Quote
  #156  
Old 10-16-2008, 12:40 PM
acast acast is offline
 
Join Date: Aug 2008
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mad@Max View Post
Use the last version of mod.
Sure friend, but you make it the stars with the same PNG image. Could be with different images? I explain you, i have a cinema subforum where i want to have different images for the different ratings instead the film is great, average, poor... and when the post have a rating appears a different image. The change you did makes that use only one image: Stars.png. Isnt it?

Thanks for your answer, i really apreciate your work.
Reply With Quote
  #157  
Old 10-29-2008, 12:49 AM
Charles_1 Charles_1 is offline
 
Join Date: Jun 2006
Location: Czech Republic, Brno
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi mad@max,

your mod is working perfectly (vB 3.6.7), thanks for sharing. But I have one request.

I am also using mod vBi-Gallery for vB 3.6.X (https://vborg.vbsupport.ru/showthread.php?t=128598), which can transform specific sections of forum to simple galleries using own versions of some templates with modifications of layout (for this mod are relevant own versions of templates showthread and threadbit, there are also own verions of postbit and forumdisplay, others are only for gallery purposes like to show newest threads/pictures in forumhome etc.) - in the way of functionality of sections, threads and posts is everything standard, image for gallery is based on ordinary vB attachment in first post - modifications are only in the way of presentation of threads in forumhome and first post in threads). From this reason of own templates your mod "[AJAX] Threads rating" doesn't work or to be more specific the box of rating system doesn't appear in these sections, which are set to be "galleries".

I suppose, that it needs only minor modifications of conditions in some places to appear also in these sections using another versions of templates, but my attempts were useless so far :-(.

Could you please direct me to what is needed to get this work also in mentioned situation with another versions of mentioned templates? I would like to use your rating modification in "gallery showthread" and "standard vB showthread" as well, but if it is too complicated, then I rather choose only "gallery showthread", becouse I really need better presentation of thread rating in these sections.

I really like your solution and I would like to use it also for our "galleries" (I looked for some hack just becouse of using it in our "galleries"). Please, help :-).
Reply With Quote
  #158  
Old 10-29-2008, 05:10 AM
mad@Max's Avatar
mad@Max mad@Max is offline
 
Join Date: Jul 2007
Location: Russia
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow, how many words Please, type your site.
Reply With Quote
  #159  
Old 10-29-2008, 08:48 AM
Charles_1 Charles_1 is offline
 
Join Date: Jun 2006
Location: Czech Republic, Brno
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mad@Max View Post
Wow, how many words Please, type your site.
Thanks for fast reply. Our forum is www.svethardware.cz/forum and section with mentioned functionality of simple gallery is for example this: http://www.svethardware.cz/forum/forumdisplay.php?f=212 (we have competition for our users in creating wallpapers on specific topic, every month new round with new topic and this way via only modified templates it is the best for this purpose - I don't want to use for this some special gallery with own database, comments and rating system). For viewing wallpaper (picture) in full size is needed to be logged in, but if you click on name of thread (first row in small boxes in forumdisplay), then you will se own template showthread of this gallery plugin.

Your plugin is disabled for whole forum right now. If you need it to be enabled somewhere for info, just let me know.
Reply With Quote
  #160  
Old 10-29-2008, 10:17 PM
Sarthek Sarthek is offline
 
Join Date: May 2006
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed, tnx

Two questions, if later for some reason (no support or whatever) we unistalled it, ratings still stay?

Can we somehowe enable guests to viewing rating?
Reply With Quote
  #161  
Old 12-01-2008, 05:23 PM
Taragon's Avatar
Taragon Taragon is offline
 
Join Date: Sep 2007
Location: The Netherlands
Posts: 390
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would it be possible to have the ajax rating bit (stars) only for vb blog as well perhaps?
If preferred after some kind of donation of course.
Reply With Quote
Reply


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 04:16 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.08482 seconds
  • Memory Usage 2,338KB
  • Queries Executed 25 (?)
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
  • (2)bbcode_code
  • (4)bbcode_html
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete