Source for file function.pageurl.php
Documentation is available at function.pageurl.php
* Smarty {pageurl} function plugin
* @link http://www.bitweaver.org/wiki/function_pageurl function_pageurl
* Smarty {pagination} function plugin
* - <listHash>=<attribute=>value> (optional) - pass in any attributes and they will be added to the url string<br>
* Output: url of the form: $_SERVER[SCRIPT_NAME]?attribute1=value1&attribute2=value2
/* Build up URL variable string */
if( !isset ( $pgnUrl ) ) {
$pgnUrl = $gBitSmarty->get_template_vars('returnURL');
if ( isset ( $params['url'] ) ) {
$pgnUrl = $params['url'];
$pgnUrl = $_SERVER['SCRIPT_NAME'];
if( !empty( $listInfo['parameters'] ) ){
if( !empty( $listInfo['ihash'] ) ){
// find can show up in two places
$foundFind = !empty( $listInfo['ihash']['find'] );
if( !empty( $pgnHidden ) ){
if ( !empty( $listInfo['sort_mode'] ) ){
if ( is_array( $listInfo['sort_mode']) ){
foreach( $listInfo['sort_mode'] as $sort ){
$str .= "&sort_mode[]=". $sort;
$str .= "&sort_mode=". $listInfo['sort_mode'];
if( !$foundFind && isset ($listInfo['find']) && $listInfo['find'] != '' ){
$str .= "&find=". $listInfo['find'];
$pageUrl = $pgnUrl . "?" . $pageUrlVar;
foreach( $pParamHash as $param=> $value ){
foreach ( $value as $v ){
$str .= "&". $param. "[]=". $v;
}elseif ( $value != '' ){
$str .= "&". $param. "=". $value;
|