Location: PHPKode > scripts > Flash-Ticker > flash-ticker/acctick.php
<?php

/************************************************************************/
//
//  FLASH-TICKER
//
// module created by HI-Lab
// Copyright (c) 2003 by cooperativa sociale l'Utopia a r.l.
// released under GPL licence
//
// www.hi-lab.net
//
/***************************************************************************/


// text source file for ticker

$tickerfile="modules/Ticker/text/ticker.txt";

// Ticker swf movie

$swfmovie="modules/Ticker/news.swf";

// Language defines

define("_NOTOPEN","Non riesco ad aprire il file del Ticker!!");
define("_TICKERMSG","Messaggio scorrevole del Ticker:");
define("_LINKEDTO","Sito web a cui il messaggio รจ linkato:");
define("_READTEXT","Leggi Ticker in formato testo.");

// --------------- HTML PAGE header

$tickerheader = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\n"
."\"http://www.w3.org/TR/html4/loose.dtd\"\">\n"
."<html>\n<head>\n"
."<title>Accessible Text version of Ticker-Flash by HI-Lab * the Social Technology - www.hi-lab.net</title>\n"
."<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-15\">\n"
."<meta NAME=\"AUTHOR\" CONTENT=\"HI-Lab * the Social Technology\">\n"
."<meta NAME=\"COPYRIGHT\" CONTENT=\"Copyright (c) 2003 by cooperativa sociale l'Utopia\">\n"
."<meta NAME=\"KEYWORDS\" CONTENT=\"ticker-flash, ticker, flash, accessibility, text version, HI-Lab, hi-lab, social, technology, cooperativa, sociale, utopia, web-design\">\n"
."<meta NAME=\"DESCRIPTION\" CONTENT=\"Text version for accessibility of Ticker-Flash by HI-Lab * the Social Technology - www.hi-lab.net\">\n"
."</head>\n<body>\n\n";

echo $tickerheader; // COMMENT THIS ROW IF YOU WANT TO INSERT THIS SCRIPT INTO PHP-NUKE PAGE

// The function reads ticker.txt and write an accessible html text format

function leggiticker($fileticker)
{
$fp=fopen($fileticker,'r') or die(""._NOTOPEN."");
echo "<i>"._TICKERMSG."</i><br>\n";
while (! feof($fp))
        {
        $lineticker=fgets($fp,1024);
        if (!((strpos($lineticker,"u")===0)||(strpos($lineticker,"&u")===0)))
                {
                $stringticker=substr($lineticker,4);
                echo "<br>\n$stringticker";
                }
        if (strpos($lineticker,"u")===0)
                {
                $linkticker=substr($lineticker,3);
                }

        }

$linkticker=trim($linkticker);

        $linkcode="<br>\n<i>"._LINKEDTO."</i><br><br>\n<a href=\"";
        if (!strstr($linkticker, "http"))
                {
                $linkcode.="http://$linkticker";
                }
        else
                {
                $linkcode.=$linkticker;
                }
        $linkcode.="\">$linkticker</a>";
        echo $linkcode;
}

// This IF try to find browser name and return proper html output

// echo $HTTP_USER_AGENT."<br>\n"; // test row: activate only if you want to know string of your browser

if (empty($verifica))
	{
	if ((strstr($HTTP_USER_AGENT,"MSIE"))&&(!(strstr($HTTP_USER_AGENT,"Opera"))))
		{
		echo "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\n"
		."codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\"\n"
		."WIDTH=\"250\" HEIGHT=\"20\" id=\"Ticker-Flash\">\n"
		."<PARAM NAME=movie VALUE=\"$swfmovie\">\n"
		."<PARAM NAME=quality VALUE=high>\n"
		."<PARAM NAME=bgcolor VALUE=#FFFFFF>\n"
		."</OBJECT>\n";

		}
	elseif ((strstr($HTTP_USER_AGENT,"Mozilla/4"))||(strstr($HTTP_USER_AGENT,"Mozilla/5"))||(strstr($HTTP_USER_AGENT,"Opera")))
		{
		echo "<embed src=\"$swfmovie\" quality=\"high\"\n"
		."width=\"250\" height=\"20\" type=\"application/x-shockwave-flash\"\n"
		."pluginspage=\"http://www.macromedia.com/go/getflashplayer\">\n";
		}
	else
		{
		echo "<a href=\"$PHP_SELF?verifica=1\">"._READTEXT."</a>\n";
		}
	}


if (isset ($verifica))
{leggiticker($tickerfile);}

$tickerfooter = "\n\n</body>\n</html>";

echo $tickerfooter; // COMMENT THIS ROW IF YOU WANT TO INSERT THIS SCRIPT INTO PHP-NUKE PAGE

?>
Return current item: Flash-Ticker