All pastes #947017 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-03-18 02:50 UTC
rendered paste body
//the goal is to allow a tag search if user hit /tag/my.tags.to.search
//however, it returns a 403 instead of calling the function

function autometa_menu($may_cache)
{
  $items = array();
  if($may_cache)
  {
    if(arg(0) == 'tag' && !is_null(arg(1)))
    {
      //arg(1) should be something like 'my.search.terms'
      $search_string = str_replace(".", " ", check_plain(arg(1)));

      $items[] = array('path' => 'tag/'. arg(1), 
            'title' => t('Learn more about'),
            'callback' => 'autometa_search_tag',
            'callback arguments' => array($search_string),
            'access' => user_access('access content'),
            'type' => MENU_CALLBACK,
            );
    }
  }
  return $items;
}

/** Search Tag function */
function autometa_search_tag($keys)
{
  return($keys);