Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Public Display of Affection (reputation display) Details »»
Public Display of Affection (reputation display)
Version: 1.00, by vbmechanic vbmechanic is offline
Developer Last Online: Oct 2006 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 02-18-2004 Last Update: Never Installs: 34
 
No support by the author.

Allow your users to easily "agree" or "disagree" with a post-- rather than having them make a whole new post, you can simply use the existing reputation system.. which is meant for exactly this purpose.

Purpose: This hack makes each post's reputation visible to everyone. You can turn this on and off per forum.

Modifications: 2 additions to admincp/forum.php, 2 template additions, 1 query

Install Time: 10 minutes

Difficulty: Easy

Screenshot attached of a post with reputation comments!


cheers,

vBMechanic




EDIT: changed functions_showthread.php edit, file changed 5:49PM PST

Show Your Support

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

Comments
  #22  
Old 07-03-2004, 01:09 PM
vbmechanic vbmechanic is offline
 
Join Date: Jan 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK I looked over the install routine and I didn't see anything that would prevent it from working in 3.0.1 or 3.0.2; nothing much has changed.

If you're using postbit_legacy, did you make that change during the install?

"Alter template 'postbit', BELOW:"

Did you take that line in the instructions and instead alter postbit_legacy ?
Reply With Quote
  #23  
Old 07-05-2004, 12:01 PM
Sanity Sanity is offline
 
Join Date: Mar 2002
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

installed everything as explained, but I get this error-message when I try to read a thread:

Quote:
Datenbankfehler in vBulletin 3.0.2:

Ungueltige SQL-Abfrage: SELECT reputation.reputation,reputation.whoadded,reputati on.reason,user.username
FROM vb_reputation
LEFT JOIN vb_user ON reputation.whoadded=user.userid
WHERE reputation.reputation!=0 AND postid='22'
mysql error: Unknown table 'reputation' in field list

mysql error number: 1109
Iam using a tableprefix.

Any suggestions?
Reply With Quote
  #24  
Old 07-05-2004, 12:36 PM
Sanity Sanity is offline
 
Join Date: Mar 2002
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Figured out the problem. Prefixes missing o_O
Reply With Quote
  #25  
Old 07-05-2004, 01:01 PM
Sanity Sanity is offline
 
Join Date: Mar 2002
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*install*
Reply With Quote
  #26  
Old 07-16-2004, 02:16 AM
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Finally got around to installing this. This is exactly what I wanted.

I added this to the postbit_fuction template to show the rep only to the perosn that made the post. A compromise between those who wanted it and those who didnt.

PHP Code:
<if condition="$bbuserinfo['userid'] == $post['userid']"
Reply With Quote
  #27  
Old 12-05-2004, 02:41 AM
dndog dndog is offline
 
Join Date: Apr 2004
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sanity
Hello,

installed everything as explained, but I get this error-message when I try to read a thread:



Iam using a tableprefix.

Any suggestions?
I'm having this same problem and I'm using a table prefix also.

What'd you do to fix this? :nervous:
Reply With Quote
  #28  
Old 12-09-2004, 02:39 PM
robertuss robertuss is offline
 
Join Date: Aug 2003
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

erm, what's with the moderateablities?
Reply With Quote
  #29  
Old 12-17-2004, 03:10 AM
dndog dndog is offline
 
Join Date: Apr 2004
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not meaning to seem impatient, but its been 12 days. Can someone help me?
Reply With Quote
  #30  
Old 02-01-2005, 12:31 AM
nintendo's Avatar
nintendo nintendo is offline
 
Join Date: Dec 2001
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there an SQL Query that can be used to turn it on on all boards?
Reply With Quote
  #31  
Old 02-15-2005, 05:44 PM
Jamsoft Jamsoft is offline
 
Join Date: Nov 2003
Location: Florida
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey guys,

I installed this on our forums, and wouldnt you know that our users found a vulnerability almost right away.

Seems that if the users put any HTML or JAVA code inside the comments, it actually renders when the page loads. For example:

Quote:
Rich agrees: Sounds good <script>alert('hi');</script>
Makes a java window pop open and say hi...

Im sure I dont have to tell you what a malicious hacker can do with something like this.

So, I'd propose this fix to the existing code. Inside the functions_showthread.php, find this code:

Code:
			// START PUBLIC DISPLAY OF AFFECTION hack			
			if ($forum['showaffection'])
			{
				$post['affection']="";
				$repcount=0;
				if ($reps = $DB_site->query("SELECT reputation.reputation,reputation.whoadded,reputation.reason,user.username 
											FROM " . TABLE_PREFIX . "reputation 
											LEFT JOIN " . TABLE_PREFIX . "user ON reputation.whoadded=user.userid 
											WHERE reputation.reputation!=0 AND postid='".$post['postid']."'"))
				{
					while ($rep = $DB_site->fetch_array($reps))
					{
						eval('$post[\'affectionbits\'] .= "' . fetch_template('postbit_affectionbit') . '";');
						$repcount++;
					}
					if ($repcount)
					{
						//echo "2";
						eval('$post[\'affection\'] .= "' . fetch_template('postbit_affection') . '";');
					} 
					else
					{	
						//echo "3";
						$post['affection']="";
					}
				}
			}
			// END PUBLIC DISPLAY OF AFFECTION hack
BEFORE the line:
Code:
eval('$post[\'affectionbits\'] .= "' . fetch_template('postbit_affectionbit') . '";');
Add this code:
Code:
// Fix for HTML entities
$rep[reason] = htmlentities($rep[reason]);
That will protect us from this issue.

Other than that, this is a great hack. Im using it on 3.0.6 on 5 forums...
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 03:49 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.09628 seconds
  • Memory Usage 2,308KB
  • 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
  • (3)bbcode_code
  • (1)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
  • (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