You are here

function fb_social_url in Facebook social plugins integration 7.2

Same name and namespace in other branches
  1. 6.2 fb_social.module \fb_social_url()
  2. 6 fb_social.module \fb_social_url()

Based on the user settings return the aliased / unaliased version of a given $url

If option is selected, the base URL is rewritten to the specified value. If option is selected, the language tag is stripped from the URL.

12 calls to fb_social_url()
fb_social_box_view in ./fb_social.module
returns the fbml content of the plugin
fb_social_handler_field::render in plugins/views/fb_social_handler_field.inc
Implements views_handler_field#render().
fb_social_preset_view in ./fb_social.module
returns the fbml content of the plugin
_fb_social_comments_link in plugins/fb_plugin/comments.inc
Pseudo hook_link for this plugin
_fb_social_comments_nodeapi_view in plugins/fb_plugin/comments.inc
nodeapi_view callback for this plugin

... See full list

File

./fb_social.module, line 757

Code

function fb_social_url($url = NULL) {
  $aliased = variable_get('fb_social_urls_mode', 0);
  $base_url = variable_get('fb_social_base_url', '');
  $strip_lang = variable_get('fb_social_url_strip_lang', 0);
  $url = url($url, array_filter(array(
    'absolute' => TRUE,
    'alias' => $aliased,
    'base_url' => $base_url,
  )));
  if ($strip_lang) {

    // i.e.  'http://www.mysite.nl/nl/node/xx' becomes 'http://www.mysite.nl/node/xx'
    global $language;
    $lang_tag = "/\\/" . $language->language . "/";
    $url = preg_replace($lang_tag, '', $url, 1);
  }
  return $url;
}