Limit plugins to the bare minimum

Discussion Of All Legal Topics Is Fine Anything Goes. Be Respectful of Others. No Personal Information or Attacks.
All Traffic, Link, Banner, Push Notification and Advertising, Offers & Requests Here,.
Domains & Websites For Sale and Requests Here.
Keep One thread per person & No More Than 1 Weekly Bump.
Post Reply
User avatar
TheButcher
Administrator
Administrator
Posts: 17530
Joined: February 2nd, 2018, 11:48 am
Title: I like weekends
Referrals: 1
Contact:

Limit plugins to the bare minimum

#1

Post by TheButcher » March 15th, 2023, 8:07 pm

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.

User avatar
vblogger
Verified Member
Verified Member
Posts: 1935
Joined: February 17th, 2018, 2:48 pm

#2

Post by vblogger » March 15th, 2023, 9:20 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.




User avatar
sarettah
Verified Member
Verified Member
Posts: 125
Joined: January 10th, 2022, 10:39 am

#3

Post by sarettah » March 16th, 2023, 12:02 am

TheButcher wrote: ↑
March 15th, 2023, 8:07 pm
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.
I left you another pm after i installed a test version on my test board.

User avatar
sarettah
Verified Member
Verified Member
Posts: 125
Joined: January 10th, 2022, 10:39 am

#4

Post by sarettah » March 16th, 2023, 1:14 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

.

User avatar
TheButcher
Administrator
Administrator
Posts: 17530
Joined: February 2nd, 2018, 11:48 am
Title: I like weekends
Referrals: 1
Contact:

#5

Post by TheButcher » March 16th, 2023, 7:53 am

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

User avatar
TheButcher
Administrator
Administrator
Posts: 17530
Joined: February 2nd, 2018, 11:48 am
Title: I like weekends
Referrals: 1
Contact:

#6

Post by TheButcher » March 16th, 2023, 10:45 am

The issue is fixed thanks to Sarettah.

Peace

User avatar
sarettah
Verified Member
Verified Member
Posts: 125
Joined: January 10th, 2022, 10:39 am

#7

Post by sarettah » March 17th, 2023, 2:12 pm

Looks good

User avatar
viking
Verified Member
Verified Member
Posts: 1420
Joined: March 18th, 2018, 8:28 pm

#8

Post by viking » March 18th, 2023, 8:12 am

Nice job Sarettah now I know who to ask when I get stuck with php




Limit plugins to the bare minimum

Post Reply