index 459613c..caf1096
--- a/follow.module
+++ b/follow.module
@@ -5,6 +5,10 @@
  *   Allows users to add links to their social network profiles.
  */
 
+/* DOMAIN ACCESS */
+global $_domain;
+define('FOLLOW_DOMAIN', str_replace(".","_", $_domain[subdomain]));
+
 define('FOLLOW_NAME', 0);
 define('FOLLOW_ME', 1);
 define('FOLLOW_US', 2);
@@ -157,29 +161,29 @@ function follow_block_info() {
 function follow_block_configure($delta = '') {
   switch($delta) {
     case 'site':
-      $form['follow_title'] = array(
+      $form[FOLLOW_DOMAIN . '_follow_title'] = array(
         '#type' => 'radios',
         '#title' => t('Default block title'),
-        '#default_value' => variable_get('follow_site_block_title', FOLLOW_NAME),
+        '#default_value' => variable_get(FOLLOW_DOMAIN . '_follow_site_block_title', FOLLOW_NAME),
         '#options' => array(
-          FOLLOW_NAME => t('Follow @name on', array('@name' => variable_get('site_name', 'Drupal'))),
+          FOLLOW_NAME => t('Follow @name on', array('@name' => variable_get(FOLLOW_DOMAIN . '_site_name', 'Drupal'))),
           FOLLOW_ME => t('Follow me on'),
           FOLLOW_US => t('Follow us on'),
         ),
       );
-      $form['follow_user'] = array(
+      $form[FOLLOW_DOMAIN . '_follow_user'] = array(
         '#type' => 'checkbox',
         '#title' => t('User pages'),
         '#description' => t('Should this block display on user profile pages?'),
-        '#default_value' => variable_get('follow_site_block_user', TRUE),
+        '#default_value' => variable_get(FOLLOW_DOMAIN . '_follow_site_block_user', TRUE),
       );
       return $form;
 
     case 'user':
-      $form['follow_title'] = array(
+      $form[FOLLOW_DOMAIN . '_follow_title'] = array(
         '#type' => 'radios',
         '#title' => t('Default block title'),
-        '#default_value' => variable_get('follow_user_block_title', FOLLOW_NAME),
+        '#default_value' => variable_get(FOLLOW_DOMAIN . '_follow_user_block_title', FOLLOW_NAME),
         '#options' => array(
           FOLLOW_NAME => t('Follow [username] on'),
           FOLLOW_ME => t('Follow me on'),
@@ -193,9 +197,9 @@ function follow_block_configure($delta = '') {
  * Implementation of hook_block_save().
  */
 function follow_block_save($delta = '', $edit = array()) {
-  variable_set('follow_'. $delta .'_block_title', $edit['follow_title']);
+  variable_set(FOLLOW_DOMAIN . '_follow_'. $delta .'_block_title', $edit[FOLLOW_DOMAIN . '_follow_title']);
   if ($delta == 'site') {
-    variable_set('follow_site_block_user', $edit['follow_user']);
+    variable_set(FOLLOW_DOMAIN . '_follow_site_block_user', $edit[FOLLOW_DOMAIN . '_follow_user']);
   }
 }
 
@@ -206,7 +210,7 @@ function follow_block_view($delta = '') {
   switch ($delta) {
     case 'site':
       if (($content = _follow_block_content())
-          && (variable_get('follow_site_block_user', TRUE) || !(arg(0) == 'user' && is_numeric(arg(1))))) {
+          && (variable_get(FOLLOW_DOMAIN . '_follow_site_block_user', TRUE) || !(arg(0) == 'user' && is_numeric(arg(1))))) {
         return array(
           'subject' => _follow_block_subject(),
           'content' => $content,
@@ -244,7 +248,7 @@ function _follow_block_subject($uid = 0) {
 function follow_link_title($uid = 0) {
   // Check to see if we have a valid username.
   if ($uid) {
-    $setting = variable_get('follow_user_block_title', FOLLOW_NAME);
+    $setting = variable_get(FOLLOW_DOMAIN . '_follow_user_block_title', FOLLOW_NAME);
     // Special handling for usernames.
     if ($setting == FOLLOW_NAME) {
       $account = user_load($uid);
@@ -254,9 +258,9 @@ function follow_link_title($uid = 0) {
     return t('Follow me on');
   }
 
-  switch(variable_get('follow_site_block_title', FOLLOW_NAME)) {
+  switch(variable_get(FOLLOW_DOMAIN . '_follow_site_block_title', FOLLOW_NAME)) {
     case FOLLOW_NAME:
-      return t('Follow @name on', array('@name' => variable_get('site_name', 'Drupal')));
+      return t('Follow @name on', array('@name' => variable_get(FOLLOW_DOMAIN . '_site_name', 'Drupal')));
 
     case FOLLOW_ME:
       return t('Follow me on');
@@ -366,6 +370,9 @@ function theme_follow_link($variables) {
 
   $classes = array();
   $classes[] = 'follow-link';
+  
+  $link->name = str_replace(FOLLOW_DOMAIN . '_', '', $link->name);
+  
   $classes[] = "follow-link-{$link->name}";
   $classes[] = $link->uid ? 'follow-link-user' : 'follow-link-site';
 
@@ -430,7 +437,7 @@ function follow_links_form(&$form_state, $uid = 0) {
   $form = array();
 
   $form['uid'] = array('#type' => 'hidden', '#value' => $uid);
-  $form['follow_links']['#tree'] = TRUE;
+  $form[FOLLOW_DOMAIN . '_follow_links']['#tree'] = TRUE;
 
   $links = follow_links_load($uid);
   $networks = follow_networks_load($uid, TRUE);
@@ -439,7 +446,7 @@ function follow_links_form(&$form_state, $uid = 0) {
   if (is_array($links)) {
     foreach ($links as $name => $link) {
       $title = $networks[$name]['title'];
-      $form['follow_links'][$name] = _follow_links_form_link($link, $title, $uid);
+      $form[FOLLOW_DOMAIN . '_follow_links'][$name] = _follow_links_form_link($link, $title, $uid);
       // Unset this specific network so we don't add the same one again below.
       unset($networks[$name]);
     }
@@ -448,7 +455,7 @@ function follow_links_form(&$form_state, $uid = 0) {
   foreach ($networks as $name => $info) {
     $link = new stdClass();
     $link->name = $name;
-    $form['follow_links'][$name] = _follow_links_form_link($link, $info['title'], $uid);
+    $form[FOLLOW_DOMAIN . '_follow_links'][$name] = _follow_links_form_link($link, $info['title'], $uid);
   }
 
   $form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
@@ -562,6 +569,7 @@ function follow_parse_url($url) {
  * Validates the url field to verify it's actually a url.
  */
 function follow_url_validate($form) {
+
   $url = trim($form['#value']);
   $networks = follow_networks_load($form['#follow_uid']);
   $info = $networks[$form['#follow_network']];
@@ -593,6 +601,7 @@ function follow_url_validate($form) {
  */
 function follow_network_regex($network_info) {
   // An external link.
+  $network_info['domain'] = str_replace(FOLLOW_DOMAIN . '_', '', $network_info['domain']);
   return '@^https?://([a-z0-9\-_.]+\\.|)' . str_replace('.', '\\.', $network_info['domain']) . '/@i';
 }
 
@@ -631,8 +640,8 @@ function follow_network_regex_external() {
  */
 function follow_links_form_submit($form, &$form_state) {
   $values = $form_state['values'];
-  $links = $values['follow_links'];
-
+  $links = $values[FOLLOW_DOMAIN . '_follow_links'];
+  
   foreach($links as $name => $link) {
     $link = (object) $link;
     $link->url = trim($link->url);
@@ -667,19 +676,19 @@ function theme_follow_links_form($form) {
   $rows = array();
   $disabled_rows = array();
 
-  foreach (element_children($form['follow_links']) as $key) {
+  foreach (element_children($form[FOLLOW_DOMAIN . '_follow_links']) as $key) {
     $row = array();
 
-    if (isset($form['follow_links'][$key]['weight'])) {
-      $row[] = drupal_render($form['follow_links'][$key]['lid']) . drupal_render($form['follow_links'][$key]['name']);
-      $row[] = drupal_render($form['follow_links'][$key]['url']);
+    if (isset($form[FOLLOW_DOMAIN . '_follow_links'][$key]['weight'])) {
+      $row[] = drupal_render($form[FOLLOW_DOMAIN . '_follow_links'][$key]['lid']) . drupal_render($form[FOLLOW_DOMAIN . '_follow_links'][$key]['name']);
+      $row[] = drupal_render($form[FOLLOW_DOMAIN . '_follow_links'][$key]['url']);
       if (user_access('change follow link titles')) {
-        $row[] = drupal_render($form['follow_links'][$key]['title']);
+        $row[] = drupal_render($form[FOLLOW_DOMAIN . '_follow_links'][$key]['title']);
       }
 
       // Now, render the weight row.
-      $form['follow_links'][$key]['weight']['#attributes']['class'] = 'follow-links-weight';
-      $row[] = drupal_render($form['follow_links'][$key]['weight']);
+      $form[FOLLOW_DOMAIN . '_follow_links'][$key]['weight']['#attributes']['class'] = 'follow-links-weight';
+      $row[] = drupal_render($form[FOLLOW_DOMAIN . '_follow_links'][$key]['weight']);
 
       // Add the new row to our collection of rows, and give it the 'draggable' class.
       $rows[] = array(
@@ -688,7 +697,7 @@ function theme_follow_links_form($form) {
       );
     }
     else {
-      $disabled_rows[] = array(drupal_render($form['follow_links'][$key]['name']), drupal_render($form['follow_links'][$key]['url']));
+      $disabled_rows[] = array(drupal_render($form[FOLLOW_DOMAIN . '_follow_links'][$key]['name']), drupal_render($form[FOLLOW_DOMAIN . '_follow_links'][$key]['url']));
     }
   }
 
@@ -737,7 +746,7 @@ function follow_settings_form() {
 function follow_links_load($uid = 0) {
   $links = array();
 
-  $sql = "SELECT * FROM {follow_links} WHERE uid = %d ORDER BY weight ASC";
+  $sql = "SELECT * FROM {follow_links} WHERE uid = %d AND name LIKE '". FOLLOW_DOMAIN ."%'  ORDER BY weight ASC";
   $result = db_query($sql, $uid);
 
   while ($link = db_fetch_object($result)) {
@@ -776,7 +785,7 @@ function follow_link_save($link) {
  *   An int containing the ID of a link.
  */
 function follow_link_delete($lid) {
-  $sql = 'DELETE FROM {follow_links} WHERE lid = %d';
+  $sql = 'DELETE FROM {follow_links} WHERE lid = %d AND name LIKE "'. FOLLOW_DOMAIN .'%" ';
   db_query($sql, $lid);
 }
 
@@ -819,55 +828,55 @@ function follow_networks_load($uid = 0, $reset = FALSE) {
  */
 function follow_default_networks($uid) {
   $networks = array(
-    'facebook'  => array(
+    FOLLOW_DOMAIN . '_facebook'  => array(
       'title' => t('Facebook'),
       'domain' => 'facebook.com',
     ),
-    'virb'      => array(
+    FOLLOW_DOMAIN . '_virb'      => array(
       'title' => t('Virb'),
       'domain' => 'virb.com',
     ),
-    'myspace'   => array(
+    FOLLOW_DOMAIN . '_myspace'   => array(
       'title' => t('MySpace'),
       'domain' => 'myspace.com',
     ),
-    'twitter'   => array(
+    FOLLOW_DOMAIN . '_twitter'   => array(
       'title' => t('Twitter'),
       'domain' => 'twitter.com',
     ),
-    'picasa'    => array(
+    FOLLOW_DOMAIN . '_picasa'    => array(
       'title' => t('Picasa'),
       'domain' => 'picasaweb.google.com',
     ),
-    'flickr'    => array(
+    FOLLOW_DOMAIN . '_flickr'    => array(
       'title' => t('Flickr'),
       'domain' => 'flickr.com',
     ),
-    'youtube'   => array(
+    FOLLOW_DOMAIN . '_youtube'   => array(
       'title' => t('YouTube'),
       'domain' => 'youtube.com',
     ),
-    'vimeo'     => array(
+    FOLLOW_DOMAIN . '_vimeo'     => array(
       'title' => t('Vimeo'),
       'domain' => 'vimeo.com',
     ),
-    'bliptv'    => array(
+    FOLLOW_DOMAIN . '_bliptv'    => array(
       'title' => t('blip.tv'),
       'domain' => 'blip.tv',
     ),
-    'lastfm'    => array(
+    FOLLOW_DOMAIN . '_lastfm'    => array(
       'title' => t('last.fm'),
       'domain' => 'last.fm',
     ),
-    'linkedin'  => array(
+    FOLLOW_DOMAIN . '_linkedin'  => array(
       'title' => t('LinkedIn'),
       'domain' => 'linkedin.com',
     ),
-    'delicious' => array(
+    FOLLOW_DOMAIN . '_delicious' => array(
       'title' => t('Delicious'),
       'domain' => 'delicious.com',
     ),
-    'tumblr'    => array(
+    FOLLOW_DOMAIN . '_tumblr'    => array(
       'title' => t('Tumblr'),
       'domain' => 'tumblr.com',
     ),
@@ -887,4 +896,4 @@ function follow_default_networks($uid) {
     );
   }
   return $networks;
-}
\ No newline at end of file
+}
diff --git a/icons/large/icon-bliptv.png b/icons/large/icon-bliptv.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-delicious.png b/icons/large/icon-delicious.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-facebook.png b/icons/large/icon-facebook.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-feed.png b/icons/large/icon-feed.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-flickr.png b/icons/large/icon-flickr.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-lastfm.png b/icons/large/icon-lastfm.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-linkedin.png b/icons/large/icon-linkedin.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-myspace.png b/icons/large/icon-myspace.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-newsletter.png b/icons/large/icon-newsletter.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-picasa.png b/icons/large/icon-picasa.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-tumblr.png b/icons/large/icon-tumblr.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-twitter.png b/icons/large/icon-twitter.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-vimeo.png b/icons/large/icon-vimeo.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-virb.png b/icons/large/icon-virb.png
old mode 100644
new mode 100755
diff --git a/icons/large/icon-youtube.png b/icons/large/icon-youtube.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-bliptv.png b/icons/small/icon-bliptv.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-delicious.png b/icons/small/icon-delicious.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-facebook.png b/icons/small/icon-facebook.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-feed.png b/icons/small/icon-feed.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-flickr.png b/icons/small/icon-flickr.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-lastfm.png b/icons/small/icon-lastfm.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-linkedin.png b/icons/small/icon-linkedin.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-myspace.png b/icons/small/icon-myspace.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-newsletter.png b/icons/small/icon-newsletter.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-picasa.png b/icons/small/icon-picasa.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-tumblr.png b/icons/small/icon-tumblr.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-twitter.png b/icons/small/icon-twitter.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-vimeo.png b/icons/small/icon-vimeo.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-virb.png b/icons/small/icon-virb.png
old mode 100644
new mode 100755
diff --git a/icons/small/icon-youtube.png b/icons/small/icon-youtube.png
old mode 100644
new mode 100755
