You are here

function _fb_settings_parse in Drupal for Facebook 6.2

Same name and namespace in other branches
  1. 5.2 fb_settings.inc \_fb_settings_parse()
  2. 6.3 fb_url_rewrite.inc \_fb_settings_parse()
  3. 7.3 fb_url_rewrite.inc \_fb_settings_parse()

Parse a setting from the URL. This may be called before custom_url_rewrite, so we can't count on fb_settings() to return the value. For internal use only (see fb_session.inc).

1 call to _fb_settings_parse()
fb_settings_session_helper in ./fb_settings.inc
Forces the session_name and session_id to be appropriate when Facebook controls the session. Call this function from custom session_inc files, before session_start() is called.
1 string reference to '_fb_settings_parse'
fb_settings_session_helper in ./fb_settings.inc
Forces the session_name and session_id to be appropriate when Facebook controls the session. Call this function from custom session_inc files, before session_start() is called.

File

./fb_url_rewrite.inc, line 43
Performs custom url rewriting for Drupal for Facebook.

Code

function _fb_settings_parse($key) {
  if (isset($_GET['q'])) {
    $path = $_GET['q'];
    $pos = strpos($path, $key . '/');
    if ($pos !== FALSE) {

      // Too soon for arg() function.
      $args = explode('/', $path);
      $i = 0;
      while (isset($args[$i]) && isset($args[$i + 1])) {
        if ($args[$i] == $key) {

          // Found the value we're interested in.
          return $args[$i + 1];
        }
        $i = $i + 2;
      }
    }
  }
}