Mojo Blogging SystemA Basic Blogging system With Normal features and good perfomence - ish
Whats the point of this Blog script?
My aunt Asked me if i could make a blogging system under 3 hours. sadly i was full of myself so attempted and failed but i still wanna make this blogging system!!Features So far :
- account (untested)
- post, and view blog posts
Features Coming:
- Advance Account controle
- PHP powered CSS so users have full Control of what there Blog looks like!
- comments, rating, & sharring
- admin control
- login/register/logout ( its all there but u gotta create forms and others ..ect )
- Better Look and more control
Design Notes:
PHP Side:
Not The Final Code.
CSS Side:
So More gonna be edited, deleted, and added based of early release
HTML :
Barley started so don't comment about it
Other:
Just started about to get hard on developments Ass
Snippit:
Code:
<?php
################################################
# MojoBLOG - Created By GarettMcCarty
################################################
class core {
private $sqlink;
private $sqldatabase;
public function connect($host,$user,$pass,$database,$con = 1)
{
$this->sqlink = mysql_connect($host,$user,$pass,$con);
$this->sqldatabase = mysql_select_db($database, $this->sqlink);
if((!$this->sqlink) or (!$this->sqldatabase)) {
die("<center><b>Mojo Blogging System</b><br /><p> Your Mojo Blog Couldnt Connect becouse ".mysql_error());
return false;
}
return True;
}
public function clean($post) {
return mysql_real_escape_string($post);
}
public function post() {
$news_title = $this->clean($_POST['news_title']);
$news_summary = $this->clean($_POST['news_summary']);
$news_content = $this->clean($_POST['news_content']);
$sql = "INSERT INTO `news_posts` (`id`, `title`, `summary`, `content`, `author`) VALUES (NULL, '".$news_title."', '".$news_summary."', '".$news_content."', '".$_SESSION['username']."');";
return mysql_query($sql);
}
public function delete()
{
}
public function displayblog() {
$query = mysql_query("SELECT * FROM news_posts LIMIT 0,5");
while($result = mysql_fetch_array($query)) {
print "<h2 class=\"title\">".$result['title']."</h2>".PHP_EOL;
print "<em><small><pre>".$result['summary']."</pre></em></small>".PHP_EOL;
print "<p>".$result['content']."</p>".PHP_EOL;
print "<div align=\"right\">".$result['author']."</div>".PHP_EOL;
}
}
}
?>