PHPFox Extension Tutorial

PHPFox Management Guide

PHPFox Web Hosting

 

In this tutorial, we loo the various ways to extend the functionality of a PHPFox website

 

1. How to Install a Language in PHPFox


PHPFox can be turned into multi-lingual website with the use of different language packs. For the purpose of this tutorial, we will install a Bulgarian language pack in PHPFox.

 

Create a Backup

 

It is recommended to create PHPFox backup, before making major changes on your website. This allows you to restore it to a fully operational state if something goes wrong.


To install a new language in PHPFox, you need to:

Step 1: Upload files
Step 2: Import language pack
Step 3: Set new language as default
Step 3: Manage phrases

PHPFox Management Guide

PHPFox Web Hosting

 

Step 1 Upload files


The first thing to do is to upload all of the .xml files of your language pack to your website. You need to access the directory, where your PHPFox website is installed and then navigate to:


include/xml/language/new-language/


where you need to rename the new-language/ folder to the actual language you are importing.


Step 2 Import language pack


Access your website as administrator and then click on the AdminCP button at the top-right corner.


Select the Extensions tab and then Language > Import Language Pack.


Click on the Install button next to your new language.


Step 3 Set new language as default


Click on the Extensions tab from the main menu and then Language > Manage Language Packs.


Click on the arrow drop-down box next to the new language and then Set as Default.


Step 4 Manage phrases


Click on the Extensions tab from the main menu and then Language > Manage Language Packs.


Click on the arrow drop-down box next to the language you wish to edit and then Manage Phrases.


Search for the phrase that you wish to change, edit it and then click on the Save Selected button to change it.

PHPFox Management Guide

PHPFox Web Hosting


2. How to Manage Modules in PHPFox


There are a lot of modules available for PHPFox. Even the default installation provides a number of pre-installed modules that you can use as per your needs. In this tutorial, we will provide the steps for activating/deactivating modules or editing their settings.


To manage the Modules in PHPFox, you will need to:


Step 1: Activate/Deactivated a Module
Step 2: Edit Module


Step 1 Activate/Deactivated a Module


Access your website as administrator and then click on the AdminCP button at the top-right corner.


Click on the Extensions button and then Module > Manage Modules.


You will notice an Active section with a button for each of the modules on your website. When the module is active, the button will be green. When the module is inactive, the module will turn to red. You can change that simply by clicking on the actual button within the Active section.


Step 2 Edit Module


To edit the module’s settings, you need to access the Manage Modules section of your website again. Here, locate the module that you wish to edit and click on the Arrow drop-down button next to it and then Manage Settings.


For the subscription module, we have the ability to enable subscriptions packages and set the selection of a subscription package during registration as required. When you are ready with the changes, simply click on the Submit button to keep them.

 

PHPFox Management Guide

PHPFox Web Hosting

 

3. How to enable Facebook Connect in PHPFox


One of the most popular modules for networking scripts is the ability to connect with your Facebook account. This will bring even more people to your website, as the process will be easier for them. This tutorial will review the process of enabling the Facebook Connect module on your PHPFox website.


To Enable Facebook Connect for PHPFox, you will need to:


Step 1: Configure a new App
Step 2: Enable the module in PHPFox


Step 1 Configure a new App


To create a Facebook app, you need to log into your Facebook account and then access the Facebook Developers section. Click on the Apps tab at the main menu and then Create a new app button.


Edit the following options:


Display Name - Enter the name of your new app
Namespace - Unique identifier for your app (optional)
Category - Choose a category for your app from the drop-down box


Click on the Create App button to proceed. When the app is completed, you need to take a note of your Facebook App ID and App secret.


Step 2 Enable the module in PHPFox


Access your website as administrator and then click on the AdminCP button at the top-right corner.


Click on the Extensions tab at the main menu and then Module > Manage Modules.


Locate the Facebook module and click on the arrow drop-down button next to the Facebook module. Then simply select the Manage Settings option.


Edit the following options:


Enable Facebook Connect - Set this to True
Facebook Secret - Enter your APP Secret
Application ID - Enter your APP ID


Hit the Submit button to keep the changes.


For the purpose of this tutorial, we took a screenshot of the registration/login page so you can see how the Facebook Connect looks on it, when enabled.


4. Display Online Users with a Menu in PHPFox


We now review the process of adding a menu item, which will allow your PHPFox users to see all members currently online.

The first step of the process is to access the AdminCP area of your website. Simpy locate and access the AdminCP button at the top-right corner of the screen.


Click on the CMS tab at the main menu and then Menus > Manage Menus.


Edit the following options:


Product - Select Core
Module - Select User
Connection - Select Members (or wherever you wish to display the menu item).
URL - user.brouse.view_online
Mobile Icon - Set a mobile Icon
Language Pack Details - Enter the name of the menu item
User Group Access - Specify the user groups that will be able to see the menu item


Click on the Submit button to keep the changes.

 

5. Put the Advanced Search Filter in a Block


When browsing for users on your PHPFox website, there are certain criteria that you can choose from. There is also a button for advanced search criteria, which includes all of the custom fields you created on your website.

However, this makes things complicated for your users as they need to perform one additional click to get there. As we always try to optimize certain features and allow users easier access to different functions, we are glad to present a way of creating a custom block on the browse section of your website, which will display all of the advanced search options directly on the same page.

Initially, the browse section has an Advanced Filter


To complete the tutorial, you will need to follow these steps:


Step 1: Create a Custom Block
Step 2: Remove the Advanced Filter Button


Step 1 Create a Custom Block

 

First, you need to access the administrative area of your PHPFox website. Log into your website as administrator and then click on the AdminCP button at the top-right corner of the screen.


Click on the CMS tab at the tom menu and then Blocks > Add New Block.


Edit the Block Details:


Product: Select Core
Module: Select User
Title: Enter the title of the new block
Type: HTML Code
Controller: user > user.browse
Placement: Block 3
Active: Set the block as active/inactive


You also need to enter the following code:


<form method="post" action="{if isset($aCallback.url_home)}{url link=$aCallback.url_home view=$sView}{else}{url link='user.browse' view=$sView}{/if}">
<div class="block">
<div class="title">
{phrase var='user.advanced_filters'}
</div>
{foreach from=$aCustomFields item=aCustomField}
{template file='custom.block.foreachcustom'}
{/foreach}
<input type="submit" value="{phrase var='user.browse_filter_submit'}" class="button" name="search[submit]" />
</div>
</form>


Choose the User groups that will have access to the block.


Hit the Submit button to keep the changes.


Step 2 Remove the Advanced Filter Button


If you wish to remove the Advanced Filter button from the browsing page, you will have to edit a core file of the product.


Void support


By editing core file of PHPFox, the support service their team provides will no longer be available for you. Thus, make sure that you are aware of the complications this may cause to your product before proceeding further.

To remove the button, you need to access the location of your PHPFox website via FTP. Then search for and access the following file:


/module/user/template/your-template/block/filter.html.php


where your-template is the actual template you are using on your website. Edit the file and remove the following lines from it (around line 72):


<ul id="js_user_browse_advanced_link">
<li><a href="#" onclick="$('#js_user_browse_advanced').show(); return false;" id="user_browse_advanced_link">{phrase var='user.advanced_filters'}</a></li>
{if isset($bIsInSearchMode) && $bIsInSearchMode}
<li><a href="#"><a href="{url link='user.browse'}">{phrase var='user.reset_browse_criteria'}</a></a> </li>
{/if}
</ul>


When completing the changes above, remember to save your changes.

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

PHPFox Web Hosting

Todhost web hosting fully supports PHPFox installation. With PHPFox you can build a social...

How to Install and Upgrade PHPFox

In this tutorial, we will cover how to install PHPFox manually, upgrade a PHPFox website to its...

PHPFox Configuration Tutorial

This tutorial will cover key configuration tutorial: How to locate and use the main...

PHPFox Management Guide

This tutorial covers the major configuration and edits involved in the management of your PHPFox...

PHPFox Backup and Restore Tutorial

This tutorial is in two parts. How to create a backup in PHPFox and how to restore the backup...