ZirconStory CMS.

Yay download linky! Time to customize! :D

Edit: I can't get it to work it always has this message.

Parse error: parse error in C:\wamp\www\Zircon\class\zircon.class.php on line 35
 
Last edited:
Yay download linky! Time to customize! :D

Edit: I can't get it to work it always has this message.

Parse error: parse error in C:\wamp\www\Zircon\class\zircon.class.php on line 35

Look on the "Set up" above.

Replace your old one with this one:
PHP:
<?php
/*
	This file is part of ZirconStory CMS.
	Krishan P. <[email protected]>

    ZirconStory CMS is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ZirconStory CMS is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ZirconStory CMS.  If not, see <http://www.gnu.org/licenses/>.
*/

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(basename($_SERVER["PHP_SELF"]) == "zircon.class.php"){
	die("403 - Access Forbidden");
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class Zircon_Core
{
private static $settings = array();
private static $instance;
private static $objects = array();

private function __construct() {
		require_once("config/db.php");
		$Zircon_Connection = mysql_connect(LOCALHOST,ROOT,PASSWORD);
		$ZirconDB = mysql_select_db(DATABASE, $Zircon_Connection) or die(mysql_error());	
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static function singleton() {
	if( !isset( self::$instance ) ) {
		$obj = __CLASS__;
		self::$instance = new $obj;
	}
		
	return self::$instance;
}

function storeObject( $object, $class, $key ) {
	require_once('obj/' . $object . '.class.php');
	self::$objects[ $key ] = new $class( self::$instance );
}

function storeCoreObjects() {
	$this->storeObject('register', 'Zircon_Register', 'register' );
	$this->storeObject('main', 'Zircon_Main', 'main' ); 
	$this->storeObject('browser', 'Zircon_Browser', 'browser' );
	$this->storeObject('settings', 'Zircon_Settings', 'settings' ); 
}
	
function getObject( $key ) {
	if( is_object ( self::$objects[ $key ] ) ) {
		return self::$objects[ $key ];
	}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# Name: storeSetting()
# Description: Stores a setting for ZirconCMS
# Syntax: storeSetting(setting, alias)
# Author: Hieroglyphics + Michael Peacock( idea) 
function storeSetting( $data, $key ) {
	$this->settings[ $key ] = $data;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# Name: getSetting()
# Description: Gets a stored setting for ZirconCMS
# Syntax: getSetting(setting alias)
# Author: Hieroglyphics + Michael Peacock( idea) 
function getSetting( $key ) {
	return $this->settings[ $key ];
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# Name: navButton()
# Description: Shows nav buttons
# Syntax: navButton(button)
# Author: Hieroglyphics
function navButton($button) {
	if ($button == user_cp) {
		$link = ucp;
	}
	else if ($button == help_desk) {
		$link = help;
	}
	else if ($button == forum) {
		$link = $this->getSetting('forum_link');
	}
	else {
		$link = $button;
	}
	if ($button == forum) {
		echo "
			<a href=\"".$link."\"><div class=\"button_".$button."\" onmouseover=\"this.style.background='url(style/images/buttons/".$button."_hover.png)';\" onmouseout=\"this.style.background='url(style/images/buttons/".$button.".png)';\" ></div></a>
		";
	} else {
		echo "
			<a href=\"?zircon=".$link."\"><div class=\"button_".$button."\" onmouseover=\"this.style.background='url(style/images/buttons/".$button."_hover.png)';\" onmouseout=\"this.style.background='url(style/images/buttons/".$button.".png)';\" ></div></a>
		";
	}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# Name: backButton()
# Description: Puts a back button
# Syntax: backButton()
# Author: Hieroglyphics
function backButton() {
	echo "<br /><center><input type=\"submit\" class=\"tos_button\" onclick=\"javascript:history.go(-1)\" value=\"Back\" name=\"back\"></center>";
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# Name: spacerLink()
# Description: Makes a div a link
# Syntax: spacerLink()
# Author: Hieroglyphics
function spacerLink($page) {
	echo "<a href=\"?zircon='".$page."'\"><img src=\"images/spacer.png\" class=\"spacer\"></a>";
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# Name: redirectLink()
# Description: Redirects to link
# Syntax: redirectLink(url)
# Author: Hieroglyphics
function redirectLink($url) {
	echo "
		<script type=\"text/javascript\">
			window.location.href='$url';
        </script>
	";
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# Name: setTitle()
# Description: Includes files for the main page
# Syntax: setTitle(Title, page)
# Author: Hieroglyphics
function setTitle($title, $page) {
	echo "<title>".$title." | ".$page."</title>";
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# Name: serverStatus()
# Description: shorten title length if it is too long
# Syntax: serverStatus(host, port)
# Author: Hieroglyphics
function serverStatus($host, $port) {
	$server = "";
	@$server = fsockopen($host, $port, $errno, $errstr, 0.1);
	if(!$server)
		return "<font color=\"red\">Offline</font>";
	else{
		fclose($server);
		return "<font color=\"green\">Online</font>";
	}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public function _deconstruct() {
		mysql_close($ZirconDB);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

?>

Look for this line:
PHP:
mysql_connect(LOCALHOST,ROOT,PASSWORD);
		$ZirconDB = mysql_select_db(DATABASE, $Zircon_Connection) or die(mysql_error());

Now change the LOCALHOST ROOT PASSWORD and DATABASE to your Mysql info. Nothing more.

Same goes for the file in the config folder.
 
This will only work on Webhosting :)

Really? Then I can count my homepc as a webhost. :D

some1 go crash his server.

Code:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '217.23.10.208' (4) in /home/valkaria/public_html/75/config.php on line 10

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/valkaria/public_html/75/config.php on line 11
Can't connect to MySQL server on '217.23.10.208' (4)
(Not my work).
 
Look on the "Set up" above.

Replace your old one with this one:

Now change the LOCALHOST ROOT PASSWORD and DATABASE to your Mysql info. Nothing more.

Same goes for the file in the config folder.
Even with those changed I still get the same message. :/:

Edit: Okay I think I fixed it but now I get error on line 28 in the same php as before.
 
Back