This is a plugin "
review" requested by
Sama34.
This is an interesting plugin which gives moderators an option to make a copy of the thread (into a specified forum) when it is created (that is, the option only appears when making a new thread and won't show up on edit thread).
I personally would've probably taken a completely different approach - just simply parsing a {SPLIT} tag on the portal page would be suffice, and doesn't suffer issues with having to manage two threads / duplicate data (such as having to update two threads instead of one), but maybe you have a reason to have a copy instead.
Plugin in general does a good job, but I'm feeling a little pedantic at the moment.
- Typo (2 instances):
- I'd recommend a mb_stripos check rather than this
Slightly faster and won't fall over with multiple instances of {SPLIT} in the message, although I guess it's not a big deal.
-
Since only $message[0] is used later on, why not just pass that? Less processing code, and less memory usage.
- I suspect the following is incorrect
as newreply_modoptions is already cached on newthread.php, whilst the added template ougc_portalnews_input isn't. Although not particularly important, I might suggest using THIS_SCRIPT constant rather than PHP_SELF, as it's a bit more reliable.
- Querying the forum is unnecessary here, as you can simply check with $thread['fid']
- Replacement 'read more' text is in bbcode, so may not work if you have that disabled (ie you prefer HTML)