2012-09-23, 08:49 PM
There can't be warn for new replies, so the best option could be to stick $post['pwn'] = ''; to the top of my code. Editpost should probably have a special attention though, I updated my last post code.
Post Warning Notification (Icon).
|
2012-09-23, 08:49 PM
There can't be warn for new replies, so the best option could be to stick $post['pwn'] = ''; to the top of my code. Editpost should probably have a special attention though, I updated my last post code.
2012-09-23, 08:51 PM
Good point, I wasn't thinking about that haha. I just remember facing errors with MyXBL due to quick reply.
2012-09-23, 09:11 PM
This is a nice plugin. Once it gets updated with the query issues, I'd be glad to use it. Thanks!
2012-09-23, 09:19 PM
Your ACP theme is so sexy, can I have?
2012-09-23, 09:26 PM
2012-09-24, 06:06 AM
This user has been denied support.
(2012-09-23, 08:32 PM)Omar G. Wrote: <?Yeah, I failed to remember that it does fetch the fid. Omar, the above code of yours had some problem, like in below query when you're fetching as a field:
I was presented with missing argument for mysqli fetch function, tried a way around but didn't got anything to work. So, I instead fetched it as an array:
and that works great. Just wanted to confirm if I can fetch it & store as an array? And yeah, the function now works correct. The cache is working on the spot, and now am running 9 less queries, which means only 1 on postbit. Am not good with cache yet, haha, so thanks for the help. Here's how the current function looks:
Let me know if it's good and if so, I shall submit an updated version. Quote:and that works great. Just wanted to confirm if I can fetch it & store as an array? My bad. Yes, you are suppose to fetch the result as array, not a specified field. The only problem I really see is this:
For performance reasons (maybe minimal, but still) you should only add global variables to the local scope (no sure about the correct terms programmers do use) when and where necessary, in this case you don't really need $mybb at all and $pids not always.
This user has been denied support.
You're correct, I've removed them as globals.I will be submitting new version in a minute or two, if possible, do approve it. Thank you, everybody for the help to assist me in optimizing the plugin. I learned few more things. Edit: submitted & approved. The plugin is now well optimized for v1.1 and runs only 1 query on postbit/showthread and is available to be downloaded from below: http://mods.mybb.com/view/post-warning-notification
Tow more suggestions.
Adding a new lang file just for one line doesn't seems reasonable at all, so maybe you can do something like this:
That way people who want to translate your plugin can simple add the following to the global.lang.php file:
Hope that helps!
This user has been denied support.
Well,1. I like to create settings for my plugins rather than altering the table. 2. I will see to it, haha, I'm used to it, but I guess I'll update it if I find time, as I am so short of time these days. I was about to create a language file but I gave up that thought and added the variable instead, I'll update it in the new version. Thanks for suggestions, appreciated. PS. This thread is getting insane views for some reason. |
« Next Oldest | Next Newest »
|