MYBB – Email For Pending Threads Approvals
This plugin send email to Mods about pending threads approvals.
For the plugin, you need to make an edit first. You can get the group ids about who will be sent from the plugin with the following path
1 |
https://your-url.com/admin/index.php?module=user-groups |
Click on one of the groups that will go from here, a section will come in the url as I have given below, at the end it says gid=4, this group index value of that group write them aside
After that download the plugin which is attachment and edit line 28
1 |
$groups = [3,4,6]; |
After that upload file to inc/plugins and active plugin on admin panel / plugins
Or Copy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
<?php if(!defined("IN_MYBB")){ die("??"); } $plugins->add_hook("newthread_do_newthread_end","hook_newthread"); function modthread_info(){ return [ "name" => "Send Mail for pending threads approval", "description" => "This Plugin Send Email To Mods About Invisible Threads", "website" => "https://www.webailesi.com", "author" => "ITenGriTR", "authorsite" => "https://www.webailesi.com", "version" => "1.0", "compatibility" => "18*" ]; } function modthread_activate(){ } function modthread_deactivate(){ } function hook_newthread(){ global $db,$mybb,$thread_info,$cache; if($thread_info["visible"] == 0){ $thread_data = get_thread($thread_info["tid"]); $message = "Hello, {username}\n".$mybb->settings["bbname"]." there is a new thread and pending approval!\n----------------------------\n\nThread Name: ".$thread_data["subject"]."\nFrom: ".$thread_data["username"]."\nThread URL: ".$mybb->settings["homeurl"]."/".get_thread_link($thread_data["tid"])."\n----------------------------\nThanks,\n".$mybb->settings["bbname"]." \n".$mybb->settings["bburl"].""; $groups = [3,4,6]; $query = $db->simple_select("users","username,email","usergroup IN (".implode(",",$groups).")"); while($user = $db->fetch_array($query)){ $maildetails = array( "mailto" => $db->escape_string($user["email"]), "mailfrom" => "", "subject" => $mybb->settings["bbname"]." - Konu Onayı", "message" => str_replace("{username}",$user["username"],$message), "headers" => "" ); $db->insert_query("mailqueue",$maildetails); $cache->update_mailqueue(); } } } ?> |
Bir cevap yazın