Triky
10-31-2015, 03:20 PM
I created this plugin:
Product: vBulletin
Location: postdata_start
// The Regular Expression filter
$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
// The Text you want to filter for urls
$text = "$post[message]";
// Check if there is a url in the text
if(preg_match($reg_exUrl, $text, $url)) {
// make the urls links
echo preg_replace($reg_exUrl, "{$url[0]}", $text);
} else {
// if no urls in the text just return the text
echo $text;
}
?>
And in my template (which is postbit_legacy) I have this:
<img src="http://img.bitpixels.com/getthumbnail?code=63152&size=200&url=$text" />
But it doesn't work. Some help please?
Product: vBulletin
Location: postdata_start
// The Regular Expression filter
$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
// The Text you want to filter for urls
$text = "$post[message]";
// Check if there is a url in the text
if(preg_match($reg_exUrl, $text, $url)) {
// make the urls links
echo preg_replace($reg_exUrl, "{$url[0]}", $text);
} else {
// if no urls in the text just return the text
echo $text;
}
?>
And in my template (which is postbit_legacy) I have this:
<img src="http://img.bitpixels.com/getthumbnail?code=63152&size=200&url=$text" />
But it doesn't work. Some help please?