glExternal - External Pages Plugin

The External Pages plugin allows glFusion site administrators to include external PHP pages as if they are part of a glFusion site. Simple HTML pages may also be included, provided the web server can parse them using the PHP extension.

Requirements

  • glFusion v1.1.2 or newer

Installation

The External Pages Plugin uses the glFusion automated plugin installer. Simply upload the distribtuion using the glFusion plugin installer located in the Plugin Administration page.

For glFusion version 1.1.1 or older, the normal plugin installation method is supported.

Upgrading

The upgrade process is identical to the installation process, simply upload the distribution from the Plugin Administration page.

Features

  • External pages can participate in glFusion's security. Permission to view may be granted to specific accounts.
  • External pages can be searched from within glFusion. Due to recent changes in the glFusion search API, the excerpts from Exteral pages will appear as “not available” in the search results.

Usage

Including external pages in glFusion is simply a matter of adding some PHP code to the page itself. There are four templates found in <plugin_dir>/externalpages_templates to help you with this:

glphp.phpInclude a straight PHP page in glFusion, with the look & feel of the glFusion site.
glphphtml.phpInclude a HTML page in glFusion, with the look & feel of the glFusion site.
php.phpUse glFusion's security check and hit counter for a PHP page, but display it normally.
phphtml.phpUse glFusion's security check and hit counter for a HTML page, but display it normally.

Note that this plugin requires the page in question to be rendered by PHP, so it may be necessary to configure your web server to render all “.html” pages using PHP.

The core of each of these templates is:

/** Make sure this points to your lib-common.php wherever you have this page.
*   Include the full filesystem path, if needed.
*   i.e. /var/sites/glfusion/public_html/lib-common.php
*/
require_once 'lib-common.php';
 
/** You should change the "$page_name" to the actual file name
*   or full URL here.  
*   If this page is outside of your glFusion webroot, then use the 
*   full URL or you'll have to edit it in glFusion later.
*/
$page_name = substr($_SERVER['SCRIPT_NAME'], 1);
 
if (!EXP_externalAccess($page_name)) {
    $display = COM_siteHeader('menu');
    $display .= COM_startBlock($LANG_EX00['access_denied']);
    $display .= '<div align="center"><b>' . 
                $LANG_EX00['access_msg'] . 
                '</b></div>';
    $display .= COM_endBlock();
    $display .= COM_siteFooter(yes);
    echo $display;
    exit;
}

You'll need to customize this file to fit your requirements.

  • Specify the correct location to your lib-common.php file. You typically should enter the full path to this file.
  • Set the $page_name variable to the actual name, or full URL, of your page. Although not absolutely necessary, links to pages located outside of the glFusion webroot will not work unless the full URL is given here, or edited in glFusion later.

Searching

External pages can be searched from within glFusion's search function. The excerpt from the page will not be displayed.

Administration

Managing Pages

External Pages are managed from the plugin's interface, available from the Command and Control area. Page information can be edited or deleted. (Pages may also be added, but this functionality will likely be removed in a future release since there's little point to adding pages manually.)

If an external page's $page_name variable was not set correctly when the page was created, you may edit the “url” field in the database. Be sure to update the $page_name variable also, or you'll quickly have another entry!

The page title field is set initially to the $page_name also, but it may be freely changed to anything that you like.

If you delete a page entry, it will be recreated the next time the page is accessed.

Global Configuration Options

Configuration Options are set by the External Pages section in the site Configuration area. There is no config.php required unless you wish to override any other settings.

OptionDescription
Show the external page list to usersSet this to “true” to allow regular site users to access the list of external pages from glFusion. This does not affect the availability of the pages themselves.
Default PermissionsSet the default group and permissions to be applied to new external pages as they are self-registered. These can be changed on a per-page basis.

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This plugin is based on the External Pages plugin for Geeklog 1.3.1 by Tom Willett, Copyright (C) 2002 by Tom Willett.

Logged in as: Guest (anonymous)
glfusion/glexternal/start.txt · Last modified: 2009/09/11 03:01 by lee
 
Except where otherwise noted, content on this wiki is licensed under the following license: GNU Free Documentation License 1.3