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

Reply
 
Thread Tools
[AJAX] Post Thank You Hack Details »»
[AJAX] Post Thank You Hack
Version: 4.5, by Abe1 Abe1 is offline
Developer Last Online: Jun 2010 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 07-17-2005 Last Update: 06-18-2006 Installs: 630
DB Changes Uses Plugins Template Edits
Additional Files  
No support by the author.

Post Thank You Hack 4.5




About this hack:
One of the biggest problems on forums as you may know is 'posts boosting'. There are users who LOVE to say 'thanks' when ever they can. How can it hurt? Their post count goes up, they have nothing to loose.

There are also users who really like to express their thanks to post but don't like posting a post that looks like they're post boosting.

Then comes the moderators who have to delete people's thanks yous so a thread can look readable with out the thanks yous thrown around.

Finally comes the posters of these useful posts. They have no idea how many people really likes their posts if only some people say 'thanks'.

What this hack does is fix ALL these problems - except those users who like post boosting. This places a button called 'thanks.' When a user clicks on it, it places his username in a box right under the post saying that so-and-so says 'thanks' for the post. Every-one who clicks is placed in one box.

By giving your users the extra feature, you forum will look allot nice and organized. It is a granted liking by ALL the members of your forum.

Features:
  • Uses vBulletin easy Product installer/updater/uninstaller
  • Uses AJAX technology so your users don't have to refresh when they thank.
  • Places an easy to use button next to the edit button
  • Separate looks for postbit and postbit_legacy
  • Places all Thanks into one small box
  • Uses only ONE query every time you view a showthread page!
  • Users can't thank twice
  • Option to not allow users to thank their own post
  • Guests don't see 'thanks' button
  • Counts how many thanks a user gives
  • Counts how many thanks a post gets
  • Shows how many thanks a user gave in every post of his
  • Shows how many thanks a user gave in profile
  • Shows how many thanks a user got
  • Shows how many posts or a user are thanked
  • Shows info in profile
  • Search for a users thanked posts
  • Search for all thanked posts
  • Administrator can remove all Thanks from a single post
  • Users can remove their own Thanks
  • Turn on and off hack totally
  • Turn on and off hack for only some forums
  • Option to turn off hack for all but the first post of a thread
  • Option to turn off hack for all but the first post of a thread in specific forums
  • Option to turn off hack view of date for specific or all forums
  • Option to add to post count when someone clicks 'thanks'.
  • Option to give a user who receives thanks reputation points.
  • Ban Usergroups
  • Ban Users
  • Uses Phrases
  • Cache Templates
  • Guaranteed to be liked by ALL users on your forum!
Installation information on hack:
  • Files edited: 0
  • Templates edited: 4
  • Files to upload: 1
  • Time to install: 5 minutes max
Updates:

Version 2.0 GOLD (10/02/05):
  • GOLD Release of this hack for vBulletin version 3.5
Version 2.1 (10/23/05):
  • [BUG FIX] When merging/splitting threads
  • [BUG FIX] When a user deletes his thanks (now removes post/rep count if option(s) on)
  • [ADD PHRASE] post_thanks_user_says
  • [ADD PHRASE] post_thanks_time_post
  • [ADD PHRASE] post_thanks_times_post
  • [ADD PHRASE] post_thanks_times_posts
  • [DELETED PHRASE] post_thanks_thanks_amount
Version 2.2 (10/23/05):
  • [ADDED] Re-counters. Found under Maintenance->Update Counters in your ACP.
Version 2.3 (11/05/05):
  • [ADDED] Cache Templates
Version 2.4 (11/07/05):
  • [ADDED] Setting to disallow users from deleting their own thanks.
Version 2.5 (11/09/05):
  • [FIXED] All number outputs run through your vb setting of number format. (e.g. 1234 will now show as 1,234)
Version 2.6 (12/04/05):
  • [FIXED] Number outputs for numbers between 1,000 and 1,999
  • [FIXED] Showing of the thanks button on deleted threads pages.

Version 2.7 (12/18/05):
  • [ADDED] Made the Thanks button a template
  • [ADDED] Made a template group for this hacks templates
  • [FIXED] One template edit. Find correction in zip file.
  • [CHANGED] Made a pop-up now when you click Thanks instead of refreshing the page.
  • [FIXED] Made the line when you give reputation points for thanks, a phrase.
  • [ADDED] Paypal link so you can make a donation for this hack.

Version 2.8 (2/5/06):
  • [FIXED] Removed one query thanks to AnhTuanCool (Abe clicks 'thanks')
  • [ADDED] Option to allow users to thank their own post
  • [ADDED] Option to allow a pop=up or refresh after a user clicks thanks

Version 2.9 (2/8/06):
  • [FIXED] Fixed allot of things in regard to deleting thanks using the "remove all thanks" and "Remove your thanks".

Version 3.0 (2/10/06):
  • [FIXED] Fixed one more thing in regard to "remove all thanks".
  • [FIXED] Re-wrote the thanks actions so it they useless queried when you give or remove thanks.

Version 3.1 (2/11/06):
  • [FIXED] Fixed bug with reputation.

Version 3.2 (2/13/06):
  • [FIXED] Fixed another bug with reputation.
  • [FIXED] Sped up the one query used to retrieve the thanks.

Version 3.3 (2/14/06):
  • [FIXED] Fixed bug with removing own thanks.

Version 3.4 (3/17/06):
  • [FIXED] Fixed a few bugs.

Version 4.0 (4/17/06):
  • [ADDED] AJAX technology so your users don't have to refresh the page they are viewing!

Version 4.1 (4/18/06):
  • [FIXED] Crashing of 'quick reply' when using Firefox.

Version 4.2 (4/23/06):
  • [FIXED] If you have vboption 'Add Template Name in HTML Comments' set to 'Yes', button was not showing.
  • [FIXED] Uncached template when viewing a PM
  • [FIXED] Getting sent to index page when clicking thanks on some forums.
  • [FIXED] Link to member's profile from the thank box.
  • [FIXED] The post thank count not updating. (Recommend you recount thanks. (ACP->Maintenance->Update Counters)

Version 4.3 (5/4/06):
  • [FIXED] Optimized a lot of the templates.
  • [ADDED] Easy integration with my Post Groan Hack.

Version 4.4 (5/7/06):
  • [FIXED] Bug with AJAX if you had the date showing.

Version 4.5 (6/19/06):
  • [FIXED] Bug with AJAX if you had hacks that added things to your output.

Please post your comments or suggestions for this hack. I read ALL posts.

MAKE SURE YOU CLICK INSTALL!
You will get an email when a new version is released.

Pictures:
  1. Showing the 'thanks' button and stats in Postbit
  2. Showing post after 'thanks' (user view)
  3. Showing post after 'thanks' (admin view)
  4. Showing post after 'thanks' with legacy posts (admin view)
  5. Stats in members profile and link
  6. Link in Search drop down menu
  7. Hacks settings

This hack is created for your use free of charge. No payment is requested. However, if you would like to donate money for the work I put in to this hack, a donation would show your appreciation.

Show Your Support

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

Comments
  #782  
Old 05-22-2006, 12:21 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kafi
Feature Request:

would be nice to have also reputation working only for desired forums (the same option as "Individual Forums to Have for Only First Post".

Thank you .-)
I'll add this to the 'list'.
Reply With Quote
  #783  
Old 05-23-2006, 12:01 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had 4.2 do i need to do any template changes if i install 4.4 and which ones?

Or do i need to do the lot again?
Reply With Quote
  #784  
Old 05-23-2006, 02:39 AM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hornstar1337
I had 4.2 do i need to do any template changes if i install 4.4 and which ones?

Or do i need to do the lot again?
Just re-upload the xml file.
Reply With Quote
  #785  
Old 05-23-2006, 09:21 AM
rmxs rmxs is offline
 
Join Date: Apr 2006
Posts: 419
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hello i install it before some weeks nice hack byt can someone tell me how to remove from every post at the bottom the Who Said Thanks:

I get this in every post..
I have select to thanks only in first post byt i get the Who Said Thanks:in all posts
Reply With Quote
  #786  
Old 05-23-2006, 09:40 AM
HuangA's Avatar
HuangA HuangA is offline
 
Join Date: Jun 2004
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Abe1:
Thanks for following up the request here's a little starter on how to make it so that you only really need it once. I've edited the postbit_button template to the following (it still comes up multiple times, but it only really need to be created 'once' at the top because its a function with parameters). It doesn't work yet because I am not familiar with call back functions, and I can't figure out how to pass the pid variable to the call back functions. If there's any AJAX guru or javascript expert who can help fix the rest, we can safely move the majority of the code to a separate .js file which can be cached by user browser and we can reduce the bandwidth usage by a lot (imagein the segment of code appear only once in a cached js VS appearing in html for each post appearing on page).

Code:
<script type="text/javascript">
<!--
function post_thanks_give( pid )
{
	do_thanks_button = new vB_AJAX_Handler(true)
	do_thanks_button.onreadystatechange = function () {
		alert('state ready pid: ' + pid);
		alert('state: ' + do_thanks_button.handler.readyState);
		if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
		{
			fetch_object('post_thanks_button_' + pid).innerHTML = do_thanks_button.handler.responseText
		}
	}
	do_thanks_button.send('showthread.php?do=post_thanks_button_ajax&p='+pid)
	
	do_thanks_add = new vB_AJAX_Handler(true)
	do_thanks_add.onreadystatechange = function () {
		if (do_thanks_add.handler.readyState == 4 && do_thanks_add.handler.status == 200)
		{
			fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_add.handler.responseText
		}
	}
	do_thanks_add.send('showthread.php?do=post_thanks_add_ajax&p='+pid)
}

function post_thanks_remove_all( pid )
{
	do_thanks_button = new vB_AJAX_Handler(true)
	do_thanks_button.onreadystatechange = function () {
		if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
		{
			fetch_object('post_thanks_button_'+pid).innerHTML = do_thanks_button.handler.responseText
		}
	}
	do_thanks_button.send('showthread.php?do=post_thanks_button_add_ajax&p='+pid)
	
	do_thanks_remove_all = new vB_AJAX_Handler(true)
	do_thanks_remove_all.onreadystatechange = function () {
		if (do_thanks_remove_all.handler.readyState == 4 && do_thanks_remove_all.handler.status == 200)
		{
			fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_remove_all.handler.responseText
		}
	}
	do_thanks_remove_all.send('showthread.php?do=post_thanks_remove_all_ajax&p='+pid)
}

function post_thanks_remove_user( pid )
{
	do_thanks_button = new vB_AJAX_Handler(true)
	do_thanks_button.onreadystatechange = function () {
		if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
		{
			fetch_object('post_thanks_button_'+pid).innerHTML = do_thanks_button.handler.responseText
		}
	}
	do_thanks_button.send('showthread.php?do=post_thanks_button_add_ajax&p='+pid)

	do_thanks_remove_user = new vB_AJAX_Handler(true)
	do_thanks_remove_user.onreadystatechange = function () {
		if (do_thanks_remove_user.handler.readyState == 4 && do_thanks_remove_user.handler.status == 200)
		{
			fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_remove_user.handler.responseText
		}
	}
	do_thanks_remove_user.send('showthread.php?do=post_thanks_remove_user_ajax&p='+pid)
}

document.write('<a href="#" id="post_thanks_button_$post[postid]" onclick="post_thanks_give( $post[postid] ); return false;"> <img src="images/buttons/post_thanks.gif" alt="Thanks" border="0" /></a>');
//-->
</script>
<noscript>
<a href="showthread.php?do=post_thanks_add&amp;p=$post[postid]"> <img src="images/buttons/post_thanks.gif" alt="Thanks" border="0" /></a>
</noscript>
Problems with the above so far: the call back doesn't work, so it doesn't properly achieve the ajax effect, and the remove functions doesn't work for whatever reason... do NOT, I repeat do NOT deploy / test the above on your production board. Hopefully someone can fine tune it to work and this hack would be perfect
Reply With Quote
  #787  
Old 05-23-2006, 12:07 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by rmxs
hello i install it before some weeks nice hack byt can someone tell me how to remove from every post at the bottom the Who Said Thanks:

I get this in every post..
I have select to thanks only in first post byt i get the Who Said Thanks:in all posts
That is very interesting. Try running all the re-counters for this hack. You can find them in the ACP under maintenance.
Reply With Quote
  #788  
Old 05-23-2006, 12:12 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HuangA
Abe1:
Thanks for following up the request here's a little starter on how to make it so that you only really need it once. I've edited the postbit_button template to the following (it still comes up multiple times, but it only really need to be created 'once' at the top because its a function with parameters). It doesn't work yet because I am not familiar with call back functions, and I can't figure out how to pass the pid variable to the call back functions. If there's any AJAX guru or javascript expert who can help fix the rest, we can safely move the majority of the code to a separate .js file which can be cached by user browser and we can reduce the bandwidth usage by a lot (imagein the segment of code appear only once in a cached js VS appearing in html for each post appearing on page).

Code:
<script type="text/javascript">
<!--
function post_thanks_give( pid )
{
	do_thanks_button = new vB_AJAX_Handler(true)
	do_thanks_button.onreadystatechange = function () {
		alert('state ready pid: ' + pid);
		alert('state: ' + do_thanks_button.handler.readyState);
		if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
		{
			fetch_object('post_thanks_button_' + pid).innerHTML = do_thanks_button.handler.responseText
		}
	}
	do_thanks_button.send('showthread.php?do=post_thanks_button_ajax&p='+pid)
	
	do_thanks_add = new vB_AJAX_Handler(true)
	do_thanks_add.onreadystatechange = function () {
		if (do_thanks_add.handler.readyState == 4 && do_thanks_add.handler.status == 200)
		{
			fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_add.handler.responseText
		}
	}
	do_thanks_add.send('showthread.php?do=post_thanks_add_ajax&p='+pid)
}

function post_thanks_remove_all( pid )
{
	do_thanks_button = new vB_AJAX_Handler(true)
	do_thanks_button.onreadystatechange = function () {
		if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
		{
			fetch_object('post_thanks_button_'+pid).innerHTML = do_thanks_button.handler.responseText
		}
	}
	do_thanks_button.send('showthread.php?do=post_thanks_button_add_ajax&p='+pid)
	
	do_thanks_remove_all = new vB_AJAX_Handler(true)
	do_thanks_remove_all.onreadystatechange = function () {
		if (do_thanks_remove_all.handler.readyState == 4 && do_thanks_remove_all.handler.status == 200)
		{
			fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_remove_all.handler.responseText
		}
	}
	do_thanks_remove_all.send('showthread.php?do=post_thanks_remove_all_ajax&p='+pid)
}

function post_thanks_remove_user( pid )
{
	do_thanks_button = new vB_AJAX_Handler(true)
	do_thanks_button.onreadystatechange = function () {
		if (do_thanks_button.handler.readyState == 4 && do_thanks_button.handler.status == 200)
		{
			fetch_object('post_thanks_button_'+pid).innerHTML = do_thanks_button.handler.responseText
		}
	}
	do_thanks_button.send('showthread.php?do=post_thanks_button_add_ajax&p='+pid)

	do_thanks_remove_user = new vB_AJAX_Handler(true)
	do_thanks_remove_user.onreadystatechange = function () {
		if (do_thanks_remove_user.handler.readyState == 4 && do_thanks_remove_user.handler.status == 200)
		{
			fetch_object('post_thanks_box_'+pid).innerHTML = do_thanks_remove_user.handler.responseText
		}
	}
	do_thanks_remove_user.send('showthread.php?do=post_thanks_remove_user_ajax&p='+pid)
}

document.write('<a href="#" id="post_thanks_button_$post[postid]" onclick="post_thanks_give( $post[postid] ); return false;"> <img src="images/buttons/post_thanks.gif" alt="Thanks" border="0" /></a>');
//-->
</script>
<noscript>
<a href="showthread.php?do=post_thanks_add&amp;p=$post[postid]"> <img src="images/buttons/post_thanks.gif" alt="Thanks" border="0" /></a>
</noscript>
Problems with the above so far: the call back doesn't work, so it doesn't properly achieve the ajax effect, and the remove functions doesn't work for whatever reason... do NOT, I repeat do NOT deploy / test the above on your production board. Hopefully someone can fine tune it to work and this hack would be perfect
I'll try to figure this out when I have time. Right now I'm working on something for my 'Form Hack'. Something that can generate a form so people who dont understand php or html be able to get a custom form for their site.
Reply With Quote
  #789  
Old 05-25-2006, 12:46 AM
Milad's Avatar
Milad Milad is offline
 
Join Date: Apr 2005
Location: Syro
Posts: 663
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Google clicks Thanks Button ...

So I added the green text to post_thanks_button template

Code:
<a href="showthread.php?$session[sessionurl]do=post_thanks_add&amp;p=$post[postid]" id="post_thanks_button_$post[postid]" onclick="post_thanks_give_$post[postid](); return false;" rel="nofollow">$post_thanks_button_image</a>
Reply With Quote
  #790  
Old 05-25-2006, 01:40 AM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Milad
Google clicks Thanks Button ...

So I added the green text to post_thanks_button template

Code:
<a href="showthread.php?$session[sessionurl]do=post_thanks_add&amp;p=$post[postid]" id="post_thanks_button_$post[postid]" onclick="post_thanks_give_$post[postid](); return false;" rel="nofollow">$post_thanks_button_image</a>
Why would it click 'thanks'? Only if you have a userID will the thanks link show. So if google is searching, the that button and link wont be there.
Reply With Quote
  #791  
Old 05-25-2006, 01:46 PM
Milad's Avatar
Milad Milad is offline
 
Join Date: Apr 2005
Location: Syro
Posts: 663
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the visitors don't see the button picture but the link is still existing
take a look at the source of this page http://www.basharialep.com/forum/showthread.php?t=1259

HTML Code:
<a href="showthread.php?do=post_thanks_add&amp;p=14350" id="post_thanks_button_14350" onclick="post_thanks_give_14350(); return false;" rel="nofollow"></a>
I added rel="nofollow" but spiders are still clicking it

Thanks for your help
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 05:57 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.08567 seconds
  • Memory Usage 2,351KB
  • 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
  • (4)bbcode_code
  • (1)bbcode_html
  • (5)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
  • (3)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