|
9 Apr 2003, 06:59
|
#1
|
Registered User
Join Date: Feb 2001
Location: /dev/null
Posts: 78
|
PHP ticker
I recall reading a post here a while ago where someone pasted a PHP coded ticker - and i was wondering if someone could re-post that as im very interessed in seeing how this is built.
ta in advance
__________________
NPRDNWHG - Norwegian Punk Rockers Dating New Wave Hooker Girls
Common now honey - bring it on, bring it on
|
|
|
9 Apr 2003, 10:08
|
#2
|
Infallible
Join Date: Feb 2001
Location: Milton Keynes, UK
Posts: 604
|
That was probably me, ages ago.
But tell me, why do you want it?
__________________
Free
|
|
|
9 Apr 2003, 12:13
|
#3
|
Forever Delayed
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
|
Is this in a text box, or the bottom of the window?
M.
__________________
Firefly Oper and General l4m3r - "I Do Stuff"
O2 Rip-off campaign
<vampy> plus i hate people ... i despise humanity as a whole
pablissimo "I'm still geting over the fact you just posted a pic of your own vomit"
|
|
|
9 Apr 2003, 12:25
|
#4
|
Forever Delayed
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
|
This works (I just grabbed the first Javascript scroller I could find)...
Code:
<?php
require ('common_db.php'); // DB Access
$filename = "text.txt"; // The name of the banner file
$handle = fopen ($filename, "r");
$contents = fread ($handle, filesize ($filename));
fclose ($handle);
?>
<HTML>
<HEAD>
<script language="JavaScript">
<!--
/*****************************************************************
* Java Script Copyright (c) 1996 3SI, Germany, http://eExpert.com
* FUNCTION: Ticker Display
* PARAMETERS: None
* RETURNS: Display Message
*****************************************************************/
// global variables
var id,pause=0,position=0;
function banner() {
// variables declaration
var i,k, msg="<?php echo $contents; ?>";
// increase msg
k=(50/msg.length)+1;
for(i=0;i<=k;i++) msg+=" "+msg;
// show it to the window
document.form.banner.value=msg.substring(position,position+76);
// set new position
if(position++==msg.length) position=0;
// repeat at entered speed
id=setTimeout("banner()",60); }
// -->
</script>
</HEAD>
<BODY onLoad="banner()">
<FORM NAME="form">
<INPUT TYPE="text" NAME="banner" VALUE="Nada..." SIZE="60">
</FORM>
</BODY>
</HTML>
__________________
Firefly Oper and General l4m3r - "I Do Stuff"
O2 Rip-off campaign
<vampy> plus i hate people ... i despise humanity as a whole
pablissimo "I'm still geting over the fact you just posted a pic of your own vomit"
|
|
|
9 Apr 2003, 15:49
|
#5
|
Pedantic hypocrite
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
|
Game ticker, Mong.
Jester
__________________
I always wanted to be a dancer, but I could never get the shit off my shoes
.......
|
|
|
9 Apr 2003, 16:01
|
#6
|
Rawr rawr
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
|
heh heh....
I have one in ASP....
|
|
|
10 Apr 2003, 08:12
|
#7
|
Registered User
Join Date: Feb 2001
Location: /dev/null
Posts: 78
|
Quote:
Originally posted by Dave
That was probably me, ages ago.
But tell me, why do you want it?
|
Because i've only done basic coding (dynamic news pages etc) where you extract stuff from DB's and i want to see some more advanced coding, would also be quite interessting to see a "big" dash of code instead of my usual 6-7 lines
__________________
NPRDNWHG - Norwegian Punk Rockers Dating New Wave Hooker Girls
Common now honey - bring it on, bring it on
|
|
|
10 Apr 2003, 12:39
|
#8
|
Infallible
Join Date: Feb 2001
Location: Milton Keynes, UK
Posts: 604
|
I would PM you it, but its too big...heh.
__________________
Free
|
|
|
12 Apr 2003, 00:08
|
#9
|
Enforcer
Join Date: Jan 2003
Location: /dev/chair
Posts: 55
|
put it on the web so everyone can see!
|
|
|
12 Apr 2003, 00:28
|
#10
|
Let battle commence
Join Date: Feb 2002
Location: England
Posts: 732
|
probably not the best place to ask, but they aren't hard to make. a more suitable language would probably be better (c++ etc)
__________________
Mit
http://tim.igoe.me.uk - Development Blog
Whats on TV now - UK TV Guide
<Mendosa> mit is a cute cudlly toy that will be in the shops by christmas
<mig-work> ur now my eternal fav pa god
<Squiz> i name thee, Sir Mit
<Zeus> u my friend are a true gamer I knew u were
|
|
|
12 Apr 2003, 08:36
|
#11
|
Rawr rawr
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
|
Quote:
Originally posted by Mit
probably not the best place to ask, but they aren't hard to make. a more suitable language would probably be better (c++ etc)
|
I partially agree.
I agree on the point that they are not THAT difficult to make. The most difficult thing is figuring out the right algorithm and actually making it FAST.
I'm not sure if a language like C++ would be more appropiate. Ofcourse it's faster, it's prolly more stable, but you have to have execution rights on your server. A scripted ticker is great for those quick games that you play with a few friends on your personal webspace.
For bigger projects C/C++ should be the language of your choice.
|
|
|
29 Apr 2003, 07:57
|
#12
|
Enforcer
Join Date: Jan 2003
Location: /dev/chair
Posts: 55
|
while speaking about it whats the PA ticker written in ? C ?
/me wants source code
|
|
|
29 Apr 2003, 08:23
|
#13
|
Registered User
Join Date: Jul 2000
Location: :noitacoL
Posts: 1,200
|
Just use a meta refresh jobby
|
|
|
29 Apr 2003, 08:24
|
#14
|
Henry Kelly
Join Date: Apr 2000
Posts: 7,374
|
http://7host.com have some kind of automated script execution thing, point it at an address, set the time interval and it'll run the page you point it to, even if it ain't on their servers.
Though I wouldn't pimp their web hosting, it''s not overly reliable.
__________________
You're now playing ketchup
|
|
|
29 Apr 2003, 16:14
|
#15
|
m u p p e t
Join Date: May 2001
Location: Whenever Wherever
Posts: 477
|
Quote:
Originally posted by Rayden
while speaking about it whats the PA ticker written in ? C ?
/me wants source code
|
Written in either C or C++. I think it's C++, as that's what the pages are all compiled in.
__________________
|
|
|
29 Apr 2003, 23:38
|
#16
|
Godfather
Join Date: May 2000
Location: England
Posts: 5,185
|
Quote:
Originally posted by Structural Integrity
heh heh....
I have one in ASP....
|
can i take a look at it?
ive built my own but its not finished yet heh
__________________
Forum Administrator
Mail : [email protected] // IRC : #forums
__________________
It's not personal, it's just business.
|
|
|
13 May 2003, 01:31
|
#17
|
Supreme Moron
Join Date: Sep 2001
Location: My Chair (BATH, UK)
Posts: 57
|
Quote:
Originally posted by pablissimo
http://7host.com have some kind of automated script execution thing, point it at an address, set the time interval and it'll run the page you point it to, even if it ain't on their servers.
Though I wouldn't pimp their web hosting, it''s not overly reliable.
|
sounds like crontabs.
__________________
the_angry_angel
- "back and kicking bottom or what?"
- "ah the nali warcow...the cow was a passive creature that just stood there and mooed. so we shot at it."
|
|
|
13 May 2003, 10:23
|
#18
|
Henry Kelly
Join Date: Apr 2000
Posts: 7,374
|
Basically.
Except they're windows machines.
And all it's doing is 'running a URL', doesn't matter if its local or not. Though i never saw the need for it for anything I've done so haven't signed up.
__________________
You're now playing ketchup
|
|
|
13 May 2003, 15:51
|
#20
|
Darling
Join Date: Dec 2000
Location: Edinburgh
Posts: 890
|
Quote:
Originally posted by pablissimo
http://7host.com have some kind of automated script execution thing, point it at an address, set the time interval and it'll run the page you point it to, even if it ain't on their servers.
Though I wouldn't pimp their web hosting, it''s not overly reliable.
|
any host with cpanel gives you cron.
|
|
|
13 May 2003, 18:19
|
#21
|
Henry Kelly
Join Date: Apr 2000
Posts: 7,374
|
I've already pointed out it's a Windows host. I didn't know of an equivalent Windows function.
__________________
You're now playing ketchup
|
|
|
14 May 2003, 00:19
|
#22
|
Street Tramp
Join Date: Apr 2000
Location: Street Gutter
Posts: 341
|
Quote:
Originally posted by pablissimo
I've already pointed out it's a Windows host. I didn't know of an equivalent Windows function.
|
Task Scheduler ?
__________________
Chimney Pots.
|
|
|
14 May 2003, 03:05
|
#23
|
Henry Kelly
Join Date: Apr 2000
Posts: 7,374
|
OH NOEEEEeeeeessSSSSSSs!"
__________________
You're now playing ketchup
|
|
|
14 May 2003, 12:03
|
#24
|
Born Sinful
Join Date: Nov 2000
Location: Loughborough, UK
Posts: 4,059
|
__________________
Worth dying for. Worth killing for. Worth going to hell for. Amen.
|
|
|
14 May 2003, 15:53
|
#25
|
Henry Kelly
Join Date: Apr 2000
Posts: 7,374
|
Fine.
There is nothing else on that particular host or any other Windows host I've been with that lets you schedule the execution of a webpage, not a process.
Goddamn pedants =/ This is not conducive for the recovery from a hangover, dammit
__________________
You're now playing ketchup
|
|
|
16 May 2003, 12:36
|
#26
|
The Usualsuspects
Join Date: Jan 2001
Posts: 240
|
google around for "deto pa"
|
|
|
16 May 2003, 13:56
|
#27
|
Rawr rawr
Join Date: Dec 2000
Location: Upside down
Posts: 5,300
|
Assuming atleast one person logs in each hour, you can use the servers clock to execute the script.
If the servers clock has passed a whole hour and there has no tick been processed that hour then execute tick.
If there is no one who logs in an hour then you'll miss ticks. But that doesn't have to be such a bad thing.
|
|
|
|
All times are GMT +1. The time now is 13:43.
| |