Create additional HTML or PHP pages directly from the Administrator Control Panel.
- About
- Getting Started
- Settings
- Templates
- Usage
- Plugins
- Built Using
- Authors
- Acknowledgments
- Support & Feedback
OUGC Pages is a versatile and feature-rich PHP plugin designed for MyBB forum administrators. It empowers administrators to effortlessly create, manage, and customize unlimited HTML or PHP pages within their forum. With this plugin, administrators can enhance their forum's functionality by adding unique and personalized content.
The plugin offers a user-friendly interface for creating, editing, and organizing pages, while its SEO-friendly URLs ensure optimal search engine visibility. Administrators can take advantage of features like seamless page export and import, extensive group access permissions, unlimited page categories, and automatic menu creation. From About Us pages to FAQ sections and more, it provides a comprehensive solution for creating engaging and dynamic custom content within MyBB forums.
The following information will assist you into getting a copy of this plugin up and running on your forum.
A setup that meets the following requirements is necessary to use this plugin.
- MyBB >= 1.8
- PHP >= 7
- MyBB-PluginLibrary >= 13
.
βββ inc
β βββ plugins
β β βββ ougc
β β β βββ Pages
β β β β βββ admin
β β β β β βββ module.php
β β β β βββ templates
β β β β β βββ .html
β β β β β βββ adminCategoryName.html
β β β β β βββ adminCategoryStatus.html
β β β β β βββ adminCodeMirror.html
β β β β β βββ adminCodeMirrorFooter.html
β β β β β βββ adminGroupSelect.html
β β β β β βββ adminPageName.html
β β β β β βββ category_link.html
β β β β β βββ category_list.html
β β β β β βββ category_list_empty.html
β β β β β βββ category_list_item.html
β β β β β βββ menu.html
β β β β β βββ menu_css.html
β β β β β βββ menu_item.html
β β β β β βββ navigation.html
β β β β β βββ navigation_next.html
β β β β β βββ navigation_previous.html
β β β β β βββ page_link.html
β β β β β βββ wrapper.html
β β β β β βββ wrapper_edited.html
β β β β β βββ wrapper_ucp.html
β β β β β βββ wrapper_ucp_nav.html
β β β β β βββ wrapper_ucp_nav_item.html
β β β β βββ admin.php
β β β β βββ adminHooks.php
β β β β βββ core.php
β β β β βββ forumHooks.php
β β β β βββ settings.json
β β βββ ougc_pages.php
β βββ languages
β β βββ espanol
β β β βββ ougc_pages.lang.php
β β β βββ admin
β β β β βββ config_ougc_pages.lang.php
β β βββ english
β β β βββ ougc_pages.lang.php
β β β βββ admin
β β β β βββ config_ougc_pages.lang.php
βββ admin
β βββ modules
β β βββ config
β β β βββougc_pages.php
βββ pages.php
erDiagram
CATEGORIES {
int cid PK "category identifier"
string(100) name "Only 100 characters allowed"
string(255) description "Only 255 characters allowed"
string(100) url UK "Only 100 characters allowed"
string(255) allowedGroups "Only 255 characters allowed"
int disporder "Display order"
int visible "1 for enabling the category"
int breadcrumb "1 for displaying the category inside the page breadcrumb"
int displayNavigation "1 for displaying previous/next navigation inside pages"
int buildMenu "1 for building a category menu"
int wrapucp "1 to wrap the category inside the UserCP sidebar"
}
PAGES {
int pid PK "page identifier"
int cid FK "category identifier"
string(100) name "Only 100 characters allowed"
string(255) description "Only 255 characters allowed"
string(100) url UK "Only 100 characters allowed"
string(255) allowedGroups "Only 255 characters allowed"
int disporder "Display order"
int visible "1 for enabling the page"
int menuItem "1 for displaying to category menu"
int wrapper "1 to use a page wrapper"
int wol "1 to update session location"
int php "1 for PHP pages"
int classicTemplate "1 for using a theme template"
int init "Initialization point"
string template "Page contents"
int dateline "Edition time stamp"
}
CATEGORIES ||--|{ PAGES : contains
Follow the next steps in order to install a copy of this plugin on your forum.
- Download the latest package from the MyBB Extend site or from the repository releases.
- Upload the contents of the Upload folder to your MyBB root directory.
- Browse to Configuration Β» Plugins and install this plugin by clicking Install & Activate.
- Browse to Configuration Β» Manage Pages to create page categories and pages.
Follow the next steps in order to update your copy of this plugin.
- Browse to Configuration Β» Plugins and deactivate this plugin by clicking Deactivate.
- Follow step 1 and 2 from the Install section.
- Browse to Configuration Β» Plugins and activate this plugin by clicking Activate.
- Browse to Configuration Β» Manage Pages to create page categories and pages.
If you are updating to 1.8.33 from any previous version:
- After following the above steps, make sure to review your settings, templates, categories, and pages, as they suffered major updates for this version.
The building of category menus requires that you edit the header
template for each of your themes.
- Open the
header
template for editing. - Find
<li><a href="{$mybb->settings['bburl']}/misc.php?action=help" class="help">{$lang->toplinks_help}</a></li>
. - Add
<!--OUGC_PAGES_FOOTER-->
right after. - Save the template.
Below you can find a description of the plugin settings.
- Use SEO friendly URLs
yesNo
Key:seo
Default:no
- Whether if to enable SEO friendly URLs for pages.
- Page URL Scheme
text
Key:seo_scheme
Default:page-{url}
- Enter the Page URL scheme. Leave empty to disable SEO URLs for Pages.
- Category URL Scheme
text
Key:seo_scheme_categories
Default:category-{url}
- Enter the Category URL scheme. Leave empty to disable SEO URLs for Categories.
- Items Per Page
numeric
Key:perpage
Default:20
- Maximum number of items to show per page in the ACP list.
- UserCP Nav Priority
select
Key:usercp_priority
Default:40
- The priority given to UserCP navigation categories.
Additionally, you can force your settings by updating the SETTINGS
array constant in the ougc\Pages\Core
namespace in the ./inc/plugins/ougc_pages.php
file. Any setting set this way will always bypass any front-end
configuration. Use the setting key as shown below:
define('ougc\Pages\Core\SETTINGS', [
'seo' => false,
'seo_scheme' => 'page-{url}',
'seo_scheme_categories' => 'category-{url}',
'perpage' => 20,
'usercp_priority' => 40
]);
PHP code is disabled by default when uploading the plugin files. You can allow initExecute()
to run eval()
by
setting the enableEval
setting to true
. This setting can not be set from the front-end and has to be set by
editing the plugin settings at file-level in the ./inc/plugins/ougc_pages.php
file:
define('ougc\Pages\Core\SETTINGS', [
'enableEval' => true
]);
To successfully use friendly urls for your page categories and pages, you need to follow the next steps:
- Enable the Use SEO friendly URLs global setting.
- Update your
.htaccess
or your NGINX configuration file to include the necessary rewrite rules.
The following would be the rewrite rules for .htacccess
when using the default URL schemes:
RewriteRule ^category\-([^./]+)/?$ pages.php?category=$1 [L,QSA,NC]
RewriteRule ^page\-([^./]+)/?$ pages.php?page=$1 [L,QSA,NC]
The following would be the rewrite rules for NGINX when using the default URL schemes:
rewrite ^/((?i)category-([^./]+))$ /pages.php?category=$2;
rewrite ^/((?i)page-([^./]+))$ /pages.php?page=$2;
The following is a list of templates available for this plugin. Uncommon in plugins, we use some templates exclusively for the Administrator Control Panel.
ougcpages
- front end; used when viewing a category or non-PHP pages
ougcpages_adminCategoryName
- back end; used when viewing categories
ougcpages_adminCategoryStatus
- back end; used when viewing a category or page
ougcpages_adminCodeMirror
- back end; used when adding or editing a page
ougcpages_adminCodeMirrorFooter
- back end; used when adding or editing a page
ougcpages_adminGroupSelect
- back end; used when adding or editing a category or page
ougcpages_category_link
- back end; used for building a category link
ougcpages_page_link
- back end; used for building a page link
ougcpages_adminPageName
- back end; used when viewing pages in a category
ougcpages_category_list
- front end; used when viewing a category
ougcpages_category_list_empty
- front end; used when viewing a category
ougcpages_category_list_item
- front end; used when viewing a category
ougcpages_menu
- front end; used when category
buildMenu
is1
- front end; used when category
ougcpages_menu_css
- front end; used when category
buildMenu
is1
- front end; used when category
ougcpages_menu_item
- front end; used when category
buildMenu
is1
- front end; used when category
ougcpages_navigation
- front end; used when category
displayNavigation
is1
- front end; used when category
ougcpages_navigation_next
- front end; used when category
displayNavigation
is1
- front end; used when category
ougcpages_navigation_previous
- front end; used when category
displayNavigation
is1
- front end; used when category
ougcpages_wrapper
- front end; used when page
wrapper
is1
- front end; used when page
ougcpages_wrapper_edited
- front end; used page category
wrapper
is1
- front end; used page category
ougcpages_wrapper_ucp
- front end; used when category
wrapucp
is1
- front end; used when category
ougcpages_wrapper_ucp_nav
- front end; used when category
wrapucp
is1
- front end; used when category
ougcpages_wrapper_ucp_nav_item
- front end; used when category
wrapucp
is1
- front end; used when category
The following is a description of the Administrator Control Panel module form fields.
- Display Order
text
- The display order for each category.
- Status
text
- Toggle category enabled status.
- Category Name
text
- Display name for this category.
- Category Description
text
- Insert the description for this category.
- Unique URL
text
- Insert the unique URL identifier for this category.
- Viewable for Groups
select
Default:all
- Select the groups that are allowed to browse this category.
- Display in Breadcrumb
yesNo
Default:yes
- Toggle to display this category in the navigation breadcrumb.
- Show Navigation
yesNo
Default:yes
- Toggle to show a previous/next pagination when browsing pages in this category.
- Build Menu
yesNo
Default:yes
- Toggle to build a dropdown menu for this category in the header.
- Wrap UserCP Menu
yesNo
Default:no
- If enabled, a section will be added to the UserCP for browsing this category and the category will be wrapped as if it was a UserCP section. Beware of errors if you allow guest access.
- Display Order
text
- The display order for each category.
- Status
text
- Toggle category enabled status.
- Category
select
- Select the category this page belongs to.
- Page Name
text
- Display name for this page.
- Page Description
text
- Insert the description for this page.
- Unique URL
text
- Insert the unique URL identifier for this page.
- Viewable for Groups
select
Default:all
- Select the groups that are allowed to see this page.
- Add to Menu
yesNo
Default:yes
- If "Build Menu" is enabled for this category, add link to this page in it.
- Use Template Wrapper
yesNo
Default:yes
- If enabled, the contents of non-PHP pages will be wrapped within the
ougcpages_wrapper
template.
- If enabled, the contents of non-PHP pages will be wrapped within the
- Show In Who Is Online (WOL) List
yesNo
Default:yes
- If disabled, activity within this page will be displayed as "Unknown location" pointing to the home page.
- Eval PHP Code
yesNo
Default:no
* See Enable PHP Pages.- If enabled, this page wilL be parsed as plain PHP code. Disable to use HTML content instead.
- Use Theme Template
yesNo
Default:no
- If enabled, the "Page Content" below will be ignored and a theme template will be used instead. The name for the
template should follow the format
ougcpages_pagePID
, for example:ougcpages_page18
- If enabled, the "Page Content" below will be ignored and a theme template will be used instead. The name for the
template should follow the format
- PHP Initialization Point
select
- Select the script section where this page should be loaded in when "Eval PHP Code" is enabled.
- Initialization: Not even all plugins are checked at this point. Very low resource consumption. Around 4-6 queries are ran by this point.
- Global Start: Mainly only session and language have been loaded. Around 6-8 queries are ran by this point.
- Global Intermediate: Theme and templates have been loaded without header, welcome block, or footer being available yet. Around 8-10 queries are ran by this point.
- Global End: Default; if unsure select this. Has the most compatibility for all forum features. Around 9-13 queries are ran by this point.
- Select the script section where this page should be loaded in when "Eval PHP Code" is enabled.
- Page Content
text
- Insert the page HTML or PHP content below.
- Local File
file
- Select the XML file to import from your computer.
- URL File
text
- Insert the URL of the XML file to import.
- Ignore Version Compatibility
yesNo
Default:yes
- Should this page be imported regardless of the version of OUGC Pages or Page Manager it was created for?.
The download package ships with nine example pages that can be used as production pages or as a reference for designing custom pages.
- Forum stats signature File:
Signature/OUGC_Pages_Signature.xml
- A dynamically generated signature image that displays stats about your forum.
- Banned List File:
OUGC_Pages_Banned_List.xml
- Displays a list of banned accounts.
- HTML Test Page File:
OUGC_Pages_HTML_Test_Page.xml
- Plain HTML page meant to serve as reference.
- List Profile Fields File:
OUGC_Pages_List_Profile_Fields.xml
- Displays a list of users and their custom profile fields values.
- New Thread File:
OUGC_Pages_New_Thread.xml
- A new thread page meant to serve as reference.
- PHP Test Page File:
OUGC_Pages_PHP_Test_Page.xml
- Basic PHP page that uses the MyBB parser meant to serve as reference.
- Profile Fields File:
OUGC_Pages_Profile_Fields.xml
- Allow users to update their custom profile fields.
- ShoutBox Page File:
OUGC_Pages_ShoutBox_Page.xml
- Displays the DVZ Shoutbox in a custom PHP page.
- Sticky Threads File:
OUGC_Pages_Sticky_Threads.xml
- Displays a list with all sticky threads.
Below is a list and short description of any compatibility with third party MyBB plugins.
- PHP in Templates / Template Conditionals
- If installed, you should be able to use any allowed syntax, expression, or tags inside the Page Content for pages, as this page field is parsed as a template.
Provides a list of available variables, functions, and methods for plugins to use.
(array) $categoriesCache
array containing cached categories data whenvisible
is equal to1
andallowedGroups
is not empty, ordered bycid, disporder
, array key is set to category identifiercid
:(string) name
(string) description
(string) url
(string) allowedGroups
-1
for all groups- CSV for allowed groups
(int) breadcrumb
(int) displayNavigation
(int) buildMenu
(int) wrapucp
(array) $pagesCache
array containing cached pages data whenvisible
is equal to1
andallowedGroups
is not empty, ordered bypid, disporder
, array key is set to page identifierpid
:(int) cid
(string) name
(string) description
(string) url
(string) allowedGroups
-1
for all groups- CSV for allowed groups
(int) menuItem
(int) wrapper
(int) wol
(int) php
(int) classicTemplate
(int) init
(int) dateline
(bool) $isCategory
true
if current page is a category.(bool) $isPage``true
if current page is a page.(int) $categoryID
current category identifier.(int) $pageID
current page identifier,0
when$isPage
isfalse
.(array) $categoryData
array containing current category page:(string) name
(string) description
(string) url
(string) allowedGroups
-1
for all groups- CSV for allowed groups
(int) breadcrumb
(int) displayNavigation
(int) buildMenu
(int) wrapucp
(array) $pageData
array containing current page, empty when$isPage
isfalse
.(int) cid
(string) name
(string) description
(string) url
(string) allowedGroups
-1
for all groups- CSV for allowed groups
(int) menuItem
(int) wrapper
(int) wol
(int) php
(int) classicTemplate
(int) init
(string) template
(int) dateline
ougcPagesExecutionInit
ougcPagesExecutionGlobalStart
ougcPagesExecutionGlobalIntermediate
ougcPagesExecutionGlobalEnd
oucPagesCategoryInsertEnd
Array object is passed by reference with the following variables:oucPagesCategoryUpdateEnd
Array object is passed by reference with the following variables:(array) categoryID
inserted/updated category identifier.(array) categoryData
array containing category data (not always available)(string) name
(string) description
(string) url
(string) allowedGroups
-1
for all groups- CSV for allowed groups
- empty for none
(int) disporder
(int) visible
(int) breadcrumb
(int) displayNavigation
(int) buildMenu
(int) wrapucp
oucPagesCategoryDeleteEnd
Variable passed by reference:(int) $categoryID
deleted page identifier.
oucPagesPageInsertEnd
Array object is passed by reference with the following variables:oucPagesPageUpdateEnd
Array object is passed by reference with the following variables:(array) pageID
inserted/updated page identifier.(array) pageData
array containing page data (not always available)(int) cid
(string) name
(string) description
(string) url
(string) allowedGroups
-1
for all groups- CSV for allowed groups
- empty for none
(int) disporder
(int) visible
(int) menuItem
(int) wrapper
(int) wol
(int) php
(int) classicTemplate
(int) init
(string) template
(int) dateline
oucPagesPageDeleteEnd
Variable passed by reference:(int) $pageID
deleted page identifier.
oucPagesStart
oucPagesEnd
loadLanguage(): void { ... }
getSetting(string $settingKey = ''): string { ... }
cacheUpdate(): void { ... }
cacheGetPages(): array { ... }
cacheGetCategories(): array { ... }
initExecute(int $pageID): never { ... }
initSession(): void { ... }
categoryInsert(array $inputData = [], int $categoryID = 0, bool $doUpdate = false): int { ... }
categoryUpdate(array $inputData = [], int $categoryID = 0): int { ... }
categoryDelete(int $categoryID): bool { ... }
categoryGet(int $categoryID, string $categoryUrl = ''): array { ... }
categoryQuery(array $fieldList = ['*'], array $whereConditions = ['1=1'], array $queryOptions = []): array { ... }
categoryGetByUrl(string $categoryUrl): array { ... }
categoryGetLink(int $categoryID): string { ... }
pageInsert(array $inputData = [], int $pageID = 0, bool $doUpdate = false): int { ... }
pageUpdate(array $inputData = [], int $pageID = 0): int { ... }
pageDelete(int $pageID): int { ... }
pageGet(int $pageID, string $pageUrl = ''): array { ... }
pageQuery(array $fieldList = ['*'], array $whereConditions = ['1=1'], array $queryOptions = []): array { ... }
pageGetByUrl(string $url): array { ... }
pageGetLink(int $pageID): string { ... }
The following is a list of constants are defined dynamically, defined()
should be used to make sure they are defined.
OUGC_PAGES_STATUS_IS_CATEGORY
int
defined as the category identifier when trying to view a valid category
OUGC_PAGES_STATUS_IS_PAGE
int
defined as the page identifier when trying to view a valid page
OUGC_PAGES_STATUS_CATEGORY_INVALID
bool
defined astrue
when trying to view an invalid category
OUGC_PAGES_STATUS_CATEGORY_NO_PERMISSION
bool
defined astrue
when permission to view a category is denied
OUGC_PAGES_STATUS_PAGE_INVALID
bool
defined astrue
when trying to view an invalid page
OUGC_PAGES_STATUS_PAGE_NO_PERMISSION
bool
defined astrue
when permission to view a page is denied
OUGC_PAGES_STATUS_PAGE_INIT_GLOBAL_START
int
defined as the page identifier when trying to view a valid page whichphp
value is1
andinit
value is2
OUGC_PAGES_STATUS_PAGE_INIT_GLOBAL_INTERMEDIATE
int
defined as the page identifier when trying to view a valid page whichphp
value is1
andinit
value is3
- MyBB - Web Framework
- MyBB PluginLibrary - A collection of useful functions for MyBB
- PHP - Server Environment
- @Omar G - Idea & Initial work
See also the list of contributors who participated in this project.
This is free development and any contribution is welcome. Get support or leave feedback at the official MyBB Community.
Thanks for downloading and using our plugins!