SatanCMS - PHP, HTML, CSS, Updated Thread.

Status
Not open for further replies.

Satan

Professional Pornstar
Aug 27, 2011
266
106
9JTof.png
Hello, today I'll be introducing a new CMS which will have loads of features.​
this project started like 20 minutes ago, don't rant about how it's barely done, I'm also looking for coders.​
Overall Project Completion - 13%
Login - 100%
User System - 93%
MySQL Functions - 22%
Basic Template Layout - 5%
Admin CP/Management System - 0%
News System (Implemented) - 100%
To avoid spending more time on this thread, all other features are at 0%.​
Feature List
  • User System​
  • News System​
  • Sleek, colorful HTML Template design​
  • Easy to manage​
  • Easily customized​
  • Thread system​
  • Admin control panel​
  • Nodes​
  • Template System​
  • MUCH MORE.​
Snippets (As Of Now).
Login Index:​
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<?php
 
// Inialize session
session_start();
 
// Check, if user is already login, then jump to secured page
if (isset($_SESSION['username'])) {
        header('Location: securedpage.php');
}
 
?>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 
    <title>Login Page</title>
 
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" type="text/css" href="style.css" />
</head>
 
<body>
 
    <form id="login-form" action="#" method="post">
        <fieldset>
 
            <legend>Log in</legend>
 
            <label for="login">Email</label>
            <input type="text" id="login" name="login"/>
            <div class="clear"></div>
 
            <label for="password">Password</label>
            <input type="password" id="password" name="password"/>
            <div class="clear"></div>
 
            <label for="remember_me" style="padding: 0;">Remember me?</label>
            <input type="checkbox" id="remember_me" style="position: relative; top: 3px; margin: 0; " name="remember_me"/>
            <div class="clear"></div>
 
            <br />
 
            <input type="submit" style="margin: -20px 0 0 287px;" class="button" name="commit" value="Log in"/>
        </fieldset>
    </form>
    <form method="POST" action="loginproc.php">
</body>
 
</html>
Loginproc.php​
PHP:
<?php
 
// Inialize session
session_start();
 
// Include database connection settings
include('config.inc');
 
// Retrieve username and password from database according to user's input
$login = mysql_query("SELECT * FROM user WHERE (username = '" . mysql_real_escape_string($_POST['username']) . "') and (password = '" . mysql_real_escape_string(md5($_POST['password'])) . "')");
 
// Check username and password match
if (mysql_num_rows($login) == 1) {
        // Set username session variable
        $_SESSION['username'] = $_POST['username'];
        // Jump to secured page
        header('Location: securedpage.php');
}
else {
        // Jump to login page
        header('Location: index.html');
}
 
?>
Config.inc (For login)​
PHP:
<?php
 
$hostname = 'localhost';        // Your MySQL hostname. Usualy named as 'localhost', so you're NOT necessary to change this even this script has already online on the internet.
$dbname  = 'dbname'; // Your database name.
$username = 'root';            // Your database username.
$password = 'password';                // Your database password. If your database has no password, leave it empty.
 
// Let's connect to host
mysql_connect($hostname, $username, $password) or DIE('Connection to host is failed, perhaps the service is down!');
// Select the database
mysql_select_db($dbname) or DIE('Database name is not available!');
 
?>
Logout.php​
Code:
<?php
 
// Inialize session
session_start();
 
// Delete certain session
unset($_SESSION['username']);
// Delete all session variables
// session_destroy();
 
// Jump to login page
header('Location: index.php');
 
?>

Style.css​
Code:
{ margin: 0; padding: 0; }
body                { font-family: Georgia, serif; background: url(images/login-page-bg.jpg) top center no-repeat #c4c4c4; color: #3a3a3a;  }
 
.clear                { clear: both; }
 
form                { width: 406px; margin: 170px auto 0; }
 
legend                { display: none; }
 
fieldset            { border: 0; }
 
label                { width: 115px; text-align: right; float: left; margin: 0 10px 0 0; padding: 9px 0 0 0; font-size: 16px; }
 
input                { width: 220px; display: block; padding: 4px; margin: 0 0 10px 0; font-size: 18px;
                      color: #3a3a3a; font-family: Georgia, serif;}
input[type=checkbox]{ width: 20px; margin: 0; display: inline-block; }
 
.button                { background: url(images/button-bg.png) repeat-x top center; border: 1px solid #999;
                      -moz-border-radius: 5px; padding: 5px; color: black; font-weight: bold;
                      -webkit-border-radius: 5px; font-size: 13px;  width: 70px; }
.button:hover        { background: white; color: black; }
Securedpage.php (Redirects to after login)​
PHP:
<?php
 
// Inialize session
session_start();
 
// Check, if username session is NOT set then this page will jump to login page
if (!isset($_SESSION['username'])) {
        header('Location: index.php');
}
 
?>
<html>
 
<head>
  <title>Secured Page</title>
</head>
 
<body>
 
<p>This is secured page with session: <b><?php echo $_SESSION['username']; ?></b>
<br>You can put your restricted information here.</p>
<p><a href="logout.php">Logout</a></p>
 
</body>
 
</html>
Register.html (basic layout and sql excluded, being worked on.)​
HTML:
<!DOCTYPE html>
<html>
 
 
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Register</title>
 
<link href='http://fonts.googleapis.com/css?family=Oswald:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
 
<body>
    <div id="realbody"></div>
    <!-- START WRAPPER -->
    <div id="wrapper">
        <a class="to-top">TOP</a>
 
        <!-- START FIRST LEVEL -->
        <div class="first-level">
 
            <!-- start logo and welcome -->
            <div class="left-side">
                <!-- logo -->
<h1>Register<br /><span class="colored"></span></h1>
<p>
<b>First Name:</b> <input type="text" name="firstname"><br>
</p>
<b>Email Address:</b> <input type="text" name="email">
<p>
<b>Username:</b> <input type="text" name="username">
</p>
<p>
<b>Time Zone:</b> <input type="text" name="timezone">
</p>
</p>
create a news article (implemented).​
PHP:
<?php
/*************************************************
* Micro News
* SatanCMS
* Version: 1.8
* Date Updated: 08-19-12
*
*
****************************************************/
 
if (!isset($_POST['submit'])) {
 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title>Micro News</title>
  <link href="style/style.css" rel="stylesheet" type="text/css" />
  <script language="javascript" type="text/javascript" src="js/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
    mode : "textareas",
    theme : "advanced",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
 
});
</script>
</head>
 
<body>
  <div id="main">
    <div id="caption">Add News</div>
      <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
        News title:<br/>
        <input type="text" name="title" size="40"/><br/><br/>
        Content:<br/>
        <textarea name="newstext" rows="15" cols="67"></textarea><br/>
        <center><input type="submit" name="submit" value="Save" /></center>
    </form>
 
      <div id="source">Micro News 1.0</div>
  </div>
</body>
 
<?php } else {
  $newsTitel  = isset($_POST['title']) ? $_POST['title'] : 'Untitled';
  $submitDate  = date('Y-m-d g:i:s A');
  $newsContent = isset($_POST['newstext']) ? $_POST['newstext'] : 'No content';
 
  $filename = date('YmdHis');
  $f = fopen('news/'.$filename.".txt","w+");
  fwrite($f,$newsTitel."\n");
  fwrite($f,$submitDate."\n");
  fwrite($f,$newsContent."\n");
  fclose($f);
 
  header('Location:news.php');
}
?>
news.php (displays news).​
PHP:
<?php
/*************************************************
* Micro News
* SatanCMS
****************************************************/
 
// This function reads all available news
function getNewsList(){
 
  $fileList = array();
 
    // Open the actual directory
    if ($handle = opendir("news")) {
        // Read all file from the actual directory
        while ($file = readdir($handle))  {
            if (!is_dir($file)) {
              $fileList[] = $file;
          }
        }
    }
 
    rsort($fileList);
 
    return $fileList;
}
 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title>Micro News</title>
  <link href="style/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
  <div id="main">
    <div id="caption">News</div>
    <table width="100%">
    <?php
 
      $list = getNewsList();
      foreach ($list as $value) {
          $newsData = file("news/".$value);
          $newsTitle  = $newsData[0];
        $submitDate = $newsData[1];
        unset ($newsData['0']);
        unset ($newsData['1']);
   
        $newsContent = "";
        foreach ($newsData as $value) {
              $newsContent .= $value;
        }
   
          echo "<tr><th align='left'>$newsTitle</th><th align='right'>$submitDate</th></tr>";
          echo "<tr><td colspan='2'>".$newsContent."<br/><hr size='1'/></td></tr>";
      }
    ?>
    </table>
    <div id="source">Micro News 1.0</div>
  </div>
</body>
config.php​
PHP:
<?php
//main path to resources
$resources = dirname(__DIR__);
//$root = dirname(dirname(__DIR__));
$root = dirname($resources);
 
 
//configuration array to hold
//vital information
$config = array(
    "db" => array(
            "username" => null,
            "password" => null,
            "host" => null,
            "database" => null

Screenshots
login index​
MJFKp.png
root folder​
UEYpe.png
That's it for now!​
Remember: This thread is always updated and looking for coders!​
 

Satan

Professional Pornstar
Aug 27, 2011
266
106
Thanks guys, Any help is greatly appreciated.
 

Tronscript

Member
Aug 18, 2012
93
8
This looks fairly decent. If I may ask, what font is the text for your logo?
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,194
3,901
Thread cleaned, in the future guys, use the report feature.
--
Looks nice, good luck.

EDIT: You sure this is actually your code? I found it here, mostly word for word, and some of the file names are the same.. ' '.

If you're actually struggling, check out PHPAcademy, here is a direct playlist that should help;
 

Satan

Professional Pornstar
Aug 27, 2011
266
106
Thread cleaned, in the future guys, use the report feature.
--
Looks nice, good luck.

EDIT: You sure this is actually your code? I found it here, mostly word for word, and some of the file names are the same.. ' '.

If you're actually struggling, check out PHPAcademy, here is a direct playlist that should help;
Someone ripped it :/ Yes this really is my code i promise. I guess that's what i get for sharing and un-finished project :(

 

Satan

Professional Pornstar
Aug 27, 2011
266
106
not to be a douche or anything.. but you stated this project started 20 mins ago (from when you posted this thread), but looking at sledmore's posts, it shows that the code was posted in June...

weird.
well the config.php i used from cookiemonsta's CMS and just implemented it.
 

Satan

Professional Pornstar
Aug 27, 2011
266
106
I don't see the whole point of tearing this post apart.

Give this guy to do what he wants to either if or if not he grabbed codes from websites he's still in to the learning part so the design is pretty nice but like Sledmore said not sure if this is really your code doesn't seem to be because I've recently found these same codes too.

Don't see why someone would be ripping and then giving you the code that's very odd and very strange it doesn't seem something that would be happening.

Good luck anyway.
Thanks for support, code is mine.
 

Satan

Professional Pornstar
Aug 27, 2011
266
106
I have a dedi which i sell hosting off of nub you mad cause you cant code
Who ever said i was mad dude? You can't just label it and say "You can't code". Because they're so many languages of code. I can "code". I can code. 
I don't really believe so but good luck anyway it's the only thing i can say i can only know that the css code appeared to be yours and so the design but not sure about the whole PHP part.

I've once again found the whole part on the Internet so it really makes me curious and makes me really doubt.

Good luck!



You are really some stupid person who likes to tear people their work off obviously as i noticed your post that is not making sense at all.

This might not be his codes but at least wish him luck and don't grief his post.
Well don't you think if i ripped the code it wouldn't have set out a big thread, put a little logo together, Design CSS, and for what? a few likes?

Thread Update: Added Register.HTML (SQL Excluded and still being worked on, bare with me)
 
Status
Not open for further replies.

Users who are viewing this thread

Top