Page 1 of 1

External URL to Text

Posted: Tue Sep 20, 2016 11:50 pm
by Sniper_E
Short version by Martin
Open includes/functions_content.php
Find
Tip: This may be a partial find and not the whole line.
Code: Select all
		case MAGIC_URL_FULL:
			$tag   = 'm';
			$text   = $short_url;
			$text = make_title_link($url, $text);
Add after
Tip: Add the following line(s) on a new blank line after the preceding line(s) of find.
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);
         }

Re: External URL to Text

Posted: Wed Sep 21, 2016 5:32 am
by Terry
Thanx :twisted: