Manage the designers and assign certain tasks to them
I have this thing called dotProject thats pretty cool, it organizes projects and assigns tasks to different departments etc.

Manage the designers and assign certain tasks to them
I have this thing called dotProject thats pretty cool, it organizes projects and assigns tasks to different departments etc.
Any you can?
To be honest, and quite frankly the person that purchases something don't care how the code looks, or how things are done. Most people purchasing a product thats been coded just want it to work, thats all. Not many care about valid HTML or CSS unless its a frontend product..
You code like a rookie too.
You act like an *** to people now since you have released KP... just like Nymrod.
SAY IT AGAIN, GO ON, SAY IT AGAINPHP Code:<?php
/**
####################################################################
# Kristall Panel Core Class
# Handles _most_ of this basics.
# Getting browser info and general information etc.
# Date Started: 30th April 2007 - 19:14 GMT
####################################################################
# @package Default
# @copyright Kristall Services, Org.
# @author Enumeric
# @version 1.0.0
####################################################################
**/
/**
* Unfreeze / initialise sessions ready for use.
**/
if( !defined( "KP_Core" ) )
{
exit;
// Exit, give them no reason, should throw them off a bit.
}
session_start();
include("class_config.php");
include("class_clean.php");
include("class_bbcode.php");
$config = new main_config;
$config->initialise();
/**
* This will put the get_opts script into debug mode
* instead of returning the sql, it will exit with the result
* to enable you to fix a problem, should it arise, with relative ease.
* LEAVE THIS ALONE UNLESS YOU KNOW HOW TO DEBUG PHP AND MySQL
*
* Case insensitive too for future reference.
**/
define( "EXITSQL", 0, true );
class panel_core
{
/**
* Set core variables
**/
// Gets information from the database and sets options
function get_opts( $option )
{
// Make the $option variable lowercase to stop "BBCode" or "OnOff" (for example) being ignored.
$option = strtolower( $option );
// Get needed settings from database (Which just so happens to be.. wait for it... all of them :D)
$getsettings = @mysql_fetch_array( mysql_query( "SELECT * FROM `" . TABLEPREFIX . "settings`" ) )
or $this->log( "MySQL Error", mysql_error( ), 1 );
// Put the settings into a big ol' array
$settings = array( "bbcode" => $getsettings["bbcode"], // Should return integer
"emoticons" => $getsettings["emotes"], // Should return integer
"onoff" => $getsettings["onoff"], // Should return integer
"filter" => $getsettings["filter"], // Should return integer
"sitename" => $getsettings["sitename"], // Should return string
"siteurl" => $getsettings["siteurl"], // Should return string
"welcome" => $getsettings["welcome"], // Should return string
"clean" => $getsettings["clean"], // Should return integer
"css" => $getsettings["css_tag"]
);
// Gotta make sure what we're after is a valid setting...
if( $settings["$option"] != "" )
{
if( EXITSQL == 1 ) // Looks like we're debugging
{
$exit = gettype( $settings["$option"] );
exit( "MySQL Returned type $exit.<br />result: {$settings["$option"]}" ); // Exit with the type returned from sql (Like boolean etc etc) and show them it with the result!
}
else // Ah, glorious non-debugging-action-which-is-taking-up-this-comment-space.
{
return $settings["$option"]; // Just return the sql result and let it get on with whatever.
}
}
else // Not a valid setting, that makes me & the script :(
{
return false; // Return false and let's get out of here.
}
}
/**
* Tag cleaning decider function
*
* Decides what functions to call (What level of cleaning)
* for cleaning string passed into it, then cleans it.
**/
function clean( $string, $forcelevel = null, $sql = null )
{
if( $forcelevel != null )
{
$getlevel = $forcelevel;
}
else
{
$getlevel = $this->get_opts( "clean" );
}
switch( $getlevel )
{
default:
$string = panel_clean::max_clean( $string );
case 4: // Panicking
$string = panel_clean::max_clean( $string ); // Welcome back $string, we missed you!
break; // No need to carry on from here, it's instantly protected beyond any "hackers" playing around.
case 3: // Nervous
$string = panel_clean::med_clean( $string );
$string = panel_clean::base_clean( $string );
$string = panel_clean::core_clean( $string );
$donl2br = 0;
break;
case 2: // Cool, calm and default
$string = panel_clean::base_clean( $string );
$string = panel_clean::core_clean( $string );
break;
case 1: // Why panic when you have KOOL-AIDS (lol aids)
$string = panel_clean::core_clean( $string );
break;
}
if( $this->get_opts( "bbcode" ) == 1 ) // Are we parsing bbcode?
{
// We are, but we need to parse it _last_ to make sure the parsed code isn't cleaned!
$string = panel_bbcode::parse_main_bb( $string, $this->get_opts( "emoticons" ) );
}
return $string; // Give em it back :(
}
/**
* Ok, lets get on with getting basic user info.
**/
function get_info( $requested )
{
// Convert to lowercase to stop case insensitive problems.
$requested = strtolower( $requested );
$available = array( "username" => $_SESSION["p_username"],
"level" => $_SESSION["p_level"],
"auth" => $_SESSION["p_randauth"],
"passhash" => $_SESSION["p_hash"],
"ip" => $_SESSION["p_ip"], // Lol pips
"lusername" => $_SESSION["p_lusername"]
);
if( $available["$requested"] != "" ) // It's in there, give them the stuff they asked for.
{
return $available["$requested"];
}
else
{
// Eh, after something that's not there :(
return "Not Available.";
}
}
function check_user( $username )
{
if( $username == "" )
{
return false;
}
// Simple function to get user information dependant on if the password is supplied or not.
// Looks like we're checking info based on just the username (Probably an auth check in the panel)
$username = strtolower( $this->clean( $username ) ); // Clean up the username.
$sql = @mysql_query( "SELECT * FROM `" . TABLEPREFIX . "users` WHERE `lusername` = '$username'" )
or $this->log( "MySQL Error", mysql_error( ), 1 );
if( @mysql_num_rows( $sql ) == 0 )
{
return false;
}
else
{
$fetch = @mysql_fetch_array( $sql )
or $this->log( "MySQL Error", mysql_error( ), 1 );
$storedinfo = array( "password" => $this->get_info( "passhash" ),
"randauth" => $this->get_info( "auth" ),
"getuseip" => $this->get_info( "ip" ),
"gtuselvl" => $this->get_info( "level" )
);
if( $storedinfo["password"] != md5( $fetch["password"] ) /*|| $storedinfo["randauth"] != $fetch["randauth"]*/ || $storedinfo["getuseip"] != $_SERVER["REMOTE_ADDR"] || $storedinfo["gtuselvl"] != $fetch["level"] )
{
return false; // Ha, not giving the right stuff eh? Better kick em out!
}
else
{
return true;
}
}
}
function notice( $header, $message, $url ) // Standard notice, don't need to touch this.
{
@header("Refresh: 9;url=".$url);
echo("<html>
<head>
<title>" . $this->phrase( $header ) . "</title>
</head>
<style type=\"text/css\">
body
{
text-align: center;
width: 100%;
margin: 0px;
background: #ffffff;
}
div, a, a:link, a:active
{
font-family: verdana;
font-size: 10px;
color: #000000;
text-decoration: none;
}
a:hover
{
font-weight: bold;
}
.wrapper
{
margin-top: 150px;
width: 371px;
margin-left: auto;
margin-right: auto;
}
.construct
{
text-align: left;
width: 371px;
position: relative;
margin-left: auto;
margin-right: auto;
}
.header, .message, .topheader
{
background: #f0f5fa;
padding: 2px;
}
.header
{
border: 1px solid #c2cfdf;
}
.topheader
{
text-align: center;
border: 1px solid #c2cfdf;
}
.message
{
color: #000000;
border-left: 1px solid #c2cfdf;
border-right: 1px solid #c2cfdf;
}
.upper
{
text-transform: uppercase;
}
</style>
<body>
<div class=\"wrapper\">
<div class=\"construct\">
<div class=\"topheader\"><strong class=\"upper\">" . $this->phrase( $header ) . "</strong></div>
<div class=\"message\">" . $this->phrase( $message ) . "</div>
<div class=\"header\">" . $this->phrase( "redirect" ) . " Click <a href=\"$url\">here</a> to go immediatley.</div>
</div>
</div>
</body>
</html>");
exit;
}
function phrase( $phrase )
{
$phrase = $this->clean( $phrase );
$sql = @mysql_query( "SELECT * FROM `" . TABLEPREFIX . "phrases` WHERE `phrasename` = '$phrase'" ); // SQL to get the query from the database...
if( mysql_num_rows( $sql ) == 0 )
{
return "Phrase not available.";
}
else
{
$sql = mysql_fetch_array( $sql );
}
$replaceable = array( "/{website}/i" ,
"/{username}/i",
"/{date}/i",
"/{level}/i",
"/{ip}/i");
$replacewith = array( $this->get_opts( "sitename" ),
$this->get_info( "username" ),
gmdate( "d/m/Y - h:i:s" ),
$this->get_info( "level" ),
$this->get_info( "ip" ), );
$getit = $sql["phrase"];
$replaceit = preg_replace( $replaceable, $replacewith, $getit );
$replaceit = str_replace( "[apos]", "'", $replaceit );
return $replaceit;
}
function encrypt( $string ) // Let's begin encryption.
{
$holda = $string;
$holdb = $string;
$holdc = $holda . $holdb;
$holdc = sha1( md5 ( $holdc ) );
$holdb = strlen( $string );
$holdb = md5( $holdb . $holdc . $holda );
$holda = crypt( $holdb, "LivePanel!CoreEncryt1.0\$Revision1" ); // LOL WUT? Edit: Need to change this to kristallpanel before release
return $holda;
}
/**
* Time to begin action logging.
*/
function log( $username, $did, $force = null )
{
if( main_config::config_setting( "use_http_logs" ) == "1" || $force == 1 )
{
// Begin http logging
echo("<html>
<head>
<title>Error Logging.</title>
</head>
<style type=\"text/css\">
body
{
text-align: center;
width: 100%;
margin: 0px;
background: #ffffff;
}
div, a, a:link, a:active
{
font-family: verdana;
font-size: 10px;
color: #000000;
text-decoration: none;
}
a:hover
{
font-weight: bold;
}
.wrapper
{
margin-top: 150px;
width: 371px;
margin-left: auto;
margin-right: auto;
}
.construct
{
text-align: left;
width: 371px;
position: relative;
margin-left: auto;
margin-right: auto;
}
.header, .message, .topheader
{
background: #f0f5fa;
padding: 2px;
}
.header
{
border: 1px solid #c2cfdf;
text-align: center;
}
.topheader
{
text-align: center;
border: 1px solid #c2cfdf;
}
.message
{
color: #000000;
border-left: 1px solid #c2cfdf;
border-right: 1px solid #c2cfdf;
}
.upper
{
text-transform: uppercase;
}
</style>
<body>
<div class=\"wrapper\">
<div class=\"construct\">
<div class=\"topheader\"><strong class=\"upper\">Error Logging</strong></div>
<div class=\"message\">Please wait, we're now doing a few checks to make sure you have the log file ready.");
#########
$date = gmdate("d/m/Y - h:i:s") . "GMT";
if( file_exists( "http_error/error.log" ) )
{
// Looks like we're gonna be writing to an already active log file.
echo("<br />--| File exists, opening now.");
$fopen = @fopen( "http_error/error.log", "at" );
if( $fopen )
{
echo("<br />---| File opened, writing error.");
@fwrite( $fopen, "\n$username ({$_SERVER["REMOTE_ADDR"]}) - [ $date ] => $did" );
echo("<br />----| Error logged, you may now navigate away.");
@fclose( $fopen );
}
}
else
{
echo("<br />--| File does not exist, attemnpting to create and open for writing.");
$fopen = @fopen( "http_error/error.log", "x+t" );
if( $fopen )
{
echo("<br />---| File created and opened, writing error.");
@fwrite( $fopen, "Kristall Panel ERROR LOGS\n$username ({$_SERVER["REMOTE_ADDR"]}) - [ $date ] => $did" );
echo("<br />----| Error logged, you may now navigate away.");
@fclose( $fopen );
}
}
#########
echo("</div>
<div class=\"header\">Powered by Kristall Panel</div>
</div>
</div>
</body>
</html>");
exit;
}
else
{
$date = gmdate( "d/m/Y - h:i:s" );
@mysql_query( "INSERT INTO `" . TABLEPREFIX . "log` (`username`, `did`, `date`, `ip`) VALUES ('$username', '$did', '$date', '{$_SERVER["REMOTE_ADDR"]}')" )
or $this->log( "MySQL Error", mysql_error( ), 1 );
}
}
function nav( $level = null )
{
if( $level == "normal" )
{
$_SESSION["nav"] = "normal";
}
elseif( $level == "admin" && $this->get_info( "level" ) == "Administrator" || $level == "admin" && $this->get_info( "level" ) == "Super Administrator")
{
$_SESSION["nav"] = "admin";
}
else
{
$_SESSION["nav"] = "normal";
}
}
function get_nav()
{
if( $_SESSION["nav"] == "admin" )
{
echo("<div class=\"selectmenuleft\"><a href=\"?nav=normal\">Main Links</a></div>
<div class=\"selectmenurightg\"><a href=\"?nav=admin\">Admin Links</a></div>");
}
else
{
echo("<div class=\"selectmenuleftg\"><a href=\"?nav=normal\">Main Links</a></div>
<div class=\"selectmenuright\"><a href=\"?nav=admin\">Admin Links</a></div>");
}
}
function get_content( $page = null )
{
if( $page == "" )
{
include( "pages/welcome.php" );
}
else
{
$page = $this->clean( $page, 2 );
if( file_exists( "pages/$page.php" ) )
{
include( "pages/$page.php" );
}
else
{
$this->log( $this->get_info( "username" ), "attempted to access a faulty page, the page was ( $page.php )" );
include( "404.php" );
}
}
}
function meta_redirect( $url, $time )
{
$url = $this->clean( $url );
echo( "<meta http-equiv=\"refresh\" content=\"$time;url=main.php$url\">" );
}
function gmt_curtime() // Because php time is **** and wont record DST
{
$checkdst = date( "I" );
$date = gmdate( "H:i:s" );
if( $checkdst == 1 )
{
$splittime = split( ":", $date );
$hour = $splittime[0] + 1;
if($hour > 23) // Are we at 11pm (E.g, is it reporting 24:00 instead of 23:00)
{
$hour = "00";
}
$newdate = $hour . ":" . $splittime[1] . ":" . $splittime[2];
return( "$newdate" );
}
else
{
return( "$date" );
}
}
function is_admin( $for = null ) // Specific page admins :P
{
$for = $this->clean( $for ); // Clean it up (do in mr bean voice, funny).
$for = strtolower( $for ); // Case ******ry.
if( $for == "timetable" )
{
$levels = array( "Super Administrator" => true,
"Administrator" => true,
"Head DJ" => true,
"Senior DJ" => false,
"DJ" => false,
);
if( $levels[$this->get_info(" level" )] == true )
{
return true;
}
else
{
return false;
}
}
}
}
?>
visit my internet web site on the internet
http://dong.engineer/
it is just videos by bill wurtz videos you have been warned
I didn't say you were a bad coder, you can just be a ***** a lot of the time.
Just like me I guess D:
visit my internet web site on the internet
http://dong.engineer/
it is just videos by bill wurtz videos you have been warned
whoo hooo a class, and clean code, bahumbug
I could do some designing and obviously flash too.
Would you wanna join? It seems to be pretty fun.
Both which make the code more professional;
Classes for good organisation.
Clean code for ease of reading
Clean code for ease of debugging!
Oh btw simon, thanks for using my encryption style :rolleyes:
I like the publicityPHP Code:function encrypt($string) {
$string = md5($string);
$string = base64_encode($string);
$string = md5($string);
$string = base64_decode($string);
$string = md5($string);
$a1 = strlen($string);
$a2 = base64_decode($string);
$a3 = rand(10000, 999999);
$a4 = "". $a1 ."". $a2 ."". $a3 ."". $a1 ."";
$crypt = md5($a4);
$string = crypt($crypt, "POWERpanelEncryptionOhYeah!lulsSMELLSLIKECHICKEN4");
return $string;
## OUTPUTTED WITH _VERY_ STRONG ENCRYPTION
}
*(Seriously)*
Last edited by Jewish Bear; 08-06-2007 at 06:10 AM.
visit my internet web site on the internet
http://dong.engineer/
it is just videos by bill wurtz videos you have been warned
Well I'm not a fantastic coder and I'm still learning however I'll happy to be help in the coding department and the design department (if there is one that is).
Good-bye signature, I love <NOT ALLOWED NAME AT ALL> despite the infraction his last name got me.
Free speech? Not anymore, you gotta' love this forum.
If your can boast about oop learn it properly, I can see without even reading its wasting alot of oops features, for one you have an call to a classes inialise method, When a object is defined it should automatically run that method if done properly (with php i belive it just uses a method shareing the classes name)SAY IT AGAIN, GO ON, SAY IT AGAINPHP Code:<?php
/**
####################################################################
# Kristall Panel Core Class
# Handles _most_ of this basics.
# Getting browser info and general information etc.
# Date Started: 30th April 2007 - 19:14 GMT
####################################################################
# @package Default
# @copyright Kristall Services, Org.
# @author Enumeric
# @version 1.0.0
####################################################################
**/
/**
* Unfreeze / initialise sessions ready for use.
**/
if( !defined( "KP_Core" ) )
{
exit;
// Exit, give them no reason, should throw them off a bit.
}
session_start();
include("class_config.php");
include("class_clean.php");
include("class_bbcode.php");
$config = new main_config;
$config->initialise();
/**
* This will put the get_opts script into debug mode
* instead of returning the sql, it will exit with the result
* to enable you to fix a problem, should it arise, with relative ease.
* LEAVE THIS ALONE UNLESS YOU KNOW HOW TO DEBUG PHP AND MySQL
*
* Case insensitive too for future reference.
**/
define( "EXITSQL", 0, true );
class panel_core
{
/**
* Set core variables
**/
// Gets information from the database and sets options
function get_opts( $option )
{
// Make the $option variable lowercase to stop "BBCode" or "OnOff" (for example) being ignored.
$option = strtolower( $option );
// Get needed settings from database (Which just so happens to be.. wait for it... all of them :D)
$getsettings = @mysql_fetch_array( mysql_query( "SELECT * FROM `" . TABLEPREFIX . "settings`" ) )
or $this->log( "MySQL Error", mysql_error( ), 1 );
// Put the settings into a big ol' array
$settings = array( "bbcode" => $getsettings["bbcode"], // Should return integer
"emoticons" => $getsettings["emotes"], // Should return integer
"onoff" => $getsettings["onoff"], // Should return integer
"filter" => $getsettings["filter"], // Should return integer
"sitename" => $getsettings["sitename"], // Should return string
"siteurl" => $getsettings["siteurl"], // Should return string
"welcome" => $getsettings["welcome"], // Should return string
"clean" => $getsettings["clean"], // Should return integer
"css" => $getsettings["css_tag"]
);
// Gotta make sure what we're after is a valid setting...
if( $settings["$option"] != "" )
{
if( EXITSQL == 1 ) // Looks like we're debugging
{
$exit = gettype( $settings["$option"] );
exit( "MySQL Returned type $exit.<br />result: {$settings["$option"]}" ); // Exit with the type returned from sql (Like boolean etc etc) and show them it with the result!
}
else // Ah, glorious non-debugging-action-which-is-taking-up-this-comment-space.
{
return $settings["$option"]; // Just return the sql result and let it get on with whatever.
}
}
else // Not a valid setting, that makes me & the script :(
{
return false; // Return false and let's get out of here.
}
}
/**
* Tag cleaning decider function
*
* Decides what functions to call (What level of cleaning)
* for cleaning string passed into it, then cleans it.
**/
function clean( $string, $forcelevel = null, $sql = null )
{
if( $forcelevel != null )
{
$getlevel = $forcelevel;
}
else
{
$getlevel = $this->get_opts( "clean" );
}
switch( $getlevel )
{
default:
$string = panel_clean::max_clean( $string );
case 4: // Panicking
$string = panel_clean::max_clean( $string ); // Welcome back $string, we missed you!
break; // No need to carry on from here, it's instantly protected beyond any "hackers" playing around.
case 3: // Nervous
$string = panel_clean::med_clean( $string );
$string = panel_clean::base_clean( $string );
$string = panel_clean::core_clean( $string );
$donl2br = 0;
break;
case 2: // Cool, calm and default
$string = panel_clean::base_clean( $string );
$string = panel_clean::core_clean( $string );
break;
case 1: // Why panic when you have KOOL-AIDS (lol aids)
$string = panel_clean::core_clean( $string );
break;
}
if( $this->get_opts( "bbcode" ) == 1 ) // Are we parsing bbcode?
{
// We are, but we need to parse it _last_ to make sure the parsed code isn't cleaned!
$string = panel_bbcode::parse_main_bb( $string, $this->get_opts( "emoticons" ) );
}
return $string; // Give em it back :(
}
/**
* Ok, lets get on with getting basic user info.
**/
function get_info( $requested )
{
// Convert to lowercase to stop case insensitive problems.
$requested = strtolower( $requested );
$available = array( "username" => $_SESSION["p_username"],
"level" => $_SESSION["p_level"],
"auth" => $_SESSION["p_randauth"],
"passhash" => $_SESSION["p_hash"],
"ip" => $_SESSION["p_ip"], // Lol pips
"lusername" => $_SESSION["p_lusername"]
);
if( $available["$requested"] != "" ) // It's in there, give them the stuff they asked for.
{
return $available["$requested"];
}
else
{
// Eh, after something that's not there :(
return "Not Available.";
}
}
function check_user( $username )
{
if( $username == "" )
{
return false;
}
// Simple function to get user information dependant on if the password is supplied or not.
// Looks like we're checking info based on just the username (Probably an auth check in the panel)
$username = strtolower( $this->clean( $username ) ); // Clean up the username.
$sql = @mysql_query( "SELECT * FROM `" . TABLEPREFIX . "users` WHERE `lusername` = '$username'" )
or $this->log( "MySQL Error", mysql_error( ), 1 );
if( @mysql_num_rows( $sql ) == 0 )
{
return false;
}
else
{
$fetch = @mysql_fetch_array( $sql )
or $this->log( "MySQL Error", mysql_error( ), 1 );
$storedinfo = array( "password" => $this->get_info( "passhash" ),
"randauth" => $this->get_info( "auth" ),
"getuseip" => $this->get_info( "ip" ),
"gtuselvl" => $this->get_info( "level" )
);
if( $storedinfo["password"] != md5( $fetch["password"] ) /*|| $storedinfo["randauth"] != $fetch["randauth"]*/ || $storedinfo["getuseip"] != $_SERVER["REMOTE_ADDR"] || $storedinfo["gtuselvl"] != $fetch["level"] )
{
return false; // Ha, not giving the right stuff eh? Better kick em out!
}
else
{
return true;
}
}
}
function notice( $header, $message, $url ) // Standard notice, don't need to touch this.
{
@header("Refresh: 9;url=".$url);
echo("<html>
<head>
<title>" . $this->phrase( $header ) . "</title>
</head>
<style type=\"text/css\">
body
{
text-align: center;
width: 100%;
margin: 0px;
background: #ffffff;
}
div, a, a:link, a:active
{
font-family: verdana;
font-size: 10px;
color: #000000;
text-decoration: none;
}
a:hover
{
font-weight: bold;
}
.wrapper
{
margin-top: 150px;
width: 371px;
margin-left: auto;
margin-right: auto;
}
.construct
{
text-align: left;
width: 371px;
position: relative;
margin-left: auto;
margin-right: auto;
}
.header, .message, .topheader
{
background: #f0f5fa;
padding: 2px;
}
.header
{
border: 1px solid #c2cfdf;
}
.topheader
{
text-align: center;
border: 1px solid #c2cfdf;
}
.message
{
color: #000000;
border-left: 1px solid #c2cfdf;
border-right: 1px solid #c2cfdf;
}
.upper
{
text-transform: uppercase;
}
</style>
<body>
<div class=\"wrapper\">
<div class=\"construct\">
<div class=\"topheader\"><strong class=\"upper\">" . $this->phrase( $header ) . "</strong></div>
<div class=\"message\">" . $this->phrase( $message ) . "</div>
<div class=\"header\">" . $this->phrase( "redirect" ) . " Click <a href=\"$url\">here</a> to go immediatley.</div>
</div>
</div>
</body>
</html>");
exit;
}
function phrase( $phrase )
{
$phrase = $this->clean( $phrase );
$sql = @mysql_query( "SELECT * FROM `" . TABLEPREFIX . "phrases` WHERE `phrasename` = '$phrase'" ); // SQL to get the query from the database...
if( mysql_num_rows( $sql ) == 0 )
{
return "Phrase not available.";
}
else
{
$sql = mysql_fetch_array( $sql );
}
$replaceable = array( "/{website}/i" ,
"/{username}/i",
"/{date}/i",
"/{level}/i",
"/{ip}/i");
$replacewith = array( $this->get_opts( "sitename" ),
$this->get_info( "username" ),
gmdate( "d/m/Y - h:i:s" ),
$this->get_info( "level" ),
$this->get_info( "ip" ), );
$getit = $sql["phrase"];
$replaceit = preg_replace( $replaceable, $replacewith, $getit );
$replaceit = str_replace( "[apos]", "'", $replaceit );
return $replaceit;
}
function encrypt( $string ) // Let's begin encryption.
{
$holda = $string;
$holdb = $string;
$holdc = $holda . $holdb;
$holdc = sha1( md5 ( $holdc ) );
$holdb = strlen( $string );
$holdb = md5( $holdb . $holdc . $holda );
$holda = crypt( $holdb, "LivePanel!CoreEncryt1.0\$Revision1" ); // LOL WUT? Edit: Need to change this to kristallpanel before release
return $holda;
}
/**
* Time to begin action logging.
*/
function log( $username, $did, $force = null )
{
if( main_config::config_setting( "use_http_logs" ) == "1" || $force == 1 )
{
// Begin http logging
echo("<html>
<head>
<title>Error Logging.</title>
</head>
<style type=\"text/css\">
body
{
text-align: center;
width: 100%;
margin: 0px;
background: #ffffff;
}
div, a, a:link, a:active
{
font-family: verdana;
font-size: 10px;
color: #000000;
text-decoration: none;
}
a:hover
{
font-weight: bold;
}
.wrapper
{
margin-top: 150px;
width: 371px;
margin-left: auto;
margin-right: auto;
}
.construct
{
text-align: left;
width: 371px;
position: relative;
margin-left: auto;
margin-right: auto;
}
.header, .message, .topheader
{
background: #f0f5fa;
padding: 2px;
}
.header
{
border: 1px solid #c2cfdf;
text-align: center;
}
.topheader
{
text-align: center;
border: 1px solid #c2cfdf;
}
.message
{
color: #000000;
border-left: 1px solid #c2cfdf;
border-right: 1px solid #c2cfdf;
}
.upper
{
text-transform: uppercase;
}
</style>
<body>
<div class=\"wrapper\">
<div class=\"construct\">
<div class=\"topheader\"><strong class=\"upper\">Error Logging</strong></div>
<div class=\"message\">Please wait, we're now doing a few checks to make sure you have the log file ready.");
#########
$date = gmdate("d/m/Y - h:i:s") . "GMT";
if( file_exists( "http_error/error.log" ) )
{
// Looks like we're gonna be writing to an already active log file.
echo("<br />--| File exists, opening now.");
$fopen = @fopen( "http_error/error.log", "at" );
if( $fopen )
{
echo("<br />---| File opened, writing error.");
@fwrite( $fopen, "\n$username ({$_SERVER["REMOTE_ADDR"]}) - [ $date ] => $did" );
echo("<br />----| Error logged, you may now navigate away.");
@fclose( $fopen );
}
}
else
{
echo("<br />--| File does not exist, attemnpting to create and open for writing.");
$fopen = @fopen( "http_error/error.log", "x+t" );
if( $fopen )
{
echo("<br />---| File created and opened, writing error.");
@fwrite( $fopen, "Kristall Panel ERROR LOGS\n$username ({$_SERVER["REMOTE_ADDR"]}) - [ $date ] => $did" );
echo("<br />----| Error logged, you may now navigate away.");
@fclose( $fopen );
}
}
#########
echo("</div>
<div class=\"header\">Powered by Kristall Panel</div>
</div>
</div>
</body>
</html>");
exit;
}
else
{
$date = gmdate( "d/m/Y - h:i:s" );
@mysql_query( "INSERT INTO `" . TABLEPREFIX . "log` (`username`, `did`, `date`, `ip`) VALUES ('$username', '$did', '$date', '{$_SERVER["REMOTE_ADDR"]}')" )
or $this->log( "MySQL Error", mysql_error( ), 1 );
}
}
function nav( $level = null )
{
if( $level == "normal" )
{
$_SESSION["nav"] = "normal";
}
elseif( $level == "admin" && $this->get_info( "level" ) == "Administrator" || $level == "admin" && $this->get_info( "level" ) == "Super Administrator")
{
$_SESSION["nav"] = "admin";
}
else
{
$_SESSION["nav"] = "normal";
}
}
function get_nav()
{
if( $_SESSION["nav"] == "admin" )
{
echo("<div class=\"selectmenuleft\"><a href=\"?nav=normal\">Main Links</a></div>
<div class=\"selectmenurightg\"><a href=\"?nav=admin\">Admin Links</a></div>");
}
else
{
echo("<div class=\"selectmenuleftg\"><a href=\"?nav=normal\">Main Links</a></div>
<div class=\"selectmenuright\"><a href=\"?nav=admin\">Admin Links</a></div>");
}
}
function get_content( $page = null )
{
if( $page == "" )
{
include( "pages/welcome.php" );
}
else
{
$page = $this->clean( $page, 2 );
if( file_exists( "pages/$page.php" ) )
{
include( "pages/$page.php" );
}
else
{
$this->log( $this->get_info( "username" ), "attempted to access a faulty page, the page was ( $page.php )" );
include( "404.php" );
}
}
}
function meta_redirect( $url, $time )
{
$url = $this->clean( $url );
echo( "<meta http-equiv=\"refresh\" content=\"$time;url=main.php$url\">" );
}
function gmt_curtime() // Because php time is **** and wont record DST
{
$checkdst = date( "I" );
$date = gmdate( "H:i:s" );
if( $checkdst == 1 )
{
$splittime = split( ":", $date );
$hour = $splittime[0] + 1;
if($hour > 23) // Are we at 11pm (E.g, is it reporting 24:00 instead of 23:00)
{
$hour = "00";
}
$newdate = $hour . ":" . $splittime[1] . ":" . $splittime[2];
return( "$newdate" );
}
else
{
return( "$date" );
}
}
function is_admin( $for = null ) // Specific page admins :P
{
$for = $this->clean( $for ); // Clean it up (do in mr bean voice, funny).
$for = strtolower( $for ); // Case ******ry.
if( $for == "timetable" )
{
$levels = array( "Super Administrator" => true,
"Administrator" => true,
"Head DJ" => true,
"Senior DJ" => false,
"DJ" => false,
);
if( $levels[$this->get_info(" level" )] == true )
{
return true;
}
else
{
return false;
}
}
}
}
?>
OOP isnt dont because it looks cleaner/nicer. no one gives a crap about that, proper indenting and commenting can do that without oop useage anyway. Its is powerful features, ease of updating and efficany it can add which would be the use. Why have 2 simlar functions in full when u can just one full and inhert to get the other?
Urmm, whats the point of that? Do you actualy know what those functions do? Your decodeing a encoded string... when its been run though an md5 function? Why??Both which make the code more professional;
Classes for good organisation.
Clean code for ease of reading
Clean code for ease of debugging!
Oh btw simon, thanks for using my encryption style :rolleyes:
I like the publicityPHP Code:function encrypt($string) {
$string = md5($string);
$string = base64_encode($string);
$string = md5($string);
$string = base64_decode($string);
$string = md5($string);
$a1 = strlen($string);
$a2 = base64_decode($string);
$a3 = rand(10000, 999999);
$a4 = "". $a1 ."". $a2 ."". $a3 ."". $a1 ."";
$crypt = md5($a4);
$string = crypt($crypt, "POWERpanelEncryptionOhYeah!lulsSMELLSLIKECHICKEN4");
return $string;
## OUTPUTTED WITH _VERY_ STRONG ENCRYPTION
}
*(Seriously)*
It would ALOT more efficent and equaly secure just to salt and pepper the md5 function, like a sain person would...
Want to hide these adverts? Register an account for free!