PHP Classes

Simple Site Class: Simple Site Class

Recommend this page to a friend!
  Info   View files View files (98)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-30 (1 month ago) RSS 2.0 feedNot enough user ratingsTotal: 94 This week: 4All time: 9,841 This week: 24Up
Version License PHP version Categories
simple-site-class 3MIT/X Consortium ...8HTML, Databases, Content management, P...
Description 

Author

This package can be used to create database-driven Web sites.

It can load a configuration file in JSON format that defines several details of the site pages like the type of database to use, site domain, copyright, paths of different kinds of files, etc...

The main class can perform several general-purpose functions that many sites need, like page headers, banners, footers, etc...

For database access, it supports MySQL using the MySQLi extension, MySQL, and SQLite with the PDO extension.

Picture of Barton Phillips
Name: Barton Phillips is available for providing paid consulting. Contact Barton Phillips .
Classes: 5 packages by
Country: United States United States
Age: 79
All time rank: 53569 in United States United States
Week rank: 20 Up4 in United States United States Up
Innovation award
Innovation award
Nominee: 1x

Instructions

Install

There are several ways to install this project

Download The ZIP File

Download the ZIP file from GitHub. Expand it into the /var/www directory that Apache2 creates.

I have /var/www and my virtual hosts off that directory in my servers.

That way, the directory created when you unzip the download is readily available to all my virtual hosts.

Use Composer

If you have Apache or Nginx installed, root your project within your DocumentRoot ('/var/www/html' for Apache2 on Ubuntu).

Or, if you want to make a separate Apache virtual host with a registered domain name, you can make your new project in '/var/www'.

Create a directory `mkdir myproject; cd myproject`, this is your project root directory. Add the following to 'composer.json', just cut and past:

{
    "require": {
        "bartonlp/simple-site-class": "dev-master"
    }
}

Then run `composer install`

Details

Examples

INPORTANT NOTE: you can disable the log function by either setting `$_site->noTrack=true` or adding `"noTrack":true,` to the mysitemap.json. Doing either of those things will keep the SimpleSiteClass from using the logagent table to log visitors. This will also mean that some of the example programs will not work.

First you will need to install mysql if you don't already have it. You will need to install the PHP extension for mysql. The SimpleSiteClass code runs with PHP 8, and it may not work with older versions of PHP.

Once you have mysql and the PHP extension you can set up mysql. These examples use a database called barton with user barton. There is a file in this directory called schema.sql. You can run it in mysql and create the table.

Now that the database is set up you can run the examples.

I have included a couple of examples to show how to use the SimpleSiteClass. They are in two seperate directories: IfComposer and IfDownloadedZip. If you set up your directory structure as:

and used composer to create a /var/www/vendor/bartonlp/simple-site-class directory, you should use IfComposer examples. If you downloaded the zip file from https://github.com/bartonlp/simple-site-class you should use the IfDownloadedZip directory.

In either case, from the examples directory in the downloaded location, do:

Then open your browser and enter:  

or

Each example has links to the rest of the examples.

Note, that when running with the PHP server it does not use the apache .htaccess file.

You can run both sets of examples from a browser if you have the apache server running on your machine. The IfComposer examples should just work. In the IfComposer directory I have a .htaccess file which has the Header set for the site loader.

The IfDownloadedZip examples need to have the includes directory, from the zip file, moved to the directory above the examples directory. Or, you can edit the examples and change the `__DIR__ . "/../../`, in the 'callback' function at the top of the file, to an absolute path.

Any questions can be directed to Barton Phillips at bartonphillips@gmail.com

Have fun

Examples SimpledbTables SimpleSiteClass Methods Additional Files Index

Contact Me

Barton Phillips : bartonphillips@gmail.com Copyright © 2023 Barton Phillips Project maintained by Barton Phillips Last Modified November 10, 2023


  Files folder image Files  
File Role Description
Files folder imagedocs (13 files, 4 directories)
Files folder imageexamples (4 files, 5 directories)
Files folder imageincludes (6 files, 1 directory)
Accessible without login Plain text file .htaccess Data Auxiliary data
Accessible without login Plain text file CHANGES.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login HTML file index.html Doc. Documentation
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file mk-html-gitlog.sh Data Auxiliary data
Accessible without login Plain text file mysitemap.json Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file update-git-log.sh Data Auxiliary data

  Files folder image Files  /  docs  
File Role Description
Files folder imagefonts (5 files)
Files folder imageimages (10 files)
Files folder imagejavascripts (2 files)
Files folder imagestylesheets (6 files)
  Accessible without login Plain text file addscript Data Auxiliary data
  Accessible without login HTML file dbTables.html Doc. Documentation
  Accessible without login Plain text file dbTables.md Example Example script
  Accessible without login HTML file examplereadme.html Doc. Documentation
  Accessible without login HTML file files.html Doc. Documentation
  Accessible without login Plain text file files.md Example Example script
  Accessible without login HTML file index.html Doc. Documentation
  Accessible without login Plain text file index.md Data Auxiliary data
  Accessible without login Plain text file mk-new.sh Data Auxiliary data
  Accessible without login Plain text file params.json Data Auxiliary data
  Accessible without login HTML file siteclass.html Doc. Documentation
  Accessible without login Plain text file siteclass.md Data Auxiliary data
  Accessible without login Plain text file _config.yml Data Auxiliary data

  Files folder image Files  /  docs  /  fonts  
File Role Description
  Accessible without login Plain text file copse-regular-webfont.svg Data Auxiliary data
  Accessible without login Plain text file quattrocentosans-bold-webfont.svg Data Auxiliary data
  Accessible without login Plain text file quattrocentosans-bolditalic-webfont.svg Data Auxiliary data
  Accessible without login Plain text file quattrocentosans-italic-webfont.svg Data Auxiliary data
  Accessible without login Plain text file quattrocentosans-regular-webfont.svg Data Auxiliary data

  Files folder image Files  /  docs  /  images  
File Role Description
  Accessible without login Image file background.png Icon Icon image
  Accessible without login Image file body-background.png Icon Icon image
  Accessible without login Image file bullet.png Icon Icon image
  Accessible without login Image file code.png Icon Icon image
  Accessible without login Image file hr.gif Icon Icon image
  Accessible without login Image file octocat-logo.png Icon Icon image
  Accessible without login Image file pattern.png Icon Icon image
  Accessible without login Image file tar.png Icon Icon image
  Accessible without login Image file top.png Icon Icon image
  Accessible without login Image file zip.png Icon Icon image

  Files folder image Files  /  docs  /  javascripts  
File Role Description
  Accessible without login Plain text file main.js Data Auxiliary data
  Accessible without login Plain text file script.js Data Auxiliary data

  Files folder image Files  /  docs  /  stylesheets  
File Role Description
  Accessible without login Plain text file github-dark.css Data Auxiliary data
  Accessible without login Plain text file github-light.css Data Auxiliary data
  Accessible without login Plain text file normalize.css Data Auxiliary data
  Accessible without login Plain text file pandoc.css Data Auxiliary data
  Accessible without login Plain text file styles.css Data Auxiliary data
  Accessible without login Plain text file stylesheet.css Data Auxiliary data

  Files folder image Files  /  examples  
File Role Description
Files folder imagecss (1 file)
Files folder imageIfComposer (8 files)
Files folder imageIfDownloadedZip (7 files, 1 directory)
Files folder imageimages (15 files)
Files folder imageincludes (3 files)
  Accessible without login Plain text file aboutwebsite.php Example Example script
  Accessible without login Plain text file phpinfo.php Aux. Auxiliary script
  Accessible without login Plain text file README.md Doc. Documentation
  Accessible without login Plain text file schema.sql Data Auxiliary data

  Files folder image Files  /  examples  /  css  
File Role Description
  Accessible without login Plain text file style.css Data Auxiliary data

  Files folder image Files  /  examples  /  IfComposer  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Accessible without login Plain text file example1.php Example Example script
  Accessible without login Plain text file example2.php Example Example script
  Accessible without login Plain text file example3.php Example Example script
  Accessible without login Plain text file example4.php Example Example script
  Accessible without login Plain text file example5.php Example Example script
  Accessible without login Plain text file example6.php Example Example script
  Accessible without login Plain text file mysitemap.json Data Auxiliary data

  Files folder image Files  /  examples  /  IfDownloadedZip  
File Role Description
Files folder imageincludes (3 files)
  Accessible without login Plain text file example1.php Example Example script
  Accessible without login Plain text file example2.php Example Example script
  Accessible without login Plain text file example3.php Example Example script
  Accessible without login Plain text file example4.php Example Example script
  Accessible without login Plain text file example5.php Example Example script
  Accessible without login Plain text file example6.php Example Example script
  Accessible without login Plain text file mysitemap.json Data Auxiliary data

  Files folder image Files  /  examples  /  IfDownloadedZip  /  includes  
File Role Description
  Accessible without login Plain text file banner.i.php Aux. Auxiliary script
  Accessible without login Plain text file footer.i.php Example Example script
  Accessible without login Plain text file head.i.php Example Example script

  Files folder image Files  /  examples  /  images  
File Role Description
  Accessible without login Image file 146624.png Icon Icon image
  Accessible without login Image file apache_logo.gif Icon Icon image
  Accessible without login Image file bestviewedwithmozillabig.gif Icon Icon image
  Accessible without login Image file blank.png Icon Icon image
  Accessible without login Image file blp-image.png Icon Icon image
  Accessible without login Image file CIRCULA.gif Icon Icon image
  Accessible without login Image file digitalocean.jpg Icon Icon image
  Accessible without login Image file favicon.ico Data Auxiliary data
  Accessible without login Image file linux-powered.gif Icon Icon image
  Accessible without login Image file logo_jquery_215x53.gif Icon Icon image
  Accessible without login Image file msfree.png Icon Icon image
  Accessible without login Image file php-small-white.png Icon Icon image
  Accessible without login Image file powered.gif Icon Icon image
  Accessible without login Image file powered_by_mysql.gif Icon Icon image
  Accessible without login Image file shirt3-small.gif Icon Icon image

  Files folder image Files  /  examples  /  includes  
File Role Description
  Accessible without login Plain text file banner.i.php Aux. Auxiliary script
  Accessible without login Plain text file footer.i.php Example Example script
  Accessible without login Plain text file head.i.php Example Example script

  Files folder image Files  /  includes  
File Role Description
Files folder imagedatabase-engines (6 files)
  Accessible without login Plain text file autoload.php Aux. Auxiliary script
  Accessible without login Plain text file getVersions.php Example Example script
  Accessible without login Plain text file mysitemap.json Data Auxiliary data
  Plain text file SiteClass.class.php Class Class source
  Plain text file siteload.php Class Class source
  Plain text file whatisloaded.php Class Class source

  Files folder image Files  /  includes  /  database-engines  
File Role Description
  Plain text file Database.class.php Class Class source
  Plain text file dbMysqli.class.php Class Class source
  Plain text file dbTables.class.php Class Class source
  Plain text file ErrorClass.class.php Class Class source
  Accessible without login Plain text file simple-helper-functions.php Example Example script
  Plain text file SqlException.class.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:94
This week:4
All time:9,841
This week:24Up