PDA

View Full Version : Site Alert Script



mat64
31-03-2006, 08:13 PM
I've seen this in a few places, you type in the alert on a control panel somewhere and everyone who is viewing the site at that time gets a Java Alert. It's dam hard to find one theres no tutorials on it or anything. Just a main feature i want is control panel where you type the alert text in. Also the page dosn't need to be refreshed for the alert to appear.

If anyone can do, It's most appricated. I'll pay if it comes to that.

Thanks.

GoldenMerc
31-03-2006, 08:20 PM
I've seen this in a few places, you type in the alert on a control panel somewhere and everyone who is viewing the site at that time gets a Java Alert. It's dam hard to find one theres no tutorials on it or anything. Just a main feature i want is control panel where you type the alert text in. Also the page dosn't need to be refreshed for the alert to appear.

If anyone can do, It's most appricated. I'll pay if it comes to that.

Thanks.

same pm me about it too i will pay supers sorry no cash cos its too risky and if you have more rep than me il go first and vise versa

nets
31-03-2006, 08:22 PM
I wrote an AJAX one a while back.

Splinter
31-03-2006, 08:28 PM
It really just requires abit of PHP and javascript =]

Mentor
31-03-2006, 08:34 PM
I wrote an AJAX one a while back.
how often does it refresh thogh as it sounds pretty wasteful of bandwidth to implement "/ or did u find a work around?

DMB-Hosting
31-03-2006, 08:39 PM
SIlverMerc = scammer scammed me - said he'd dropped furni didnt

GoldenMerc
31-03-2006, 08:42 PM
SIlverMerc = scammer scammed me - said he'd dropped furni didnt

look in donations 1 dimwit i dropped it like a few mins ago

DMB-Hosting
31-03-2006, 08:45 PM
I dont have a donations 1

GoldenMerc
31-03-2006, 08:46 PM
I dont have a donations 1

1 donations thing look there and i didnt scam you i would need to cos i def put it in their

DMB-Hosting
31-03-2006, 08:47 PM
I have Donations :)
and Donations 2

you search the account =-.dan.-=
Didnt you?

GoldenMerc
31-03-2006, 08:55 PM
I have Donations :)
and Donations 2

you search the account =-.dan.-=
Didnt you?

u said -=.dan.=- thts what u said so i did

DMB-Hosting
31-03-2006, 08:56 PM
no i didnt i said =-.dan.-=

And also if you search -=.dan.=- theres no rooms...

Why scam me?

GoldenMerc
31-03-2006, 08:58 PM
no i didnt i said =-.dan.-=

mate im pretty sure,f.r him its prob unlikely he will give u it but ask,this was your misstake not mine so dont say i scam its pretty certain i dont

Mentor
31-03-2006, 08:59 PM
mate im pretty sure,f.r him its prob unlikely he will give u it but ask,this was your misstake not mine so dont say i scam its pretty certain i dont
you notice in the second sentance he's already complty discredited what youve just said :rolleyes:

DMB-Hosting
31-03-2006, 09:00 PM
Why would i say my name was -=.dan.=- when it isnt im certain i said =-.dan.-= PLUS you said you dropped itin his donations room which he dont have. Youre a scammer and i didnt expect with the post count and reps you have

GoldenMerc
31-03-2006, 09:20 PM
Why would i say my name was -=.dan.=- when it isnt im certain i said =-.dan.-= PLUS you said you dropped itin his donations room which he dont have. Youre a scammer and i didnt expect with the post count and reps you have

ypu must have not searched the name u sent me he has something like home and donations and soem queer room thts it i dropped throne in tht room have a look cos tht is what u told me to do so what can i do now i dont have any thrones left search my rooms

DMB-Hosting
31-03-2006, 09:23 PM
You just lieing, also you said on MSN gotta go then blocked me

GoldenMerc
31-03-2006, 09:24 PM
You just lieing, also you said on MSN gotta go then blocked me

i was eating a pizza thats why and u were saying r u there r u there agaian and again its pretty annoying

DMB-Hosting
31-03-2006, 09:26 PM
meh i said have you dropped yet, you go yes then say i gtg bye straight away after

GoldenMerc
31-03-2006, 09:29 PM
meh i said have you dropped yet, you go yes then say i gtg bye straight away after

no i was on the other pc and u jept saying tht then i said i dropped it and thne i went off for 5 mins or so eating :P then u kept saying have u dropped it then i came and blocked you.

nets
31-03-2006, 09:31 PM
I can't find the AJAX one, so I'll write another.

Save as disp.php:

<?php

header("Cache-Control: no-cache, must-revalidate");

session_start();
if(!isset($_SESSION['alert'])) {
$_SESSION['alert'] = 'no_message';
}

$handle = fopen('message.txt', 'r');
$message = fread($handle, filesize('message.txt'));
fclose($handle);

if($message != $_SESSION['alert']) {
print '<script type="text/JavaScript">alert(\''.$message.'\');</script>';
$_SESSION['alert'] = $message;
}

?>

Put the JavaScript and Iframe on the page where you want the alert to appear:

<html>
<head>
<script>
function update() {
document.getElementById('display_alert').src = 'disp.php';
setTimeout('update()', 10000);
}
</script>
</head>
<body onLoad="update();">
<iframe id="display_alert" style="display: none" src="disp.php"></iframe>
</body>
</html>
(Tweak the time etc).

Then when you want to send out a message, just change the text inside a file named message.txt. If you want a panel to edit the message, then just say and I'll make one.

GoldenMerc
31-03-2006, 09:33 PM
I can't find the AJAX one, so I'll write another.

Save as disp.php:

<?php

header("Cache-Control: no-cache, must-revalidate");

session_start();
if(!isset($_SESSION['alert'])) {
$_SESSION['alert'] = 'no_message';
}

$handle = fopen('message.txt', 'r');
$message = fread($handle, filesize('message.txt'));
fclose($handle);

if($message != $_SESSION['alert']) {
print '<script type="text/JavaScript">alert(\''.$message.'\');</script>';
$_SESSION['alert'] = $message;
}

?>

Put the JavaScript and Iframe on the page where you want the alert to appear:

<html>
<head>
<script>
function update() {
document.getElementById('display_alert').src = 'disp.php';
setTimeout('update()', 10000);
}
</script>
</head>
<body onLoad="update();">
<iframe id="display_alert" style="display: none" src="disp.php"></iframe>
</body>
</html>
(Tweak the time etc).

Then when you want to send out a message, just change the text inside a file named message.txt. If you want a panel to edit the message, then just say and I'll make one.

lol nets i just payed 1T for something similer to that

DMB-Hosting
31-03-2006, 09:38 PM
nets no he didnt he scammed

GoldenMerc
31-03-2006, 09:42 PM
nets no he didnt he scammed

what i dont understand is why u tell me a room to put the throne in then u say i scammed you like wth

nets
31-03-2006, 09:44 PM
**I haven't tested that script I posted, so I suggest you test it yourself. Also, it may use lots of bandwidth, unless adjusted.

2hd.
31-03-2006, 09:44 PM
is there much point in you two just arguing threw a whole 2 pages?

DMB-Hosting
31-03-2006, 09:46 PM
Lol i could argue for longer xD - i dont give up

GoldenMerc
31-03-2006, 09:49 PM
no 1st i wasted 1T on something he didnt even get
2.i could have got for free

DMB-Hosting
31-03-2006, 09:52 PM
and 3. no2 was a lie

Tomm
01-04-2006, 07:34 AM
DMB-Hosting stop reselling my script :D

:Edzy
01-04-2006, 07:44 AM
Warning: fread(): Length parameter must be greater than 0. in /home2/comissio/public_html/tc/disp.php on line 11

Am I missing something?:s


Oops n00bish question!

Jamie.
01-04-2006, 08:02 AM
DMB-Hosting stop reselling my script :D
Lol, is it your script???? u shud get the throne

GoldenMerc
01-04-2006, 08:04 AM
Lol, is it your script???? u shud get the throne

well he didnt nether cos he told em the wrong name so some random perm is 1T up

mat64
01-04-2006, 08:06 AM
Would there be away to alert everyone viewing differnet pages in one directory? Or would there have to be a code on each page?


If you want a panel to edit the message, then just say and I'll make one.

nets
01-04-2006, 09:30 AM
That script isn't that good, and I'll make another version sometime.
@mat64
No
@DJ-Zero
Your file is zero bytes, the script wont work with that as there's a problem (hence why I'm going to make another).

:Edzy
01-04-2006, 09:45 AM
yeh its coz i had nothing in message.txt it works now:)

-=andy-g=-2
01-04-2006, 09:48 AM
SilverMerc, DMB-Hosting:

There is a chance SilverMerc could be telling the truth, because if you search -=.dan.-= it comes up with "home" "donations" and "scared of the guru". However, there is no throne in the donations room, meaning he could be lieing, or the owner has picked it up already.

nets
01-04-2006, 09:50 AM
You could have something like this on the IF statement, so that it's possible to not send out an alert (when you don't want an alert, write "none" in message.txt).

if($message != $_SESSION['alert'] && $message != 'none')
Also, where it says:

setTimeout('update()', 10000);
Make the timeout larger to save bandwidth and server usage.

GoldenMerc
01-04-2006, 10:37 AM
SilverMerc, DMB-Hosting:

There is a chance SilverMerc could be telling the truth, because if you search -=.dan.-= it comes up with "home" "donations" and "scared of the guru". However, there is no throne in the donations room, meaning he could be lieing, or the owner has picked it up already.

check when he was on last

DMB-Hosting
01-04-2006, 12:39 PM
Heh i rekon he made that habbo -=.dan.=-

GoldenMerc
01-04-2006, 12:46 PM
Heh i rekon he made that habbo -=.dan.=-

why would i need to i def put it in there and u know u told me the wrong habbo,and even mor eit isnt even your script!so i payed for soemthing i shoult
use

Want to hide these adverts? Register an account for free!