Version 3.1.4

This commit is contained in:
Neo committed 2025-12-19 00:32:22 -08:00
1 parent 1d4720f3e2
commit ae5c01cc78
2563 files changed
+283048 -240689

No files matched your search

@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
@@ -1,90 +1,92 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Template Plugin: Add to head
* Last Updated: $Date: 2009-06-22 07:08:23 -0400 (Mon, 22 Jun 2009) $
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 4801 $
*/
/**
* Main loader class
*/
class tp_addtohead extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$return = '';
switch( $options['type'] )
{
case 'javascript':
case 'js':
return '" . ' . "\$this->registry->getClass('output')->addToDocumentHead( 'javascript', \"" .$data . '" )' . ' . "';
break;
case 'inlinecss':
return '" . ' . "\$this->registry->getClass('output')->addToDocumentHead( 'inlinecss', \"" .$data . '" )' . ' . "';
break;
case 'importcss':
return '" . ' . "\$this->registry->getClass('output')->addToDocumentHead( 'importcss', \"" .$data . '" )' . ' . "';
break;
case 'raw':
return '" . ' . "\$this->registry->getClass('output')->addToDocumentHead( 'raw', \"" .$data . '" )' . ' . "';
break;
}
return '';
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'addtohead',
'author' => 'IPS, Inc.',
'usage' => '{parse addtohead="{$this->settings[\'public_dir\']}js/myJS.js" type="javascript"}',
'options' => array( 'type' ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template Plugin: Add to head
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 5713 $
*/
/**
* Main loader class
*/
class tp_addtohead extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$return = '';
switch( $options['type'] )
{
case 'javascript':
case 'js':
return '" . ' . "\$this->registry->getClass('output')->addToDocumentHead( 'javascript', \"" .$data . '" )' . ' . "';
break;
case 'inlinecss':
return '" . ' . "\$this->registry->getClass('output')->addToDocumentHead( 'inlinecss', \"" .$data . '" )' . ' . "';
break;
case 'importcss':
return '" . ' . "\$this->registry->getClass('output')->addToDocumentHead( 'importcss', \"" .$data . '" )' . ' . "';
break;
case 'raw':
return '" . ' . "\$this->registry->getClass('output')->addToDocumentHead( 'raw', \"" .$data . '" )' . ' . "';
break;
}
return '';
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'addtohead',
'author' => 'IPS, Inc.',
'usage' => '{parse addtohead="{$this->settings[\'public_dir\']}js/myJS.js" type="javascript"}',
'options' => array( 'type' ) );
}
}
@@ -0,0 +1,65 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template Pluging: Currency
* Last Updated: $Date: 2010-05-19 06:23:08 -0400 (Wed, 19 May 2010) $
* </pre>
*
* @author $Author: mark $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 6317 $
*/
/**
* Main loader class
*/
class tp_currency extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
$return = '$this->registry->getClass(\'class_localization\')->formatMoney( ' . $data . ', FALSE )';
return '" . ' . $return . ' . "';
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @return array
*/
public function getPluginInfo()
{
return array( 'name' => 'currency',
'author' => 'IPS, Inc.',
'usage' => '{parse currency="5.00"}',
'options' => array( 'format', 'relative' ) );
}
}
@@ -1,95 +1,97 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Template Pluging: Date
* Last Updated: $Date: 2009-09-22 17:31:43 -0400 (Tue, 22 Sep 2009) $
*
* @author $Author: josh $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 5141 $
*/
/**
* Main loader class
*/
class tp_date extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
$return = '';
$_format = 'LONG';
$_relative = 1;
$timestamp = $data ? $data : "'{custom:now}'";
# Fix up string style dates
/*if ( ! preg_match( "#^[0-9]{10}$#", $timestamp ) AND ( substr( $timestamp, 0, 1 ) != '$' ) )
{
$_time = strtotime( $timestamp );
if ( $_time === FALSE OR $_time == -1 )
{
$timestamp = 0;
}
else
{
$timestamp = $_time;
}
}*/
$_relative = ( isset( $options['relative'] ) && $options['relative'] == 'false' ) ? 1 : 0;
$return = '$this->registry->getClass(\'class_localization\')->getDate(' . $timestamp . ',"' . $options['format'] . '", ' . $_relative . ')';
return '" . ' . $return . ' . "';
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'date',
'author' => 'IPS, Inc.',
'usage' => '{parse date="now" format="long" relative="false"}',
'options' => array( 'format', 'relative' ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template Pluging: Date
* Last Updated: $Date: 2010-03-10 07:00:06 -0500 (Wed, 10 Mar 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 5932 $
*/
/**
* Main loader class
*/
class tp_date extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
$return = '';
$_format = 'LONG';
$_relative = 1;
$timestamp = $data ? $data : "'{custom:now}'";
# Fix up string style dates
/*if ( ! preg_match( "#^[0-9]{10}$#", $timestamp ) AND ( substr( $timestamp, 0, 1 ) != '$' ) )
{
$_time = strtotime( $timestamp );
if ( $_time === FALSE OR $_time == -1 )
{
$timestamp = 0;
}
else
{
$timestamp = $_time;
}
}*/
$_relative = ( isset( $options['relative'] ) && $options['relative'] == 'false' ) ? 1 : 0;
$return = '$this->registry->getClass(\'class_localization\')->getDate(' . $timestamp . ',"' . $options['format'] . '", ' . $_relative . ')';
return '" . ' . $return . ' . "';
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'date',
'author' => 'IPS, Inc.',
'usage' => '{parse date="now" format="long" relative="false"}',
'options' => array( 'format', 'relative' ) );
}
}
@@ -1,68 +1,70 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Template plugin: execute PHP expression
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @since 6/24/2008
* @version $Revision: 3887 $
*/
/**
* Main loader class
*/
class tp_expression extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
return '" . ' . $data . ' . "';
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
return array( 'name' => 'expression',
'author' => 'IPS, Inc.',
'usage' => '{parse expression="intval($data)"}',
'options' => array() );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template plugin: execute PHP expression
* Last Updated: $Date: 2010-08-12 08:32:14 -0400 (Thu, 12 Aug 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @since 6/24/2008
* @version $Revision: 6745 $
*/
/**
* Main loader class
*/
class tp_expression extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
return '" . ' . $data . ' . "';
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
return array( 'name' => 'expression',
'author' => 'IPS, Inc.',
'usage' => '{parse expression="intval($data)"}',
'options' => array() );
}
}
@@ -1,73 +1,75 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Template Pluging: Format Number
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 3887 $
*/
/**
* Main loader class
*/
class tp_format_number extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Brandon Farber
* @param string The initial data from the tag
* @param array Array of options [N/A]
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
$return = '$this->registry->getClass(\'class_localization\')->formatNumber( ' . $data . ' )';
return '" . ' . $return . ' . "';
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'format_number',
'author' => 'IPS, Inc.',
'usage' => '{parse format_number="123456"}',
'options' => array() );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template Pluging: Format Number
* Last Updated: $Date: 2010-08-12 08:32:14 -0400 (Thu, 12 Aug 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 6745 $
*/
/**
* Main loader class
*/
class tp_format_number extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Brandon Farber
* @param string The initial data from the tag
* @param array Array of options [N/A]
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
$return = '$this->registry->getClass(\'class_localization\')->formatNumber( ' . $data . ' )';
return '" . ' . $return . ' . "';
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'format_number',
'author' => 'IPS, Inc.',
'usage' => '{parse format_number="123456"}',
'options' => array() );
}
}
@@ -0,0 +1,80 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template Pluging: Resize images in templates proportionately
* Last Updated: $Date: 2010-01-15 09:55:46 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Content
* @link http://www.invisionpower.com
* @version $Rev: 166 $
*/
/**
* Main loader class
*/
class tp_gallery_resize extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
if ( ! $data )
{
return;
}
$return = '$this->registry->getClass(\'gallery\')->inlineResize( ' . $data . ",'" . trim( $options['width'] ) . "','" . trim( $options['height'] ) . '\' )';
return '" . ' . $return . ' . "';
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Brandon Farber
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'gallery_resize',
'author' => 'Invision Power Services, Inc.',
'usage' => '{parse gallery_resize="{$image_tag_html}" width="100" height="100"}',
'options' => array( 'width', 'height' ) );
}
}
@@ -1,92 +1,94 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Template Pluging: Include
* Last Updated: $Date: 2009-06-24 23:14:22 -0400 (Wed, 24 Jun 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 4818 $
*/
/**
* Main loader class
*/
class tp_include extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$return = '';
//-----------------------------------------
// Make life easier...
//-----------------------------------------
$data = str_replace( '#IPS_ROOT_PATH#' , IPS_ROOT_PATH , $data );
$data = str_replace( '#IPS_DOC_ROOT_PATH#', IPS_DOC_ROOT_PATH, $data );
$data = str_replace( '#ROOT#' , IPS_DOC_ROOT_PATH, $data );
//-----------------------------------------
// Attempt to get data
//-----------------------------------------
$return = <<<EOF
ob_start();
include( "$data" );
\$data = ob_get_contents();
ob_end_clean();
EOF;
return "<!--included content-->\n\";\n {$return} \$IPBHTML .= \$data . \"\n<!--/ included content-->";
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'addtohead',
'author' => 'IPS, Inc.',
'usage' => '{parse include="/path/to/file"}',
'options' => array() );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template Pluging: Include
* Last Updated: $Date: 2010-08-12 08:32:14 -0400 (Thu, 12 Aug 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 6745 $
*/
/**
* Main loader class
*/
class tp_include extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$return = '';
//-----------------------------------------
// Make life easier...
//-----------------------------------------
$data = str_replace( '#IPS_ROOT_PATH#' , IPS_ROOT_PATH , $data );
$data = str_replace( '#IPS_DOC_ROOT_PATH#', IPS_DOC_ROOT_PATH, $data );
$data = str_replace( '#ROOT#' , IPS_DOC_ROOT_PATH, $data );
//-----------------------------------------
// Attempt to get data
//-----------------------------------------
$return = <<<EOF
ob_start();
include( "$data" );
\$data = ob_get_contents();
ob_end_clean();
EOF;
return "<!--included content-->\n\";\n {$return} \$IPBHTML .= \$data . \"\n<!--/ included content-->";
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'addtohead',
'author' => 'IPS, Inc.',
'usage' => '{parse include="/path/to/file"}',
'options' => array() );
}
}
@@ -1,81 +1,83 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Template Pluging: JS Module
* Last Updated: $Date: 2009-02-17 16:13:28 -0500 (Tue, 17 Feb 2009) $
*
* @author $Author: josh $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 4022 $
*/
/**
* Main loader class
*/
class tp_js_module extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Rikki Tissier
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$return = '';
if( $data )
{
$priority = isset( $options['important'] ) ? $options['important'] : 0;
return '" . ' . "\$this->registry->getClass('output')->addJSModule(\"" . addslashes( $data ) . '", "' . addslashes( $priority ) . '" )' . ' . "';
//$this->registry->output->addJSModule( $data, $priority );
}
return '';
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'js_module',
'author' => 'IPS, Inc.',
'usage' => '{parse js_module="name_of_module"}',
'options' => array('important') );
}
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template Pluging: JS Module
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 5713 $
*/
/**
* Main loader class
*/
class tp_js_module extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Rikki Tissier
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$return = '';
if( $data )
{
$priority = isset( $options['important'] ) ? $options['important'] : 0;
return '" . ' . "\$this->registry->getClass('output')->addJSModule(\"" . addslashes( $data ) . '", "' . addslashes( $priority ) . '" )' . ' . "';
//$this->registry->output->addJSModule( $data, $priority );
}
return '';
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'js_module',
'author' => 'IPS, Inc.',
'usage' => '{parse js_module="name_of_module"}',
'options' => array('important') );
}
}
@@ -1,70 +1,72 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Template plugin: perform macro replacement
* Last Updated: $Date: 2009-02-04 15:03:36 -0500 (Wed, 04 Feb 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @since 6/24/2008
* @version $Revision: 3887 $
*/
/**
* Main loader class
*/
class tp_replacement extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
$return = "\$this->registry->getClass('output')->getReplacement(\"" . $data . "\")";
return '" . ' . $return . ' . "';
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
return array( 'name' => 'replacement',
'author' => 'IPS, Inc.',
'usage' => '{parse replacement="a_post"}',
'options' => array() );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template plugin: perform macro replacement
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @since 6/24/2008
* @version $Revision: 5713 $
*/
/**
* Main loader class
*/
class tp_replacement extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
$return = "\$this->registry->getClass('output')->getReplacement(\"" . $data . "\")";
return '" . ' . $return . ' . "';
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
return array( 'name' => 'replacement',
'author' => 'IPS, Inc.',
'usage' => '{parse replacement="a_post"}',
'options' => array() );
}
}
@@ -0,0 +1,91 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template Pluging: Resize images in templates proportionately
* Last Updated: $Date: 2010-01-15 09:55:46 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Content
* @link http://www.invisionpower.com
* @version $Rev: 166 $
*/
/**
* Main loader class
*/
class tp_resize_image extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Brandon Farber
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
if( !$data )
{
return;
}
if( substr( $data, 0, 1 ) == '$' )
{
$_phpCode = '" . IPSLib::getTemplateDimensions(' . $data . ', \'' . $options['maxwidth'] . '\', \'' . $options['maxheight'] . '\') . "';
}
else
{
$_phpCode = '" . IPSLib::getTemplateDimensions("' . $data . '", \'' . $options['maxwidth'] . '\', \'' . $options['maxheight'] . '\') . "';
}
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
return $_phpCode;
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Brandon Farber
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'resize_image',
'author' => 'Invision Power Services, Inc.',
'usage' => '{parse resize_image="/path/to/image" maxwidth="100" maxheight="100"}',
'options' => array( 'maxwidth', 'maxheight' ) );
}
}
@@ -1,86 +1,88 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Template plugin: Perform row striping
* Last Updated: $Date: 2009-11-16 06:14:54 -0500 (Mon, 16 Nov 2009) $
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @since 6/24/2008
* @version $Revision: 5408 $
*/
/**
* Main loader class
*/
class tp_striping extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$phpCode = '';
if ( ! isset( $options['classes'] ) )
{
return '" . IPSLib::next( $this->registry->templateStriping["'.$data.'"] ) . "';
}
else
{
$_classes = explode( ",", trim( $options['classes'] ) );
//$phpCode .= "\n " . '$this->registry->templateStriping[\'' . $data . '\'] = array( FALSE, "' . implode( '","', $_classes ) . "\");\n";
$phpCode .= "\n if ( ! isset( " . '$this->registry->templateStriping[\'' . $data . "'] ) ) {\n" . '$this->registry->templateStriping[\'' . $data . '\'] = array( FALSE, "' . implode( '","', $_classes ) . "\");\n}\n";
}
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
return ( $phpCode ) ? "<php>" . $phpCode . "</php>" : '';
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
return array( 'name' => 'striping',
'author' => 'IPS, Inc.',
'usage' => '{parse striping="someKey" classes="row1, row2"}',
'options' => array( 'classes' ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template plugin: Perform row striping
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @since 6/24/2008
* @version $Revision: 5713 $
*/
/**
* Main loader class
*/
class tp_striping extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$phpCode = '';
if ( ! isset( $options['classes'] ) )
{
return '" . IPSLib::next( $this->registry->templateStriping["'.$data.'"] ) . "';
}
else
{
$_classes = explode( ",", trim( $options['classes'] ) );
//$phpCode .= "\n " . '$this->registry->templateStriping[\'' . $data . '\'] = array( FALSE, "' . implode( '","', $_classes ) . "\");\n";
$phpCode .= "\n if ( ! isset( " . '$this->registry->templateStriping[\'' . $data . "'] ) ) {\n" . '$this->registry->templateStriping[\'' . $data . '\'] = array( FALSE, "' . implode( '","', $_classes ) . "\");\n}\n";
}
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
return ( $phpCode ) ? "<php>" . $phpCode . "</php>" : '';
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
return array( 'name' => 'striping',
'author' => 'IPS, Inc.',
'usage' => '{parse striping="someKey" classes="row1, row2"}',
'options' => array( 'classes' ) );
}
}
@@ -1,84 +1,86 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Template Pluging: Template Include
* Last Updated: $Date: 2009-04-30 17:36:35 -0400 (Thu, 30 Apr 2009) $
*
* @author $Author: josh $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 4586 $
*/
/**
* Main loader class
*/
class tp_template extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
if( $options['group'] == 'editors' && ipsRegistry::isClassLoaded( 'class_localization' ) )
{
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_editors' ), 'core' );
}
$return = '';
$_group = str_replace( 'skin_', '', $options['group'] );
$_group = str_replace( '{current_app}', "'.\$this->registry->getCurrentApplication().'", $_group );
$_params = $options['params'];
$return = "\$this->registry->getClass('output')->getTemplate('" . $_group . "')->".$data."(".$_params.")";
return '" . ' . $return . ' . "';
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'template',
'author' => 'IPS, Inc.',
'usage' => '{parse template="myTemplate" group="global" params="$data, $moreData"}',
'options' => array( 'group', 'params' ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template Pluging: Template Include
* Last Updated: $Date: 2010-08-12 08:32:14 -0400 (Thu, 12 Aug 2010) $
* </pre>
*
* @author $Author: matt $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 6745 $
*/
/**
* Main loader class
*/
class tp_template extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
if( $options['group'] == 'editors' && ipsRegistry::isClassLoaded( 'class_localization' ) )
{
ipsRegistry::getClass('class_localization')->loadLanguageFile( array( 'public_editors' ), 'core' );
}
$return = '';
$_group = str_replace( 'skin_', '', $options['group'] );
$_group = str_replace( '{current_app}', "'.\$this->registry->getCurrentApplication().'", $_group );
$_params = $options['params'];
$return = "\$this->registry->getClass('output')->getTemplate('" . $_group . "')->".$data."(".$_params.")";
return '" . ' . $return . ' . "';
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'template',
'author' => 'IPS, Inc.',
'usage' => '{parse template="myTemplate" group="global" params="$data, $moreData"}',
'options' => array( 'group', 'params' ) );
}
}
+131 -79
View File
@@ -1,80 +1,132 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Template Pluging: URL
* Last Updated: $Date: 2009-09-21 16:09:44 -0400 (Mon, 21 Sep 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @version $Rev: 5134 $
*/
/**
* Main loader class
*/
class tp_url extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$return = '';
$base = str_replace( '"', '\\"', $options['base'] );
$seotitle = isset( $options['seotitle'] ) ? str_replace( '"', '\\"', $options['seotitle'] ) : '';
$template = isset( $options['template'] ) ? str_replace( '"', '\\"', $options['template'] ) : '';
$options['httpauth'] = isset( $options['httpauth'] ) ? $options['httpauth'] : '';
$return = '$this->registry->getClass(\'output\')->formatUrl( $this->registry->getClass(\'output\')->buildUrl( "' . $data . '", "' . $base . '",\'' . $options['httpauth'] . '\' ), "' . $seotitle . '", "' . $template . '" )';
return '" . ' . $return . ' . "';
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'url',
'author' => 'IPS, Inc.',
'usage' => '{parse url="this=that" base="public"}',
'options' => array( 'base', 'seotitle', 'template', 'httpauth' ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template Pluging: URL
* Last Updated: $Date: 2010-01-15 10:18:44 -0500 (Fri, 15 Jan 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 5713 $
*/
/**
* Main loader class
*/
class tp_url extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
* @access public
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$return = '';
$base = str_replace( '"', '\\"', $options['base'] );
$seotitle = isset( $options['seotitle'] ) ? str_replace( '"', '\\"', $options['seotitle'] ) : '';
$template = isset( $options['template'] ) ? str_replace( '"', '\\"', $options['template'] ) : '';
$options['httpauth'] = isset( $options['httpauth'] ) ? $options['httpauth'] : '';
//$data = $this->_cleanData( $data );
$return = '$this->registry->getClass(\'output\')->formatUrl( $this->registry->getClass(\'output\')->buildUrl( "' . $data . '", "' . $base . '",\'' . $options['httpauth'] . '\' ), "' . $seotitle . '", "' . $template . '" )';
return '" . ' . $return . ' . "';
}
/**
* Clean the data passed to this plugin
*
* @access private
* @param string Query string params
* @return string Query string params (singular keys)
* @see http://community.invisionpower.com/tracker/issue-20122-hard-coded-query-strings-in-members-list/
*/
private function _cleanData( $data )
{
$_return = str_replace( '&amp;', '&', $data );
$_pairs = array();
$_existing = explode( '&', $_return );
if( count( $_existing ) AND is_array( $_existing ) )
{
foreach( $_existing as $kvp )
{
list( $key, $value ) = explode( '=', $kvp );
if( $key AND $value )
{
if( strpos( $key, '[' ) === false OR strpos( $key, '[]' ) !== false )
{
$_pairs[ $key ] = $key . '=' . $value;
}
else
{
preg_match( "/^(.+?)\[(.+?)\]$/", $key, $matches );
$_pairs[ $matches[1] . $matches[2] ] = $key . '=' . $value;
}
}
else
{
$_pairs[] = $kvp;
}
}
return implode( '&amp;', $_pairs );
}
else
{
return $data;
}
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
//-----------------------------------------
// Return the data, it's that simple...
//-----------------------------------------
return array( 'name' => 'url',
'author' => 'IPS, Inc.',
'usage' => '{parse url="this=that" base="public"}',
'options' => array( 'base', 'seotitle', 'template', 'httpauth' ) );
}
}
@@ -1,95 +1,97 @@
<?php
/**
* Invision Power Services
* IP.Board v3.0.5
* Template plugin: Set and retrieve template variables
* Last Updated: $Date: 2009-10-23 21:23:07 -0400 (Fri, 23 Oct 2009) $
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.iinvisionpower.com/community/board/license.html
* @package Invision Power Board
* @link http://www.iinvisionpower.com
* @since 6/24/2008
* @version $Revision: 5283 $
*/
/**
* Main loader class
*/
class tp_variable extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
*
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$phpCode = '';
//-----------------------------------------
// Just want the tag?
//-----------------------------------------
if ( ! count( $options ) )
{
return '" . $this->templateVars["'.$data.'"] . "';
}
if ( isset($options['default']) )
{
$phpCode .= "\n" . '$this->templateVars[\'' . $data . '\'] = "' . str_replace( '"', '\\"', $options['default'] ) . '";';
$phpCode .= "\n" . '$this->__default__templateVars[\'' . $data . '\'] = "' . str_replace( '"', '\\"', $options['default'] ) . '";';
}
if ( $options['oncondition'] AND isset( $options['value'] ) )
{
$phpCode .= "\nif ( {$options['oncondition']} )\n{\n\t".'$this->templateVars[\'' . $data . '\'] = "' . str_replace( '"', '\\"', $options['value'] ) . '";' . "\n}";
$phpCode .= "\nelse {" . '$this->templateVars[\'' . $data . '\'] = $this->__default__templateVars[\'' . $data . '\']; }';
}
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
return ( $phpCode ) ? "<php>" . $phpCode . "</php>" : '';
}
/**
* Return information about this modifier
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
return array( 'name' => 'variable',
'author' => 'IPS, Inc.',
'usage' => '{parse variable="testKey" default="foo" oncondition="$data == \'new\'" value="bar"}',
'options' => array( 'default', 'oncondition', 'value' ) );
}
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* Template plugin: Set and retrieve template variables
* Last Updated: $Date: 2010-09-15 19:24:12 -0400 (Wed, 15 Sep 2010) $
* </pre>
*
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @package IP.Board
* @link http://www.invisionpower.com
* @since 6/24/2008
* @version $Revision: 6882 $
*/
/**
* Main loader class
*/
class tp_variable extends output implements interfaceTemplatePlugins
{
/**
* Prevent our main destructor being called by this class
*
* @access public
* @return void
*/
public function __destruct()
{
}
/**
* Run the plug-in
*
*
* @author Matt Mecham
* @param string The initial data from the tag
* @param array Array of options
* @return string Processed HTML
*/
public function runPlugin( $data, $options )
{
//-----------------------------------------
// INIT
//-----------------------------------------
$phpCode = '';
//-----------------------------------------
// Just want the tag?
//-----------------------------------------
if ( ! count( $options ) )
{
return '" . $this->templateVars["'.$data.'"] . "';
}
if ( isset($options['default']) )
{
$phpCode .= "\n" . '$this->templateVars[\'' . $data . '\'] = "' . str_replace( '"', '\\"', $options['default'] ) . '";';
$phpCode .= "\n" . '$this->__default__templateVars[\'' . $data . '\'] = "' . str_replace( '"', '\\"', $options['default'] ) . '";';
}
if ( isset($options['oncondition']) AND $options['oncondition'] AND isset( $options['value'] ) )
{
$phpCode .= "\nif ( {$options['oncondition']} )\n{\n\t".'$this->templateVars[\'' . $data . '\'] = "' . str_replace( '"', '\\"', $options['value'] ) . '";' . "\n}";
$phpCode .= "\nelse {" . '$this->templateVars[\'' . $data . '\'] = $this->__default__templateVars[\'' . $data . '\']; }';
}
//-----------------------------------------
// Process the tag and return the data
//-----------------------------------------
return ( $phpCode ) ? "<php>" . $phpCode . "</php>" : '';
}
/**
* Return information about this modifier.
*
* It MUST contain an array of available options in 'options'. If there are no allowed options, then use an empty array.
* Failure to keep this up to date will most likely break your template tag.
*
* @access public
* @author Matt Mecham
* @return array
*/
public function getPluginInfo()
{
return array( 'name' => 'variable',
'author' => 'IPS, Inc.',
'usage' => '{parse variable="testKey" default="foo" oncondition="$data == \'new\'" value="bar"}',
'options' => array( 'default', 'oncondition', 'value' ) );
}
}