PDA

View Full Version : How Can I Get This - Ticker.stm



100%
04-15-2004, 08:27 PM
Is there any way to get this

http://news.bbc.co.uk/nol/ifs_news/hi/front_page/ticker.stm

running live in a sig in this forum?

(i would like it live, not as a recorded gif)

h1
04-15-2004, 10:57 PM
PHP. Untested...
<?php
$ticker=fopen('http://news.bbc.co.uk/nol/ifs_news/hi/front_page/ticker.stm','r');
function findNewsItem($str,$pos)
{
  $str=substr($ticker,strpos($ticker,"theSummaries[{$pos}] = \""));
  $str=substr($str,0,strpos($str,'.')+1);
  return $str;
}
function text($x,$n)
{
  ImageString($im,4,$x,10,$news[$n],$black);
}
$news=array('','','','');
for($i=0;$i<3;$i++)
{
  $news[$i]=findNewsItem($news[$i],$i);
}
unset($ticker);
$im=ImageCreate(500,150);
$white=ImageColorAllocate($im,0xFF,0xFF,0xFF);
$black=ImageColorAllocate($im,0x00,0x00,0x00);
text(10,0);
text(45,1);
text(80,2);
text(115,3);

// if the image gets too large (filesize), lower the third number image the ImageJPEG function. valid numbers are 1 to 10.

$fn=mt_rand(1,999999999).'.jpg';
header('Content-type: image/jpeg');
ImageJPEG($im,$fn,10);
unlink($fn);
?>

CoolMac
04-16-2004, 12:41 AM
just use the dohtml tag and add the marquee tag

100%
04-16-2004, 08:53 AM
Um.....thanks
noob at work here
but im not quite sure
what to do with what you both just wrote
dont know how to implement it

Haxor-am i supposed to put that text in the sig box or what? if so it doesnt allow it
CoolMac-what exactly do you mean?

If you could show me or do an example, or post it in areply so i can grab it -
thanks

h1
04-16-2004, 11:03 PM
Save it as a .php file, upload it to a server with PHP, and put this in your sig:
[img]http://www.site.com/file.php[/img]

CoolMac
04-16-2004, 11:14 PM
haxor's option is the best one.
I was suggesting for you to use html to crate a marquee

SeK612
04-17-2004, 12:44 AM
dohtml tag and add the marquee tag

Can you do this in a sig? Doesn't HTML need to be enabled for that (it isn't on this forum)?



[img]http://www.site.com/file.php[/img]

.php extensions can't be added inside [img] tags....

100%
04-17-2004, 09:40 AM
It is not permitted to post .php extensions :o

is there any other way..... :helpsmile:

h1
04-17-2004, 10:22 PM
Make a folder just for this script. Name it sig.txt and upload it. Rename it to sig.jpg once uploaded. Upload this file, named ".htaccess" to that directory:
AddType application/x-httpd-php .jpg

100%
04-18-2004, 03:00 AM
Ok Haxor
i have hope
first i will fiond out what php is
find a site which hosts it
load your script¨
make a folder for the script
name it si.txt and upload it
rename it to sig.jpg an dupload it
uplload file .htaccess to that directory

as a first timer i will learn alot in this process
and will post once i have achieved - success.
if not.... questions will follow


Haxor- is there absolutøly any chance that you could try to be a little bit more explicit in your replies- as in not expect those with problems to understand everything you know-?
Thanks again

h1
04-18-2004, 09:21 PM
:lol: I just assumed you knew what PHP was, sorry about that.

There's also three major fuck-ups in that script, it should be this:
<?php
$ticker=fopen('http://news.bbc.co.uk/nol/ifs_news/hi/front_page/ticker.stm','r');
function findNewsItem($str,$pos)
{
 $str=substr($ticker,(strpos($ticker,"theSummaries[{$pos}] = \"")+18));
 $str=substr($str,0,strpos($str,'.')+1);
 return $str;
}
function text($x,$n)
{
 ImageString($im,4,$x,10,$news[$n],$black);
}
$news=array('','','','');
for($i=0;$i<3;$i++)
{
 $news[$i]=findNewsItem($news[$i],$i);
}
unset($ticker);
$im=ImageCreate(500,150);
$white=ImageColorAllocate($im,0xFF,0xFF,0xFF);
$black=ImageColorAllocate($im,0x00,0x00,0x00);
text(10,0);
text(45,1);
text(80,2);
text(115,3);

// if the image gets too large (filesize), lower the third number image the ImageJPEG function. valid numbers are 1 to 10.

$fn=rand(1,999999999).'.jpg';
header('Cache-control: no-cache, must-revalidate, no-store');
header('Cache-control: pre-check=0, post-check=0',false);
header('Content-type: image/jpeg');
header('Last-modified: '.gmstrftime("%a, %d %b %Y %H:%M %S GMT",(time()+(365*86640)));
header('Expires: '.gmstrftime("%a, %d %b %Y %H:%M %S GMT",(time()+(365*86640)));
header('Pragma: no-cache);
ImageJPEG($im,$fn,10);
unlink($fn);
?>
Hope this helps. :)

100%
04-20-2004, 09:11 PM
Any chance of linking to a site that can host this mini script
or if possible if someone could host it for me
I seriously have looked
cant see the difference between php and web hosting-it seems php sites are difficult to find
+
have absolutly no clue ihow to put Haxors script into praxis
(i opened an account at http://www.domaindlx.com/ is that ok? ?
Cheers

h1
04-20-2004, 11:49 PM
DomainDLX can't run it.

Click here (http://www.clickherefree.com/hosting-free) and search with the following parameters: Disk space: no preference
Language: no preference
Your URL: no preference
Site interests: no preference
Forced ads: no preference
Allowed: none
Custom scripting: PHP
Installed scripts: none
Database: none
Accommodations: Unmetered bandwidth, .htaccess
Email: none
Upload methods: FTP
Platform: Any
You should get a ton of results. Pick something with a lot of bandwidth.

MundoServer (http://www.mundoserver.com) looks good, you'll have no problem getting 300 hits a day with the traffic this site gets.