Page: Program_Root/public_html/lib-common.php

This is the common library for Geeklog. Through our code, you will see
functions with the COM_ prefix (e.g. COM_siteHeader()).  Any such functions
 can be found in this file.  This file provides all configuration variables
 needed by Geeklog with a series of includes (see further down).

 --- You only need to modify one line in this file! ---

 WARNING: put any custom hacks in lib-custom.php and not in here.  This file is
 modified frequently by the Geeklog development team.  If you put your hacks in
 lib-custom.php you will find upgrading much easier.

Classes defined on this page:
Include Statements Summary
INCLUDE TYPEINCLUDED FILENAMEDESCRIPTION
require_once "/path/to/geeklog/config.php" Configuration Include: You should ONLY have to modify this line. Leave the rest of this file intact!
require_once $_CONF["path_system"]."classes/timer.class.php" Include page time -- used to time how fast each page was created
require_once $_CONF["path_system"]."classes/url.class.php" Include URL class This provides optional URL rewriting functionality.
require_once $_CONF["path_system"]."classes/template.class.php" This is our HTML template class. It is the same one found in PHPLib and is licensed under the LGPL. See that file for details
require_once $_CONF["path_system"]."lib-database.php" This is the database library.
require_once $_CONF["path_system"]."lib-security.php" This is the security library used for application security
require_once $_CONF["path_system"]."lib-custom.php" This is the custom library.
require_once $_CONF["path_system"]."lib-plugins.php" Include plugin class.
require_once $_CONF["path_system"]."lib-sessions.php" Session management library
require_once $_CONF["path_layout"]."functions.php" Include theme functions file
require_once $_CONF["path"]."plugins/".$A["pi_name"]."/functions.inc"


Constant Summary
CONSTANT NAMECONSTANT VALUEDESCRIPTION


Function Summary
void COM_accesslog ( $logentry )
Logs message to access.log
string COM_adminEdit ( $type, $text )
Prints Admin option on moderation.php DO NOT USE THIS FUNCTION.
string COM_adminMenu ( $help, $title )
Prints administration menu
string COM_allowedhtml ( )
Returns what HTML is allows in content
string COM_article ( $A, $index )
Returns the array (created from db record) passed to it as formatted HTML
string COM_buildURL ( $url )
Wrapper function for URL class so as to not confuse people as this will eventually get used all over the place
string COM_checkHTML ( $str )
This function checks html tags.
string COM_checkList ( $table, $selection, $where, $selected )
Creates a <input> checklist from a database list for use in forms
string COM_checkWords ( $Message )
This censors inappropriate content
string COM_comment ( $A, $mode, $type, $level, [$ispreview = false] )
This function prints $A (an individual comment) in comment format
string COM_commentBar ( $sid, $title, $type, $order, $mode )
This function displays the comment control bar
string COM_commentChildren ( $sid, $pid, $order, $mode, $type, $level )
Prints the next level of children for a given comment
string COM_debug ( $A )
Prints out an associative array for debugging
void COM_emailUserTopics ( )
This will email new stories in the topics that the user is interested in
string COM_endBlock ( $template )
Closes out COM_startBlock
string COM_errorLog ( $logentry, $actionid )
Logs messages to error.log or the web page or both
void COM_exportRDF ( )
Creates a valid RDF file from the stories
void COM_featuredCheck ( )
Checks and Updates the featured status of all articles.
string COM_getArgument ( $name )
Wrapper function for URL class
string COM_getBlockTemplate ( $blockname, $which )
Return the file to use for a block template.
string COM_getDayFormOptions ( $selected )
Gets the <option> values for calendar days
string COM_getHourFormOptions ( $selected )
Gets the <option> values for clock hours
string COM_getMinuteOptions ( $selected )
Gets the <option> values for clock minutes
string COM_getMonthFormOptions ( $selected )
Gets the <option> values for calendar months
string COM_getpassword ( $loginname )
Return the password for the given username
int COM_getRate ( $occurrences, $timespan )
Occurences / time
array COM_getThemes ( )
Gets all installed themes
int COM_getUserCookieTimeout ( )
Returns user-defined cookie timeout
array COM_getUserDateTimeFormat ( $date )
Returns formatted date/time for user
string COM_getYearFormOptions ( $selected )
Gets the <option> values for calendar years
void COM_hit ( )
Adds a hit to the system
boolean COM_isemail ( $email )
checks to see if email address is valid
string COM_killJS ( $Message )
Takes some amount of text and replaces all javascript events on*= with in
string COM_makeList ( $listofitems )
Creates an HTML unordered list from the given array.
string COM_makesid ( )
Makes an ID based on current date/time
void COM_olderStuff ( )
Creates older stuff block Creates the olderstuff block for display.
string COM_optionList ( $table, $selection, $selected, [$sortcol = 1] )
Creates a <option> list from a database list for use in forms
string COM_pollResults ( $qid, [$scale = 400], $order, $mode )
Shows the results of a poll
string COM_pollVote ( $qid )
Shows a poll form
string COM_printPageNavigation ( $base_url, $curpage, $num_pages )
Prints Google(tm)-like paging navigation
string COM_printUpcomingEvents ( $help, $title )
Returns the upcoming event block
void COM_rdfCharacterData ( $parser, $data )
void COM_rdfCheck ( $bid, $rdfurl, $date )
Checks to see if it's time to import and RDF/RSS block again
void COM_rdfEndElement ( $parser, $name )
void COM_rdfImport ( $bid, $rdfurl )
This is the actual RDF parser (the above are just helper functions)
void COM_rdfStartElement ( $parser, $name, $attrs )
Imports an RDF/RSS block
void COM_rdfUpToDateCheck ( )
Checks to see if RDF file needs updating and updates it if sol
void COM_refresh ( $url )
Redirects user to a given URL
boolean COM_setArgNames ( $names )
Wrapper function for URL class so as to not confuse people
string COM_showBlock ( $name, $help, $title )
Shows a single Geeklog block
string COM_showBlocks ( $side, $topic, $name )
Shows Geeklog blocks
string COM_showMessage ( $msg )
Displays a message on the webpage
String COM_showPoll ( $size, $qid )
This shows a poll
string COM_showTopics ( $topic )
Shows all available topics Show the topics in the system the user has access to and prints them in HTML.
string COM_siteFooter ( [$rightblock = false] )
Returns the site footer
string COM_siteHeader ( $what )
Returns the site header
string COM_startBlock ( $title, $helpfile, $template )
Prints out standard block header
string COM_startComment ( )
Same as COM_startBlock, but set up for the comments
string COM_topicList ( $selection, $selected, [$sortcol = 1] )
Create and return a list of available topics
string COM_userComments ( $sid, $title, $type, $order, $mode, $pid )
This function displays the comments in a high level format.
string COM_userMenu ( $help, $title )
Shows the user their menu options
string COM_whatsNewBlock ( $help, $title )
Shows any new information in block
string phpblock_whosonline ( )
Shows who is online in slick little block

Include Statements Detail

require_once

require_once file: "/path/to/geeklog/config.php"

Configuration Include: You should ONLY have to modify this line. Leave the rest of this file intact!


require_once

require_once file: $_CONF["path_system"]."classes/timer.class.php"

Include page time -- used to time how fast each page was created


require_once

require_once file: $_CONF["path_system"]."classes/url.class.php"

Include URL class This provides optional URL rewriting functionality.
Please note this code is still experimental and is only currently used by the staticpages plugin.

require_once

require_once file: $_CONF["path_system"]."classes/template.class.php"

This is our HTML template class. It is the same one found in PHPLib and is licensed under the LGPL. See that file for details


require_once

require_once file: $_CONF["path_system"]."lib-database.php"

This is the database library.
Including this give you a working connection to the database

require_once

require_once file: $_CONF["path_system"]."lib-security.php"

This is the security library used for application security


require_once

require_once file: $_CONF["path_system"]."lib-custom.php"

This is the custom library.
It is the sandbox for every Geeklog Admin to play in.  
 We will never modify this file.  This should hold all custom
 hacks to make upgrading easier.

require_once

require_once file: $_CONF["path_system"]."lib-plugins.php"

Include plugin class.
This is a poorly implemented class that was not very well thought out.  
 Still very necessary

require_once

require_once file: $_CONF["path_system"]."lib-sessions.php"

Session management library


require_once

require_once file: $_CONF["path_layout"]."functions.php"

Include theme functions file


require_once

require_once file: $_CONF["path"]."plugins/".$A["pi_name"]."/functions.inc"




Constant Detail

Function Detail

COM_accesslog

void COM_accesslog ( $logentry )

Logs message to access.log
This will print a message to the Geeklog access log
Function Parameters:
- $string string Message to write to access log
Function Info:
See - COM_errorLog()

COM_adminEdit

string COM_adminEdit ( $type, $text )

Prints Admin option on moderation.php DO NOT USE THIS FUNCTION.
This prints an image/label pair on moderation.php  This should not be
 used by any of our pages anymore but we need to test that out before
 removing permanently.
Function Parameters:
- $type string Type of adminedit we are creating
- $text string Text label
Function Info:
Return - Formatted HTML

COM_adminMenu

string COM_adminMenu ( $help, $title )

Prints administration menu
This will return the administration menu items that the user has
 sufficient rights to -- Admin Block on right side.
Function Parameters:
- $help string Help file to show
- $title string Menu Title
Function Info:
Return - HTML of Administration Block
See - COM_userMenu()

COM_allowedhtml

string COM_allowedhtml ( )

Returns what HTML is allows in content
Returns what HTML tags the system allows to be used inside content
 you can modify this by changing $_CONF['allowablehtml'] in 
 config.php
Function Parameters:
Function Info:
Return - HTML <span> enclosed string

COM_article

string COM_article ( $A, $index )

Returns the array (created from db record) passed to it as formatted HTML
Formats the given article data into HTML.  Called by index.php and
 admin/story.php (when previewing)
Function Parameters:
- $A array Data to display as an article (associative array from record from gl_stories
- $index string whether or not this is the index page if 'n' then compact display for index page else display full article
Function Info:
Return - Article as formatted HTML

COM_buildURL

string COM_buildURL ( $url )

Wrapper function for URL class so as to not confuse people as this will eventually get used all over the place
This function returns a crawler friendly URL (if possible)
Function Parameters:
- $url string URL to try to build crawler friendly URL for
Function Info:
Return - Rewritten URL

COM_checkHTML

string COM_checkHTML ( $str )

This function checks html tags.
The core of this code has been lifted from phpslash which is licensed under
 the GPL.  It checks to see that the HTML tags are on the approved list and
 removes them if not.
Function Parameters:
- $str string HTML to check
Function Info:
Return - Filtered HTML
See - COM_checkHTML()

COM_checkList

string COM_checkList ( $table, $selection, $where, $selected )

Creates a <input> checklist from a database list for use in forms
Creates a group of checkbox form fields with given arguments
Function Parameters:
- $table string DB Table to pull data from
- $selection string Comma delimited list of fields to pull from table
- $where string Where clause of SQL statement
- $selected string Value to set to CHECKED
Function Info:
Return - HTML with Checkbox code
See - COM_optionList()

COM_checkWords

string COM_checkWords ( $Message )

This censors inappropriate content
This will replace 'bad words' with something more appropriate
Function Parameters:
- $Message string String to check
Function Info:
Return - Edited $Message
See - COM_checkHTML()

COM_comment

string COM_comment ( $A, $mode, $type, $level, [$ispreview = false] )

This function prints $A (an individual comment) in comment format

Function Parameters:
- $A array Associative array based on comment record from DB
- $mode string 'flat', 'threaded', etc
- $level int how deep in comment thread
- $ispreview boolean Preview display (for edit) or not
Function Info:
Return - HTML Formatted Comment

COM_commentBar

string COM_commentBar ( $sid, $title, $type, $order, $mode )

This function displays the comment control bar
Prints the control that allows the user to interact with Geeklog Comments
Function Parameters:
- $sid string ID of item in question
- $title string Title of item
- $type string Type of item (i.e. story, photo, etc)
- $order string Order that comments are displayed in
- $mode string Mode (nested, flat, etc.)
Function Info:
Return - HTML Formatted comment bar
See - COM_userComments(), COM_commentChildren()

COM_commentChildren

string COM_commentChildren ( $sid, $pid, $order, $mode, $type, $level )

Prints the next level of children for a given comment
This is called recursively to display all the comments for a given
 comment
Function Parameters:
- $sid string ID for item comments belong to
- $pid string Parent ID
- $order string Order to show comments in 'ASC' or 'DESC'
- $mode string Mode (e.g. nested, flat, etc)
- $type string Type of item (article, photo, link, etc.)
- $level int How deep in comment thread we are
Function Info:
Return - HTML formatted Comment
See - COM_commentBar(), COM_userComments()

COM_debug

string COM_debug ( $A )

Prints out an associative array for debugging
The core of this code has been lifted from phpweblog which is licensed
 under the GPL.  This is not used very much in the code but you can use it
 if you see fit
Function Parameters:
- $A array Array to loop through and print values for
Function Info:
Return - Formatted HTML List

COM_emailUserTopics

void COM_emailUserTopics ( )

This will email new stories in the topics that the user is interested in
In account information the user can specify which topics for which they
 will receive any new article for in a daily digest. As of 10/15/2001 this
 isn't working entirely (usersettings.php needs to be modified)
Function Parameters:
Function Info:

COM_endBlock

string COM_endBlock ( $template )

Closes out COM_startBlock

Function Parameters:
- $template string HTML template file used to format block footer
Function Info:
Return - Formatted HTML to close block
See - COM_startBlock()

COM_errorLog

string COM_errorLog ( $logentry, $actionid )

Logs messages to error.log or the web page or both
Prints a well formatted message to either the web page, error log
 or both.
Function Parameters:
- $logentry string Text to log to error log
- $actionid int 1 = write to log file, 2 = write to screen (default) both
Function Info:
Return - If $actionid = 2 or '' then HTML formatted string (wrapped in block) else nothing
See - COM_accesslog()

COM_exportRDF

void COM_exportRDF ( )

Creates a vaild RDF file from the stories
The core of this code has been lifted from phpweblog which is licensed
 under the GPL.
Function Parameters:
Function Info:
See - COM_rdfUpToDateCheck()

COM_featuredCheck

void COM_featuredCheck ( )

Checks and Updates the featured status of all articles.
Checks to see if any articles that were published for the future have been published and, if
 so, will see if they are featured.  If they are featured, this will set old featured article (if
 if there is one) to normal
Function Parameters:
Function Info:

COM_getArgument

string COM_getArgument ( $name )

Wrapper function for URL class
returns value for specified argument
Function Parameters:
- $name string argument to get value for
Function Info:
Return - Argument value

COM_getBlockTemplate

string COM_getBlockTemplate ( $blockname, $which )

Return the file to use for a block template.
This returns the template needed to build the HTML for a block.  This function
 allows designers to give a block it's own custom look and feel.  If no
 templates for the block are specified, the default blockheader.html and
 blockfooter.html will be used.
Function Parameters:
- $blockname string corresponds to name field in block table
- $which string can be either 'header' or 'footer' for corresponding template
Function Info:
Return - template name
See - COM_startBlock(), COM_endBlock()
See - COM_showBlocks(), COM_showBlock()

COM_getDayFormOptions

string COM_getDayFormOptions ( $selected )

Gets the <option> values for calendar days

Function Parameters:
- $selected string Selected day
Function Info:
Return - HTML days as option values
See - COM_getMonthFormOptions(), COM_getYearFormOptions()
See - COM_getHourFormOptions(), COM_getMinuteOptions

COM_getHourFormOptions

string COM_getHourFormOptions ( $selected )

Gets the <option> values for clock hours

Function Parameters:
- $selected string Selected hour
Function Info:
Return - HTML string of options
See - COM_getMonthFormOptions(), COM_getDayFormOptions()
See - COM_getYearFormOptions(), COM_getMinuteOptions

COM_getMinuteOptions

string COM_getMinuteOptions ( $selected )

Gets the <option> values for clock minutes

Function Parameters:
- $selected string Selected minutes
Function Info:
Return - HTML of option minutes
See - COM_getMonthFormOptions(), COM_getDayFormOptions()
See - COM_getHourFormOptions(), COM_getYearFormOptions()

COM_getMonthFormOptions

string COM_getMonthFormOptions ( $selected )

Gets the <option> values for calendar months

Function Parameters:
- $selected string Selected month
Function Info:
Return - HTML Months as option values
See - COM_getDayFormOptions(), COM_getYearFormOptions()
See - COM_getHourFormOptions(), COM_getMinuteOptions

COM_getpassword

string COM_getpassword ( $loginname )

Return the password for the given username
Fetches a password for the given user
Function Parameters:
- $loginname string username to get password for
Function Info:
Return - Password or ''

COM_getRate

int COM_getRate ( $occurrences, $timespan )

Occurences / time
This will take a number of occurrences, and number of seconds for the time span and return
 the smallest #/time interval
Function Parameters:
- $occurrences int how many occurrences during time interval
- $timespan int time interval in seconds
Function Info:
Return - Seconds per interval

COM_getThemes

array COM_getThemes ( )

Gets all installed themes
Gets all directory names in /path/to/geeklog/themes/ and returns all the 
 directories
Function Parameters:
Function Info:
Return - All installed themes

COM_getUserCookieTimeout

int COM_getUserCookieTimeout ( )

Returns user-defined cookie timeout
In account preferences users can specify when their long-term cookie expires.  This
 function returns that value.
Function Parameters:
Function Info:
Return - Cookie time out value in seconds

COM_getUserDateTimeFormat

array COM_getUserDateTimeFormat ( $date )

Returns formatted date/time for user
This function COM_takes a date in either unixtimestamp or in english and 
 formats it to the users preference.  If the user didn't specify a format
 the format in the config file is used.  This returns array where array[0]
 is the formatted date and array[1] is the unixtimestamp
Function Parameters:
- $date string date to format, otherwise we format current date/time
Function Info:
Return - array[0] is the formatted date and array[1] is the unixtimestamp.

COM_getYearFormOptions

string COM_getYearFormOptions ( $selected )

Gets the <option> values for calendar years
Returns Option list Containing 5 years starting with current 
 unless @selected is < current year then starts with @selected
Function Parameters:
- $selected string Selected year
Function Info:
Return - HTML years as option values
See - COM_getMonthFormOptions(), COM_getDayFormOptions()
See - COM_getHourFormOptions(), COM_getMinuteOptions

COM_hit

void COM_hit ( )

Adds a hit to the system
This function is called in the footer of every page and is used to
 track the number of hits to the Geeklog system.  This information is 
 shown on stats.php
Function Parameters:
Function Info:

COM_isemail

boolean COM_isemail ( $email )

checks to see if email address is valid
This function COM_checks to see if an email address is in the correct from
Function Parameters:
- $email string Email address to verify
Function Info:
Return - True if valid otherwise false

COM_killJS

string COM_killJS ( $Message )

Takes some amount of text and replaces all javascript events on*= with in
This script takes some amount of text and matches all javascript events, on*= (onBlur= onMouseClick=)
  and replaces them with in*=
  Essentially this will cause onBlur to become inBlur, onFocus to be inFocus
  These are not valid javascript events and the browser will ignore them.
Function Parameters:
- $Message string Text to filter
Function Info:
Return - $Message with java filtered
See - COM_checkWords(), COM_checkHTML()

COM_makeList

string COM_makeList ( $listofitems )

Creates an HTML unordered list from the given array.
It formats one list item per array element, using the list.thtml 
 and listitem.thtml templates.
Function Parameters:
- $listofitems array Items to list out
Function Info:
Return - HTML unordered list of array items

COM_makesid

string COM_makesid ( )

Makes an ID based on current date/time
This function COM_creates a 17 digit sid for stories based on the 14 digit date
 and a 3 digit random number that was seeded with the number of microseconds
 (.000001th of a second) since the last full second. NOTE: this is now used for more than
 just stories!
Function Parameters:
Function Info:
Return - $sid Story ID

COM_olderStuff

void COM_olderStuff ( )

Creates older stuff block Creates the olderstuff block for display.
Actually updates the olderstuff record in the gl_blocks database.
Function Parameters:
Function Info:

COM_optionList

string COM_optionList ( $table, $selection, $selected, [$sortcol = 1] )

Creates a <option> list from a database list for use in forms
Creates option list form field using given arguments
Function Parameters:
- $table string Database Table to get data from
- $selection string Comma delimited string of fields to pull The first field is the value of the option and the second is the label to be displayed. This is used in a SQL statement and can include DISTINCT to start.
- $selected string Value (from $selection) to set to SELECTED or default
- $sortcol int Which field to sort option list by 0 (value) or 1 (label)
Function Info:
Return - Formatted HTML of option values
See - COM_checkList()

COM_pollResults

string COM_pollResults ( $qid, [$scale = 400], $order, $mode )

Shows the results of a poll
Shows the poll results for a give poll question
Function Parameters:
- $qid string ID for poll question to show
- $scale int Size in pixels to scale formatted results to
- $order string 'ASC' or 'DESC' for Comment ordering (SQL statement ordering)
- $mode string Comment Mode possible values 'nocomment', 'flat', 'nested', 'threaded'
Function Info:
Return - HTML Formatted Poll Results
See - COM_pollVote(), COM_showPoll()

COM_pollVote

string COM_pollVote ( $qid )

Shows a poll form
Shows an HTML formatted poll for the given question ID
Function Parameters:
- $qid string ID for poll question
Function Info:
Return - HTML Formatted Poll
See - COM_pollResults(), COM_showPoll()

COM_printPageNavigation

string COM_printPageNavigation ( $base_url, $curpage, $num_pages )

Prints Google(tm)-like paging navigation

Function Parameters:
- $base_url string base url to use for all generated links
- $curpage int current page we are on
- $num_pages int Total number of pages
Function Info:
Return - HTML formatted widget

COM_printUpcomingEvents

string COM_printUpcomingEvents ( $help, $title )

Returns the upcoming event block
Returns the HTML for any upcoming events in the calendar
Function Parameters:
- $help string Help file for block
- $title string Title to be used in block header
Function Info:
Return - HTML formatted block containing events.

COM_rdfCharacterData

void COM_rdfCharacterData ( $parser, $data )


Function Parameters:
Function Info:

COM_rdfCheck

void COM_rdfCheck ( $bid, $rdfurl, $date )

Checks to see if it's time to import and RDF/RSS block again
Updates RDF/RSS block if needed
Function Parameters:
- $bid string Block ID
- $rdfurl string URL to get headlines from
- $date string Last time the headlines were imported
Function Info:
See - COM_rdfImport()

COM_rdfEndElement

void COM_rdfEndElement ( $parser, $name )


Function Parameters:
Function Info:

COM_rdfImport

void COM_rdfImport ( $bid, $rdfurl )

This is the actual RDF parser (the above are just helper functions)

Function Parameters:
- $bid string Block ID
- $rdfurl string URL to get content from
Function Info:
See - COM_rdfCheck()

COM_rdfStartElement

void COM_rdfStartElement ( $parser, $name, $attrs )

Imports an RDF/RSS block
This will pull content from another site and store it in the database
 to be shown within a portal block

 new RDF parser provided by Roger Webster
Function Parameters:
Function Info:

COM_rdfUpToDateCheck

void COM_rdfUpToDateCheck ( )

Checks to see if RDF file needs updating and updates it if sol
Checks to see if we need to update the RDF as a result
 of an article with a future publish date reaching it's 
 publish time and if so updates the RDF file.
Function Parameters:
Function Info:
See - COM_exportRDF()

COM_refresh

void COM_refresh ( $url )

Redirects user to a given URL
This function COM_passes a meta tag to COM_refresh after a form is sent.  This is
 necessary because for some reason Nutscrape and PHP4 don't play well with
 the header() function COM_100% of the time.
Function Parameters:
- $url string URL to send user to
Function Info:

COM_setArgNames

boolean COM_setArgNames ( $names )

Wrapper function for URL class so as to not confuse people
This function sets the name of the arguments found in url
Function Parameters:
- $names array Names of arguments in query string to assign to values
Function Info:
Return - True if successful

COM_showBlock

string COM_showBlock ( $name, $help, $title )

Shows a single Geeklog block
This shows a single block and is typically called from
 COM_showBlocks OR from plugin code
Function Parameters:
- $name string Logical name of block (not same as title) -- 'user_block', 'admin_block', 'section_block', 'events_block', 'poll_block', 'whats_new_block'.
- $help string Help file location
- $title string Title shown in block header
Function Info:
Return - HTML Formatted block
See - COM_showBlocks()

COM_showBlocks

string COM_showBlocks ( $side, $topic, $name )

Shows Geeklog blocks
Returns HTML for blocks on a given side and, potentially, for
 a given topic. Currently only used by static pages.
Function Parameters:
- $side string Side to get blocks for (right or left for now)
- $topic string Only get blocks for this topic
- $name string Block name (not used)
Function Info:
Return - HTML Formatted blocks
See - COM_showBlock()

COM_showMessage

string COM_showMessage ( $msg )

Displays a message on the webpage
Pulls $msg off the URL string and gets the corresponding message and returns
 it for display on the calling page
Function Parameters:
- $msg int ID of message to show
Function Info:
Return - HTML block with message

COM_showPoll

String COM_showPoll ( $size, $qid )

This shows a poll
This will determine if a user needs to see the poll form OR the poll
 result.
Function Parameters:
- $sise int Size in pixels of poll results
- $qid string Question ID to show (optional)
Function Info:
Return - HTML Formatted string of Poll
See - COM_pollVote(), COM_pollResults()

COM_showTopics

string COM_showTopics ( $topic )

Shows all available topics Show the topics in the system the user has access to and prints them in HTML.
This function is used to show the topics in the sections block. Topics have href and 
 are separated by line breaks.
Function Parameters:
- $topic string TopicID of currently selected
Function Info:
Return - HTML formatted topic list

COM_siteFooter

string COM_siteFooter ( [$rightblock = false] )

Returns the site footer
This loads the proper templates, does variable substitution and returns the 
 HTML for the site footer.
Function Parameters:
- $rightblock boolean Whether or not to show blocks on right hand side default is no
Function Info:
Return - Formatted HTML containing site footer and optionally right blocks
See - COM_siteHeader()

COM_siteHeader

string COM_siteHeader ( $what )

Returns the site header
This loads the proper templates, does variable substitution and returns the 
 HTML for the site header with or without blocks depending on the value of $what

 Programming Note:

 The two functions COM_siteHeader and COM_siteFooter provide the framework for page display 
 in Geeklog.  COM_siteHeader controls the display of the Header and left blocks and COM_siteFooter
 controls the display of the right blocks and the footer.  You use them like a sandwich.  Thus the 
 following code will display a Geeklog page with both right and left blocks displayed.

 -------------------------------------------------------------------------------------
 <?php
 require_once('lib-common.php');
 $display .= COM_siteHeader();	//Change to COM_siteHeader('none') to not display left blocks
 $display .= "Here is your html for display";
 $display .= COM_siteFooter(true);  // Change to COM_siteFooter() to not display right blocks
 echo $display;
 ?>
 ---------------------------------------------------------------------------------------
 Note that the default for the header is to display the left blocks and the default of the
 footer is to not display the right blocks.

 This sandwich produces code like this (greatly simplified)

 // COM_siteHeader
 <table><tr><td colspan="3">Header</td></tr>
 <tr><td>Left Blocks</td><td>

 // Your HTML goes here
 Here is your html for display

 // COM_siteFooter
 </td><td>Right Blocks</td></tr>
 <tr><td colspan="3">Footer</td></table>
Function Parameters:
- $what string If 'none' then no left blocks are returned, if 'menu' (default) then right blocks are returned
Function Info:
Return - This returns formatted HTML containing the site header
See - COM_siteFooter()

COM_startBlock

string COM_startBlock ( $title, $helpfile, $template )

Prints out standard block header
Prints out standard block header but pulling header HTML formatting from 
 the database.

 Programming Note:  The two functions COM_startBlock and COM_endBlock are used to sandwich your
 block content or use COM_startComment and COM_endBlock for comments.  These functions are not 
 used only for blocks but anything that uses that format, e.g. Stats page.  They are used like
 COM_siteHeader and COM_siteFooter but for internal page elements.
Function Parameters:
- $title string Value to set block title to
- $helpfile string Help file, if one exists
- $template string HTML template file to use to format the block
Function Info:
Return - Formatted HTML containing block header
See - COM_endBlock(), COM_siteHeader()

COM_startComment

string COM_startComment ( )

Same as COM_startBlock, but set up for the comments
Use COM_endBlock to end comment
Function Parameters:
Function Info:
Return - Formatted HTML Starting Comment block
See - COM_startBlock()

COM_topicList

string COM_topicList ( $selection, $selected, [$sortcol = 1] )

Create and return a list of available topics
This is a variation of COM_optionList() from lib-common.php. It will add
 only those topics to the option list which are accessible by the current
 user.
Function Parameters:
- $selection string Comma delimited string of fields to pull The first field is the value of the option and the second is the label to be displayed. This is used in a SQL statement and can include DISTINCT to start.
- $selected string Value (from $selection) to set to SELECTED or default
- $sortcol int Which field to sort option list by 0 (value) or 1 (label)
Function Info:
Return - Formatted HTML of option values
See - COM_optionList()

COM_userComments

string COM_userComments ( $sid, $title, $type, $order, $mode, $pid )

This function displays the comments in a high level format.
Begins displaying user comments for an item
Function Parameters:
- $sid string ID for item to show comments for
- $title string Title of item
- $type string Type of item (article,photo,link,etc.)
- $order string How to order the comments 'ASC' or 'DESC'
- $mode string comment mode (nested, flat, etc.)
- $pid int Parent ID
Function Info:
Return - HTML Formatted Comments
See - COM_commentBar(), COM_commentChildren()

COM_userMenu

string COM_userMenu ( $help, $title )

Shows the user their menu options
This shows the average joe use their menu options. This is the user block on right side
Function Parameters:
- $help string Help file to show
- $title string Title of Menu
Function Info:
Return - HTML of User Block
See - COM_adminMenu()

COM_whatsNewBlock

string COM_whatsNewBlock ( $help, $title )

Shows any new information in block
Return the HTML that shows any new stories, comments, etc
Function Parameters:
- $help string Help file for block
- $title string Title used in block header
Function Info:
Return - Return the HTML that shows any new stories, comments, etc

phpblock_whosonline

string phpblock_whosonline ( )

Shows who is online in slick little block

Function Parameters:
Function Info:
Return - HTML string of online users separated by line breaks.