Renamed blogsite.php to index.php, updated and added some links and rewrote README to match

This commit is contained in:
Jack-Benny Persson 2014-06-26 19:46:59 +02:00
parent 0e072a2152
commit d5077b085a
7 changed files with 31 additions and 39 deletions

View File

@ -1,24 +1,10 @@
simplog simplog
======= =======
simplog is a (very) simple PHP blog engine. It's supposed to be implemented into simplog is a simple PHP blog engine. It's supposed to either be implemented into
an existing webpage since this in only the engine part and does not contain a an existing webpage (simplog.php) since this in only the engine part or being
complete webpage/blog of any kind. It's also intended to only have a single run as is with the included index.php which is a simple webpage easy to
user. customize.
What's missing?
---------------
Not much really as of 2013-07-27, depending on how you plan to use it. Included
is a template to create the MySQL table, a small HTML and PHP file to create
new posts, a simplog.php file that displays your posts and a config file to
connect to a database and set number of posts per page. Now there is also a
HTML file to find your posts and edit/update them.
You no longer need to protect the user/ directory yourself. Authentication is
done using the database.
Since of 2014-06-25 there is also nice HTML-template for a real blog. So now
it's possible to just upload it and start blogging away!
Usage Usage
----- -----
@ -32,31 +18,29 @@ on Edit post (in /user) and fill in the date and title of the post you want to
edit. Hit Find post to find the post or posts matching. Now you can edit the edit. Hit Find post to find the post or posts matching. Now you can edit the
post. post.
From 2014-06-26 there is a index.php file included with a simple yet fancy
webpage one can use for everyday blogging. It's simple to customize since all of
the design, colors etc resides in a single CSS file.
How do I create the MySQL table? How do I create the MySQL table?
-------------------------------- --------------------------------
Either create a new mysql user and database or use an existing one, then either: Either create a new mysql user and database or use an existing one, then:
Option 1) Go to http://mydomain.tld/path-to-simplog/install.php Go to http://mydomain.tld/path-to-simplog/install.php
or... On this page you enter a password for the admin user. The admin user is unique
in the MySQL table so once you've entered a password for the user you cannot
Option 2) Run this command from the shell: run it again. But to really be on the safe side you should remove install.php
after you have entered a password for admin.
mysql -u <user> -p <database> < blogtable.sql Once you have entered your desired password you have created the table for the
blog and can start filling it with blog posts.
You'll be asked to enter the password for the user, enter it.
Now you have created the table for the blog. Now you can start filling it with
blog posts.
Screenshot Screenshot
---------- ----------
![alt text](screenshots/blog.png "Blog") ![alt text](screenshots/blog.png "Blog")
Contributing Contributing
------------ ------------
Any contributions are welcome since this is a work in progress. Any contributions are welcome since this is a work in progress.

View File

@ -8,7 +8,7 @@
</tr> </tr>
<tr> <tr>
<td><strong>Password</strong></td> <td><strong>Password</strong></td>
<td><input type="text" name="password" size="20" maxlength="20"></td> <td><input type="password" name="password" size="20" maxlength="20"></td>
</tr> </tr>
<tr> <tr>
<td colspan=2 align="center"><input type="submit" value="Login"></td> <td colspan=2 align="center"><input type="submit" value="Login"></td>

View File

@ -27,7 +27,7 @@
<meta name="description" content="jackbenny" /> <meta name="description" content="jackbenny" />
<meta name="keywords" content="linux,html,css" /> <meta name="keywords" content="linux,html,css" />
<meta name="author" content="Jack-Benny Persson" /> <meta name="author" content="Jack-Benny Persson" />
<link type="text/css" rel="stylesheet" href="blogsite.css"> <link type="text/css" rel="stylesheet" href="stylesheet.css">
</head> </head>
<body> <body>
@ -39,6 +39,7 @@
<li class="link"><a href="#">About</a></li> <li class="link"><a href="#">About</a></li>
<li class="link"><a href="#">Articles</a></li> <li class="link"><a href="#">Articles</a></li>
<li class="link"><a href="#">Contact</a></li> <li class="link"><a href="#">Contact</a></li>
<li class="link"><a href="user/">Login</a></li>
</ul> </ul>
</div> </div>
<div id="logo"> <div id="logo">
@ -67,7 +68,9 @@
$query = "SELECT * FROM blog ORDER BY date DESC LIMIT $start, $query = "SELECT * FROM blog ORDER BY date DESC LIMIT $start,
$posts_per_page"; $posts_per_page";
$result = mysql_query($query) $result = mysql_query($query)
or die("No matching queries..."); or die("No matching queries...<br /> It seems you either " .
"haven't started blogging yet or haven't installed the".
" the database table yet<br/>");
// Printing posts in HTML // Printing posts in HTML

View File

@ -16,8 +16,10 @@ if (!mysql_query($query))
die ("Something went wrong!"); die ("Something went wrong!");
} }
print "Post added"; print "Post added";
?>
<br/>
<a href="../index.php">Back to simplog</a>
<?php
// Close MySQL link // Close MySQL link
mysql_close($link); mysql_close($link);

View File

@ -6,7 +6,7 @@ setcookie("session", "", time()-3600);
<p> <p>
You have been logged out succesfully!<br /> You have been logged out succesfully!<br />
<a href="../simplog.php">Return to simplog</a> <a href="../index.php">Return to simplog</a>
</p> </p>
<?php <?php

View File

@ -18,7 +18,10 @@ if (!mysql_query($query))
} }
print "Post updated"; print "Post updated";
?>
<br/>
<a href="../index.php">Back to simplog</a>
<?php
// Close MySQL link // Close MySQL link
mysql_close($link); mysql_close($link);