2021-04-19, 11:10 AM
Hello Everyone
Finally I'm able to configure SafeLink Plugin for my Forum but now facing another issue that the background color is white and text is also white so i can't see the warning and the external URL. And the code is in PHP show i don't know to change it or make some changes in it.
Here's the Code of SafeLink.php:
And here's the Output of the Code:
https://prnt.sc/11p4stu
Can anyone help me to change the looks of output?
I want the Warning Page Look like this:
https://prnt.sc/11p4zrb
If my desire Warning page isn't possible then help me atleast i can change the background color so the users of my forum can view the warning.
Thanks in advance.
Finally I'm able to configure SafeLink Plugin for my Forum but now facing another issue that the background color is white and text is also white so i can't see the warning and the external URL. And the code is in PHP show i don't know to change it or make some changes in it.
Here's the Code of SafeLink.php:
<?php
/**************************************************************************\
||========================================================================||
|| MyBB SafeLink ||
|| Copyright 2011-2016 ||
|| Version 1.3.4 ||
|| Made by fizz on the official MyBB board ||
|| http://community.mybb.com/user-36020.html ||
|| I don't take responsibility for any errors caused by this plugin. ||
|| Always keep MyBB up to date and always keep this plugin up to date. ||
|| You may NOT redistribute this plugin, sell it,
|| remove copyrights, or claim it as your own in any way. ||
||========================================================================||
\*************************************************************************/
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'safelink.php');
require_once("./global.php");
if(!$lang->safelink)
$lang->load("safelink");
// Add link in breadcrumb
add_breadcrumb($lang->safelink, "safelink.php");
if($mybb->settings['safelink_enabled'] == 1)
{
if($mybb->input['url'])
{
if(!filter_var($mybb->input['url'], FILTER_VALIDATE_URL))
{
$error = $lang->sl_badurl;
}
else
{
$v = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], "safelink.php?url=")); // these 2 lines filter out the url to continue to
$url = str_replace('safelink.php?url=', '', $v); // only problem with these is it will replace all occurrencesof 'safelink.php?url=' in the url, and I don't know how to fix this (preg_replace perhaps?)
$group = $mybb->user['usergroup'];
$groups = explode(",", $mybb->settings['safelink_groups']);
$excludes = explode("\n", $mybb->settings['safelink_urls']);
foreach($excludes as $exclude)
{
if(!preg_match("#^".trim($exclude)."+[\d\w]*#i", $url) && !in_array($group, $groups)) // not an excluded site, go to safelink page and link intended URL
{
$warning = $lang->sl_warning;
$continue = $lang->sl_continue;
}
else // site excluded from safelink OR user is in excluded usergroup
{
header("location:$url");
}
}
}
}
else
{
$error = $lang->sl_nourl;
}
}
else
{
$error = $lang->sl_disabled;
}
eval("\$safelink = \"".$templates->get("safelink")."\";");
output_page($safelink);
exit;
?>
And here's the Output of the Code:
https://prnt.sc/11p4stu
Can anyone help me to change the looks of output?
I want the Warning Page Look like this:
https://prnt.sc/11p4zrb
If my desire Warning page isn't possible then help me atleast i can change the background color so the users of my forum can view the warning.
Thanks in advance.