2013-03-04, 12:03 PM
Hello I'm hoping someone can help with some code advice on an existing plugin?
The plugin is Extra Forum Permissions but as the person who made it is no longer active here, there is no support for the plugin.
So I'm trying to work out how I can let members who don't have permission to post links, post internal links. For example if a member is disallowed posting links via the Extra Forum Permissions plugin they cant post an internal link to another thread on the forum.
I've had a little look at the code but I don't have a clue what I'm doing, I think this is the part that stops a link being posted, but how can I add a code to let everyone post internal links?
Thank You.
The plugin is Extra Forum Permissions but as the person who made it is no longer active here, there is no support for the plugin.
So I'm trying to work out how I can let members who don't have permission to post links, post internal links. For example if a member is disallowed posting links via the Extra Forum Permissions plugin they cant post an internal link to another thread on the forum.
I've had a little look at the code but I don't have a clue what I'm doing, I think this is the part that stops a link being posted, but how can I add a code to let everyone post internal links?
if(!$forumpermissions['canpostlinks'])
{
$http_links = "#([\>\s\(\)])(http|https|ftp|news){1}://([^\/\"\s\<\[\.]+\.([^\/\"\s\<\[\.]+\.)*[\w]+(:[0-9]+)?(/[^\"\s<\[]*)?)#i";
$www_links = "#([\>\s\(\)])(www|ftp)\.(([^\/\"\s\<\[\.]+\.)*[\w]+(:[0-9]+)?(/[^\"\s<\[]*)?)#i";
$url_tags_simple = "#\[url\]([a-z]+?://)([^\r\n\"<]+?)\[/url\]#si";
$url_tags_simple2 = "#\[url\]([^\r\n\"<]+?)\[/url\]#i";
$url_tags_complex = "#\[url=([a-z]+?://)([^\r\n\"<]+?)\](.+?)\[/url\]#si";
$url_tags_complex2 = "#\[url=([^\r\n\"<&\(\)]+?)\](.+?)\[/url\]#si";
if(
preg_match($http_links, $message) ||
preg_match($www_links, $message) ||
preg_match($url_tags_simple, $message) ||
preg_match($url_tags_simple2, $message) ||
preg_match($url_tags_complex, $message) ||
preg_match($url_tags_complex2, $message)
)
{
extraforumperm__lang_load();
$datahandler->is_validated = false;
$datahandler->set_error($lang->error_canpostlinks);
}
}
Thank You.