Skip to content

Instantly share code, notes, and snippets.

@sobi3ch
Created November 23, 2011 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sobi3ch/1389113 to your computer and use it in GitHub Desktop.
Save sobi3ch/1389113 to your computer and use it in GitHub Desktop.
dobrafaza nadpisywanie wszystkich linkow
/**
* overwrite all links with extra subkultura _GET parametr
* This is usefull for people that send link over IM's
* @param type $path
* @param type $options
* @param type $original_path
*/
function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
if(isset($_SESSION['subculture'])) {
if(!empty($options['query'])) {
$options['query'] .= '&'. drupal_query_string_encode(array('subkultura' => $_SESSION['subculture']));
} else {
$options['query'] = drupal_query_string_encode(array('subkultura' => $_SESSION['subculture']));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment