PDA

View Full Version : Simple DJ Says. If you just want a DJ Says without the whole panel!



Sam
12-01-2007, 11:17 PM
Yeah well basically. Theres a load of Dj Panels flying about but what if you just want something to display a message from a DJ..

Also, this method doesnt use Cutenews. Cutenews sucks. Period.

Since i havent used this forum in months i saw this uitable as something nice to post for people to use. I wrote the script with reference to a few tutorials (Im new to PHP)

This uses a basic function where the current text in the box is added into a text document, but when the text in the box is changed, it also changes in the Text document.

Play about with it a bit, just so long as you give me credit for it. A live verison on it can be seen at:

Dj Says - Write and update the text to be displayed. (http://www.elitemaple.net/loginsys/djsays.php)

Dj Says - The current text in the .txt file. To be displayed where you wish the Dj Says to be (http://www.elitemaple.net/loginsys/djsays.txt)

And last but not least. The source code.

Create a file named djsays.php and djsays.txt.

In the djsays.php, paste this code:


<?php
if($_POST['update']) {
$newmsg = stripslashes($_POST['message']);
$file = fopen("djsays.txt","r+");
ftruncate($file,0);
$writedate = fwrite($file,$newmsg);
fclose($file);
}
$messages = fopen("djsays.txt","r+");
$message = fread($messages,100000);
fclose($messages);


?>


<html>
<head>
<title>Dj Says Ver 1.07 - By Sam (HxF)</title>
<style type="text/css">

body {
Font-family: Tahoma;
Font-size: 9px;
color: #FFFFFF;
Background-color: #000000;
}
</style>
</head>
<body>
<div align="center"><br>
<b>Dj Says Ver 1.07<b><br>
<p>
Enter in the text you wish to be displayed below and hit Update! Simple as!<br>
<p>
Oh, but dont forget, You must use a PHP include function on the 'Djsays.txt' file if you want it displayed on a page. Also, if you are using iframes, just set the iframe src to Djsays.txt.<br>
<p>
You may remove this text and edit the CSS<br>
<p>
- Sam



<form action="<? $php_self ?>" method="post">
<textarea name="message" rows="8" cols="50"><?=$message?>
</textarea> <br><p>
<input type="submit" name="update" value="Update" />
</form> <br>

<p>
Suggested Addons:<br>
<p>
Turn DJsays.txt into a html file, add a refresh.<br>
Password protect this file<br>




Save the .php file.

Instrucions are in the actual file. Once you've ran it, open djsays.php and read the text.

Have Fun :)

- Sam

MrChaz
13-01-2007, 12:58 AM
Thats pretty friggen dope.

9 Dj Says out of 10

Sam
13-01-2007, 01:09 AM
In English ?

Rofl..

Its like.. My second PHP Script.

My first was a Login system

MrChaz
13-01-2007, 01:16 AM
Oh english sorry.

Jene hubsch Fregatte betauben.

Dj Sagt auber 10

Edited by L&#181;ke (Forum Moderator): Please do not post in another language.

Sam
13-01-2007, 01:18 AM
Or.. You could just write it in English and not German o.o

Heinous
13-01-2007, 04:06 AM
Dj Says Ver 1.07 - By Sam (HxF)

Version 1.07 for such a simple script?

fakeguy2
13-01-2007, 07:22 AM
Oh english sorry.

Jene hubsch Fregatte betauben.

Dj Sagt auber 10

lol thats funny

Edited by L&#181;ke (Forum Moderator): Please do not post pointlessly.

Sam
13-01-2007, 09:02 PM
Rofl i just made up a ver name because im bored..

It might be added into the CMS im making atm..


As an extra or something. And my CMS isnt just like one of those nooby cms's pls

<3

F32
13-01-2007, 09:11 PM
Rofl i just made up a ver name because im bored..

It might be added into the CMS im making atm..


As an extra or something. And my CMS isnt just like one of those nooby cms's pls

<3
People use Joomla! to escape dodgy, hole-filled, noob-created cms'.

No offence, but...

Sam
13-01-2007, 09:15 PM
Rofl it wont be a noob CMS. I have pro PHP coders helping me :)

Im also good at everything else required such as (I might use CSS?) CSS, Graphics etc.. Im going to make a template for the actual panel.

The basis of the system has already been tested and seems to be working fine.. Im going to also try and see about preventing SQL Injections etc.

F32
13-01-2007, 09:18 PM
In a CMS, you have to use CSS - otherwise it's an instant failure.

You got a good plan :rolleyes:

Sam
13-01-2007, 09:20 PM
Well originally i was just going to use plain old HTML..

But i thought that would look stupid..

Especially when im experienced in CSS.....


Oh btw , Was that sarcasm ?

Just give it like.. a Month or two and i'll release a BETA for people to try.

F32
13-01-2007, 09:23 PM
HTML to create a CMS, well done.

it doesn't take a genius to work out sarcasm, it takes a genius' fool.

Sam
13-01-2007, 09:29 PM
Rofl why the sarcasm..

If you knew from when i was active here. you'd know if i say im building something i will :)

HTML just seemed more.. Easier at the time..

Carl told me to plan things out, which ive done, and now i have a perfect plan of it drew up.. Its had alot of thought and effort put into it.. It will happen i can assure you of that :rolleyes:

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