This is a new news system, but currently in the developing stages!
Currently, i have created Version 1.1
This is just a basic news system with only 1 user allowed.
This system, is also protected by a password/username that you choose.
THIS SYSTEM IS COMPLETLY OPENSOURCE! HOWEVER, I ASK THAT YOU TELL YOUR FREINDS IF YOUR USING IT :) THERE IS NO COPYRIGHT RH4U LABEL, AND THERE DOESENT INTEND TO BE!
Current Version (V1.1)
- PHP Driven
- Automaticaly creates the sql, stops you having going into phpMyAdmin
- Password Protected
Coming in Version 1.2 TO 1.3:
- Multiple Users
- Smileys
- Banning System
- News Intro/Full News
- Able To Include the news without messing up CSS
- Option to change system into a guestbook (it automaticaly changes settings in the database)
View The Source To Install:
PHP Code:
<?php //HERE WE ARE DEFINING THE USERNAME AND PASSWORD YOU WANT $usernames = ""; ## USERNAME YOU WANT $passwords = ""; ## PASSWORD YOU WANT
//THIS MUST BE CONFIGURED PROPELLY. //IF NOT, THE SYSTEM WILL NOT WORK. $username = ""; ##DATABASE USERNAME $password = ""; ##DATABASE PASSWORD $host = "localhost"; ##DATABASE HOST, NORMALLY LOCALHOST $database = ""; ##DATABASE NAME mysql_connect($host,$username,$password) or die("Error connecting to Database! " . mysql_error()); mysql_select_db($database) or die("Cannot select database! " . mysql_error()); mysql_query (" CREATE TABLE `newscms` ( `id` int(10) unsigned NOT NULL auto_increment, `date` varchar(50) default NULL, `title` varchar(50) NOT NULL default '', `message` text NOT NULL, `user` varchar(50) NOT NULL default '', PRIMARY KEY (`id`), KEY `date` (`date`) ); "); switch ($HTTP_GET_VARS[news]) { case 'shownews': $result = mysql_query("select * from newscms order by id desc limit 7"); while($r=mysql_fetch_array($result)) { $id=$r["id"]; $title=$r["title"]; $date=$r["date"]; $user=$r["user"]; $message=$r["message"]; echo " <style> body { background color:#000000; color:#FFFFFF; } </style> <center><table width='372' height='154' border='1'> <tr> <td>Title: $title</td> </tr> <tr> <td>Posted on: $date </td> </tr> <tr> <td>Posted by: $user</td> </tr> <tr> <td>Message: $message</td> </tr> </table></center><br /><br /> "; } break; default: echo "<title>Please Login!</title></head> <body> <div align=\"center\"> <p align=\"center\"><strong>You need to be logged in to edit the news!</strong></p> <p align=\"center\"><form action='news.php' method='post'> <div align=\"center\">Username: <input type='text' name='user'> <br /> Password: <input type='password' name='pass'> <br /> <input type='submit' value='Login'> </div>"; $user=$_POST['user']; $pass=$_POST['pass']; if (($user==$usernames) && ($pass==$passwords)) echo "<center>Thanks For Taking The Time To Login!<br /><a href=\"?news=addnews_successlg_{4395384573498545903457803577478337592459435093200365094305640395634056340576430573405736458064350865084}\">Click Here To Edit News</a></center>"; else echo "Sorry. The Username $user With The Password $pass Was Incorrect."; break; case 'addnews_successlg_{4395384573498545903457803577478337592459435093200365094305640395634056340576430573405736458064350865084}': echo " <title>Add News :: Doms News Panel</title> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" /> <style type=\"text/css\"> <!-- body{ font-family: verdana; font-size: 12px; color: #000000; } .container{ width: 400px; background-color: #ffffff; margin-left: auto; margin-right: auto; margin-top: 15px; } .addnews{ width: 380px; padding-left: 10px; padding-right: 10px; } --!> </style> </head> <body> <div class=\"container\"> <div class=\"addnews\">"; $title = addslashes(strip_tags($_POST['title'])); $user = addslashes(strip_tags($_POST['user'])); $message = $_POST['message']; $date = addslashes(strip_tags($_POST['date'])); $sql = "INSERT INTO newscms SET title='$title', user='$user', message='$message', date='$date'"; if (mysql_query($sql)) { echo(""); } else { echo("Error adding entry: " . mysql_error() . ""); } print " <form action=\"\" method=\"post\"> <br />Title: <br /><input name=\"title\" type=\"text\" value=\"Title\"> <br />Author: <br /><input name=\"user\" type=\"text\" value=\"$usernames\" disabled=\"disabled\"> <br />Date: <br /><input name=\"date\" type=\"text\" disabled=\"disabled\"";?> value="<?php echo date("D F Y");?>" <?php print"> <br />Message: <br /><textarea name=\"message\" cols=\"40\" rows=\"6\" value=\"Message\"> </textarea> <br /> <br /><input type=\"submit\" value=\"Make News Post!\" />"; break; } ?>
Thanksyou, Dominic.
I Ask that you kindy tell me of any Errors, and i shall +REP you and fix them! ;)
04-11-2007, 12:40 AM
Florx
Wheres the rest of the files?
04-11-2007, 12:58 AM
Puma
Quote:
Originally Posted by FlorX
Wheres the rest of the files?
was about to say the same..
04-11-2007, 01:10 AM
Invent
Another file isn't needed..?
04-11-2007, 07:45 AM
DeejayMachoo$
umm? ^ like the others wheres the rest?
04-11-2007, 09:05 AM
lolwut
I really don't get it... :rolleyes:
You do need some more files?
04-11-2007, 09:58 AM
redtom
Yeah by the looks of it all the stuff you need is in that file. Apart from displaying the news.
04-11-2007, 10:03 AM
lolwut
Which is what we need... :rolleyes:
04-11-2007, 10:09 AM
Xeros
Exactly like explained above we need other files too.
04-11-2007, 10:22 AM
rh4u
news.php?news=shownews :)
There ya go ;)
i did say im releasing a better version of it :D
iframe it for now ;)
04-11-2007, 10:26 AM
Beau
Quote:
Originally Posted by rh4u
news.php?news=shownews :)
There ya go ;)
i did say im releasing a better version of it :D
iframe it for now ;)
You really should make these into seperate files, instead of making the administration and view news functions in the same file...
04-11-2007, 10:33 AM
rh4u
Im starting on Version 1.2 today :)
04-11-2007, 11:14 AM
Luckyrare
Next version you should tidy up your coding, very very messy.
04-11-2007, 11:39 AM
rh4u
i am :)
Doing the WYSIWYG editor now, has over 250 smilies :D
04-11-2007, 08:31 PM
rh4u
-- >The V1.2 will be out in a few days!
04-11-2007, 08:36 PM
DeejayMachoo$
ok.. gl with it
04-11-2007, 09:40 PM
rh4u
Tar :)
04-11-2007, 09:42 PM
Puma
GL hope it goes well..
04-11-2007, 10:28 PM
rh4u
Tar! :)
04-11-2007, 10:29 PM
ScottDiamond.
If someone is stupid enough to use that, they deserve to be hit over the head several times.
05-11-2007, 09:29 AM
rh4u
If someone is dumb enough to like you, they should be shot, and shot again !