
Originally Posted by
philip937
Wow loads of ideas, just replied to what I thought was te last post then boom all of a sudden I had all these great suggestions.
Now @Design75 did your fix work? Does it work when applying a filter and then going to the second page of te filter results
@gjh42 I will try your suggestion also thanks for your input, and thank you for explaining the code :-)
@DrByte how can I incorporate that fix with the dynamic filter code?
Thanks all
Wow indeed ;)
@philip937: My fix worked, but gjh42 is better. Like he said, my fix always assumes an integer, which may not be the case.
@gjh42
thank you for the lesson
, like said before. I am learning PHP bit by bit. Everyday I am understanding a little more.
@DrByte, I am using the functions_general.php that came with ZC 1.5.1, and merged the dynamic filter code in to it.
This is how the merged result looks like, including Glenn's fix.
PHP Code:
function zen_get_all_get_params($exclude_array = '', $search_engine_safe = true) {
if (!is_array($exclude_array)) $exclude_array = array();
$exclude_array = array_merge($exclude_array, array(zen_session_name(), 'main_page', 'error', 'x', 'y'));
$get_url = '';
if (is_array($_GET) && (sizeof($_GET) > 0)) {
reset($_GET);
while (list($key, $value) = each($_GET)) {
// bof dynamic filter 1 of 3
if ( (!in_array($key, $exclude_array)) && (is_string($value) && strlen($value) > 0 || is_array($value) && array_filter($value) ) && ($key != 'main_page') && ($key != zen_session_name()) && ($key != 'error') && ($key != 'x') && ($key != 'y') ) {
// eof dynamic filter 1 of 3
// bof dynamic filter 2 of 3
if (is_array($value)) {
foreach($value as $arr){
$get_url .= zen_sanitize_string($key) . '[]=' . rawurlencode(stripslashes($arr)) . '&';
}
} else {
// eof dynamic filter 2 of 3
$get_url .= zen_sanitize_string($key) . '=' . rawurlencode(stripslashes($value)) . '&';
// bof dynamic filter 3 of 3
}
// eof dynamic filter 3 of 3
}
}
}
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
while (strstr($get_url, '&&')) $get_url = str_replace('&&', '&', $get_url);
return $get_url;
}
Bookmarks