• During registration a specific email will be required. Only gmail.com & outlook.com" .
    Do not create multi-accounts, you will be blocked! For more information about rules, limits, and more, visit the Support.
Vbresults - Custom PHP Pages

Vbresults - Custom PHP Pages 1.2.1

No permission to download
This add-on allows creating any number of custom PHP pages with or without the XF layout.
A custom page has access to the XF engine's functions, including sessions and permissions.

All custom pages are their own PHP script with individual configuration; PHP knowledge is required.
A custom page script can be above, below or within the XF install folder, no restrictions.

You can optionally configure any of the following items on a per-page basis:
  • The custom <head> tag items on top of XenForo's defaults (presumably from an external script)
  • The custom page title
  • The custom page content
  • Whether or not to wrap above content in the XenForo layout
  • Whether or not to include XF's social meta tags for social media content previews
  • Whether or not to show breadcrumbs, and what breadcrumbs to show
Installation Instructions
  1. Install the add-on zip file (this is an add-on package without extra files)
  2. Make a copy of sample.php script and name it whatever you want
  3. Point the script's XF constant value to your XenForo install folder; the default is DIR
  4. Set the $head and/or $content variables
  5. Adjust the \ScriptsPages\Setup::set parameters (below), and installation is complete
Sample (sample.php)
PHP:
<?php

// Set PHP Reporting
error_reporting(E_ALL & ~E_NOTICE);

define('__XF__', __DIR__); // EDIT VALUE IF SCRIPT IS NOT IN XF FOLDER
require __XF__ . '/src/XF.php';

XF::start(__XF__);
\ScriptsPages\Setup::set('init', true);

$app = \XF::setupApp('XF\Pub\App');
$app->start();
$request = $app->request();

// EDIT BELOW to set the page's $head and/or $content; the code below is a sample

/** ob_start();
require_once __DIR__ . DIRECTORY_SEPARATOR . pathinfo(__FILE__, PATHINFO_FILENAME) . "-head.php";
$head = ob_get_contents();
ob_end_clean(); **/

/** ob_start();
require_once __DIR__ . DIRECTORY_SEPARATOR . pathinfo(__FILE__, PATHINFO_FILENAME) . "-content.php";
$content = ob_get_contents();
ob_end_clean();  */

// EDIT BELOW TO CONFIGURE

\ScriptsPages\Setup::set([
    'breadcrumbs' => ['Item 1' => '/1', 'Item 2' => '/2', 'Item 3' => '/3'],
    'head' => $head,
    'content' => $content
]);

// STOP HERE

$app->run()->send($request);
How to set parameters externally

To set any parameter above from an external script, define the PHP constant SCRIPT_PAGE_{KEY} prior to loading XenForo, i.e.
PHP:
define('SCRIPT_PAGE_CONTENT', '<b>Hello world</b>');
Author
XenModz
Downloads
4
Views
113
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from XenModz

Latest updates

  1. 1.2.1

    Fixed InvalidArgumentException error.
  2. 1.2

    Cleaned out old code A companion add-on to make these custom php pages searchable is now...
  3. 1.1.7

    Fixed a major bug relating to custom page controller.

Similar resources

VBResults - Searchable Custom Pages XenModz
Make custom pages searchable within XenForo.
VBResults - Filter Resource Fields XenModz
Make resources filterable by custom resource fields.
VBResults - Filter Thread Fields XenModz
Make threads filterable by custom thread fields.
vbresults - Keyword Alerts XenModz
Receive e-mail notifications when new posts match your keywords.
VBResults - Read-only Mode XenModz
Keep your community online to visitors and search engines with only the ability to view content.
Back
Top Bottom