function pSort($link, $param, $field, $style = '', $imgAsc = TZN_DB_ASC_OFF, $imgAscActive = TZN_DB_ASC_ON, $imgDesc = TZN_DB_DESC_OFF, $imgDescActive = TZN_DB_DESC_ON) { $begin = '<a href="' . $link; if (ereg('\\?', $link)) { $begin .= '&'; } else { $begin .= '?'; } $begin .= $param . '='; $end = '"'; $end .= Tzn::_style($style); $end .= '>'; if (ereg('^' . $field . ' ASC', $this->_sqlOrder)) { print '<img src="' . $imgAscActive . '">'; } else { print $begin . $field . '+ASC' . $end . '<img src="' . $imgAsc . '" border="0"></a>'; } if (ereg('^' . $field . ' DESC', $this->_sqlOrder)) { print '<img src="' . $imgDescActive . '">'; } else { print $begin . $field . '+DESC' . $end . '<img src="' . $imgDesc . '" border="0"></a>'; } }
function pUrl($keyval, $target = '', $default = '', $style = '', $xtra = '') { $value = Tzn::_value($keyval); if ($value) { $str = '<a href="' . $value . '" ' . Tzn::_style($style); if ($target) { $str .= 'target="' . $target . '" '; } if ($xtra) { $str .= $xtra; } $str .= '>' . preg_replace("/^(http[s]?|ftp):\\/\\//i", '', $value) . '</a>'; print $str; } else { print $default; } }