Myparse in a nutshell.

Myparse violates most rules that seemed to have been inherent until now. Technology is changing, by catering to later version numbers (Apache 2 and PHP 5.3+) we are able to get away with it, and enjoy greater security through efficiency. Myparse allows many interesting things to happen inside your MySQL database:

Dynamic creation,modification of Object parameters through the use of the 'block_options' field.

SQL results most everywhere: Call SQL queries within many fields, use results in other fields in same record.

User defined variables: write in variables that will be automatically replaced with values in a single file (user_vars.php)

Use these variables in most database fields

Use values in an entered url as markup inside database fields, specifically, but not limited to, to providing variables for sql queries.

Building Web Applications With Myparse

Myparse includes several templates to assist developers in quickly building a web application.

Your web application must do several things for the user :

1) Allow the user to register and login.

2) Allow the user to easily log out.

3) Allow different access to different levels of users to different sets of data.

1)Logging In:

Myparse includes a template for logging in, it automatically hides itself when the user has a valid session. Create a block, define a url (use '*' if you want this login box to appear in every url), and set its template to 'login'.

Logging out:

Myparse already has a url that handles logouts, simply create a link inside of a block with a permissions level set with a link to the 'logout' url. You create it inside of a block with permissions because you don't want to log someone out that isn't logged in (although going to this url will be harmless if the user is not logged in.

2)User Registration:

Create a block, define its template as 'user_registration', and define a url. You can change the appearance of the user registration inside of the template, by modifying a php file or by using css. You may wish to hide this block from users logged in, so you will want to select the permission option 'Hide block from all logged in users.'

Modifying existing accounts

You may also edit existing accounts in the administrator interface, you cannot define a password (as of myparse 1.61), but you may allow a random password to be generated. You can also modify the users' group level, by selecting a different group.

Understanding Permissions Groups

The permission groups are defined inside of the table 'mp_groups', an editor is in the works, but for now you will have to use your favorite mysql client to modify these groups. When a user is created (using the user registration form) its default group is set to "Normal User" or the ID of the record in the table 'mp_groups'.

When a user logs in and retrieves a page the sql statement that renders the url also calculates the users 'group_level' by joining with the mp_groups table (as well as the mp_sessions, and mp_users). If a block is loaded with a permissions group it will determine wether the group_level allows the user access to the data. If not a message will be returned (inside that one block) that the data is unauthorized. This allows the administrator a flexible way to define and limit access among different groups.

Block Types

Block types help speed up 'block' processing by applying specific actions to the block based on its type. Leaving this field blank will result in 'normal' block processing. myparse comes with the following blocks:

parse - will 'parse' block for replaceable values (urls/user defined).

paginate - will automatically provide pagination for a block (when available)

raw_html - will render a block to screen as defined in block_content without any parsing (variable replacement, and records handling).

html_full - will render an entire html output, but will also display records so this block can be used to create rss feeds!

html_head - block appears in the 'head' of the html document.

dyn_head - allows a block object to be 'dynamic' inside of the head, variables will parse and you could also possibly use a selection to put something in the head.

full_doc - will render an entire raw document output (outputs contents of block_content directly to screen as is)

inline_css - will add a inline css to the head of document.

full_doc block type

By using the block_type 'full_doc' anything entered into the 'block_content' will be output when the display_url is requested as the entire document. You can only have one of these block_types per url, as defined. This would be useful if you wanted to show one page for everything ('server down message') when using the '*' wild-card designator.

Config.php

You can configure your myparse installation by editing the system/config.php file. Typically options are variables that may be uncommented to enable, or commented to disable. More information is contained inside of the config.php file.

User Variables

Users can define their own variables which can be placed within block/template records, these variables are most useful for 3rd party plugins but can be expanded to drive entire sites that can be edited through a single file. More information on how to create and use these variables are available in system/user_vars.php

Page Caching

Myparse page cacher is very fast, very easy to configure, and does not require any additional libraries/scripts to function properly. This cacher allows for cached pages to render in less than .0010 seconds and does not need to open a database connection, nor the script that generates html pages. To enable uncomment $config["page_cache"] and $config["page_timeout"] in system/config.php.

cachemap

Cachemap is a bundled plugin that can generate a sitemap based on cached files. These cached files must exist, and cache must be enabled to function properly. This map is updated every time you load it. Instructions on usage is available at libraries/cachemap.php.

Head blocks

Head blocks are blocks that are defined as 'html_head' .. these blocks are inserted into the head of the html document

Working with CSS

Inline

Designation of 'inline_css' as a block_type will place the data inside 'block_content' in the proper inlinecss tag.CSS styles are inputted in block_content.

External

You may also enter a external stylesheet link to a css file (also as a html_head block_type). With the proper html_block (a block type 'external_css' might be useful in a future release.)

CSS File

If desired, you can store entire CSS files in the database, although not recommended, this method still may help with file access if you are trying to keep your css organized and have many css files.

By reducing the number of file accesses to a web server you can greatly increase throughput. Although in the case of css, you must measure which is faster, multiple accesses to the myparse script, or multiple accesses your file system - and you may want to consider consolidating many css files into one linked file in the filesystem.