PDA

View Full Version : Starting a company.



Dentafrice,
02-06-2007, 04:02 PM
Well for the past couple of months I have been thinking about creating a Website Design company.

It would have different departments

EX: Design, Programming, Content, Support, Project Management.

I have yet to think of a name, I started with Cabtech Design.

I also need some people to help out. I can host and get domain and things like that.

Would anyone else be interested in helping?

Caleb

Aflux
02-06-2007, 04:03 PM
No offence but what's the point when us prime designs can go freelance?

Dentafrice,
02-06-2007, 04:12 PM
us prime designs?

I just want to code :( And can't find anything to code.

Invent
02-06-2007, 04:14 PM
Code a good CMS.

Dentafrice,
02-06-2007, 04:15 PM
Thats a good idea.... very good.

Sygon..
02-06-2007, 09:51 PM
From my experience going solo is better.

:Liam
02-06-2007, 09:53 PM
From my experience going solo is better.
I agree, I run a hosting company, I used to do it with another person but we used to argue alot. Its easier doing a company on your own, theres no one to argue with.

LeftForDead
05-06-2007, 10:04 PM
I agree, I run a hosting company, I used to do it with another person but we used to argue alot. Its easier doing a company on your own, theres no one to argue with.
or hiring people who know who is the boss and who to respect

Dentafrice,
05-06-2007, 10:07 PM
True, but you can't do everything your self. Maybe have a content team, designing team, coding team, sales team

Diablo10
05-06-2007, 10:27 PM
Id be happy to be apart of the sales team, As long as there is some sort of payment or even a free design or something

Agnostic Bear
06-06-2007, 09:18 AM
Thats a good idea.... very good.


You can't code well enough to code a professional CMS, it'd just end up as a rookie CMS with rookie coding.

Hypertext
06-06-2007, 01:38 PM
I tried to do it with someone, ruined my life with him, and I forgot about it, but i'm starting up again on my own, also coding with someone is VERY hard.. If you have a good knowledge of PHP make a website for your company, using mysql & php, I did it, I think i have it on my laptop, i'll upload it later.. and start fresh. But if I get some work I can't do (AJAX) I'll hand it over to you guys here, you take pay, no commision (i'm not that mean), in the meantime, i'll start to worth on my JS and AJAX, also do a flash banner ^^ i know flash back to front.

Dentafrice,
06-06-2007, 07:20 PM
You can't code well enough to code a professional CMS, it'd just end up as a rookie CMS with rookie coding.
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.

Invent
06-06-2007, 08:41 PM
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.
I AGREE SIR....apart from the Nymrod part as I don't speak to him D:

Dentafrice,
06-06-2007, 08:52 PM
Yeah but he thinks he is all that, omg you suck at coding and you are unprofessional, when he is just the same.

Mentor
06-06-2007, 09:05 PM
Well, good luck with the company, also if you ever do start getting alot of buessness, you could always contract me in to do somthing as a freelancer if you need to, since i could do with a little more paying work comeing in :p

Dentafrice,
06-06-2007, 09:44 PM
Okay, I will keep that in mind. The thing I am worried about is the design department.

Thats something I have no clue about.

Colin-Roberts
06-06-2007, 10:01 PM
i'm not the best designer in the world.. but i could probly manage to run the design part.

Dentafrice,
06-06-2007, 10:05 PM
I am hoping for

Coding >>
-- Leader
-- coder
-- coder

Design >>
-- Leader
-- designer
-- designer

Colin-Roberts
06-06-2007, 10:29 PM
what do leaders do>?

Dentafrice,
06-06-2007, 10:47 PM
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.

Agnostic Bear
07-06-2007, 09:49 AM
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.


I AGREE SIR....apart from the Nymrod part as I don't speak to him D:


Yeah but he thinks he is all that, omg you suck at coding and you are unprofessional, when he is just the same.




<?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;
}
}
}
}

?>


SAY IT AGAIN, GO ON, SAY IT AGAIN

Invent
07-06-2007, 03:00 PM
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:

Agnostic Bear
07-06-2007, 04:04 PM
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:

Wasn't directed at you.

Dentafrice,
07-06-2007, 08:00 PM
whoo hooo a class, and clean code, bahumbug

Oni
07-06-2007, 08:11 PM
I could do some designing and obviously flash too.

Dentafrice,
08-06-2007, 12:24 AM
Would you wanna join? It seems to be pretty fun.

Agnostic Bear
08-06-2007, 05:59 AM
whoo hooo a class, and clean code, bahumbug


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:



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

}

I like the publicity :D *(Seriously)*

JamesRouale
08-06-2007, 06:40 AM
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).

Mentor
08-06-2007, 04:02 PM
<?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;
}
}
}
}

?>


SAY IT AGAIN, GO ON, SAY IT AGAIN
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)

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?



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:



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

}

I like the publicity :D *(Seriously)*
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??

It would ALOT more efficent and equaly secure just to salt and pepper the md5 function, like a sain person would...

Agnostic Bear
08-06-2007, 06:46 PM
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)

1) Don't venture in to php territory against a person who's had ~3 years experience
2) I need to call it in other places, you can't see where it's being called from (different places)
3) That's perfectly fine OOP, as I said, need to call it in other places, so don't want it always on.


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.

WELL WHY DO YOU THINK I USED IT?


Why have 2 simlar functions in full when u can just one full and inhert to get the other?

I don't have 2 similar functions in full.

Mentor
08-06-2007, 07:12 PM
1) Don't venture in to php territory against a person who's had ~3 years experience
2) I need to call it in other places, you can't see where it's being called from (different places)
3) That's perfectly fine OOP, as I said, need to call it in other places, so don't want it always on.
1) wow, arnt you great, 3 years... Apart from the fact ive probably been programming longer than you, the time youve been useing it really doesn't make any odds.
2)No very well programmed then is it :p
3) Ok, that didnt make much sense, so im guessing your repeating number 2 so bulk up you bullet points count?


WELL WHY DO YOU THINK I USED IT?
Well for the reasons you said you did when asked:
"good organization"
"Clean code"


I don't have 2 similar functions in full.
I never said you did, i just said said thats why people usually do use oop though, as opposed to just organization and clean code.



Plus, you forgot to respond to my last point... i wonder why. I certainly learnt my lesson against venturing in to php territory against someone with *lightning flash* ~3 years experence **lightning flash*

Also, why do you feel so threatened by them if your "so much better"? or is there some other reason your trolling the thread?

Dentafrice,
08-06-2007, 07:24 PM
Dan seems to think he knows everything about PHP. Bag and Nets are the two most expierenced here. Alot older then you also, and I believe they are friends IRL.

Don't act like a ***** and think you know everything because its just gonna get you flamed AND proven wrong.

Okay, if a company asked you to say, design/code them a poll application for their business website, then they most likely do not know PHP. (hence they they are asking you)

So if they do not know php, why would they care if the code is not clean nor organized. If you are so good a PHP you shouldn't have to debug it, you can format it from dirty to clean code with the push of a button.

So why would someone care if the code is dirty/unorganized. Most of the time all a company wants is something that WORKS and is SECURE not CLEAN AND ORGANIZED.

They dont care as long as it is safe secure and works.

Your not better then us, someone with 3 months expierence can be way better then you.

I remember when you were learning "PHP + MySQL for dummies" long after I started PHP.

(copied carl) *lightning flash* ~3 years * lightning flash*

So don't act like a ***** after he proved you wrong many times, why decode an encoded script thats already been encrypted by MD5. You can't decode that... when you could just easily salt it.

Flisker
08-06-2007, 08:01 PM
This is exciting...

Sygon..
08-06-2007, 08:13 PM
<?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;
}
}
}
}

?>
SAY IT AGAIN, GO ON, SAY IT AGAIN

IT AGAIN, GO ON, SAY IT AGAIN

Oni
08-06-2007, 09:00 PM
Dan you cant seriously think you know more than carl or josh?

Dentafrice,
09-06-2007, 04:43 AM
lol thats what I said, lol that just made alot of people lose respect for him.

JamesRouale
09-06-2007, 07:43 PM
I find it pathetic how some people put experience over knowledge.

DiscoPat
10-06-2007, 06:20 PM
If the support is like, one person (support guy) checks the E-mails and like if its to do with lets say, programming then the support guy sends the email to the programming leader etc so everything gets sent to the right place.. If its like that i can do it :P

Dentafrice,
10-06-2007, 06:42 PM
If you would like to help out and make some $$$ PM me with what you can do,

support, advertising, designing, coding.

Rix
13-06-2007, 12:22 PM
i can design, support and code and am willing to join the team

Dentafrice,
13-06-2007, 01:26 PM
Can you please PM me rix with some examples of past layout work :)

Blinger1
14-06-2007, 01:03 PM
aww :( keep fighting about the code!!

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