[pre-release] dev cms Website 

Status
Not open for further replies.
Legendary Battlemage
Joined
Aug 16, 2008
Messages
600
Reaction score
259
I had this lying around that I was working on at one point, this ain't a full release, there are things that need to be finished on, but maybe you guys want to finish it, or rip some of the pages to add to your own? Everything is my own coding, except the template system that was from UberCMS, although the structure system is a lot better.

Attachments are below

Some code:

PHP:
<?php 
if (!defined('IN_PAGES'))
{
	die ('<h1>Access denied</h1><p>You do not have the privileges to access this webpage.</p>');
}

class html
{
	public static function meta ()
	{
		GLOBAL $config;
		return ('<meta name="description" content="Check into the world\'s largest virtual hotel for FREE! Meet and make friends, play games, chat with others, create your avatar, design rooms and more..." />
		<meta name="keywords" content="'.strtolower($config['www']['name']).' hotel, virtual, world, social network, free, community, avatar, chat, online, teen, roleplaying, join, social, groups, forums, safe, play, games, online, friends, teens, rares, rare furni, collecting, create, collect, connect, furni, furniture, pets, room design, sharing, expression, badges, hangout, music, celebrity, celebrity visits, celebrities, mmo, mmorpg, massively multiplayer">');
	}
	
	public static function header ()
	{
		GLOBAL $config;
		$colour = array();
		
		if (isset($_GET['p']))
		{
			if ($_GET['p'] == 'me')
			{
				$colour[0] = ' white';
			}
			else if ($_GET['p'] == 'home')
			{
				$colour[1] = ' class="white"';
			}
			else if ($_GET['p'] == 'account')
			{
				$colour[2] = ' class="white"';
			}
			else if ($_GET['p'] == 'news')
			{
				$colour[3] = ' class="white"';
			}
			else if ($_GET['p'] == 'staff')
			{
				$colour[4] = ' class="white"';
			}
			else if ($_GET['p'] == 'shop')
			{
				$colour[5] = ' class="white"';
			}
			else
			{
				$colour = NULL;
			}
		}
		
		return ('<div id="container-header">
			<div id="backdrop"></div>
			<div class="container">
				<div id="container-navigation">
					<a href="'.$config['www']['url'].'/?p=me" target="_self" id="logo"></a>
					<ul class="navigation">
						<li><a href="'.$config['www']['url'].'/?p=me" target="_self" class="first'.$colour[0].'">Predict</a></li>
						<li><a href="'.$config['www']['url'].'/?p=home" target="_self"'.$colour[1].'>Home</a></li>
						<li><a href="'.$config['www']['url'].'/?p=account" target="_self"'.$colour[2].'>Account</a></li>
						<li><a href="'.$config['www']['url'].'/?p=news" target="_self"'.$colour[3].'>News</a></li>
						<li><a href="'.$config['www']['url'].'/?p=staff" target="_self"'.$colour[4].'>Staff</a></li>
						<li><a href="'.$config['www']['url'].'/?p=shop" target="_self"'.$colour[5].'>Shop</a></li>
						<li><a href="'.$config['www']['url'].'/?p=logout" target="_self" class="last">Logout</a></li>
					</ul>
					<ul class="navigation">
						<li><a href="'.$config['www']['url'].'/?p=client" target="_self" class="first green">Enter '.$config['www']['name'].' Hotel</a></li>
						<li><a href="'.$config['www']['url'].'/?p=users" target="_self" class="last white">0   users online</a></li>
					</ul>
				</div>
			</div>
		</div>');
	}
	
	public static function advertisement ()
	{
		return ('<div id="container-column-03" class="container-column">
				<div class="container-title orange">Advertisement</div>
				<div class="container-body"></div>
			</div>');
	}

	public static function footer ()
	{
		GLOBAL $config;
		return ('<div id="container-footer">
				<a href="'.$config['www']['url'].'/" target="_self" class="link">Homepage</a> | 
				<a href="'.$config['www']['url'].'/?p=paper&sub=1" target="_self" class="link">Terms of use</a> | 
				<a href="'.$config['www']['url'].'/?p=paper&sub=2" target="_self" class="link">Privacy policy</a> | 
				<a href="'.$config['www']['url'].'/?p=paper&sub=3" target="_self" class="link">'.$config['www']['name'].' way</a>
			</div>');
	}
}
?>

PHP:
<?php
define ('IN_PAGES', true);

require_once ('private/application/bootstrap.php');

$page = NULL;

if (isset($_POST['p']) || isset($_GET['p']))
{
	$initial = NULL;
	
	if ($_POST['p'])
	{
		$initial = $_POST['p'];
	}
	else if ($_GET['p'])
	{
		$initial = $_GET['p'];
	}

	$page = strtolower(trim(htmlentities($initial)));
}

if (isset($_SESSION['username']) && isset($_SESSION['password']))
{
	if ($usr->user_login($_SESSION['username'], $_SESSION['password']))
	{
		define ('LOGGED_IN', true);
	}
	else
	{
		define ('LOGGED_IN', false);
	}
}
else
{
	define ('LOGGED_IN', false);
}

if ($page == NULL)
{
	$initial = NULL;
	
	if (LOGGED_IN)
	{
		$initial = 'me';
	}
	else
	{
		$initial = 'login';
	}

	header ('Location: '.$config['www']['url'].'/?p='.$initial);
	exit;
}

switch($page)
{
	case 'logout':
		unset ($_SESSION['username']);
		unset ($_SESSION['password']);
		header ('Location: '.$config['www']['url'].'/?p=login');
		exit;
	break;
	
	case 'ase';
		if (!LOGGED_IN) // CHANGE
		{
			require_once ('private/application/theme/public/housekeeping/dash.php');
		}
		else
		{
			require_once ('private/application/theme/public/error.php');
		}
	break;
	
	default:
		if (file_exists('private/application/theme/public/'.$page.'.php'))
		{
			require_once ('private/application/theme/public/'.$page.'.php');
		}
		else
		{
			require_once ('private/application/theme/public/error.php');
		}
	break;
}
?>

PHP:
<?php 
if (!defined('IN_PAGES'))
{
	die ('<h1>Access denied</h1><p>You do not have the privileges to access this webpage.</p>');
}

if(isset($_SERVER['HTTP_CF_CONNECTING_IP']))
{
	$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
}

// error_reporting(0);
date_default_timezone_set('Europe/London');

require_once ('private/application/config/config.php');

require_once ('private/application/library/class.mysqli.php');
	$db = new db_mysqli($config['mysqli']['hostname'], $config['mysqli']['username'], $config['mysqli']['password'], $config['mysqli']['database']);

require_once ('private/application/library/class.template.php');
	$tpl = new template();

require_once ('private/application/library/class.user.php');
	$usr = new user();

require_once ('private/application/library/class.html.php');

session_start();
?>
 

Attachments

  • tit - [pre-release] dev cms - RaGEZONE Forums
    tit.webp
    36.7 KB · Views: 634
  • tits - [pre-release] dev cms - RaGEZONE Forums
    tits.webp
    56.2 KB · Views: 573
  • sexy_tim - [pre-release] dev cms - RaGEZONE Forums
    sexy_time.webp
    41.2 KB · Views: 680
  • private.zip
    private.zip
    163.2 KB · Views: 208
It looks nice. You should have started this in the development section. Although you're releasing it, it's not finished. Would have been a better idea to make a thread regarding the development of this CMS and then work on it until it's fully built.
 
Testing this out and I'm receiving "Please enter a username that does not already exist." I'm testing this out on a clean database with no users registered, so... What exactly is the problem?

Besides that it looks good, good work.
 
I don't like the header function. You're going to get e_notices because you're using keys in the array that aren't there if you're not on that page. Other than that I like the design

if ($_POST['p']) -> Why not just if (isset($_POST['p']))? Wouldn't the first thing throw a notice if it isn't set? Same thing for the GET btw
 
Thanks guys, if there anything that can be improved upon, don't hesitate to post patches/updates to improve the bases of things
jaja
 
PHP:
  if (isset($_GET['p'])) 
        { 
            if ($_GET['p'] == 'me') 
            { 
                $colour[0] = ' white'; 
            } 
            else if ($_GET['p'] == 'home') 
            { 
                $colour[1] = ' class="white"'; 
            } 
            else if ($_GET['p'] == 'account') 
            { 
                $colour[2] = ' class="white"'; 
            } 
            else if ($_GET['p'] == 'news') 
            { 
                $colour[3] = ' class="white"'; 
            } 
            else if ($_GET['p'] == 'staff') 
            { 
                $colour[4] = ' class="white"'; 
            } 
            else if ($_GET['p'] == 'shop') 
            { 
                $colour[5] = ' class="white"'; 
            } 
            else 
            { 
                $colour = NULL; 
            } 
        }

Start using switch statements man...
 
PHP:
  if (isset($_GET['p'])) 
        { 
            if ($_GET['p'] == 'me') 
            { 
                $colour[0] = ' white'; 
            } 
            else if ($_GET['p'] == 'home') 
            { 
                $colour[1] = ' class="white"'; 
            } 
            else if ($_GET['p'] == 'account') 
            { 
                $colour[2] = ' class="white"'; 
            } 
            else if ($_GET['p'] == 'news') 
            { 
                $colour[3] = ' class="white"'; 
            } 
            else if ($_GET['p'] == 'staff') 
            { 
                $colour[4] = ' class="white"'; 
            } 
            else if ($_GET['p'] == 'shop') 
            { 
                $colour[5] = ' class="white"'; 
            } 
            else 
            { 
                $colour = NULL; 
            } 
        }

Start using switch statements man...

They are if statements.
 
Status
Not open for further replies.
Back