[3.1][3.2][DEV] Referrals

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
dmzx
Registered User
Posts: 774
Joined: Fri Sep 05, 2014 6:48 am
Location: The Netherlands
Contact:

Re: [3.1][3.2][DEV] Referrals

Post by dmzx » Sun Oct 07, 2018 5:00 am

3Di wrote:
Sat Oct 06, 2018 11:11 pm
Not compatible with ONLY_FULL_GROUP_BY, to reproduce go viewing stats in contests (ACP).
General Error
SQL ERROR [ mysqli ]

Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'bb.phpbb_referrals.referral_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by [1055]

SQL

SELECT * , COUNT(referrer_username) AS referrals_count FROM phpbb_referrals LEFT JOIN phpbb_users ON referral_username=username WHERE referral_since BETWEEN 1538867101 AND 1541718318 AND user_posts >= 2 GROUP BY referrer_username ORDER BY referrals_count DESC
Admin controller

Code: Select all

			case 'stats':

				$this->template->assign_vars(array(
					'VIEW_STATS'	=> true,
				));

				$sql = 'SELECT * ,
					COUNT(referrer_username) AS referrals_count
					FROM ' . $this->referral_table . '
						LEFT JOIN ' . USERS_TABLE . '
						ON referral_username=username
					WHERE referral_since
					BETWEEN ' . $start_date . ' AND ' . $end_date . '
						AND user_posts >= ' . $ref_min_posts . '
					GROUP BY referrer_username
					ORDER BY referrals_count DESC';
				$result = $this->db->sql_query($sql);
Changing this line

Code: Select all

GROUP BY referrer_username
to

Code: Select all

GROUP BY user_id, referral_id, referrer_username
seems to do the trick, have a look.
Will check it.
Contact me on dmzx-web.net
 Need a Host or buy me a beer Donate and try binance.com

moogoo
Registered User
Posts: 2
Joined: Fri Feb 22, 2019 6:04 am

Re: [DEV] Referrals

Post by moogoo » Fri Feb 22, 2019 6:05 am

MrMoney1 wrote:
Tue Feb 06, 2018 1:49 pm
dmzx wrote:
Tue Dec 12, 2017 5:23 pm

@dmzx
Now working
How did you get it working?

User avatar
dmzx
Registered User
Posts: 774
Joined: Fri Sep 05, 2014 6:48 am
Location: The Netherlands
Contact:

Re: [DEV] Referrals

Post by dmzx » Fri Feb 22, 2019 5:19 pm

moogoo wrote:
Fri Feb 22, 2019 6:05 am
MrMoney1 wrote:
Tue Feb 06, 2018 1:49 pm
dmzx wrote:
Tue Dec 12, 2017 5:23 pm

@dmzx
Now working
How did you get it working?
What is the error?
Contact me on dmzx-web.net
 Need a Host or buy me a beer Donate and try binance.com

moogoo
Registered User
Posts: 2
Joined: Fri Feb 22, 2019 6:04 am

Re: [3.1][3.2][DEV] Referrals

Post by moogoo » Fri Feb 22, 2019 7:37 pm

As far as I can tell, there is no error. But maybe I'm not looking in the correct place.

I was able to install it and enable it. When I go to use it, the referral link redirects back to the main page and sending the email invite doesn't work, even though I get the success confirmation screen afterward.

Where should I look to find the error log for the extension?

Post Reply

Return to “Extensions in Development”