Source for file filter.backtotop.php
Documentation is available at filter.backtotop.php
* @subpackage plugins_filter
* definitions ( guid character limit is 16 chars )
define( 'PLUGIN_GUID_FILTERBACKTOTOP', 'filterbacktotop' );
'title' => 'Back to Top',
'description' => 'Add back to top link to headers.<br />We recommend that you add something like this to your CSS file:<br /><code>a.backtotop {display:block;text-align:right;}</code>',
'auto_activate' => FALSE,
'postparse_function' => 'backtotop_postparsefilter',
// these settings are to get the plugin help working on content edit pages
'help_page' => 'FilterPluginBacktoTop',
'help_function' => 'backtotop_help',
'syntax' => '{backtotop}',
if( preg_match( "/\{(backtotop[^\}]*)\}/i", $pData, $backtotop )) {
// remove {backtotop} from page
$pData = preg_replace( '#(<p>)?'. preg_quote( $backtotop[0], '#' ). '(</p>)?(\s*<[Bb][Rr]\s*/?>)?#', '', $pData );
$gBitSmarty->loadPlugin( 'smarty_function_biticon' );
'iexplain' => 'Back to top',
// get all headers into an array
foreach( $headers[0] as $key => $header ) {
if( $headers[1][$key] >= $params['min'] && $headers[1][$key] <= $params['max'] ) {
$pData = str_replace( $header, $link. $header, $pData );
'<table class="data help">
<th>'. tra( "Key" ). '</th>
<th>'. tra( "Type" ). '</th>
<th>'. tra( "Comments" ). '</th>
<td>'. tra( "numeric"). '<br />('. tra("optional"). ')</td>
<td>'. tra( 'If you specify 2 here, backtotop will only add links from h2 to h6 level.' ). '</td>
<td>'. tra( "numeric"). '<br />('. tra("optional"). ')</td>
<td>'. tra( 'If you specify 3 here, backtotop will only add links from h1 to h3 level.' ). '</td>
tra("Example: "). '{backtotop min=2 max=3}';
|