Previous Thread
Next Thread
Print Thread
Hop To
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
When you are admin and set the option "Do you want to be notified when a user uses the Notify Post option? Normally these are just sent to Moderators." you get double notifies if you are also set as moderator for a certain forum.

Not unlikely to set yourself as moderator for visibibility reasons.

my fix?

change
Code
	        $notify_array[] = $admin;;

into:

Code
	        if (!in_array($admin,$notify_array)) { $notify_array[] = $admin; };

You can also save a bit of duplicate code in there for the e-mailing by checking for an empty array, and if so, add the main admin id to the array.


[Linked Image from siemons.org]
Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Thanks for the fix. Also made the change to remove the duplicate code.

Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Originally Posted by Rick
Thanks for the fix. Also made the change to remove the duplicate code.

I saw in the code if the main admin was not set, it would just take number 2, without a check if it was an admin or not. I would suggest a query that takes the first admin user from the userlist.

At our board user number 2 is an ex-admin who left.


[Linked Image from siemons.org]
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
I have a comment on that, why use user2? We have a superadmin field, why not use this?


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Originally Posted by Gizmo
I have a comment on that, why use user2? We have a superadmin field, why not use this?

If you look at the code, it takes the super admin field, but if that field is not set, it will take blindly user #2, without any check if it's an admin or not.


[Linked Image from siemons.org]
Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
Ahh, well, then I'd say that'd be the admin's fault for not populating that field...


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
It's not copy/pasted right for 7.2.2 Rick.

while(list($admin) = $dbh->fetch_array($sth)) {
if (!in_array(admin,$notify_array)) {

It's missing a $ there.


[Linked Image from siemons.org]
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
el fixo for 7.3 smile

also there is a dupe email check. smile


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
0 members (), 541 guests, and 181 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)