Skip to content

Commit

Permalink
novenber
Browse files Browse the repository at this point in the history
  • Loading branch information
tradesouthwest committed Nov 19, 2015
1 parent 50a73a7 commit 7b8057e
Show file tree
Hide file tree
Showing 68 changed files with 5,574 additions and 14 deletions.
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Details NanoBlog
Small foot-print nano blog platform
# TSW Details Nano Blog

## Overview
* PHP, HTML5, Twitter Bootstrap, jQuery
* Small foot-print blog platform
Expand All @@ -19,31 +19,38 @@ Small foot-print nano blog platform
## Code Example
Example of security measures using PDO and PHP5 var_filters
```
$prv_pub = filter_var( 1, FILTER_VALIDATE_INT);
// grab all non-private items from db
$prv_pub = filter_var( 1, FILTER_VALIDATE_INT );
//Grab all non-private items from db
require_once 'inc/dbh.php';
$sql = "SELECT * FROM tsw_details WHERE prv = $prv_pub";
$result = $dbh->query($sql);
// Parse returned data, and displays them
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
$idd_int = $row['idd']; if (!filter_var($idd_int, FILTER_VALIDATE_INT) === false) {
$sql = "SELECT * FROM tsw_details WHERE prv = $prv_pub"; //Placeholder not used(integer clean)
$result = $dbh->query( $sql );
//Parse returned data, and displays them
while( $row = $result->fetch( PDO::FETCH_ASSOC )) {
$idd_int = $row['idd']; if( !filter_var( $idd_int, FILTER_VALIDATE_INT ) === false ) {
```

## Motivation
Main motive is to advance the use of PHP out-of-the-box coding over MVC and framework deployment of a CMS. All code for the core application is written and executed in PDO so that any intermediate coder can run their website with a zero learning learning curve. There may be many whom disagree with my intentions to promote "less" MVC but this project is for intermediate learners of PDO and will remain devoted to those people so that the basics of PHP can be understood and the scope of applying PDO and PHP in there "raw" forms will promolgate better understanding of coding.

## Installation
Very basic PHP Apache Server, LAMP style install:
* create a database or just add the one table to an existing database
* the table is in the `inc` directory; file named `sql.txt`
* add settings in file `inc/settings.php` and connection in `inc/dbh.php`
* Create a database or just add the tables to an existing database
* The tables are in the `inc` directory; file named `sql.txt`
* You may want to change the URL in `tsw_settings` before adding tables!!!
* Add database connection credentials in `inc/dbh.php`
*
* You can register as a new editor or use default in `inc/settings.php`
* IMPORTANT!
* Remember this is viewable on Github so you better change login ASAP

demo: http://tradesouthwest.com/dev/details

## Contributors
Open for contributions.
thanks http://jqueryte.com/ - jQuery TE
thanks http://www.daveismyname.com PHP Pagination Class
thanks Twitter Bootstrap

## License
Licensed under MIT License (MIT).
http://opensource.org/licenses/MIT
http://opensource.org/licenses/MIT
38 changes: 38 additions & 0 deletions admin/admin-list.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* TSW Details NanoBlog
* Author: Larry Judd Oliver @tradesouthwest | http://tradesouthwest.com/details
* Contributors in readme.md file
* License in LICENSE.md file
*/
include 'header.php';
?>

<title>Dev App for Looping Details</title>
</head>
<body>

<?php include 'admin-nav.php'; ?><div class="clearfix"></div>

<div class="container">
<div class="row">

<header class="col-md-12 text-center">
<h3 class="page-header">Admin Control Panel</h3>
</header>

</div>
</div>

<div class="container">
<div class="row">

<div class="col-md-12 col-sm-12">

<?php include 'details-list.php'; ?>

</div>

</div>
</div>
<?php include 'footer.php'; ?>
24 changes: 24 additions & 0 deletions admin/admin-nav.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php"><img src="../lib/img/tsw-logoem.png" /></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav grad-menu">
<div class="btn-group btn-group-sm list-inline" id="admin-nav-top">
<li><a class="btn btn-default" href="../index.php" title="forms">Read Articles</a></li>
<li><a class="btn btn-default" href="form-in.php" title="forms">Write Article</a></li>
<li><a class="btn btn-default" href="admin-list.php" title="forms">List Articles</a></li>
<li><a class="btn btn-default" href="index.php" title="lists">Config</a></li>
</div>
</ul>
<h1 id="nav-header-title" class="nopadding"><?php esc( $det_name ); ?></h1>
</div><!--/.nav-collapse -->
</div><!--/.container-fluid -->
</nav>
Loading

0 comments on commit 7b8057e

Please sign in to comment.