Removed sample site, will be replaced with wiki entries.

This commit is contained in:
Josh Sherman 2010-10-14 20:11:15 -04:00
parent 1cb7980353
commit 186d57f648
10 changed files with 0 additions and 168 deletions

View file

@ -1 +0,0 @@
This is a sample site running in PICKLES.

View file

@ -1,20 +0,0 @@
# Sample Apache Virtual Host Entry
#
# If you'd rather not do it this way, the aliases can either be omitted
# entirely (at the loss of utilizing shared PICKLES static content) or it can
# be alternately accomplished via symlinks within your site's document root.
#
# As for the PHP include_path (which is very mandatory) you could set it
# directly in the php.ini file, or simply set the include_path with ini_set()
# at the top of index.php (the sample has the line commented out for
# reference.
#
<VirtualHost *>
ServerName yoursite.com
ServerAdmin your@email.com
DocumentRoot /path/to/your/site/public
Alias /pickles/css /path/to/pickles/css
Alias /pickles/js /path/to/pickles/js
Alias /pickles/images /path/to/pickles/images
php_value include_path .:/path/to/pickles
</VirtualHost>

View file

@ -1,13 +0,0 @@
[site]
disabled = false ; Change to 'true' to take a site down and display a down for maintenance message
[module]
default = posts ; Default module to be loaded when no module is specified
template = index ; Main template (wrapper if you will) Typically 'index', but you can name it whatever (sans extension)
session = true ; Whether or not to use PHP sessions
[database]
hostname = localhost
username = username
password = password
database = pickles_blog

View file

@ -1,36 +0,0 @@
<?php
/**
* Post Model
*
* PHP version 5
*
* Licensed under the GNU General Public License Version 3
* Redistribution of these files must retain the above copyright notice.
*
* @package PICKLES
* @author Josh Sherman <josh@phpwithpickles.org>
* @copyright Copyright 2007-2010, Gravity Boulevard, LLC
* @license http://www.gnu.org/licenses/gpl.html GPL v3
* @link http://phpwithpickles.org
*/
class Post extends Model
{
/**
* Table Name
*
* @access protected
* @var string
*/
protected $table = 'pickles_posts';
/**
* Columns to Order By
*
* @access protected
* @var string
*/
protected $order_by = 'posted_at DESC';
}
?>

View file

@ -1,13 +0,0 @@
<?php
class posts extends Module
{
public function __default()
{
$post = new Post(true); // You pass true to tell it to pull everything, this can be modified to support pagination
return array('posts' => $post->records);
}
}
?>

View file

@ -1,28 +0,0 @@
# Sets up ETags
FileETag MTime Size
# Prevent session IDs from appearing
php_value session.use_only_cookies 1
php_value session.use_trans_sid 0
# Sets up the mod_rewrite engine
RewriteEngine on
RewriteBase /
# Strips the trailing slash
RewriteRule ^(.+)/$ $1 [R]
# Makes sure to skip rewriting actual files and directories
RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule .* - [L]
# One rewrite to rule them all
RewriteRule ^(.+)$ index.php?request=$1 [NC,QSA]
# Blocks access to .htaccess
<Files .htaccess>
order allow,deny
deny from all
</Files>

View file

@ -1,8 +0,0 @@
<?php
// ini_set('include_path', ini_get('include_path') . ':/path/to/pickles');
require_once 'pickles.php';
new Controller();
?>

View file

@ -1,12 +0,0 @@
--
-- Table structure for table `posts`
--
CREATE TABLE IF NOT EXISTS `pickles_posts` (
`id` int(1) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`body` text COLLATE utf8_unicode_ci NOT NULL,
`posted_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Sample Blog Posts Table for PICKLES' AUTO_INCREMENT=1 ;

View file

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Sample PICKLES Site</title>
</head>
<body>
<h1>PICKLES Blog</h1>
<h2>Super simple example of PICKLES in action</h2>
<?php
// Loads the module's template
require_once $template;
?>
</body>
</html>

View file

@ -1,23 +0,0 @@
<?php
// This sanity check could have been in the module and different variables
// passed to the template based of if there are any posts
if (count($module['posts']) == 0)
{
echo 'No posts to display';
}
else
{
// Loops through the posts and displays them
foreach ($module['posts'] as $post)
{
// Nested templates are supported (since it's just PHP) so if you wanted
// to, you could abstract the next block into a another file
echo '<h3>' . $post['title'] . '</h3>';
echo $post['body'] . '<br /><br />';
echo 'Posted at ' . date('g:ia on m/d/Y');
echo '<hr />';
}
}
?>