external links

Modifications for phpBB3.
Try the Mods here and share Your own Mods
Forum rules
You dont have to use ModX or make your mod AutoMod compatible. A simple textfile is fine
But if you post Mods here You also have to give support

external links

Post by martin123456 »

what mod you using for external links to be renamed http://www.somesite.com

Never mind i used a part of another mod

Open: includes/functions_content.php
find

Code: Select all

case MAGIC_URL_FULL:
			$tag	= 'm';
			$text	= $short_url;
add after

Code: Select all

$handle = @fopen($url, "r");
			if ($handle)
			{
				while (($line = fgets($handle, 4096)) !== false) 
				{
					if (feof($handle)) break;
					$match = preg_match('$(\<title\>)(.*)(\<\/title\>)$i', $line, $matches);
					if ($match and trim($matches[2] !== ''))
					{
						$text = strip_tags($matches[2]);
						break;
					}
				}
				fclose($handle);
			}
edit i missed this part off but added it fclose($handle);
}
Last edited by martin123456 on 19 Apr 2013, 19:25, edited 1 time in total.

external links

Post by Stoker »

I think its the one by miriam

external links

Post by Blackwolf »

Cool snippet.....thanks Martinn123456

external links

Post by martin123456 »

Stoker wrote:I think its the one by miriam
Yeah it is it looks like she put 3 mods into one internal,external.cookie

i just used the external and cookie as i use the forum to topic title for internals.

external links

Post by neuropass »

great thanks martin!!! looks like it was updated:

this is the new code:

Code: Select all

$handle = @fopen($url, "r");
             if ($handle)
             {
                while (($line = fgets($handle, 4096)) !== false)
                {
                   if (feof($handle)) break;
                   $match = preg_match('$(\<title\>)(.*)(\<\/title\>)$i', $line, $matches);
                   if ($match and trim($matches[2] !== ''))
                   {
                      $text = strip_tags($matches[2]);
                      break;
                   }
                }
                $text = html_entity_decode($text);
             }

external links

Post by martin123456 »

Same code i just missed the bottom line out but have placed it there now.

external links

Post by RMcGirr83 »

https://www.phpbb.com/community/viewtop ... &t=2180431

Doesn't seem to work for phpBB stuffs.

Seems to work okay from my site. I wonder if it has something to do with the https of phpBB?

http://www.rmcgirr83.org/viewtopic.php?f=5&t=3467

external links

Post by Stoker »

Weird, it works with: https://www.google.com/

Code: Select all

https://www.google.com/

external links

Post by martin123456 »

Works on my site perfect also in mchat too and it dont work in stokers mchat
2013-04-20_194556.png
edit it does work with https
links.png
You do not have the required permissions to view the files attached to this post.

external links

Post by Stoker »

I have just updated to the newest code from here: https://www.phpbb.com/community/viewtop ... &t=2164716
But its the same