Frontend Config Options

The table below lists all the configuration variables available in the included onpub_conf.php config file. Each variable has a default value and a description of what frontend functionality it controls. All of these variable's default values can be overriden via the onpub_conf_local.php file as described here.

Variable Name Description Default Value
Database Config
$onpub_db_host MySQL server host where the Onpub database schema is installed. Change the value of this variable to the hostname of your MySQL server if it's not running on the same server as Onpub. 'localhost'
$onpub_db_name MySQL database where Onpub schema is installed. Change the value of this variable to the name of the MySQL database where you'd like to install the Onpub schema the first time you login to the Onpub content management interface. ''
$onpub_db_user MySQL username used to connect to Onpub database. Change the value of this variable to the username that has at least read access to the database where you installed the Onpub database schema. ''
$onpub_db_pass MySQL password used to connect to Onpub database. Change the value of this variable to the password of the MySQL user defined by the variable above. ''
Directories Config
$onpub_dir_root Path to the root Onpub directory. All files and directories below this variable are included/referenced relative to the path defined here. For example if you change the value of this variable to 'onpub/', all directories defined below will be referenced by the frontend relative to this path, e.g.: onpub/api/, onpub/frontend/, etc. This enables you to symlink the frontend index.php and onpub_conf_*.php files from a location outside of the root onpub/ installation directory. ''
$onpub_dir_local Path to local include files. Please note that all path names defined in this section must include a trailing slash ('/') character. Change the value of this variable if you want to store your local include files in a directory other than the default defined here. See the Local Files Include section below for a list of file names that will automatically be included by the frontend if they exist in this directory. $onpub_dir_root . 'local/'
$onpub_dir_api Path to OnpubAPI directory. It is recommended that you leave this value unchanged. $onpub_dir_root . 'api/'
$onpub_dir_yui Path to YUI directory. This directory contains the YUI 3 distribution. Rename or delete this directory if you'd like to include the YUI files from Yahoo!'s CDN instead. Using the CDN is recommended for production websites since you should experience faster site loading performance. $onpub_dir_api . 'yui/build/'
$onpub_dir_phpthumb Path to the phpThumb installation directory. $onpub_dir_api . 'phpThumb/'
$onpub_dir_frontend Path to default Onpub frontend directory. This variable is useful for pointing Onpub to a different frontend include path. For example, you could copy the entire frontend/ directory to a new directory called frontend-custom/ and then change the value of this variable to 'frontend-custom/'. Onpub would then automatically include the frontend files from the frontend-custom/ directory. This is one way to use the existing Onpub frontend code as a starting-point to create a totally custom layout/design while still using the Onpub content management interface to keep your site updated. $onpub_dir_root . 'frontend/'
$onpub_dir_manage Path to the Onpub management interface. It is recommended that you leave this value unchanged. $onpub_dir_root . 'manage/'
Frontend Display Config
$onpub_disp_website ID of Onpub Website you want the frontend to display. Most people will not need to modify this variable since the first website you create with Onpub will have an ID of 1. 1
$onpub_disp_article ID of Onpub Article to display on the frontend home page. Set this to null if you don't want to display an article on the home page. Or change this to the ID of the Onpub article you want to display on the home page. By default, the first article you create with Onpub is displayed on the frontend home page (index.php). 1
$onpub_disp_updates Set this to false if you do not want to display the "What's New" section on the home page. true
$onpub_disp_updates_num Number of "What's New" articles to display on the home page if $onpub_disp_updates is true. This also controls the number of items generated within the RSS feed if $onpub_disp_rss is true. 5
$onpub_disp_login Set this to false to prevent the Onpub "Login" hyperlink from showing up anywhere on the frontend interface. Setting this to false will also hide the "Powered by Onpub" link to onpub.com. true
$onpub_disp_menu Set this to false to hide the Onpub horizontal navigation menu bar. true
$onpub_disp_rss Set this to false to disable the site's RSS feed. true
Local File Includes Config
$onpub_inc_foot If this file exists in the $onpub_dir_local directory it will automatically be included by the frontend right before the closing </body> tag on every page. $onpub_dir_local . 'onpub_foot.php'
$onpub_inc_head If this file exists in the $onpub_dir_local directory, it is included by the frontend immediately before the opening <head> tag on every page. Suitable for initializing JavaScript variables and/or other dynamic PHP or JavaScript code. $onpub_dir_local . 'onpub_head.php'
$onpub_inc_banner If this file exists in the $onpub_dir_local directory, it is included by the frontend immediately before the <div id="onpub-header"> section on every page. This file is useful for including code that will display an ad banner or other page header content that's separate from the site logo and navigation at the top of every page served by the frontend. $onpub_dir_local . 'onpub_banner.php'
$onpub_inc_article_updates If this file exists in the $onpub_dir_local directory, it is included directly after the "What's New" section on the home page. This file will only be included on the page if $onpub_disp_updates = true. $onpub_dir_local . 'onpub_article_updates.php'
$onpub_inc_article_info If this file exists in the $onpub_dir_local directory, it is included in the right-side column beside the published/updated dates <div> on article pages only. We use this file to include our AddThis code for our articles and blog posts. $onpub_dir_local . 'onpub_article_info.php'
$onpub_inc_article_foot If this file exists in the $onpub_dir_local directory, it is included immediately after the main content section on all frontend article pages. We use this file to include our Disqus comment threading code. $onpub_dir_local . 'onpub_article_foot.php'
$onpub_inc_css If this file exists in the $onpub_dir_local directory, this file is included in place of the default Onpub frontend CSS file. This allows you to redefine the frontend's default CSS classes. Tweaking this file allows you to create your own custom-branded Onpub frontend design. $onpub_dir_local . 'onpub.css'
$onpub_inc_css_menu If this file exists in the $onpub_dir_local directory, this file is included in place of the default Onpub frontend horizontal navigation menu CSS file. This allows you to redefine the CSS classes that specify the style of the navigation menu. $onpub_dir_local . 'onpub-menu.css'
YUI Config
$onpub_yui_version This variable is only used if the $onpub_dir_yui directory does not exist. If that directory is missing, this variable specifies the version of YUI that will be automatically downloaded from Yahoo!'s CDN. The default value of this variable will usually be set to whatever the most recent version of YUI 3 is at the time new versions of Onpub are released. '3.4.1'