[ABD] Users Reputation System Mod

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
antongranik
Registered User
Posts: 153
Joined: Tue Oct 07, 2003 5:41 pm
Location: russia/moscow
Contact:

Post by antongranik » Sat Feb 18, 2006 10:51 am

rockboyteek wrote: but you know vBulletin Forum Software, they have a reputation system.. and that is what i like, :wink: ..

And I didn't like this thing. Just a button "approve/don't approve" and a comment. Very easy and not so strong. Here you can give whatever you want to the user and see the full history and earn medals of 5 different sizes. And if one doesn't like the medals system, one can turn the text version on.
anton granik. graphic designer.

rockboyteek
Registered User
Posts: 591
Joined: Tue Mar 29, 2005 2:50 pm
Contact:

Post by rockboyteek » Sat Feb 18, 2006 10:54 am

I fine with the comments stuff but its just the medals thing :D
http://www.adminfuel.com/ - Forum for Forum Administrators

rockboyteek
Registered User
Posts: 591
Joined: Tue Mar 29, 2005 2:50 pm
Contact:

Post by rockboyteek » Sat Feb 18, 2006 10:55 am

PROBLEM!!!

right this error comes up when trying to view topic..

Code: Select all

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/.endora/etcworld/etcworld.co.uk/etcforum/viewtopic.php on line 1525
When i remove the code in that area the error goes.. the code for that bit is..

Code: Select all

	// START ADD Reputation Mod v.0.0.1
	$reputation = '';
	if ($postrow[$i]['user_id'] != ANONYMOUS)
	{
		if ($rep_config['rep_disable'] == 0)
		{
			if ($postrow[$i]['user_reputation'] == 0)
			{
				$reputation = $lang['Zero_reputation'];
			} else
			{
				if ($rep_config['graphic_version'] == 0)
				{
					// Text version
					$reputation =  $lang['Reputation'] . ": ";
					if ($postrow[$i]['user_reputation'] > 0)
					{
						$reputation .= "<strong><font color=\"green\">" . round($postrow[$i]['user_reputation'],1) . "</font></strong>";
					} else {
						$reputation .= "<strong><font color=\"red\">" . round($postrow[$i]['user_reputation'],1) . "</font></strong>";
					}
					$reputation_add = '';
				} else {
					// Graphic version
					get_reputation_medals($postrow[$i]['user_reputation']);
				}
			}
			$reputation .=  " <a href=\""  . append_sid("reputation.$phpEx?a=add&" . POST_USERS_URL . "=" . $postrow[$i]['user_id']) . "&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&c=" . substr(md5($bbcode_uid),0,8) . "\" target=\"_blank\" onClick=\"popupWin = window.open(this.href, '" . $lang['Reputation'] . "', 'location,width=700,height=400,top=0,scrollbars=yes'); popupWin.focus(); return false;\"><img src=\"images/reputation_add_plus.gif\" alt=\"\" border=\"0\"><img src=\"images/reputation_add_minus.gif\" alt=\"\" border=\"0\"></a>";
			$sql = "SELECT COUNT(user_id) AS count_reps
					FROM " . REPUTATION_TABLE . " AS r
					WHERE r.user_id = " . $postrow[$i]['user_id'] . "
					GROUP BY user_id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, "Could not obtain reputation stats for this user", '', __LINE__, __FILE__, $sql);
			}
			$row_rep = $db->sql_fetchrow($result);
			if ($row_rep)
			{
				$reputation .= "<br /><a href=\""  . append_sid("reputation.$phpEx?a=stats&" . POST_USERS_URL . "=" . $postrow[$i]['user_id']) . "\" target=\"_blank\" onClick=\"popupWin = window.open(this.href, '" . $lang['Reputation'] . "', 'location,width=700,height=400,top=0,scrollbars=yes'); popupWin.focus(); return false;\">" . $lang['Votes'] . "</a>: " . $row_rep['count_reps'];
			}
		}
	}
	// END ADD Reputation Mod v.0.0.1
http://www.adminfuel.com/ - Forum for Forum Administrators

User avatar
antongranik
Registered User
Posts: 153
Joined: Tue Oct 07, 2003 5:41 pm
Location: russia/moscow
Contact:

Post by antongranik » Sat Feb 18, 2006 11:39 am

hm, very strange, I don't have any errors and I haven't seen this error ever earlier...

Let's dig it up.

Make these changes (but temporary, undo them after this):

Code: Select all

viewtopic.php
# 
#-----[ FIND ]-------------------------------------- 
#
                        $reputation .=  " <a href=\""  .
append_sid("reputation.$phpEx?a=add&" . POST_USERS_URL . "=" . $postrow[$i]['user_id']) . "&"
. POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&c=" . substr(md5($bbcode_uid),0,8) . "\"
target=\"_blank\" onClick=\"popupWin = window.open(this.href, '" . $lang['Reputation'] . "',
'location,width=700,height=400,top=0,scrollbars=yes'); popupWin.focus(); return false;\"><img
src=\"images/reputation_add_plus.gif\" alt=\"\" border=\"0\"><img
src=\"images/reputation_add_minus.gif\" alt=\"\" border=\"0\"></a>";
# 
#-----[ REPLACE ]-------------------------------------- 
#
                        $reputation .= '';
# 
#-----[ FIND ]-------------------------------------- 
#
                                $reputation .= "<br /><a href=\""  .
append_sid("reputation.$phpEx?a=stats&" . POST_USERS_URL . "=" . $postrow[$i]['user_id']) .
"\" target=\"_blank\" onClick=\"popupWin = window.open(this.href, '" . $lang['Reputation'] .
"', 'location,width=700,height=400,top=0,scrollbars=yes'); popupWin.focus(); return
false;\">" . $lang['Votes'] . "</a>: " . $row_rep['count_reps'];
# 
#-----[ REPLACE ]-------------------------------------- 
#
                        $reputation .= '';
And tell me whether this error shows up again after that or not. And undo then these changes.
anton granik. graphic designer.

rockboyteek
Registered User
Posts: 591
Joined: Tue Mar 29, 2005 2:50 pm
Contact:

Post by rockboyteek » Sat Feb 18, 2006 12:23 pm

works with those changes..

also i don't understand the medal system for it as in admin panel it just shows the 1 medal for each this but in view topic and profile people have got 3, 4 and other amounts of medals of different sizes..

And the plus and minus buttons are not showing with those changes..
http://www.adminfuel.com/ - Forum for Forum Administrators

rockboyteek
Registered User
Posts: 591
Joined: Tue Mar 29, 2005 2:50 pm
Contact:

Post by rockboyteek » Sat Feb 18, 2006 2:32 pm

rockboyteek wrote: also i don't understand the medal system for it as in admin panel it just shows the 1 medal for each this but in view topic and profile people have got 3, 4 and other amounts of medals of different sizes..


KK Dreamweaver was doing something wierd to the file so wasn't working.. works fine now :D .. the question quoted still applies, still do not understand the system... and how can move the +/- numbers in viewtopic seperate from the reputation so that they are at the bottom of each post..

Also what difference between graphical and non-graphical system?
http://www.adminfuel.com/ - Forum for Forum Administrators

rockboyteek
Registered User
Posts: 591
Joined: Tue Mar 29, 2005 2:50 pm
Contact:

Post by rockboyteek » Sat Feb 18, 2006 3:55 pm

More errors... when you click 'submit to post the next page goes like this :

In header..:

Code: Select all

Warning: Division by zero in /home/.endora/etcworld/etcworld.co.uk/etcforum/includes/functions_post.php on line 391

Warning: Cannot modify header information - headers already sent by (output started at /home/.endora/etcworld/etcworld.co.uk/etcforum/includes/functions_post.php:391) in /home/.endora/etcworld/etcworld.co.uk/etcforum/includes/page_header.php on line 644

Warning: Cannot modify header information - headers already sent by (output started at /home/.endora/etcworld/etcworld.co.uk/etcforum/includes/functions_post.php:391) in /home/.endora/etcworld/etcworld.co.uk/etcforum/includes/page_header.php on line 646

Warning: Cannot modify header information - headers already sent by (output started at /home/.endora/etcworld/etcworld.co.uk/etcforum/includes/functions_post.php:391) in /home/.endora/etcworld/etcworld.co.uk/etcforum/includes/page_header.php on line 647
Then instead of showing that the post has been submitted this comes up..

Code: Select all

Error in posting

DEBUG MODE

UPDATE phpbb_users SET user_posts = user_posts + 1, user_reputation = user_reputation + , user_rep_last_time = 1140259130 WHERE user_id = 2

Line : 503
File : functions_post.php 
i got id of a bit of code from this line as shown below and all worked fine except for errors in header ^^^^

Code: Select all

# 
#-----[ FIND ]------------------------------------------ 
#
, user_reputation = user_reputation $sign_rep, user_rep_last_time = $last_time

#
#----[ REMOVE ]---------------------------------------

 $sign_rep
whats problem?
http://www.adminfuel.com/ - Forum for Forum Administrators

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20368
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Post by RMcGirr83 » Sat Feb 18, 2006 8:44 pm

actually has to do with this I believe

Code: Select all

// START ADD Reputation Mod v.0.0.1
	$sign_rep = ($mode == 'delete') ? '- ' . (1/$rep_config['posts_to_earn']) : '+ ' . (1/$rep_config['posts_to_earn']);
	$last_time = $userdata['user_rep_last_time'];
	$dif = time() - $last_time;
	$dif = round($dif/86400,0);
	if ($dif > 1)
	{
		$sign_rep .= ' + ' . $dif / $rep_config['days_to_earn'];
		$last_time = time();
	}
	// END ADD Reputation Mod v.0.0.1

ShadowTek
Registered User
Posts: 66
Joined: Thu Jul 22, 2004 8:21 am
Contact:

Post by ShadowTek » Sat Feb 18, 2006 9:06 pm

Look like a great idea, it it functional yet?

rockboyteek
Registered User
Posts: 591
Joined: Tue Mar 29, 2005 2:50 pm
Contact:

Post by rockboyteek » Sat Feb 18, 2006 9:18 pm

RMcGirr83 wrote: actually has to do with this I believe

Code: Select all

// START ADD Reputation Mod v.0.0.1
	$sign_rep = ($mode == 'delete') ? '- ' . (1/$rep_config['posts_to_earn']) : '+ ' . (1/$rep_config['posts_to_earn']);
	$last_time = $userdata['user_rep_last_time'];
	$dif = time() - $last_time;
	$dif = round($dif/86400,0);
	if ($dif > 1)
	{
		$sign_rep .= ' + ' . $dif / $rep_config['days_to_earn'];
		$last_time = time();
	}
	// END ADD Reputation Mod v.0.0.1


so what should i do to correct it?
http://www.adminfuel.com/ - Forum for Forum Administrators

User avatar
antongranik
Registered User
Posts: 153
Joined: Tue Oct 07, 2003 5:41 pm
Location: russia/moscow
Contact:

Post by antongranik » Sat Feb 18, 2006 9:58 pm

Ok, caught the bug! Here's the change for those who already installed the mod. For the others the download rar is updated.

Code: Select all

includes/functions_post.php

# 
#-----[ FIND ]------------------------------------------ 
#
	// START ADD Reputation Mod v.0.0.1
	$sign_rep = ($mode == 'delete') ? '- ' . (1/$rep_config['posts_to_earn']) : '+ ' . (1/$rep_config['posts_to_earn']);
	$last_time = $userdata['user_rep_last_time'];
	$dif = time() - $last_time;
	$dif = round($dif/86400,0);
	if ($dif > 1)
	{
		$sign_rep .= ' + ' . $dif / $rep_config['days_to_earn'];
		$last_time = time();
	}
	// END ADD Reputation Mod v.0.0.1
# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
	// START ADD Reputation Mod v.0.0.1
	$sign_rep = ($mode == 'delete') ? '- ' . (1/$rep_config['posts_to_earn']) : '+ ' . (1/$rep_config['posts_to_earn']);
	if ($userdata['user_id'] == ANONYMOUS)
	{
		$last_time = time();
	} else
	{
		$last_time = $userdata['user_rep_last_time'];
		$dif = time() - $last_time;
		$dif = round($dif/86400,0);
		if ($dif > 1)
		{
			$sign_rep .= ' + ' . $dif / $rep_config['days_to_earn'];
			$last_time = time();
		}
	}
	// END ADD Reputation Mod v.0.0.1
anton granik. graphic designer.

User avatar
antongranik
Registered User
Posts: 153
Joined: Tue Oct 07, 2003 5:41 pm
Location: russia/moscow
Contact:

Post by antongranik » Sat Feb 18, 2006 10:02 pm

ShadowTek wrote: Look like a great idea, it it functional yet?

Yes, it's functional but it's RC version. Me and other people helping me are finding the bugs and make this mod better. After that I'll release it in a good working condition. ;)
anton granik. graphic designer.

rockboyteek
Registered User
Posts: 591
Joined: Tue Mar 29, 2005 2:50 pm
Contact:

Post by rockboyteek » Sat Feb 18, 2006 10:06 pm

new errors.. didn't fix it..

Code: Select all

 
Error in posting

DEBUG MODE

UPDATE phpbb_forums SET , forum_last_post_id = 5718 WHERE forum_id = 1

Line : 487
File : functions_post.php 
also the header stuff hasnt gone..
http://www.adminfuel.com/ - Forum for Forum Administrators

User avatar
antongranik
Registered User
Posts: 153
Joined: Tue Oct 07, 2003 5:41 pm
Location: russia/moscow
Contact:

Post by antongranik » Sat Feb 18, 2006 10:25 pm

rockboyteek wrote: new errors.. didn't fix it..

Code: Select all

 
Error in posting

DEBUG MODE

UPDATE phpbb_forums SET , forum_last_post_id = 5718 WHERE forum_id = 1

Line : 487
File : functions_post.php 
also the header stuff hasnt gone..

Please, tell me what you're doing when the errors appear. It really helps to find out the problem. ;)
anton granik. graphic designer.

rockboyteek
Registered User
Posts: 591
Joined: Tue Mar 29, 2005 2:50 pm
Contact:

Post by rockboyteek » Sat Feb 18, 2006 10:33 pm

right got rid of code from functions_post.php and that error still appears what has happened!!!!!!, the error appears on the confirmation page when posting a new message/topic, also the header errors still remain that i sed about earlier...
http://www.adminfuel.com/ - Forum for Forum Administrators

Locked

Return to “[2.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 11 guests

cron