MinimalWeblogClass to handle weblog functionality; for embedding in existing web page
MinimalWeblog 1.0.2 by Jan Pieter Kunst, based on Personal Weblog 1.0.0 by Mark Pulford
Located in /MinimalWeblog.php (line 50)
bool
$_admin
= FALSE (line 55)
string
$_body
(line 139)
bool
$_broken
= FALSE (line 71)
obj
$_db
(line 59)
array
$_dbvars
= array() (line 67)
int
$_delopt
(line 103)
int
$_eid
(line 107)
array
$_errors
= array() (line 79)
string
$_icon
(line 127)
string
$_mode
(line 115)
string
$_more
(line 143)
string
$_name
(line 123)
array
$_numeric_cgi
= array('topic', 'delopt', 'tid', 'eid', 'offset') (line 83)
int
$_offset
= 0 (line 95)
string
$_password
(line 119)
string
$_prefix
(line 63)
string
$_search
(line 151)
string
$_self
(line 75)
array
$_string_cgi
= array('mode', 'name', 'icon', 'value', 'title', 'body', 'more', 'password', 'update', 'search') (line 87)
int
$_tid
(line 111)
string
$_title
(line 135)
int
$_topic
(line 99)
string
$_update
(line 147)
array
$_valid_cgi
= array() (line 91)
array
$_value
(line 131)
Weblog constructor
The Weblog class must be instantiated at the top of the page before any data is sent. This way it can modify the HTTP headers. Checks for a valid new or current login; Sets the class variable $_admin to true on a successful login.
Next/previous links for complete entries (wl_mode=more)
Next/previous links for paged list of entries
Delete one entry. wl_mode=delete+entry
Uses properties: eid
Display one complete entry (wl_mode=more).
Uses property: eid (current entry id number)
Edit an entry. wl_mode=edit+entry
Uses properties: eid, tid, title, body, more, update The entry can be given from CGI variables, start blank, or be loaded from the DB.
Load a weblog entry overriding current title, tid, body, more values
Preview an entry. wl_mode=preview+entry
Uses properties: eid, tid, title, body, more, update
Print per entry admin menu maintaining search parameters
Used to create a link to the previous or next entry
Empty search conditions and return all entries. wl_mode=$this->getvar('reset_text')
Save an entry. wl_mode=save+entry
Uses properties: eid, tid, title, body, more, update
Generates a (partial) list of entries, possibly restricted by topic or searched text. wl_mode=$this->getvar('search_text')
Uses properties: topic, offset, search
Add ORDER BY and LIMIT to query for selecting entries
Configuraton variables are assumed to exist and are required to run
Error handling
Does not work if not defined as public, never called explicitly though
Store any GET/POST variables in the class. POST has precedence over GET
Login; if already logged in show the main page
CGI mode: "login" (wl_mode=login) Trigger error if editing is not allowed from remote host. See MINIMALWEBLOG_HOSTS_EDITING_ALLOWED constant in config.inc.php
Logout
Empty and destroy session, set admin property to false CGI mode: "logout" (wl_mode=logout)
Show search box, topic select, ...
Format found entries
Return HTML for hidden fields to maintain current cgi variable values through html form
Generate RSS file with the current search parameters
CGI mode: "rss" (wl_mode=rss) Uses: topic, offset, search
Clean up GET/POST contents
Ensure all non string CGI variables are clean Strings are always escaped for db use by using prepared statements name, icon, title, body, more, value: used in db searches mode, password, update: not used in db searches
Returns query and array of parameters for selecting entries
Returns a select query limiting entries based on CGI variables and topic restriction. Further conditions can be appended.
Edit weblog options (data from 'vars' table). wl_mode=edit+setup
Save weblog options (data from 'vars' table). wl_mode=save+setup
Update a weblog (configuration) variable (in class and database)
Substitute an entry into a template via tokens
Delete a topic, possibly moving entries to another topic. wl_mode=delete+topic
Uses properties: tid, delopt
Returns the form HTML necessary to select between topics
Return a link back to the main page while maintaining current search parameters
Provides backtrace when MINIMALWEBLOG_DEBUG == 2
Returns an <a> element
Returns an URL query string
Change name or icon of topic. wl_mode=change+topic
Uses properties: tid, name, icon
Documentation generated on Sun, 17 Jun 2007 19:20:45 +0200 by phpDocumentor 1.3.2