Welcome To TutorialBase

Please feel free to Browse our tutorials. Just selet a catagory down the side, and take a look through our tutorials.
'.$row['tutorialname'].'

By '.$row['creator'].' in '.$row['category'].''; echo '
'.$row['description'].'

'; } class display { function pagination($rows, $per_page, $current_page, $page_link) { global $core,$C; $this->pages = ceil($rows / $per_page); if($this->pages == 1) { return; } $output = "Pages: "; // Should we show the FIRST PAGE link? if($current_page > 2) { $output = ''; } // Should we show the PREVIOUS PAGE link? if($current_page > 1) { $previous_page = $current_page - 1; $output = ' page="'. $previous_page .'" title="Previous Page">'; } // Current Page Number $output = '[ '. $current_page .' ]'; // Should we show the NEXT PAGE link? if($current_page < $this->pages) { $next_page = $current_page + 1; $output = ''; } // Should we show the LAST PAGE link? if($current_page < $this->pages - 1) { $output = ' '; } // Return the output. return $output; } } $display = new display; echo $display->pagination($articles_in_db, $articles_per_page, $current_page, $install_adress); } elseif ($_GET['action'] == 'login' ) { if ($_SESSION["valid_user"]) { echo 'You are already loged in Click here to return to the index.'; } else { if ($_GET["op"] == "login") { if (!$_POST["username"] || !$_POST["password"]) { die("You need to provide a username and password."); } $username = mysql_real_escape_string($_POST["username"]); $password = mysql_real_escape_string($_POST["password"]); $password = combo_hash($password); // Create query $q = "SELECT * FROM `dbusers` " ."WHERE username='".$username."' " ."AND passw= '".$password."' " ."LIMIT 1"; // Run query $r = mysql_query($q); if ( $obj = @mysql_fetch_object($r) ) { // Login good, create session variables $_SESSION["valid_id"] = $obj->id; $_SESSION["valid_user"] = $_POST["username"]; $_SESSION["valid_time"] = time(); // Redirect to member page echo '
Thank you for logging in. Click here to return to the index.
'; } else { // Login not successful echo '
Sorry, could not log you in. Wrong login information.
'; } } else { //If all went right the Web form appears and users can log in echo '
* Indicates required field

Log In

'; echo ''; echo ''; echo ''; echo "
"; } } } elseif ($_GET['action'] == 'register' ){ if ( $_GET["op"] == "reg" ) { $bInputFlag = false; foreach ( $_POST as $field ) { if ($field == "") { $bInputFlag = false; } else { $bInputFlag = true; } } // If we had problems with the input, exit with error if ($bInputFlag == false) { die( "Problem with your registration info. " ."Please go back and try again."); } $username = mysql_real_escape_string($_POST["username"]); $password = mysql_real_escape_string($_POST["password"]); $email = mysql_real_escape_string($_POST["email"]); $password = combo_hash($password); $q = "INSERT INTO `dbusers` (`username`,`passw`,`email`) " ."VALUES ('".$username."', " ." '".$password."', " ."'".$email."')"; $r = mysql_query($q); if ( !mysql_insert_id() ) { die("Error: User not added to database."); } else { echo "

Thanks for registering!

"; } } else { echo '
* Indicates required field

Log In

'; echo '
'; echo '
'; echo '
'; echo ''; echo "
"; } } elseif ($_GET['action'] == 'logout' ){ ##session_start(); ##session_unset(); session_destroy(); echo 'Thank you for your stay. Click here to return to the index.
'; } elseif ($_GET['action'] == 'submit' ) { if ($_SESSION["valid_user"]) { ?>

Submit a tutorial

Tutorial Details:








http//



http://




'.$row['tutorialname'].'

By '.$row['creator'].' in '.$row['category'].''; echo '
'.$row['description'].'

'; $i++; } } elseif($_GET['action'] == 'User Area') { ?>

Welcome to your user area.

Unfortunatly, there is nothing here yet.
'.$row['tutorialname'].'

By '.$row['creator'].' in '.$row['category'].''; echo '
'.$row['description'].'

'; echo 'Approve -- Trash -- Delete

'; } class display { function pagination($rows, $per_page, $current_page, $page_link) { global $core,$C; $this->pages = ceil($rows / $per_page); if($this->pages == 1) { return; } $output = "Pages: "; // Should we show the FIRST PAGE link? if($current_page > 2) { $output = ''; } // Should we show the PREVIOUS PAGE link? if($current_page > 1) { $previous_page = $current_page - 1; $output = ' page="'. $previous_page .'" title="Previous Page">'; } // Current Page Number $output = '[ '. $current_page .' ]'; // Should we show the NEXT PAGE link? if($current_page < $this->pages) { $next_page = $current_page + 1; $output = ''; } // Should we show the LAST PAGE link? if($current_page < $this->pages - 1) { $output = ' '; } // Return the output. return $output; } } $display = new display; echo $display->pagination($articles_in_db, $articles_per_page, $current_page, "index.php"); } if ($_GET['action'] == 'trashedtuts' ) { $catt = mysql_real_escape_string($_GET['cat']); $query = "SELECT * FROM tutorials WHERE approved = 'tra' ORDER BY id DESC LIMIT ".$start.", ".$end.""; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo '

'.$row['tutorialname'].'

By '.$row['creator'].' in '.$row['category'].''; echo '
'.$row['description'].'

'; echo 'Approve -- Delete

'; } class display { function pagination($rows, $per_page, $current_page, $page_link) { global $core,$C; $this->pages = ceil($rows / $per_page); if($this->pages == 1) { return; } $output = "Pages: "; // Should we show the FIRST PAGE link? if($current_page > 2) { $output = ''; } // Should we show the PREVIOUS PAGE link? if($current_page > 1) { $previous_page = $current_page - 1; $output = ' page="'. $previous_page .'" title="Previous Page">'; } // Current Page Number $output = '[ '. $current_page .' ]'; // Should we show the NEXT PAGE link? if($current_page < $this->pages) { $next_page = $current_page + 1; $output = ''; } // Should we show the LAST PAGE link? if($current_page < $this->pages - 1) { $output = ' '; } // Return the output. return $output; } } $display = new display; echo $display->pagination($articles_in_db, $articles_per_page, $current_page, "index.php"); } if ($_GET['action'] == 'trash' ) { mysql_query("UPDATE tutorials SET approved='tra' WHERE ID = '{$_GET["id"]}';"); echo "Tutorial added to trash!"; } if ($_GET['action'] == 'approve' ) { mysql_query("UPDATE tutorials SET approved='yes' WHERE ID = '{$_GET["id"]}';"); echo "Tutorial approved!"; } if ($_GET['action'] == 'delete' ) { $id = $_GET["id"]; mysql_query("DELETE FROM tutorials WHERE ID = '".$id."';"); echo "The tutorial has been deleted."; } if ($_GET['action'] == 'logout' ) { session_start(); session_unset(); session_destroy(); echo 'Thank you for your stay. Click here to return to the index.
'; } } //ROOT ONLY if ($_SESSION["valid_user"] === $rootadmin) { if ($_GET['action'] == 'modchange' ) { echo $_POST['mods']; $modarray = explode("\n", $_POST['mods']); foreach ($modarray as &$value) { $value = substr("$value", 0, -1); } $mods = implode("' , '", $modarray); $articles2 = file('constants.php'); $data = fopen("constants.php", "w"); $articles2['2'] = "\$modarray = array('$mods');\n"; $articles2 = implode('',$articles2); fwrite($data,$articles2); fclose($data); echo "Options Changed"; } if ($_GET['action'] == 'categorymod' ) { echo "

Bellow are the categorys that exist at the moment, to delete one, click the delete button (But, this will mean all tutorials under that category will no longer be displayed, you can change their categorys using My PHP admin) or to add a new one, click the add button

"; $query = "SELECT * FROM categorys"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "

".$row['categoryname'].' -- Delete

'; } echo '

Click here to add a new category'; } if (isset($_GET["deleteid"])) { $id = $_GET["deleteid"]; mysql_query("DELETE FROM categorys WHERE ID = '".$id."';"); echo 'The category has been deleted.'; } if ($_GET['action'] == 'options' ) { ?>

All the options availible are bellow.





All the mods are listed bellow, to add one, write each name on a new line, the admin doesnt need to be in the list.





Create a category

Category Details:











'; } } //Others if (!isset($_GET["action"])){ ?>

Update - 20th May

As usual, I have updated our code yet again, the new features include:
  • User controll Pannel
  • Tutorials Home Page
  • Subgroupings
FarCry - Mollio