Just venting because I have a plugin here or as phpBB calls them "Extensions" and it is out dated and not updating. Specifically the extension is called "Referrals" by DMZX his home page listed on the extension is http://www.dmzx-web.net/ which is down.
The issue with this thing is I am running a referral contest here, it works, the admin stats updated in real time but the "Top 3 referrers" on the index page here is stuck at the first 3 people who made a referral. I have posted on his official support thread over at phpbb.com but doubt he'll ever answer as he seems to have given up on it and shut down his site.
For now the only solution that pops to my mind is to do weekly screen shots of the admin stats and post them in the referral contest thread.
I just went a head and disabled and deleted all plugins on my blogs that i can live without and some extensions on this forum.
The moral of this story is adding code and plugins (call them what you like) can be a problem when those things do not get updated.
Limit plugins to the bare minimum
- TheButcher
- Administrator

- Posts: 17531
- Joined: February 2nd, 2018, 11:48 am
- Title: I like weekends
- Referrals: 1
- Contact:
- vblogger
- Verified Member

- Posts: 1935
- Joined: February 17th, 2018, 2:48 pm
Right never add more than you need to any site,you are asking for trouble from hackers and defunct plugins. Good luck getting this sorted out man.
- sarettah
- Verified Member

- Posts: 125
- Joined: January 10th, 2022, 10:39 am
I left you another pm after i installed a test version on my test board.TheButcher wrote: ↑March 15th, 2023, 8:07 pmJust venting because I have a plugin here or as phpBB calls them "Extensions" and it is out dated and not updating. Specifically the extension is called "Referrals" by DMZX his home page listed on the extension is http://www.dmzx-web.net/ which is down.
- sarettah
- Verified Member

- Posts: 125
- Joined: January 10th, 2022, 10:39 am
hey, i have been sending you pms but they are still sitting in my outbox instead of going to sent messages, not sure if that is the way it is supposed to be or not, maybe it doesn't go into the sent until you have read them on your end
i had another pm written up but it got lost somewhere along the way so i will put what i had in there, here
i have a fix for the issue, found the mistake they have in the code
i need you to send me the listener.php file from the extension folder it would be in ext/dmzx/referral/event/
very easy fix, just changing one line
they have a query screwed up in there
$sql = 'SELECT *,
COUNT(referrer_username) AS referrals_count
FROM ' . $this->referral_table . '
LEFT JOIN ' . USERS_TABLE . '
ON referral_username = username
WHERE referral_since
BETWEEN ' . $contest_start_date . '
AND ' . $contest_end_date . '
AND user_posts >= ' . $ref_min_posts . '
GROUP BY user_id, referral_id, referrer_username
ORDER BY referrals_count DESC';
needs to be
'SELECT *,
COUNT(referrer_username) AS referrals_count
FROM ' . $this->referral_table . '
LEFT JOIN ' . USERS_TABLE . '
ON referral_username = username
WHERE referral_since
BETWEEN ' . $contest_start_date . '
AND ' . $contest_end_date . '
AND user_posts >= ' . $ref_min_posts . '
GROUP BY referrer_username
ORDER BY referrals_count DESC';
That is down around line 237 in my copy, we are not on the same version and that is why i wanted you to send me the file because i do not know for sure that your copy will be the same as mine
the original query, because they group by userid, referrer id and referrer username you end up with 1 record per referral, so every record has a referral count of 1 and so no record has more than 1 referral and it lists it out in the natural order because they are all equal
changing the group by to referrer username gives us 1 record per referrer with a total of the number of referrals, which is then listed in descending order and voila you have the list you want
so either pass me the listener.php file so i can make the change for you or go in, locate the code and make the change yourself, remember, make a back up copy before you change anything - i shouldn't have to say that but better safe than sorry
.
i had another pm written up but it got lost somewhere along the way so i will put what i had in there, here
i have a fix for the issue, found the mistake they have in the code
i need you to send me the listener.php file from the extension folder it would be in ext/dmzx/referral/event/
very easy fix, just changing one line
they have a query screwed up in there
$sql = 'SELECT *,
COUNT(referrer_username) AS referrals_count
FROM ' . $this->referral_table . '
LEFT JOIN ' . USERS_TABLE . '
ON referral_username = username
WHERE referral_since
BETWEEN ' . $contest_start_date . '
AND ' . $contest_end_date . '
AND user_posts >= ' . $ref_min_posts . '
GROUP BY user_id, referral_id, referrer_username
ORDER BY referrals_count DESC';
needs to be
'SELECT *,
COUNT(referrer_username) AS referrals_count
FROM ' . $this->referral_table . '
LEFT JOIN ' . USERS_TABLE . '
ON referral_username = username
WHERE referral_since
BETWEEN ' . $contest_start_date . '
AND ' . $contest_end_date . '
AND user_posts >= ' . $ref_min_posts . '
GROUP BY referrer_username
ORDER BY referrals_count DESC';
That is down around line 237 in my copy, we are not on the same version and that is why i wanted you to send me the file because i do not know for sure that your copy will be the same as mine
the original query, because they group by userid, referrer id and referrer username you end up with 1 record per referral, so every record has a referral count of 1 and so no record has more than 1 referral and it lists it out in the natural order because they are all equal
changing the group by to referrer username gives us 1 record per referrer with a total of the number of referrals, which is then listed in descending order and voila you have the list you want
so either pass me the listener.php file so i can make the change for you or go in, locate the code and make the change yourself, remember, make a back up copy before you change anything - i shouldn't have to say that but better safe than sorry
.
- TheButcher
- Administrator

- Posts: 17531
- Joined: February 2nd, 2018, 11:48 am
- Title: I like weekends
- Referrals: 1
- Contact:
Good morning Sarettah I just woke up and got online, I replaced that block and purged the cache, I must have goofed up. I'll email you the original file in a minute. I'll get to the pm's next there are like 14 from over night.
Thanks for all your help, I appreciate it.
Peace
Thanks for all your help, I appreciate it.
Peace
- TheButcher
- Administrator

- Posts: 17531
- Joined: February 2nd, 2018, 11:48 am
- Title: I like weekends
- Referrals: 1
- Contact:
The issue is fixed thanks to Sarettah.
Peace
Peace
- sarettah
- Verified Member

- Posts: 125
- Joined: January 10th, 2022, 10:39 am
- viking
- Verified Member

- Posts: 1420
- Joined: March 18th, 2018, 8:28 pm
Nice job Sarettah now I know who to ask when I get stuck with php