WSN Gallery
Featuresspacer Showcasespacer Reviewsspacer Demosspacer Purchasespacer Manualspacer Support
Show Custom Template Anywhere
Show Custom Template Anywhere
By Paul

The code:
<?php
/* Supply the path to WSN and the name of your template on the lines as requested */

$pathtowsn = '/full/file/path/'; // as listed on your settings->general configuation page but without the 'attachments/' part

$yourtemplatename = 'mytemplate.tpl'; // the template, located in the 'custom' subdirectory of your templates directory, that you want to display

$usewrapper = 'yes'; // set to 'no' if you don't want to show the WSN wrapper

$curr_path = getcwd();
chdir($pathtowsn);
require 'start.php';
if (!$template) $template = new template('custom/'. $yourtemplatename);
require 'end.php';
chdir($curr_path);
?>


Modify and save it as yournamehere.php in whatever directory you have in mind.

Want it to apply over a particular page? Replace
require 'start.php';
if (!$template) $template = new template('custom/'. $yourtemplatename);
require 'end.php';
with
$_GET['custom'] = 'yes';
$_GET['TID'] = 'yourtemplatename';
require 'index.php';


Change index.php to the php file you want, and set the appropriate GET parameters you want to pass besides custom and TID.

See http://www.webmastersite.net/forums/thread/3937 for discussion and alterenate versions.

Rating:


3/5 based on 2 votes. The median rating is 1.

Submitted: 11/01/04 (Edited 07/21/08)

Description: Showing your content outside of the WSN directory.

Views: 1820 views. Averaging 1 per day.
In the most recent 30 day period, there've been 2 views.

Previous Article | Next Article

Home    |    Features    |    Showcase    |    Reviews    |    Demos    |    Purchase    |    Manual    |    Support