) * - Frames * - RSS+ATOM-feeds * - Removing lots of unnecessary code * - Optionally replacing images with their alt-text * - Wap-pages passthru * - Follow -tags * * Limitations: * - Pages that require an Authorization username and password (not implemented for safety reasons) * - If you come accross other limitations, please let me know * **/ session_start(); class Phonifier { var $baseurl = ""; //Baseurl of the phonifier var $user_agent = 'Mozilla/5.0 (compatible; Phonifier; +http://www.phonifier.com)'; //The name of the user-agent var $time_out = 5; //Maximum time you want fsockopen to access the url var $data = ""; //The outputdata var $header = ""; //The headerdata var $scheme = ""; //HTTP OR HTTPS var $port = 80; //HTTP=80 (default), HTTPS=443 var $times = 0; //Number of redirects followed var $iswap = false; //Is the accessed page a wml-page? var $post = ""; //Post-values var $method = "GET"; //GET (default), POST var $url = "http://"; //The url the parser has to access var $img = true; //Show images in the result or replace them with their alt-text var $urlinfo; //Result of parse_url() var $contenttype = ""; //Content-type of the result var $contentlength = 0; //Content-lenght of the result var $starttime = 0; //Start-time, used for benchmarking var $error = false; //No errors yet :-) var $errortype = ""; //The errortype (for debugging) var $feed = false; //Is this a feed? //The template used for displaying the result var $template ="
@ism'
,'@((
)+((\r)?\n)*)+@i'
,'@(\r\n)+@'
,'@(style)=(\'|").*(["\'])+( |>)@Usi'
,'@
'
,''
,' | '
,'
'
,' '
,'\4'
,'Frame: \2
'
,''
);
if(!$this->img) //filter out images
{
//images with alt
$search[] = "/]* alt=(\"([^\"]+)\"|'([^']+)'|([^\"'> ]+))[^>]*>/i";
$replace[] = "[$2$3$4] ";
//images without alt
$search[] = '/
{$channels[3]}
";
if($atom)
{
$itemCount = preg_match_all("|