View Full Version : just made the first layout I am proud of! what do you think?


Hany
05-15-2006, 12:09 AM
http://www.powerpetsmania.com/index_page.php

That's a powerpets.com helpsite

What do you think of the layout :D?

amyaurora
05-15-2006, 12:36 AM
Looks pretty good.

Hany
05-15-2006, 12:42 AM
Thanks!

Any suggestions to improve the layout :)?

amyaurora
05-15-2006, 12:52 AM
Not at this time.

Hany
05-15-2006, 12:54 AM
hehe, thanks for the rating then :)

Dan Williamson
05-15-2006, 01:21 AM
It's nice for your first but you seriously need to think a few things:

1) Re-code without tables for faster loading times and more accessibility.

2) Find a better Content Management System which doesn't run off a text-file and is easily exploitable.

Hany
05-15-2006, 01:26 AM
Thanks

1) What do you mean without tables? As in with CSS?

2) Know of any?

Thanks again for your help!

Dan Williamson
05-15-2006, 01:46 AM
Yeah a CSS layout, it may seem daunting but the final result is awesome.

I think for a CMS you could look at a most basic mySQL one. Here is one I used a long time ago,

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,
`icon` varchar(100) NOT NULL default '',
`user` varchar(50) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `date` (`date`)
);

Run that in PHPMYADMIN to set up your SQL table.

<?
$username = "username"; //put your mysql username
$password = "password"; //put your mysql password
$host = "localhost"; //put your mysql host usually localhost
$database = "database"; //put your mysql
database name

//Do not change these lines below
mysql_connect($host,$username,$password) or die("Error connecting to Database! " . mysql_error());
mysql_select_db($database) or die("Cannot select database! " . mysql_error());
?>

Thats your basic Database connection, the code is commented.

<?
include('dbconnect.php'); //connects to database
//select the table
$result = mysql_query("select * from newscms order by id desc limit 5");
//grab all the content from the table
while($r=mysql_fetch_array($result))
{
$id=$r["id"];
$title=$r["title"];
$date=$r["date"];
$user=$r["user"];
$icon=$r["icon"];
$message=$r["message"];
//displays the row's
echo "<img src='
$icon' align='left'>
<b>$title</b> Posted on $date
<br>Posted by: <b>
$user</b>
<br>$message
<br>";
}
?>

Again commented, this will display the news on your index.php file.

? include('dbconnect.php'); ?>
<form action="addnews.php" method="post">
<br>Title:
<br><input name="title" type="text" value="Title">
<br>Author:
<br><input name="user" type="text" value="Name">
<br>Date:
<br><input name="date" type="text" value="<?php print date("F j Y"); ?>">
<br>Icon:
<br><input name="icon" type="text" value="Icon URL">
<br>Message:
<br><textarea name="message" cols="40" rows="6" value="Message"> </textarea>
<br>Password:
<br><input name="password" type="password">
<br><input name="submit" type="submit" value="Submit">
<?php $password="yourpassword"; //change this to the password you want if ($_POST['password']==$password){ //DO NOT CHANGE THIS LINE
if (isset($_POST['submit'])) {
include("dbconnect.php");
$title = addslashes(strip_tags($_POST['title']));
$user = addslashes(strip_tags($_POST['user']));
$icon = addslashes(strip_tags($_POST['icon']));
$message = $_POST['message'];
$date = addslashes(strip_tags($_POST['date']));
$sql = "INSERT INTO newscms SET title='$title', user='$user', icon='$icon', message='$message', date='$date'";
if (mysql_query($sql)) {
echo("Your news has been added.");
} else {
echo("Error adding entry: " . mysql_error() . "");
}
}
?>

The admin panel, easily customizable. Also a SQL password protection in there ;D

Tracey
05-15-2006, 11:04 PM
I like the layout. :)

iTom
05-16-2006, 05:58 PM
*Ahem* I hate to break all your fun, but isn't this advertising?

Arwen
05-16-2006, 06:03 PM
I agree with iThomas. You could show us a picture instead.

Hany
05-17-2006, 02:16 AM
I don't think this is advertising at all.

Site is not open and will not be for a while while everything (guides and all) are done. All I posted was a layout...no advertising at all.

Thanks for the support with that news program and the codes. I will have to look at that :D