glFusion Wiki

Site Tools


COM_ Functions

The following COM_ APIs provide a set of common functions for a glFusion site / plugin to utilize. The functions are defined in lib-common.php which should always be included by any glFusion plugin or addon.

Function Description
COM_404 Display an HTML 404 Page.
COM_accessLog Logs message to access.log
COM_adminMenu Prints administration menu
COM_allowedHTML Returns what HTML is allowed in content
COM_applyBasicFilter Filter parameters
COM_applyFilter Filter parameters passed per GET (URL) or POST.
COM_buildOwnerList Build a drop down list of users.
COM_buildURL Returns a crawler friendly URL (if possible)
COM_checkHTML This function checks html tags.
COM_checkList Creates a <input> checklist from a database list for use in forms
COM_checkSpeedlimit Check if speed limit applies
COM_checkVersion Compare 2 version numbers
COM_checkWords Censors inappropriate content
COM_clearSpeedlimit Clear out expired speed limits.
COM_convertDate2Timestamp Convert a text based date YYYY-MM-DD to a unix timestamp integer value
COM_createImage Create an HTML img
COM_createLink Create an HTML link
COM_dateDiff Determines the difference between two dates.
COM_decompress Decompress an archive.
COM_debug Prints out an associative array for debugging.
COM_displayMessageAndAbort Display a message and abort.
COM_emailEscape Encode a string such that it can be used in an email header.
COM_emailUserTopics This will email new stories in the topics that the user is interested in.
COM_endBlock Closes out COM_startBlock.
COM_errorLog Logs messages to error.log or the web page or both.
COM_featuredCheck DEPRECIATED Use STORY_featuredCheck() - Checks and Updates the featured status of all articles.
COM_filterHTML Filters HTML for malicious content
COM_formatBlock Formats a glFusion block.
COM_formatEmailAddress Takes a name and an email address and returns a string that vaguely resembles an email address specification conforming to RFC(2)822.
COM_formatTimeString Creates the string that indicates the timespan in which new items were found.
COM_getAmPmFormSelection Create an am/pm selector dropdown menu.
COM_getArgument Retrieves a $_GET parameter when URL rewrite is enabled.
COM_getBlockTemplate Return the file to use for a block template.
COM_getCharset Get the current character set.
COM_getCurrentURL Try to figure out our current URL, including all parameters.
COM_getDayFormOptions Gets the <option> values for calendar days.
COM_getDisplayName Return the username or fullname for the passed member id (uid).
COM_getEncodingt Return valid character set for use with htmlspecialchars()
COM_getHourFormOptions Gets the <option> values for clock hours.
COM_getImgSizeAttributes Get the HTML for an image with height & width.
COM_getLangSQL Return SQL expression to request language-specific content.
COM_getLanguage Determine current language.
COM_getLanguageFromBrowser Try to determine the user's preferred language by looking at the “Accept-Language” header sent by their browser.
COM_getLanguageId Determine the ID to use for the current language.
COM_getLanguageName Get the name of the current language, minus the character set.
COM_getMinuteFormOptions Gets the <option> values for clock minutes.
COM_getMonthFormOptions Gets the <option> values for calendar months.
COM_getPassword Return the password for the given username.
COM_getPermSQL Return SQL expression to check for permissions.
COM_getRate Occurences / time
COM_getThemes Gets all installed themes.
COM_getTopicImageUrl Return full URL of a topic icon.
COM_getTopicSQL Return SQL expression to check for allowed topics.
COM_getUserCookieTimeout Returns user-defined cookie timeout.
COM_getUserDateTimeFormat Returns formatted date/time for user.
COM_getYearFormOptions Gets the <option> values for calendar years.
COM_handleCode Handles the part within a [code] … [/code] section, i.e. escapes all special characters.
COM_handleError Handle errors.
COM_highlightQuery Highlight the words from a search query in a given text string.
COM_hit Adds a hit to the system.
COM_isAnonUser Checks to see if a specified user, or the current user if non-specified is the anonymous user.
COM_isEmail Checks to see if email address is valid.
COM_isFrontpage DEPRECIATED Check if we're on glFusion's index page [deprecated].
COM_isWritable Determines if directory or file is writable by the web server.
COM_killJS Takes some amount of text and replaces all javascript events on*= with in
COM_mail Send an email.
COM_makeClickableLinks Detect links in a plain-ascii text and turn them into clickable links.
COM_makeList Creates an HTML unordered list from the given array.
COM_makesid Makes an ID based on current date/time.
COM_numberFormat Converts a number for output into a formatted number string.
COM_olderStuff Creates older stuff block.
COM_onFrontpage Check if we're on glFusion's index page.
COM_optionList Creates a <option> list from a database list for use in forms.
COM_printPageNavigation Prints Google™-like paging navigation.
COM_rdfCheck Checks to see if it's time to import and RDF/RSS block again.
COM_rdfImport Syndication import function. Imports headline data to a portal block.
COM_rdfUpToDateCheck Checks to see if RDF file needs updating and updates it if so.
COM_refresh Redirects user to a given URL.
COM_renderMenu Create the menu, i.e.; replace {menu_elements} in the site header with the actual menu entries.
COM_renderWikiText Convert wiki-formatted text to (X)HTML.
COM_resetSpeedlimit Reset the speedlimit.
COM_rootDebugClean Recurse through the error context array removing/blanking password/cookie values.
COM_sanitizeFilename Sanitize a filename.
COM_sanitizeID Ensure an ID contains only alphanumeric characters, dots, dashes, or underscores.
COM_sanitizeUrl Sanitize a URL.
COM_setArgNames Sets the name of the arguments found in URL.
COM_setLangIdAndAttribute Set the {lang_id} and {lang_attribute} variables for a template.
COM_showBlock Shows a single glFusion block.
COM_showBlocks Shows glFusion blocks.
COM_showMessage Displays a message on the webpage.
COM_showMessageFromParameter Displays a message, as defined by URL parameters.
COM_showMessageText Displays a message text in a “System Message” block.
COM_showTopics Shows all available topics.
COM_siteFooter Returns the site footer.
COM_siteHeader Returns the site header.
COM_startBlock Prints out standard block header.
COM_stripslashes Strip slashes from a string only when magic_quotes_gpc = on.
COM_switchLocaleSettings Switch locale settings.
COM_topicArray Return a list of topics in an array.
COM_topicList Create and return a dropdown-list of available topics.
COM_truncate Truncate a string.
COM_undoClickableLinks Undo the conversion of URLs to clickable links (in plain text posts).
COM_undoSpecialChars undo function for htmlspecialchars().
COM_updateSpeedlimit Store post info for speed limit.
COM_userMenu Shows the user their menu options.
COM_whatsNewBlock Shows any new information in a block.
glfusion/development/api/com.txt · Last modified: 2016/10/09 10:09 (external edit)

Page Tools