PDA

View Full Version : [RELEASE] {V1.1} DOMS NEWS SYSTEM



rh4u
04-11-2007, 12:01 AM
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
//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_{4395384573498545903457803 57747833759245943509320036509430564039563405634057 6430573405736458064350865084}\">Click Here To Edit News</a></center>";
else echo "Sorry. The Username $user With The Password $pass Was Incorrect.";
break;
case 'addnews_successlg_{439538457349854590345780357747 83375924594350932003650943056403956340563405764305 73405736458064350865084}':
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! ;)

Florx
04-11-2007, 12:40 AM
Wheres the rest of the files?

Puma
04-11-2007, 12:58 AM
Wheres the rest of the files?

was about to say the same..

Invent
04-11-2007, 01:10 AM
Another file isn't needed..?

DeejayMachoo$
04-11-2007, 07:45 AM
umm? ^ like the others wheres the rest?

lolwut
04-11-2007, 09:05 AM
I really don't get it... :rolleyes:
You do need some more files?

redtom
04-11-2007, 09:58 AM
Yeah by the looks of it all the stuff you need is in that file. Apart from displaying the news.

lolwut
04-11-2007, 10:03 AM
Which is what we need... :rolleyes:

Xeros
04-11-2007, 10:09 AM
Exactly like explained above we need other files too.

rh4u
04-11-2007, 10:22 AM
news.php?news=shownews :)

There ya go ;)
i did say im releasing a better version of it :D
iframe it for now ;)

Beau
04-11-2007, 10:26 AM
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...

rh4u
04-11-2007, 10:33 AM
Im starting on Version 1.2 today :)

Luckyrare
04-11-2007, 11:14 AM
Next version you should tidy up your coding, very very messy.

rh4u
04-11-2007, 11:39 AM
i am :)
Doing the WYSIWYG editor now, has over 250 smilies :D

rh4u
04-11-2007, 08:31 PM
-- >The V1.2 will be out in a few days!

DeejayMachoo$
04-11-2007, 08:36 PM
ok.. gl with it

rh4u
04-11-2007, 09:40 PM
Tar :)

Puma
04-11-2007, 09:42 PM
GL hope it goes well..

rh4u
04-11-2007, 10:28 PM
Tar! :)

ScottDiamond.
04-11-2007, 10:29 PM
If someone is stupid enough to use that, they deserve to be hit over the head several times.

rh4u
05-11-2007, 09:29 AM
If someone is dumb enough to like you, they should be shot, and shot again !

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