blogconfig.phpHolds basic configuration constants that are required by all pages. Some of these constants can be over-ridden in either the userdata/userconfig.php or userdata/userconfig.cfg files. Those files do not exist in the default installation, but if created by the user, it will be executed before the body of this file. Summary | Holds basic configuration constants that are required by all pages. | | | | | | Directory name where user data is stored. | | Path delimiter for local paths. | | | | A globally accessible convenience function that takes a variable number of arguments and strings them together with PATH_DELIM. | | A quick global function to define get the path to the current blog even if the BLOG_ROOT constant is not defined. | | | | Reads file contents, respecting the values of the LNBLOG_OPEN_BASEDIR and LNBLOG_PARANOIA configuration constants. | | | | Tells the system what kind of URIs to generate. | | | | The language to use for text. | | Directory to store the localization files. | | Information on the package itself. | | | | The official package name, currently “LnBlog”. | | The version number of the software. | | The full URL of the LnBlog project home page. | | The offical text-blurb description of the software. | | The offical LnBlog copyright notice. | | These are full, valid doctypes to use for pages. | | | | Full doctype for XHTML 1.1 | | Full doctype for XHTML 1.0 Strict | | Full doctype for XHTML 1.0 Transitional | | Full doctype for XHTML 1.0 Frameset | | Full doctype for HTML 4.01 Strict | | Full doctype for HTML 4.01 Transitional | | Full doctype for HTML 4.01 Frameset | | Full doctype for HTML 3.2 | | Assorted configuration constants that don’t fit into any coherent category. | | | | Controls the use of PHP wrapper scripts for pages. | | The DOCTYPE used by your markup. | | The expiration time for the login cookies. | | The default character encoding. | | | | Determine whether to use strftime() or date() for user-readable dates. | | The character set used by the system when returning generated text. | | This is the regular expression used to determine if a local path refers to a user’s web root, which would be referred to with a URI like http://www.example.com/~jowblow/ and vice versa. | | | | | | | | Use an ugly hack with htmlentities() instead of the simpler htmlspecialchars() to deal with problems displaying Unicode characters. | | The file to save the sitemap link list for the menubar. | | Defines the level of header used for the [h] LBCode tag. | | Shows the inline boxes used for old version of the JavaScript editor | | Shows the the buttons to add entities for mathamatical symbols. | | Constants that relate to user authentication | | | | Use sessions in authentication instead of just cookies. | | Username of site administrator. | | File name use to store custom fields that will be listed in user profiles. | | The INI section of the CUSTOM_PROFILE file that holds the list of custom fields. | | Configuration constants regarding date formats and file names. | | | | File name for storing blog metadata. | | Directory name used to store old blog settings. | | The name of the subdirectory of the blog root URL under which blog entries are accessed. | | Directory where draft entries are stored. | | | | | | Default number of entries to display on the front page. | | | | | | Controls whether deleted and modified entries are kept archived, or if they are just permanently deleted. | | The date format used directories for blog entries. | | | | The file name used to store the data for a blog enrty or article. | | The character used to separate individual tags entered for entries. | | Format used to display dates for entries and articles. | | Directory name to access comments on entries and articles. | | Directory name to access trackbacks on entries and articles. | | Directory name to access pingbacks on entries and articles. | | The file suffix for old versions of entries and articles. | | The name of the “sticky” file for articles. | | | | | | File suffix used for storing TrackBacks. | | | | | | File suffix used for storing Pingbacks. | | Configuration constants used for controlling reader comments. | | | | Determine whether to use the rel=”nofollow” attribute in links in comments. | | | | Default name for users who don’t enter a name. | | Default text if the user does not enter a subject. | | Date format string to use for comment file names. | | File suffix to use for comment files. | | Leaf directory name where deleted comments are stored. | | Controls the default setting for whether e-mail addresses in comments are visible to everybody. |
EssentialsSummary | | | Directory name where user data is stored. | | Path delimiter for local paths. | | | | A globally accessible convenience function that takes a variable number of arguments and strings them together with PATH_DELIM. | | A quick global function to define get the path to the current blog even if the BLOG_ROOT constant is not defined. | | | | Reads file contents, respecting the values of the LNBLOG_OPEN_BASEDIR and LNBLOG_PARANOIA configuration constants. | | | | Tells the system what kind of URIs to generate. | | | | The language to use for text. | | Directory to store the localization files. |
USER_DATADirectory name where user data is stored. The standard name is “userdata”.
PATH_DELIMPath delimiter for local paths. This is calculated at run-time and is set to ‘/’ for UNIX-like systems and ‘\’ for Windows systems.
mkpathA globally accessible convenience function that takes a variable number of arguments and strings them together with PATH_DELIM. ReturnsA string with each of the arguments separated by PATH_DELIM.
get_blog_pathA quick global function to define get the path to the current blog even if the BLOG_ROOT constant is not defined. ReturnsThe full path to the blog.
load_plugin| function load_plugin( | $plugin_name | ) |
|
Loads a plugin. This is used for plugins that do page output and will result in the plugin outputing its markup. Note that not all plugins support this and for those that do, it is configurable as an option, with the alternative being using the event system. Parameters| plugin_name | The name of the class for this plugin. |
ReturnsAn instance of the plugin. The return value may safely be disregarded.
read_file| function read_file( | $filename | ) |
|
Reads file contents, respecting the values of the LNBLOG_OPEN_BASEDIR and LNBLOG_PARANOIA configuration constants. If LNBLOG_OPEN_BASEDIR and LNBLOG_PARANOIA are not defined or set to false, then this function behaves exactly like the standard file() function. If LNBLOG_OPEN_BASEDIR is set, it will return false for any attempt to read a file that is above that directory in the filesystem. So for example, if LNBLOG_OPEN_BASEDIR = /var/www/demo, then this will return the contents of /var/www/demo/file.txt or /var/www/demo/foo/bar.txt, but it will return false for /var/www/myfile.txt If LNBLOG_PARANOIA is set, this will return false when attempting to open any file with a .php extension. So, for example, it would open /var/www/demo/foo.txt, but would return false for /var/www/demo/foo.php.
URI_TYPETells the system what kind of URIs to generate. The available values are as follows. directory - Convert local directory paths directly into URIs using the old wrapper script method. querystring - Use ugly old query string URIs. htaccess - Use query strings made pretty with Apache rewrite rules. Note that this only works on Apache servers with support for mod_rewrite and .htaccess files. The default mode is “directory”.
DEFAULT_LANGUAGEThe default language. If a translation does not exist for your specified language, then this will be used as the “last resort.” This is set to “en_US”.
LANGUAGEThe language to use for text. This setting controls which language is used for the templates and other literal text that LnBlog outputs. The default is to use the value of the LANG environment variable, if it is set. If not, this is set to the DEFAULT_LANGUAGE and the LANG environment variable is set. Please note that this constant is also used to set the locale, as follows. setlocale(LC_ALL, LANGUAGE);
Because of this, it is important to note that Windows uses different values for languages than UNIX and Linux systems. In Linux, for example, a German locale might be “de_DE”, whereas on Windows it woule be “deu”.
LOCALEDIRDirectory to store the localization files. This is used by both GNU gettext and the ad hoc translation system.
Package informationInformation on the package itself. Summary | | | The official package name, currently “LnBlog”. | | The version number of the software. | | The full URL of the LnBlog project home page. | | The offical text-blurb description of the software. | | The offical LnBlog copyright notice. |
PACKAGE_NAMEThe official package name, currently “LnBlog”.
PACKAGE_VERSIONThe version number of the software. This is a string in the format “1.2.3”. Note that each number may be more than one digit.
PACKAGE_URLThe full URL of the LnBlog project home page.
PACKAGE_DESCRIPTIONThe offical text-blurb description of the software.
PACKAGE_COPYRIGHTThe offical LnBlog copyright notice.
Page DOCTYPEsThese are full, valid doctypes to use for pages. See DEFAULT_DOCTYPE. Summary | | | Full doctype for XHTML 1.1 | | Full doctype for XHTML 1.0 Strict | | Full doctype for XHTML 1.0 Transitional | | Full doctype for XHTML 1.0 Frameset | | Full doctype for HTML 4.01 Strict | | Full doctype for HTML 4.01 Transitional | | Full doctype for HTML 4.01 Frameset | | Full doctype for HTML 3.2 |
XHTML_1_1Full doctype for XHTML 1.1
XHTML_1_0_StrictFull doctype for XHTML 1.0 Strict
XHTML_1_0_TransitionalFull doctype for XHTML 1.0 Transitional
XHTML_1_0_FramesetFull doctype for XHTML 1.0 Frameset
HTML_4_01_StrictFull doctype for HTML 4.01 Strict
HTML_4_01_TransitionalFull doctype for HTML 4.01 Transitional
HTML_4_01_FramesetFull doctype for HTML 4.01 Frameset
HTML_3_2Full doctype for HTML 3.2
Miscellaneous configurationAssorted configuration constants that don’t fit into any coherent category. Summary | | | Controls the use of PHP wrapper scripts for pages. | | The DOCTYPE used by your markup. | | The expiration time for the login cookies. | | The default character encoding. | | | | Determine whether to use strftime() or date() for user-readable dates. | | The character set used by the system when returning generated text. | | This is the regular expression used to determine if a local path refers to a user’s web root, which would be referred to with a URI like http://www.example.com/~jowblow/ and vice versa. | | | | | | | | Use an ugly hack with htmlentities() instead of the simpler htmlspecialchars() to deal with problems displaying Unicode characters. | | The file to save the sitemap link list for the menubar. | | Defines the level of header used for the [h] LBCode tag. | | Shows the inline boxes used for old version of the JavaScript editor | | Shows the the buttons to add entities for mathamatical symbols. |
USE_WRAPPER_SCRIPTSControls the use of PHP wrapper scripts for pages. When this is turned on, LnBlog will use a series of wrapper PHP scripts to include the files that build pages. This results in a clean, directory-based URL structure. If this is set to false, then LnBlog will revert to a URL scheme based on query strings. The up side of doing things this way is that you never need to upgrade the wrapper scripts. You can achieve a clean URL structure this way if you have Apache and an appropriate .htacces file. Defaults to true. Note: this is not yet implemented.
DEFAULT_DOCTYPEThe DOCTYPE used by your markup. The default is XHTML 1.0 Strict.
LOGIN_EXPIRE_TIMEThe expiration time for the login cookies. If set to an integer value, the cookies used for user logins will expire that number of seconds from the current time. So, if you set this to 3600, then the user will be logged out in 1 hour. The default is false, which means cookies expire when the session ends.
DEFAULT_CHARSETThe default character encoding. This is the encoding included in the Content-Type meta tag for each page. There are two defaults for this setting. If the default_charset INI variable is set, then that value is used. If it is not set, then the default is to use “utf-8”, which is an ASCII-compatible Unicode encoding.
DEFAULT_MIME_TYPEThe default MIME type to accompany DEFAULT_CHARSET in the Content-Type. As with DEFAULT_CHARSET, there are two possible defaults for this. If the default_mimetype INI variable is set, then that value is used. If it is not, then the default is “text/html”.
USE_STRFTIMEDetermine whether to use strftime() or date() for user-readable dates. Defaults to true. When set to false, things like entry dates will be formatted using the function date() instead of strftime(). If you change this, you will also need to change the ENTRY_DATE_FORMAT.
SYSTEM_CHARSETThe character set used by the system when returning generated text. This is used in conjunction with USE_STRFTIME to automatically convert characters. By default, this is not set. When it is set and the iconv extension is enabled, then the dates will be converted from this character set to the DEFAULT_CHARSET.
LOCALPATH_TO_URI_MATCH_REThis is the regular expression used to determine if a local path refers to a user’s web root, which would be referred to with a URI like http://www.example.com/~jowblow/ and vice versa. The generated URI will use the parent of the document root, e.g. /home/users/joeblow/www/ would be translated to /~joeblow/. Depending on your setup, you may need to add components before the username or change the document root from www to something else. Of course, if you don’t use ~user directories, you can probably ignore this. Default is “/^\/home\/([^\/]+)\/www(.*)/i”.
URI_TO_LOCALPATH_MATCH_REThe reverse of LOCALPATH_TO_URI_MATCH_RE. This is the regular expression that matches part of a root-relative URI and extracts a directory name. Default is “/^\/~([^\/]+)(.*)/i”.
UNICODE_ESCAPE_HACKUse an ugly hack with htmlentities() instead of the simpler htmlspecialchars() to deal with problems displaying Unicode characters. This is to account for character encoding issues. The basic situation is that, for whatever reason, it appears that if the many browsers will automatically escape characters in the wrong encoding to numeric HTML character codes. When sanitizing this input with htmlentities(), the ampersands get converted to & and so need to be converted back. When this is set to true, that’s what happens. When this is set to false, input will only be sanitized with htmlspecialchars(), which does fewer substitutions in the first place. This mode does not effect the above mentioned auto-conversion, so you should only use this if you’re sure nobody is going to be posting to the site in a character set that differs from the one defined by the server. Note that this setting only applies to posts (including comments) that use LBCode or auto-markup. Raw HTML code is left completely unmodified. Default is true.
SITEMAP_FILEThe file to save the sitemap link list for the menubar. Default is “sitemap.htm”.
LBCODE_HEADER_WEIGHTDefines the level of header used for the [h] LBCode tag. Default is 3.
EDITOR_HIDE_INLINE_BOXESShows the inline boxes used for old version of the JavaScript editor Default is false.
EDITOR_HIDE_SYMBOLSShows the the buttons to add entities for mathamatical symbols. Default is false.
User AuthenticationConstants that relate to user authentication Summary | | | Use sessions in authentication instead of just cookies. | | Username of site administrator. | | File name use to store custom fields that will be listed in user profiles. | | The INI section of the CUSTOM_PROFILE file that holds the list of custom fields. |
AUTH_USE_SESSIONUse sessions in authentication instead of just cookies. Default is true.
ADMIN_USERUsername of site administrator. This is the only one who can add or delete blogs. Default is “administrator”.
CUSTOM_PROFILEFile name use to store custom fields that will be listed in user profiles. This file is in INI format, with key names corresponding to the custom field names and values being the label displayed for the field.
CUSTOM_PROFILE_SECTIONThe INI section of the CUSTOM_PROFILE file that holds the list of custom fields.
Blog configurationConfiguration constants regarding date formats and file names. Summary | | | File name for storing blog metadata. | | Directory name used to store old blog settings. | | The name of the subdirectory of the blog root URL under which blog entries are accessed. | | Directory where draft entries are stored. | | | | | | Default number of entries to display on the front page. |
BLOG_CONFIG_PATHFile name for storing blog metadata. Note that this is specific to file-based storage and should not be used for database storage. Default is “blogdata.ini”.
BLOG_DELETED_PATHDirectory name used to store old blog settings. Note that this is only for file-based storage that uses history-tracking. Default is “deleted”.
BLOG_ENTRY_PATHThe name of the subdirectory of the blog root URL under which blog entries are accessed. This may not necessarily be a real directory on the server. Default is “entries”.
ENTRY_DRAFT_PATHDirectory where draft entries are stored. Default is “drafts”.
BLOG_ARTICLE_PATHLike BLOG_ENTRY_PATH, except for static articles. Default is “content”.
BLOG_RSS_PATHLike BLOG_ENTRY_PATH, except for accessing RSS feeds. Default is “feeds”.
BLOG_MAX_ENTRIESDefault number of entries to display on the front page. This constant is used as a default setting for creating new blogs and can be over-ridden on a per-blog basis. In other words, not every blog will use this value. Default is 10.
Blog entry and Article configurationSummary | | | Controls whether deleted and modified entries are kept archived, or if they are just permanently deleted. | | The date format used directories for blog entries. | | | | The file name used to store the data for a blog enrty or article. | | The character used to separate individual tags entered for entries. | | Format used to display dates for entries and articles. | | Directory name to access comments on entries and articles. | | Directory name to access trackbacks on entries and articles. | | Directory name to access pingbacks on entries and articles. | | The file suffix for old versions of entries and articles. | | The name of the “sticky” file for articles. |
KEEP_EDIT_HISTORYControls whether deleted and modified entries are kept archived, or if they are just permanently deleted. The default is false, which mean that deleted items are gone forever. In previous versions, the default behavior was to save these, despite the fact that there was no interface for dealing with them.
ENTRY_PATH_FORMATThe date format used directories for blog entries. The formats here are passed to the PHP strftime(), so check the docs on that for details. The creation timestamp of the blog entry is used to return the exact value. Programmers should also note that the “directories” referenced here are components of a URI and may not be real directories on the server. The default is “d_Hi”, which is the day, hour, and minute. For example, 10_1215 would be returned for 12:15 PM on the 10th of the month.
ENTRY_PATH_FORMAT_LONGAn alternate to ENTRY_PATH_FORMAT. This format was used in earlier versions of the software, but is retained in case there is a need to fall back to a longer format. The default is “d_His”, which is the same as ENTRY_PATH_FORMAT, but includes the seconds at the end.
ENTRY_DEFAULT_FILEThe file name used to store the data for a blog enrty or article. Note that this is specific to file-based storage. The default is “current.htm”.
TAG_SEPARATORThe character used to separate individual tags entered for entries. The default is a comma (“,”).
ENTRY_DATE_FORMATFormat used to display dates for entries and articles. Note that, like ENTRY_PATH_FORMAT this string includes strftime() scancodes. The default is “%Y-%m-%d %H:%M %Z”, which gives a date like “2005-08-16 04:26 EST”.
ENTRY_COMMENT_DIRDirectory name to access comments on entries and articles. Default is “comments”.
ENTRY_TRACKBACK_DIRDirectory name to access trackbacks on entries and articles. Default is “trackback”.
ENTRY_PINGBACK_DIRDirectory name to access pingbacks on entries and articles. Default is “pingback”.
ENTRY_PATH_SUFFIXThe file suffix for old versions of entries and articles. Note that this only applies to file-based storage when using history tracking. The default is “.htm”.
STICKY_PATHThe name of the “sticky” file for articles. In the file-based storage implementation, when this file exists in an article directory, the article will be treated as “sticky,” meaning it will be displayed in the default sidebar. This file may contain some of the article metadata. The exact content is intentionally left undocumented, but will include at least the subject. The default value is “sticky.txt”.
Trackback configurationSummary | | | File suffix used for storing TrackBacks. |
TRACKBACK_PATH_SUFFIXFile suffix used for storing TrackBacks. Note that this is specific to file-based storage. The default is “.txt”.
Pingback configurationSummary | | | File suffix used for storing Pingbacks. |
PINGBACK_PATH_SUFFIXFile suffix used for storing Pingbacks. Note that this is specific to file-based storage. The default is “.txt”.
Comment configurationConfiguration constants used for controlling reader comments. Summary | | | Determine whether to use the rel=”nofollow” attribute in links in comments. | | | | Default name for users who don’t enter a name. | | Default text if the user does not enter a subject. | | Date format string to use for comment file names. | | File suffix to use for comment files. | | Leaf directory name where deleted comments are stored. | | Controls the default setting for whether e-mail addresses in comments are visible to everybody. |
COMMENT_NOFOLLOWDetermine whether to use the rel=”nofollow” attribute in links in comments. This attribute is a comment spam fighting measure instituted by Google, who will not index links with this attribute. Default is true.
KEEP_COMMENT_HISTORYLike KEEP_EDIT_HISTORY, except for comments. Default is false Again, this was previously on my default, but is now off.
ANON_POST_NAMEDefault name for users who don’t enter a name. Default is “Anonymous Reader”.
NO_SUBJECTDefault text if the user does not enter a subject. Default is “No Subject”.
COMMENT_PATH_FORMATDate format string to use for comment file names. The default is “Y-m-d_His”.
COMMENT_PATH_SUFFIXFile suffix to use for comment files. Default is “.txt”.
COMMENT_DELETED_PATHLeaf directory name where deleted comments are stored. The default is “deleted”.
COMMENT_EMAIL_VIEW_PUBLICControls the default setting for whether e-mail addresses in comments are visible to everybody. The default is false, which means only logged-in users can see e-mail addresses specified as non-public.
|