Requirements

  • Php version 5+.
  • Install the files where the index.php exist into the root folder.
  • EssenceOne will run in any Wamp/Xamp/Vertrigo and or Server.

Add The Users Table As Follows

CREATE TABLE `users` (
`id` bigint(20) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`avatar` text NOT NULL,
`signup_date` DATE/TIME NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Session Users

Sessions is already installed once you set the $admin's name valu in the a1/config.php file your signup name if this matches will allow any auth_admin user check you create to work. Using --->

Place this file within the c3 folder and name it admin_check.php Then place it's path above the header view on a members page. To redirect admin to admin.php.

if(isset($SESSION'username') and $SESSION'username' ==$admin)
header('Location: admin.php');

Place this file within a class or function on users profile page left menu to show a link to Admin page ect.
if(isset($SESSION'username') and $SESSION'username'==$admin)
{ Show Link or Do code }else{ Do Other for non admin members }

For a users check auth_user.php use-->
Place this file path into all the class router users page list within the class Protected router
<?php
if (!isset($_SESSION'username')) { //if user not authorized next line redirects user to login page
header('Location: ../index.php?page=login'); //this checks if user has session before users can view members pages
}
?>
You can also remove the ! in front of isset and use it to check if member is session member within a query function or a class. Example:

if (isset($_SESSION'userid') //notice we use the id now within a class or function !//
{ $id = ($SESSION'userid'); $result=mysqliquery(select from users where id= "'.$id.'" etc.

P.S. This Wiki does not show the underscore or brackets in $ ? SESSIONS ?? above.

Adding Pages

  • Change or add views and controllers for each page you add within the numeric module it goes.
  • Add file paths and $page-part-View paths into the Router Class or indexer in template use order.
  • Use Php short-tags to call classes and functions within the Views(page-parts) and Run !

Adding Additional Modules

  • Create the next alphanumeric order of folders to place new files within(c4,v4,r4,l4,p4 etc).
  • Seperate your app's files according to views, controllers, libs, resources, images and anything required.
  • Path all links, paths, inclusions, resources, and GET $data parses through the indexer(index.php)page.
  • Can easily add more indexers if need arises.

Alphanumeric Modules

*Public m1/ main index/php m1(main index.php), c1 controllers, v1 views folders
*Protected m2/ m2 indexer class router, c2 controllers,v2 views folders
*Private m3 class router ,c3 controllers, v3 views folders

Last edited Apr 22, 2013 at 7:17 AM by about2mount, version 7

Comments

venumadhuri Sep 10, 2015 at 11:00 AM 
rdstrsdt

madhukonakanchi Sep 10, 2015 at 10:59 AM 
fggsrtr

about2mount Apr 22, 2013 at 5:39 AM 
I had missed the $title and $meta description variable's within the index.php and the class routers. For these to work simply define them as follows and echo them into the header files with Php short tags where needed. Place these two or more vars above each if $page=='home'; $title='Home'; $meta='My Great Website !'; Then place the short tags as--> <title><?php echo $title;?></title> and <meta><?php echo $meta;?></meta> That way each selected page will show it's own name and meta.

about2mount Apr 22, 2013 at 5:26 AM 
There will be a newer version out which will be fully Mysqli compatible and will have more documentation on Users Classes and Functions and how to implement them. This Php Framework is a Procedural Framework to allow dynamic development while retaining full control over the build process. This Framework uses $_GET method as Static and Class Wrapped, and Apache and Php both are against the use of .htaccess files for protection. This Framework relies on two Sessions values. So if used with Session Checks above Protected(Member) and Private(Admin) pages it will be fine.

Create an Auth_user.php file in the c2, and c3 sub folders and place its path into the class router above the header-a1.php path, this will re direct anyone not validated. -->
<?php
if (!isset($_SESSION['username'])) { //if user not authorized next line redirects user to login page
header('Location: ../index.php?page=login'); //this checks if user has session before users can view members pages
}
?>

about2mount Apr 20, 2013 at 3:10 AM 
To create Dynamic Php Applications simply create a Template broken down into 6 to 10 page-part Views, add Controllers(classes and Functions), stack both the COntrollers above the Views where they are requested by the View(sections) and add the Php short tags to each View to auto implement the needed classes and functions. Requires No Php Includes On Any File or Page.

about2mount Apr 19, 2013 at 9:09 PM 
There are two ways in which to use this Framework. One is using the indexers as the main indexer, or two use the class router indexers to keep everything wrapped within it's own scope. This Php Framework is not intended to downgrade OOP programming but rather to encourage Rasmus Lerdorf's take on Procedural Programming in a Whole New Light ! If used properly this framework will require no Php includes on any file or page,,this is done Automatically.