MyBB Community Forums

Full Version: MyAlerts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Added the ",1" and it worked, thankyou!!!!
Smile Glad to hear it!
Having read all the positive replies regarding this plugin, I've attempted to install it on our little forum. I installed the PluginLibrary dependancy plugin , followed by MyAlerts. All looks to go well, but when I reply to a post without any quotes, nothing happens, and when I try quote a post, I get this:

Quote:MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1
Query:
SELECT uid,subject,fid FROM mybb_threads WHERE tid = LIMIT 1

I'm still very new to coding and my skills are very basic so if anyone has any ideas on how to rectify this, I'd greatly appreciate it.

I have a tester account should you need it and if you'd like any more info, please ask. My forum's url is www.forevergaming.co.uk.

Thanks in advance!
That's not a query that MyAlerts runs, so I'm pretty sure MyAlerts isn't actually causing that. COuld you disable myAlerts and try doing the same and see if the error still occurs?
Thanks for the quick reply. The error disappears when I disable MyAlerts, so it's probably conflicting with another plugin. I'll cycle through them later and see if it helps. I'll be sure to report back and let you know.
I think I've been forgotten because I took a really long time to actually PM you back, euantor. Toungue
(I'll never get into calling you Euan T., by the way...)
When someone mentions ( http://community.mybb.com/thread-131448.html ), quotes and replies to you in the same post you get 3 alerts just for one post.
(2013-03-29, 12:11 AM)Shade Wrote: [ -> ]I think that the Internal Server Error you're getting is fired due to the server ending the script because of its execution taking too long to load. This might be the same for all Forums with an high number of users.

The script Wildcard provided, although it is correct, runs one query per setting per user. Simplified example: if you have 9447 users and 5 alert types (why you're not using MentionMe, Plugins Alerts Pack or Moderation Alerts Pack? bad boy Big Grin), the script will run 1*5*9447 = 47235 queries. This is a really high value isn't it? Big Grin

The solution is quite easy: rather than querying the database in the foreach loop, just build an array of data and then build a single query with insert_query_multiple() function. Result: 2 SELECT queries, 1 INSERT query, fast edits.

I've edited Wildcard's script, just upload and run it once by opening the file from your browser.

I haven't tested the script, but it should work.

EDIT: sorry there was a SQL error. Now it should work.

Where do I upload this file to?
^ upload to MyBB files server where you have global.php, index.php and other main php files.
Thanks m.