mirror of
https://github.com/TotalFreedomMC/StaffOnlyText.git
synced 2024-12-22 07:45:13 +00:00
Add new reply parsing
This commit is contained in:
parent
db349641e7
commit
57b03d08b9
1 changed files with 15 additions and 7 deletions
|
@ -5,6 +5,7 @@ if(!defined("IN_MYBB"))
|
|||
}
|
||||
|
||||
$plugins->add_hook("parse_message", "staff_only_text_run");
|
||||
$plugins->add_hook("parse_quoted_message", "parse_new_reply");
|
||||
|
||||
function staff_only_text_info()
|
||||
{
|
||||
|
@ -14,12 +15,20 @@ global $mybb;
|
|||
"description" => "Staff only viewable text",
|
||||
"author" => "scripthead",
|
||||
"authorsite" => "https://scripthead.me",
|
||||
"version" => "1.0.0",
|
||||
"version" => "1.0.1",
|
||||
"codename" => "staff_only_text",
|
||||
"compatibility" => "*",
|
||||
);
|
||||
}
|
||||
|
||||
function parse_new_reply(&$message)
|
||||
{
|
||||
if (!has_permission())
|
||||
{
|
||||
$message = preg_replace('#\[staff\](.*?)\[\/staff\]#si','Only staff may view this text',$message);
|
||||
}
|
||||
}
|
||||
|
||||
function staff_only_text_activate()
|
||||
{
|
||||
global $mybb, $db;
|
||||
|
@ -42,9 +51,8 @@ function staff_only_text_activate()
|
|||
|
||||
$i = 1;
|
||||
|
||||
foreach ($settings as &$row) {
|
||||
foreach ($settings as &$row)
|
||||
$row['gid'] = $settingGroupId;
|
||||
$row['title'] = $db->escape_string($row['title']);
|
||||
$row['description'] = $db->escape_string($row['description']);
|
||||
$row['disporder'] = $i++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue