* @param array consist of all the pathinfo variables in querystring format
*/
function save2Get($var_query){
- if (empty($var_query) || !is_array($var_query))
- return;
- foreach($var_query as $k=>$v){
- if ($k=='page_to_load'){
- continue;
- }
+ if (empty($var_query) || !is_array($var_query))
+ return;
- //If mod_rewrite is on, the page# will be shown as <page#>.html.
- //in this case, parse the page number out.
- if ($k=='page'){
- if (preg_match('/(.*)\.html$/', $v, $matches)==1){
- $v = $matches[1];
- }
- }
- $_GET[$k] = $v;
- $_REQUEST[$k] = $v;
- }
+ //recreate URL querystring so we can use the PHP function - parse_str() later on
+ foreach($var_query as $k=>$v){
+ if ($k=='page_to_load'){
+ continue;
+ }
+
+ //If mod_rewrite is on, the page# will be shown as <page#>.html.
+ //in this case, parse the page number out.
+ if ($k=='page'){
+ if (preg_match('/(.*)\.html$/', $v, $matches)==1){
+ $v = $matches[1];
+ }
+ }
+ $temp[] = $k . '=' . $v;
+ }
+ $var_query = implode(SEP, $temp);
+ parse_str($var_query, $output); //convert querystring to php array
+
+ //saves it to both GET and REQUEST
+ //TODO: Would overwrite POST value that has the same GET name within REQUEST. Fix this.
+ //Avoid the use of REQUEST in the code.
+ foreach($output as $k=>$v){
+ $_GET[$k] = $v;
+ $_REQUEST[$k] = $v;
+ }
}
/**
$last_updated = '';\r
}\r
\r
- echo '<li class="top-tool" style="position:relative;"><a href="'.url_rewrite('mods/_standard/blogs/view.php?ot='.BLOGS_GROUP.htmlentities(SEP).'oid='.$row['group_id']).'">'.$row['title'].$last_updated.'</a>';\r
+ echo '<li class="top-tool" style="position:relative;"><a href="'.url_rewrite('mods/_standard/blogs/view.php?ot='.BLOGS_GROUP. SEP .'oid='.$row['group_id']).'">'.$row['title'].$last_updated.'</a>';\r
\r
// Check if subscribed and make appropriate button\r
if ($sub->is_subscribed('blog',$_SESSION['member_id'],$row['group_id'])){\r
- echo '<a style="float:right;clear:right;padding-right:20px;" href="'.$_SERVER['PHP_SELF'].'?group_id='.$row['group_id'].htmlentities(SEP).'subscribe=unset"><img border="0" src="'.AT_BASE_HREF.'images/unsubscribe-envelope.png" alt="" /> '._AT('blog_unsubscribe').'</a>';\r
+ echo '<a style="float:right;clear:right;padding-right:20px;" href="'.$_SERVER['PHP_SELF'].'?group_id='.$row['group_id']. SEP .'subscribe=unset"><img border="0" src="'.AT_BASE_HREF.'images/unsubscribe-envelope.png" alt="" /> '._AT('blog_unsubscribe').'</a>';\r
} else {\r
- echo '<a style="float:right;clear:right;padding-right:20px;" href="'.$_SERVER['PHP_SELF'].'?group_id='.$row['group_id'].htmlentities(SEP).'subscribe=set"><img border="0" src="'.AT_BASE_HREF.'images/subscribe-envelope.png" alt="" /> '._AT('blog_subscribe').'</a>';\r
+ echo '<a style="float:right;clear:right;padding-right:20px;" href="'.$_SERVER['PHP_SELF'].'?group_id='.$row['group_id']. SEP .'subscribe=set"><img border="0" src="'.AT_BASE_HREF.'images/subscribe-envelope.png" alt="" /> '._AT('blog_subscribe').'</a>';\r
}\r
echo '</li>';\r
$blogs = true;\r
}
$link_title = $row['title'].$last_updated;
- $list[] = '<a href="'.url_rewrite('mods/_standard/blogs/view.php?ot='.BLOGS_GROUP.htmlentities(SEP).'oid='.$row['group_id'], AT_PRETTY_URL_IS_HEADER).'"'.
+ $list[] = '<a href="'.url_rewrite('mods/_standard/blogs/view.php?ot='.BLOGS_GROUP. SEP .'oid='.$row['group_id'], AT_PRETTY_URL_IS_HEADER).'"'.
(strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="'.$link_title.'"' : '') .'>'.
validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>';
}
$filetext = $row['file_name'];
}
- $list[] = '<a href="'.url_rewrite('mods/_standard/file_storage/index.php?download=1'.htmlentities(SEP).'files[]='. $row['file_id'], AT_PRETTY_URL_IS_HEADER).'"'.
+ $list[] = '<a href="'.url_rewrite('mods/_standard/file_storage/index.php?download=1'.SEP.'files[]='. $row['file_id'], AT_PRETTY_URL_IS_HEADER).'"'.
(strlen($filetext) > SUBLINK_TEXT_LEN ? ' title="'.$filetext.'"' : '') .'>'.
validate_length($filetext, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>';
}