Hello Everyone,
I’m a Noob in Programming, I just wanted to change UI of one of a PHP page. The PHP page is basically a Plugin page for MyBB where the Page Warn User when they try to click on External Page or URL.
Here is how the page Code:
<?php
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:
Can anyone help me to change the looks of output?
I want the Warning Page Look like this:
Thanks in Advance!