StaticPages
[ class tree: StaticPages ] [ index: StaticPages ] [ all elements ]

Procedural File: functions.inc

Source Location: /plugins/staticpages/functions.inc



Page Details:

Implementation of the Plugin API for the Static Pages plugin



Includes:

include_once($plugin_path.'services.inc.php') [line 74]
require_once($langfile) [line 54]
Language file include

require_once($_CONF['path_system'].'classes/config.class.php') [line 63]
Check and see if we need to load the plugin configuration

require_once($plugin_path.'language/english.php') [line 56]






plugin_autotags_staticpages [line 1125]

void plugin_autotags_staticpages( $op, [ $content = ''], [ $autotag = ''])

Implements the [staticpage:] autotag.



Parameters

   $op  
   $content  
   $autotag  
[ Top ]



plugin_autouninstall_staticpages [line 1346]

array plugin_autouninstall_staticpages( )

Automatic uninstall function for plugins



Tags:

return:  This code is automatically uninstalling the plugin. It passes an array to the core code function that removes tables, groups, features and php blocks from the tables. Additionally, this code can perform special actions that cannot be foreseen by the core code (interactions with other plugins for example)


[ Top ]



plugin_cclabel_staticpages [line 822]

void plugin_cclabel_staticpages( )

This will put an option for static pages in the command and control block on

moderation.php




[ Top ]



plugin_centerblock_staticpages [line 914]

string plugin_centerblock_staticpages( [where $where = 1], [page $page = 1], [topic $topic = ''])

Display static pages in the center block.



Tags:

return:  HTML for the static page (can be empty)


Parameters

where   $where   int where the static page will be displayed (0..3)
page   $page   int page number
topic   $topic   string topic ID
[ Top ]



plugin_chkVersion_staticpages [line 1110]

void plugin_chkVersion_staticpages( )

Return the current version of code.

Used in the Plugin Editor to show the registered version and code version




[ Top ]



plugin_deletecomment_staticpages [line 213]

mixed plugin_deletecomment_staticpages( int $cid, string $id)

staticpages: delete a comment



Tags:

return:  false for failure, HTML string (redirect?) for success


Parameters

int   $cid   Comment to be deleted
string   $id   Item id to which $cid belongs
[ Top ]



plugin_displaycomment_staticpages [line 130]

mixed plugin_displaycomment_staticpages( string $id, int $cid, string $title, string $order, string $format, int $page, boolean $view)

Plugin should display [a] comment[s]



Tags:

return:  results of calling the plugin_displaycomment_ function


Parameters

string   $id   Unique idenifier for item comment belongs to
int   $cid   Comment id to display (possibly including sub-comments)
string   $title   Page/comment title
string   $order   'ASC' or 'DSC' or blank
string   $format   'threaded', 'nested', or 'flat'
int   $page   Page number of comments to display
boolean   $view   True to view comment (by cid), false to display (by $pid)
[ Top ]



plugin_dopluginsearch_staticpages [line 742]

void plugin_dopluginsearch_staticpages( string $query, date $datestart, date $dateend, string $topic, string $type, int $author, string $keyType, int $page, int $perpage)

this searches for static pages matching the user query and returns an array of for the header and table rows back to search.php where it will be formated and printed



Parameters

string   $query   Keywords user is looking for
date   $datestart   Start date to get results for
date   $dateend   End date to get results for
string   $topic   The topic they were searching in
string   $type   Type of items they are searching, or 'all' (deprecated)
int   $author   Get all results by this author
string   $keyType   search key type: 'all', 'phrase', 'any'
int   $page   page number of current search (deprecated)
int   $perpage   number of results per page (deprecated)
[ Top ]



plugin_getadminoption_staticpages [line 839]

void plugin_getadminoption_staticpages( )

returns the administrative option for this plugin



[ Top ]



plugin_getcommenturlid_staticpages [line 1883]

array plugin_getcommenturlid_staticpages( )

Provide URL and ID for the link to a comment's parent

NOTE: The Plugin API does not support $_CONF['url_rewrite'] here, so we'll end up with a non-rewritten URL ...




Tags:

return:  array consisting of the base URL and the ID name


[ Top ]



plugin_getconfigtooltip_staticpages [line 1868]

mixed plugin_getconfigtooltip_staticpages( string $id)

Provides text for a Configuration tooltip



Tags:

return:  Text to use regular tooltip, NULL to use config tooltip hack, or empty string when not available


Parameters

string   $id   Id of config value
[ Top ]



plugin_getdocumentationurl_staticpages [line 1829]

mixed plugin_getdocumentationurl_staticpages( string $file)

Provide URL of a documentation file



Tags:

return:  URL or false when not available


Parameters

string   $file   documentation file being requested, e.g. 'config'
[ Top ]



plugin_geticon_staticpages [line 1203]

string plugin_geticon_staticpages( )

Returns the URL of the plugin's icon



Tags:

return:  URL of the icon


[ Top ]



plugin_getiteminfo_staticpages [line 1692]

mixed plugin_getiteminfo_staticpages( string $sp_id, string $what, [int $uid = 0], [array $options = array()])

Return information for a static page



Tags:

return:  string or array of strings with the information


Parameters

string   $sp_id   static page ID or '*'
string   $what   comma-separated list of properties
int   $uid   user ID or 0 = current user
array   $options   (reserved for future extensions)
[ Top ]



plugin_getListField_staticpages [line 1402]

void plugin_getListField_staticpages( $fieldname, $fieldvalue, $A, $icon_arr)



Parameters

   $fieldname  
   $fieldvalue  
   $A  
   $icon_arr  
[ Top ]



plugin_getmenuitems_staticpages [line 87]

void plugin_getmenuitems_staticpages( )

Returns the items for this plugin that should appear on the main menu

NOTE: this MUST return the url/value pairs in the following format $<arrayname>[<label>] = <url>




[ Top ]



plugin_getwhatsnewcomment_staticpages [line 1647]

array plugin_getwhatsnewcomment_staticpages( [string $numreturn = 0], [string $uid = 0])

Return new Static Page comments for the What's New block



Tags:

return:  list of new comments (dups, type, title, sid, lastdate) or (sid, title, cid, unixdate)


Parameters

string   $numreturn   If 0 will return results for What's New Block. If > 0 will return last X new comments for User Profile.
string   $uid   ID of the user to return results for. 0 = all users.
[ Top ]



plugin_getwhatsnew_staticpages [line 1570]

string plugin_getwhatsnew_staticpages( )

Return new Static Pages for the What's New block



Tags:

return:  HTML list of new staticpages


[ Top ]



plugin_itemsaved_staticpages [line 1905]

void plugin_itemsaved_staticpages( string $id, string $type, string $old_id)

Callback function when an item was saved



Tags:

see:  PLG_itemSaved()


Parameters

string   $id   (unused) ID of item being saved
string   $type   type of item ('article', 'staticpages', ...)
string   $old_id   (unused) previous ID of item, if != $id
[ Top ]



plugin_migrate_staticpages [line 1319]

void plugin_migrate_staticpages( array $old_conf, boolean 1)

Called during site migration - handle changed URLs or paths



Parameters

array   $old_conf   contents of the $_CONF array on the old site
boolean   1   true on success, otherwise false
[ Top ]



plugin_savecomment_staticpages [line 173]

mixed plugin_savecomment_staticpages( string $title, string $comment, string $id, int $pid, string $postmode)

Static Page saves a comment



Tags:

return:  false for failure, HTML string (redirect?) for success


Parameters

string   $title   comment title
string   $comment   comment text
string   $id   Item id to which $cid belongs
int   $pid   comment parent
string   $postmode   'html' or 'text'
[ Top ]



plugin_searchtypes_staticpages [line 714]

void plugin_searchtypes_staticpages( )

Geeklog is asking us to provide any new items that show up in the type

drop-down on search.php. Let's let users search static pages!




[ Top ]



plugin_showstats_staticpages [line 640]

void plugin_showstats_staticpages( int $showsitestats)

Shows the statistics for the Static Pages plugin on stats.php.

If $showsitestats is 1 then we are to only print the overall stats in the 'site statistics box' otherwise we show the detailed stats




Parameters

int   $showsitestats   showsitestate Flag to let us know which stats to get
[ Top ]



plugin_statssummary_staticpages [line 700]

array(item plugin_statssummary_staticpages( )

New stats plugin API function for proper integration with the site stats



Tags:

return:  text, item count);


[ Top ]



plugin_upgrade_staticpages [line 1216]

int plugin_upgrade_staticpages( )

Update the Static Pages plugin



Tags:

return:  Number of message to display (true = generic success msg)


[ Top ]



plugin_user_delete_staticpages [line 1082]

void plugin_user_delete_staticpages( uid $uid)

A user is about to be deleted. Update ownership of any static pages owned by that user or delete them.



Parameters

uid   $uid   int User id of deleted user
[ Top ]



plugin_whatsnewsupported_staticpages [line 1548]

mixed plugin_whatsnewsupported_staticpages( )

Return headlines for New Static Pages section in the What's New block, if enabled



Tags:

return:  array(headline, byline), or boolean false if disabled


[ Top ]



plugin_wsEnabled_staticpages [line 1537]

boolean plugin_wsEnabled_staticpages( )

Return true since this plugin supports webservices



Tags:

return:  True, if webservices are supported


[ Top ]



SP_countVisiblePages [line 245]

int SP_countVisiblePages( )

Helper function: Count static pages visible to the current user



Tags:

return:  number of pages


[ Top ]



SP_displayPage [line 279]

string SP_displayPage( string $page, array $A, [string $comment_order = 'ASC'], [string $comment_mode = 'nested'], [ $comment_page = 1], [int $msg = 0], [string $query = ''])

Prepare static page for display.



Tags:

return:  HTML for the static page


Parameters

string   $page   static page id
array   $A   static page data
string   $comment_order   sorting of comments
string   $comment_mode   comment mode (nested, flat, etc.)
int   $msg   optional message number
string   $query   optional search query string to highlight
   $comment_page  
[ Top ]



SP_getPerms [line 872]

string SP_getPerms( [string $table = ''], [int $access = '2'], [int $u_id = ''])

Return SQL where statement with appropriate permissions

Takes User id and permission and returns SQL where clause which will return the appropriate objects. This assumes that the table has the following security structure: owner_id | mediumint(8) group_id | mediumint(8) perm_owner | tinyint(1) unsigned perm_group | tinyint(1) unsigned perm_members | tinyint(1) unsigned perm_anon | tinyint(1) unsigned This will work with the standard GL tables




Tags:

return:  Where clause of sql statement


Parameters

string   $table   Table name (used in joins)
int   $access   Access if blank read access 2 = read 3 = read/edit
int   $u_id   User ID if blank current user
[ Top ]



SP_printPage [line 481]

string SP_printPage( string $page, array $A)

Prepare static page for print (i.e. display as "printable version").



Tags:

return:  HTML for the static page


Parameters

string   $page   static page id
array   $A   static page data
[ Top ]



SP_render_content [line 1495]

string SP_render_content( string $sp_content, int $sp_php, [string $query = ''])

Render the actual content of a static page (without any surrounding blocks)



Tags:

return:  rendered content (HTML)


Parameters

string   $sp_content   the content (HTML or PHP source)
int   $sp_php   flag: 1 = content is PHP source, 0 = is HTML
string   $query   optional search query string to highlight
[ Top ]



SP_returnStaticpage [line 603]

string SP_returnStaticpage( [string $page = ''], [string $mode = ''], [string $comment_order = 'ASC'], [string $comment_mode = 'nested'], [ $comment_page = 1], [int $msg = 0], [string $query = ''])

Prepare static page for display



Tags:

return:  HTML for the static page


Parameters

string   $page   static page id
string   $mode   type of display to return ('', 'print', 'autotag'
string   $comment_order   sorting of comments
string   $comment_mode   comment mode (nested, flat, etc.)
int   $msg   optional message number
string   $query   optional search query string to highlight
   $comment_page  
[ Top ]



staticpages_templatePath [line 1380]

string staticpages_templatePath( [string $path = ''])

Get path for the template files.



Tags:

return:  full path to template directory


Parameters

string   $path   subdirectory within the base template path
[ Top ]



Documentation generated on Sat, 11 Feb 2012 02:07:40 -0500 by phpDocumentor 1.4.3