[MODDB] Ultimate Points 1.0.6

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!
Suggested Hosts
Locked
plasmino
Registered User
Posts: 261
Joined: Sat Jul 25, 2009 11:12 am

Re: [RC] Ultimate Points 1.0.3

Post by plasmino » Thu Jul 30, 2009 2:22 pm

idem error help help

icebox33
Registered User
Posts: 3
Joined: Sun Jul 12, 2009 9:02 pm

Re: [RC] Ultimate Points 1.0.3

Post by icebox33 » Fri Jul 31, 2009 11:35 am

I greet. I have the question. Does someone know as to alter the code and where would the Bank account by to be activated together with with the user registration?

I apologize for doubling the subject but I do not know English now I have to translate every fast and to find me the answer heavily. I ask me to help
Very sorry for the quality of speech but I do not speak English and I use google translator .

User avatar
moltendorf
Registered User
Posts: 173
Joined: Thu Dec 01, 2005 2:02 am
Location: San Ramon, California
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by moltendorf » Fri Jul 31, 2009 4:40 pm

danielnguyen wrote:I see this error when I run your sql code!

Code: Select all

Error

SQL query: Documentation

UPDATE phpbb_users u SET u.user_points = (( SELECT c.reg_points_bonus FROM phpbb_points_values c LIMIT 1 ) + IF(( SELECT SUM(f.phpbb_perpost + (f.phpbb_peredit * p.post_edit_count) + (@attachment_initial * p.post_attachment)) FROM phpbb_forums f, phpbb_posts p WHERE f.phpbb_id = p.phpbb_id AND p.poster_id = u.user_id ),( SELECT SUM(f.phpbb_perpost + (f.phpbb_peredit * p.post_edit_count) + (@attachment_initial * p.post_attachment)) FROM phpbb_forums f, phpbb_posts p WHERE f.phpbb_id = p.phpbb_id AND p.poster_id = u.user_id ),0) + IF[...]

MySQL said: Documentation
#1054 - Unknown column 'f.phpbb_perpost' in 'field list' 
Well, that was my fault, I didn't double-check that my mass-replace screwed up the query.
I have fixed it, and it now properly works on a vanilla phpBB 3 install with Ultimate Points.

http://www.phpbb.com/community/viewtopi ... #p10269755
Did I ever mention that I think phpBB is awesome? I thought I did, but I'm not so sure, so I'll say it again: phpBB is awesome!
pantry \ snack :: is_good ( ) ? pantry \ snack :: hastily_consume ( ) : pantry \ snack :: reject ( );

Need some help? I have a solid understanding several programming and markup languages.
Projects: QuickChat: A Shoutbox, Live Post, ORANGEstyle

plasmino
Registered User
Posts: 261
Joined: Sat Jul 25, 2009 11:12 am

Re: [RC] Ultimate Points 1.0.3

Post by plasmino » Fri Jul 31, 2009 6:11 pm

thank moltendorf for fix ^-^

User avatar
Tophon
Registered User
Posts: 212
Joined: Wed Oct 22, 2008 12:19 am
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by Tophon » Sat Aug 01, 2009 4:46 pm

Any plan to make a better revised shop mod to run with this femu?

jaygee
Registered User
Posts: 31
Joined: Tue Feb 03, 2004 9:34 pm

Re: [RC] Ultimate Points 1.0.3

Post by jaygee » Sat Aug 01, 2009 10:39 pm

This looks like it would be a GREAT mod for my board. I am wondering what (if any) bugs have been found thus far. Also, overall reviews on this mod. Also, does it only work with certain themes? Or does it work across all themes? Are there any visual errors (misplaced graphics, or anything like that).

Wyr!H@x!mu$
Registered User
Posts: 802
Joined: Fri Jan 24, 2003 12:06 pm
Location: Koedijk, Alkmaar, The Netherlands
Name: Cees-Jan
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by Wyr!H@x!mu$ » Sat Aug 01, 2009 11:23 pm

@femu && Wuerzi
After my comment about a overhead of useless queries I came to these code changes to eliminate the 2 extra queries per post:
OPEN: viewtopic.php
FIND:

Code: Select all

$sql = $db->sql_build_query('SELECT', array(
	'SELECT'	=> 'u.*, z.friend, z.foe, p.*',

	'FROM'		=> array(
		USERS_TABLE		=> 'u',
		POSTS_TABLE		=> 'p',
	),

	'LEFT_JOIN'	=> array(
		array(
			'FROM'	=> array(ZEBRA_TABLE => 'z'),
			'ON'	=> 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
		)
	),

	'WHERE'		=> $db->sql_in_set('p.post_id', $post_list) . '
		AND u.user_id = p.poster_id'
));
REPLACE, WITH:

Code: Select all

$sql = $db->sql_build_query('SELECT', array(
	'SELECT'	=> 'u.*, z.friend, z.foe, p.*, pb.id AS pb_id, pb.holding AS pb_holding',

	'FROM'		=> array(
		USERS_TABLE		=> 'u',
		POSTS_TABLE		=> 'p',
	),

	'LEFT_JOIN'	=> array(
		array(
			'FROM'	=> array(ZEBRA_TABLE => 'z'),
			'ON'	=> 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
		),
		array(
			'FROM'	=> array(POINTS_BANK_TABLE => 'pb'),
			'ON'	=> 'pb.user_id = p.poster_id'
		),
	),

	'WHERE'		=> $db->sql_in_set('p.post_id', $post_list) . '
		AND u.user_id = p.poster_id'
));
FIND:

Code: Select all

	// Start Ultimate Points
	$pointslock = $banklock = '';
	$has_account = true;
	if ( $config['points_enable'] ) 
	{
		// Get the points status
		$pointslock = true;
		$UA = new auth();
		$UA->acl($row);
		$pointslock = !$UA->acl_get('u_use_points');
		
		// Get the bank status
		$banklock = true;
		if ($points_config['bank_enable'])
		{
			$UA = new auth();
			$UA->acl($row);
			$banklock = !$UA->acl_get('u_use_bank');
		}
		
		// Check if user has a bank account
		$sql1 = "SELECT *
			FROM " . POINTS_BANK_TABLE . "
			WHERE user_id = '{$poster_id}'";
		$result1 = $db->sql_query($sql1);
		$check_row = $db->sql_fetchrow($result1);

		if ( !isset($check_row['holding']) && $poster_id > 0 )
		{
			$has_account = false;
		}
	}
	// End Ultimate Points
REPLACE, WITH:

Code: Select all

	// Start Ultimate Points
	$pointslock = $banklock = '';
	$has_account = true;
        $holding = ( empty($holding) ) ? array() : $holding;
	if ( $config['points_enable'] )
	{
		// Get the points status
		$pointslock = true;
		$UA = new auth();
		$UA->acl($row);
		$pointslock = !$UA->acl_get('u_use_points');

		// Get the bank status
		$banklock = true;
		if ($points_config['bank_enable'])
		{
			$UA = new auth();
			$UA->acl($row);
			$banklock = !$UA->acl_get('u_use_bank');
		}

		if ( !isset($row['pb_holding']) && $poster_id > 0 )
		{
			$has_account = false;
		}
                $holding[$poster_id] = ( $row['pb_holding'] ) ? $row['pb_holding'] : '0';
	}
	// End Ultimate Points
FIND:

Code: Select all

	// Start Ultimate Points
	$holding = ( empty($holding) ) ? array() : $holding;
	if ( empty($holding[$poster_id]) )
	{
		$sql = "SELECT holding
			FROM " . POINTS_BANK_TABLE . "
			WHERE user_id = '$poster_id'";
		$result = $db->sql_query($sql);
		$bank_row = $db->sql_fetchrow($result);
		$holding[$poster_id] = ( $bank_row['holding'] ) ? $bank_row['holding'] : '0';
		$bank_row = '';
	}
	// End Ultimate Points
REMOVE IT

Lemme know what you think :).

jaygee
Registered User
Posts: 31
Joined: Tue Feb 03, 2004 9:34 pm

Re: [RC] Ultimate Points 1.0.3

Post by jaygee » Sat Aug 01, 2009 11:28 pm

Here is an error message I am getting...

Code: Select all

SQL ERROR [ mysqli ]

Table 'jag_phpbb3.phpbb_points_config' doesn't exist [1146]

SQL

SELECT config_name, config_value FROM (phpbb_points_config c)

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 163
CALL: dbal->sql_error()

FILE: index.php
LINE: 121
CALL: dbal_mysqli->sql_query()
Any ideas?

femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [RC] Ultimate Points 1.0.3

Post by femu » Sun Aug 02, 2009 11:48 am

Hi,

thanks for the input. We will check it and if it works as it should, we will replace this. So every thought to make it easier is very welcome ;) As I said, we are no real programmers and we are still learning :mrgreen:

Wyr!H@x!mu$ wrote:@femu && Wuerzi
After my comment about a overhead of useless queries I came to these code changes to eliminate the 2 extra queries per post:
OPEN: viewtopic.php
FIND:

Code: Select all

$sql = $db->sql_build_query('SELECT', array(
	'SELECT'	=> 'u.*, z.friend, z.foe, p.*',

	'FROM'		=> array(
		USERS_TABLE		=> 'u',
		POSTS_TABLE		=> 'p',
	),

	'LEFT_JOIN'	=> array(
		array(
			'FROM'	=> array(ZEBRA_TABLE => 'z'),
			'ON'	=> 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
		)
	),

	'WHERE'		=> $db->sql_in_set('p.post_id', $post_list) . '
		AND u.user_id = p.poster_id'
));
REPLACE, WITH:

Code: Select all

$sql = $db->sql_build_query('SELECT', array(
	'SELECT'	=> 'u.*, z.friend, z.foe, p.*, pb.id AS pb_id, pb.holding AS pb_holding',

	'FROM'		=> array(
		USERS_TABLE		=> 'u',
		POSTS_TABLE		=> 'p',
	),

	'LEFT_JOIN'	=> array(
		array(
			'FROM'	=> array(ZEBRA_TABLE => 'z'),
			'ON'	=> 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
		),
		array(
			'FROM'	=> array(POINTS_BANK_TABLE => 'pb'),
			'ON'	=> 'pb.user_id = p.poster_id'
		),
	),

	'WHERE'		=> $db->sql_in_set('p.post_id', $post_list) . '
		AND u.user_id = p.poster_id'
));
FIND:

Code: Select all

	// Start Ultimate Points
	$pointslock = $banklock = '';
	$has_account = true;
	if ( $config['points_enable'] ) 
	{
		// Get the points status
		$pointslock = true;
		$UA = new auth();
		$UA->acl($row);
		$pointslock = !$UA->acl_get('u_use_points');
		
		// Get the bank status
		$banklock = true;
		if ($points_config['bank_enable'])
		{
			$UA = new auth();
			$UA->acl($row);
			$banklock = !$UA->acl_get('u_use_bank');
		}
		
		// Check if user has a bank account
		$sql1 = "SELECT *
			FROM " . POINTS_BANK_TABLE . "
			WHERE user_id = '{$poster_id}'";
		$result1 = $db->sql_query($sql1);
		$check_row = $db->sql_fetchrow($result1);

		if ( !isset($check_row['holding']) && $poster_id > 0 )
		{
			$has_account = false;
		}
	}
	// End Ultimate Points
REPLACE, WITH:

Code: Select all

	// Start Ultimate Points
	$pointslock = $banklock = '';
	$has_account = true;
        $holding = ( empty($holding) ) ? array() : $holding;
	if ( $config['points_enable'] )
	{
		// Get the points status
		$pointslock = true;
		$UA = new auth();
		$UA->acl($row);
		$pointslock = !$UA->acl_get('u_use_points');

		// Get the bank status
		$banklock = true;
		if ($points_config['bank_enable'])
		{
			$UA = new auth();
			$UA->acl($row);
			$banklock = !$UA->acl_get('u_use_bank');
		}

		if ( !isset($row['pb_holding']) && $poster_id > 0 )
		{
			$has_account = false;
		}
                $holding[$poster_id] = ( $row['pb_holding'] ) ? $row['pb_holding'] : '0';
	}
	// End Ultimate Points
FIND:

Code: Select all

	// Start Ultimate Points
	$holding = ( empty($holding) ) ? array() : $holding;
	if ( empty($holding[$poster_id]) )
	{
		$sql = "SELECT holding
			FROM " . POINTS_BANK_TABLE . "
			WHERE user_id = '$poster_id'";
		$result = $db->sql_query($sql);
		$bank_row = $db->sql_fetchrow($result);
		$holding[$poster_id] = ( $bank_row['holding'] ) ? $bank_row['holding'] : '0';
		$bank_row = '';
	}
	// End Ultimate Points
REMOVE IT

Lemme know what you think :).
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]

femu
Registered User
Posts: 1070
Joined: Tue Sep 27, 2005 10:03 am

Re: [RC] Ultimate Points 1.0.3

Post by femu » Sun Aug 02, 2009 11:48 am

jaygee wrote:Here is an error message I am getting...

Code: Select all

SQL ERROR [ mysqli ]

Table 'jag_phpbb3.phpbb_points_config' doesn't exist [1146]

SQL

SELECT config_name, config_value FROM (phpbb_points_config c)

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 163
CALL: dbal->sql_error()

FILE: index.php
LINE: 121
CALL: dbal_mysqli->sql_query()
Any ideas?
Looks like you forgot the edit in your constants.php or forget to upload it ....
Regards, femu
_____________________________________________
[My development page] - [My normal homepage (German only)]

shadowcreeper
Registered User
Posts: 5
Joined: Mon Jul 06, 2009 7:11 pm

Re: [RC] Ultimate Points 1.0.3

Post by shadowcreeper » Sun Aug 02, 2009 1:52 pm

i added the patch moltendorf posted about - points when editing a post that didn't seem to work for me ,, i still get - points when i edit a post?

i even tryed to disable edit post for points and that don't work either still gives - points even when i have it turned off..

any help with this would be great..

is there something i can remove from a file so it don't even check or mess with the points when somebody edits a post??

Thanks

shadowcreeper
Registered User
Posts: 5
Joined: Mon Jul 06, 2009 7:11 pm

Re: [RC] Ultimate Points 1.0.3

Post by shadowcreeper » Sun Aug 02, 2009 3:56 pm

ok long as i don't set the Advanced Points Settings and leave everthing at 0 , there is no problems if i edit any field in the advanced settings it messes things up..

User avatar
modifier
Registered User
Posts: 71
Joined: Thu Jul 30, 2009 7:31 pm
Location: Maryland
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by modifier » Sun Aug 02, 2009 9:11 pm

Evening guys i am using the latest release and it looks great. Everything works except for the points per post . I have done 8 or 9 test posts and none have given me points. The bank works etc but i cannot get the points to work when posting it just says 0.00 earned for post and i do not get any points per post but points do get deducted. I know i am messing up somewhere, maybe permissions or something. ANy help would begreatly appreciated.

Heres the site: http://www.nukeoptimized.com

Thanks friends.
http://www.ngnuke.comYour source for PHPBB3 Graphics and Mods.

User avatar
Ashley.S.
Registered User
Posts: 468
Joined: Mon Aug 04, 2008 6:01 pm
Location: Falmouth, Cornwall, UK
Name: Ashley .S.
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by Ashley.S. » Sun Aug 02, 2009 9:22 pm

modifier wrote:Evening guys i am using the latest release and it looks great. Everything works except for the points per post . I have done 8 or 9 test posts and none have given me points. The bank works etc but i cannot get the points to work when posting it just says 0.00 earned for post and i do not get any points per post but points do get deducted. I know i am messing up somewhere, maybe permissions or something. ANy help would begreatly appreciated.

Heres the site: http://www.nukeoptimized.com

Thanks friends.
tried the patch: http://www.phpbb.com/community/viewtopi ... #p10262315 ?
Regards,
-Ashley.S. [ ProphpBB Free Forum Hosting Moderator ]

Wyr!H@x!mu$
Registered User
Posts: 802
Joined: Fri Jan 24, 2003 12:06 pm
Location: Koedijk, Alkmaar, The Netherlands
Name: Cees-Jan
Contact:

Re: [RC] Ultimate Points 1.0.3

Post by Wyr!H@x!mu$ » Sun Aug 02, 2009 9:44 pm

femu wrote:Hi,

thanks for the input. We will check it and if it works as it should, we will replace this. So every thought to make it easier is very welcome ;) As I said, we are no real programmers and we are still learning :mrgreen:
Np hope you learn something from it aswell ;).

Locked

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