46
Mods & Plugins (Requests & Discussions) / Dereferer
« on: April 18, 2014, 01:10:40 AM »
Hallo zusammen,
ich habe mir für externe URLs Dereferer-Service eingebaut:
Die Bbcodes sind angepasst:
if ($bbcode == 1) {
$search_array = array(
"/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
"/(\[)(list)(])(.*)(\[\/list\])/siU",
"/(\[\*\])/siU",
"/(\[\/\*\])/siU",
"/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
"/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
"/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
"/javascript:/si",
"/about:/si"
);
$replace_array = array(
"<ol type=\"\\5\">\\7</ol>",
"<ul>\\4</ul>",
"<li>",
"</li>",
"<a href=\"".$config['uro_dereferer']."http://www.\\6\" target=\"_blank\" rel=\"nofollow\">\\8</a>",
"<a href=\"".$config['uro_dereferer']."\\5\" target=\"_blank\" rel=\"nofollow\">\\7</a>",
"<a href=\"".$config['uro_dereferer']."http://www.\\5\" target=\"_blank\" rel=\"nofollow\">www.\\5</a>",
"<a href=\"".$config['uro_dereferer']."\\4\" target=\"_blank\" rel=\"nofollow\">\\4</a>",
"<pre>Code:<hr size=1>\\5<hr size=1></pre>",
"java script:",
"about :"
);
$uro_dereferer_optionlist = array(
'out/?url='
'http://dontknow.me/'
'http://anonym.to/' => 'anonym.to',
'http://www.dereferer.org/?' => 'dereferer.org',
);
function show_uro_dereferer_select($setting_name, $setting_value) {
global $uro_dereferer_optionlist, $self_url;
echo "<select name=\"setting_item[".$setting_name."]\">";
foreach ($uro_dereferer_optionlist as $key => $val) {
echo "<option value=\"$key\"";
if ($setting_value == $key) {
echo " selected=\"selected\"";
}
echo ">".$val."</option>";
}
echo "</select>";
}
Das funbktioniert auch, aber ich würde gerne auch einen eigenen Dereferer einsetzen. Ich habes es folgendermaßen versucht:
if(($pos = strpos($_SERVER['REQUEST_URI'], 'out/?url=')) !== false) {
$url = trim(substr($_SERVER['REQUEST_URI'], $pos + 1));
if(!empty($url)) {
include_once ROOT_PATH.'redirect.php';
exit;
}
}
redirect.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; URL=<?php echo $url; ?>" />
<title><?php echo $url; ?> …</title>
</head>
<body>
<div align="center">
<p><?php echo $url; ?> …</p>
</div>
</body>
</html>
Aber das geht nicht. Kann mir jemand helfen?
ich habe mir für externe URLs Dereferer-Service eingebaut:
Die Bbcodes sind angepasst:
if ($bbcode == 1) {
global $config;
$search_array = array(
"/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU",
"/(\[)(list)(])(.*)(\[\/list\])/siU",
"/(\[\*\])/siU",
"/(\[\/\*\])/siU",
"/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU",
"/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU",
"/(\[)(url)(])([^\"]*)(\[\/url\])/siU",
"/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU",
"/javascript:/si",
"/about:/si"
);
$replace_array = array(
"<ol type=\"\\5\">\\7</ol>",
"<ul>\\4</ul>",
"<li>",
"</li>",
"<a href=\"".$config['uro_dereferer']."http://www.\\6\" target=\"_blank\" rel=\"nofollow\">\\8</a>",
"<a href=\"".$config['uro_dereferer']."\\5\" target=\"_blank\" rel=\"nofollow\">\\7</a>",
"<a href=\"".$config['uro_dereferer']."http://www.\\5\" target=\"_blank\" rel=\"nofollow\">www.\\5</a>",
"<a href=\"".$config['uro_dereferer']."\\4\" target=\"_blank\" rel=\"nofollow\">\\4</a>",
"<pre>Code:<hr size=1>\\5<hr size=1></pre>",
"java script:",
"about :"
);
$uro_dereferer_optionlist = array(
'out/?url='
=> 'URO',
'http://dontknow.me/'
=> 'dontknow.me',
'http://anonym.to/' => 'anonym.to',
'http://www.dereferer.org/?' => 'dereferer.org',
'http://hideref.org/' => 'hideref.org/',
);
function show_uro_dereferer_select($setting_name, $setting_value) {
global $uro_dereferer_optionlist, $self_url;
echo "<select name=\"setting_item[".$setting_name."]\">";
foreach ($uro_dereferer_optionlist as $key => $val) {
echo "<option value=\"$key\"";
if ($setting_value == $key) {
echo " selected=\"selected\"";
}
echo ">".$val."</option>";
}
echo "</select>";
}
Das funbktioniert auch, aber ich würde gerne auch einen eigenen Dereferer einsetzen. Ich habes es folgendermaßen versucht:
if(($pos = strpos($_SERVER['REQUEST_URI'], 'out/?url=')) !== false) {
$url = trim(substr($_SERVER['REQUEST_URI'], $pos + 1));
if(!empty($url)) {
include_once ROOT_PATH.'redirect.php';
exit;
}
}
redirect.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; URL=<?php echo $url; ?>" />
<title><?php echo $url; ?> …</title>
</head>
<body>
<div align="center">
<p><?php echo $url; ?> …</p>
</div>
</body>
</html>
Aber das geht nicht. Kann mir jemand helfen?