vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Public Display of Affection (reputation display) (https://vborg.vbsupport.ru/showthread.php?t=61713)

vbmechanic 02-18-2004 10:00 PM

Public Display of Affection (reputation display)
 
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

The Quibbler 02-19-2004 02:55 AM

/me will install very soon

robertuss 02-19-2004 06:39 AM

I love you :)

vbmechanic 02-19-2004 03:48 PM

I must admit, I love you too!

*group hugs*

Martin CX 02-19-2004 05:34 PM

Love is all around us... but before I install... is there anyway of moderating these public display of affections? :) I wouldn't want to create a way for people to be circumvent my moderators.

Allan 02-19-2004 05:48 PM

very nice, i take, thank :)

vbmechanic 02-19-2004 06:42 PM

Good point-- it does not have any moderation capability and it does not take into consideration the user's ignore list. It is quite basic! Maybe I will add these features to an upgrade.

gmarik 02-22-2004 06:15 AM

nice idea, still it could be 5 stars, not more, the rating maximum

robertuss 03-02-2004 05:02 AM

Quote:

Originally Posted by vbmechanic
Good point-- it does not have any moderation capability and it does not take into consideration the user's ignore list. It is quite basic! Maybe I will add these features to an upgrade.

...mh , or should we ask around if any other coder wants to try his/her luck?

Geographic2 03-22-2004 06:36 AM

If one of your users has a problem using the system you can simply take away reputation priveledges I guess. ;)

red_baron2000 04-13-2004 01:33 AM

cool hack ..i install thank you :)

Brahm 05-09-2004 03:00 AM

nice

Nj?rd Eriksson 05-09-2004 07:38 PM

I installed this hack and it works great.

However, most of my members seem to prefer to have the reputation comments not publicly.

Question:

If I want to uninstall it, how would I reverse this my SQL query?

Code:

ALTER TABLE `forum` ADD `showaffection` SMALLINT(6)  UNSIGNED DEFAULT "0" NOT NULL

Majik? 05-10-2004 01:08 AM

Quote:

Originally Posted by Nj?rd Eriksson
how would I reverse this my SQL query?

Code:

ALTER TABLE `forum` ADD `showaffection` SMALLINT(6) UNSIGNED DEFAULT "0" NOT NULL

[sql]ALTER TABLE `forum` DROP `showaffection`;[/sql]

Nj?rd Eriksson 05-11-2004 01:36 AM

Quote:

Originally Posted by Majik?
[sql]ALTER TABLE `forum` DROP `showaffection`;[/sql]

Thank you. Worked like a gem. :)

Reeve of shinra 06-04-2004 06:02 PM

Rather than the comments, I just want a little thumbs up or down if they gave positive rep or not -- is there a way to do that with this hack?

TJFweb 06-29-2004 03:26 AM

Well, this hack doesn't work under 3.0.1... I don't think.

I installed it twice and I can't get anything to show under the posts yet it doesn't throw any errors.

yinyang 06-29-2004 08:34 PM

Quote:

Originally Posted by TJFweb
Well, this hack doesn't work under 3.0.1... I don't think.

I installed it twice and I can't get anything to show under the posts yet it doesn't throw any errors.

me 2. i'm having the same problem. weird. anyone have any thoughts?

yinyang 06-29-2004 08:50 PM

Quote:

Originally Posted by yinyang
me 2. i'm having the same problem. weird. anyone have any thoughts?

TJFweb, i bet it's because you and i are using Postbit Legacy. am i right? now before i go tearing into it trying to code... 'cause i have no idea what i'm doing, can anyone plese suggest the proper way to do it?

TJFweb 06-30-2004 12:09 AM

Quote:

Originally Posted by yinyang
TJFweb, i bet it's because you and i are using Postbit Legacy. am i right? now before i go tearing into it trying to code... 'cause i have no idea what i'm doing, can anyone plese suggest the proper way to do it?

That's right, I am using postbit_legacy... ???

vbmechanic 07-03-2004 01:09 PM

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 ?

Sanity 07-05-2004 12:01 PM

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?

Sanity 07-05-2004 12:36 PM

Figured out the problem. Prefixes missing o_O

Sanity 07-05-2004 01:01 PM

*install*

Reeve of shinra 07-16-2004 02:16 AM

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']"


dndog 12-05-2004 02:41 AM

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:

robertuss 12-09-2004 02:39 PM

erm, what's with the moderateablities?

dndog 12-17-2004 03:10 AM

Not meaning to seem impatient, but its been 12 days. Can someone help me?

nintendo 02-01-2005 12:31 AM

Is there an SQL Query that can be used to turn it on on all boards?

Jamsoft 02-15-2005 05:44 PM

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

Borgs8472 02-26-2005 01:10 PM

^ ^
thanks a lot! :D

IceFanatic 03-04-2005 09:16 PM

Would there be any way to alter this hack so that users can turn it on or off for their posts/comments? So if one user doesn't want their rep (given or received) shown publically they can turn it off. Any way to do that easily? Or would that be too difficult...

subnet_rx 03-31-2005 02:40 AM

this is a great hack, I'd love to see it updated with some of the features listed here.

nintendo 05-04-2005 03:49 AM

With this hack, members can now post HTML in the reputation. Great way to generate abuse.

Citizen E 06-08-2005 03:04 PM

Has anyone gotten this mod to work for 3.0.7?

johnn 07-09-2005 02:35 AM

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
I'm getting pretty much the same problem. Could someone be so kind as to please tell me how to fix this?

johnn 07-10-2005 06:18 AM

Nevermind. I figured it out on my own, but I figured I'd go ahead and post the solution here as some other person had the same problem and no one answered them.

Quote:

if ($reps = $DB_site->query("SELECT reputation.reputation,reputation.whoadded,reputati on.reason,user.username
FROM " . vb3_ . "reputation AS reputation
LEFT JOIN " . vb3_ . "user AS user ON reputation.whoadded=user.userid
WHERE reputation.reputation!=0 AND postid='".$post['postid']."'"))
Use that, and where it has the 2 instances of "vb3_" put your own table prefix there, if you have one (which you likely do). You can find what your table prefix is, if you don't know it, in your "includes/config.php" file.

That should work.

Citizen E 08-10-2005 07:39 PM

Anyone get this to work with 3.0.8?

Noodles24 09-07-2005 11:13 PM

Quote:

Originally Posted by Citizen E
Anyone get this to work with 3.0.8?

Yup, if you're using the legacy display, you need to add the
<div>$post[affection]</div> in the legacy postbit too (took me a while to find)

Jedi Blaze 10-01-2005 08:40 PM

Will this work with 3.5 or does it need code changes.


All times are GMT. The time now is 01:09 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.02222 seconds
  • Memory Usage 1,824KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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