Author: novalis
Date: 2008-05-30 16:02:40 -0400 (Fri, 30 May 2008)
New Revision: 17525

Modified:
   streetsblog/trunk/wp-content/plugins/relateme.php
   streetsblog/trunk/wp-content/widgets/sblog-nook.php
Log:
CHANGED: make relateme's blog id come from actual server

Modified: streetsblog/trunk/wp-content/plugins/relateme.php
===================================================================
--- streetsblog/trunk/wp-content/plugins/relateme.php   2008-05-30 19:59:14 UTC 
(rev 17524)
+++ streetsblog/trunk/wp-content/plugins/relateme.php   2008-05-30 20:02:40 UTC 
(rev 17525)
@@ -160,6 +160,27 @@
     update_option('rme_username', $_POST['username']);
     update_option('rme_password', $_POST['password']);
     update_option('rme_category_specification', $_POST['cat']);
+
+    $url = get_option('rme_url') . "/remote/id";
+    #talk to relateme server to get blog id
+    $vars = array('username' => $_POST['username'],
+                  'password' => $_POST['password']);
+  
+    #test out the new options
+    $snoopy = new Snoopy();
+    $result = $snoopy->submit($url, $vars);
+    $error = "";
+    if ($result != 1) {
+      $error = "Could not connect to server";
+    } elseif (!(int)($snoopy->results)) {
+      $error = $snoopy->results;
+    } else {
+      update_option('rme_blog_id', $snoopy->results);
+    }
+    if ($error) {
+      echo "<center><h2>Error: " . $error . "</h2></center>";      
+    }
+
     $failures = 0;
     if ($_POST['Reindex']) {
       $failures = rme_reindex();

Modified: streetsblog/trunk/wp-content/widgets/sblog-nook.php
===================================================================
--- streetsblog/trunk/wp-content/widgets/sblog-nook.php 2008-05-30 19:59:14 UTC 
(rev 17524)
+++ streetsblog/trunk/wp-content/widgets/sblog-nook.php 2008-05-30 20:02:40 UTC 
(rev 17525)
@@ -34,18 +34,13 @@
 
   echo $before_widget . $before_title . $title . $after_title; 
 
-  $dbToUse = '';
-  if (is_site('streetfilms'))
-     $dbToUse = '2';
-  else
-     $dbToUse = '1';
-
+  $blog_id = get_option('rme_blog_id');
 ?>
 
 <div id="nook-body">
   <div class="widget-content">
      <?php
-       $relate_me_url = 
RELATEME_LOCATION."/?post_id=".$post_id."&blog_id=".$dbToUse;
+       $relate_me_url = 
RELATEME_LOCATION."/?post_id=".$post_id."&blog_id=".$blog_id;
        $relate_me_url = urlencode($relate_me_url);
        ?>
      <script src="<?php echo SCRIPTTRANSCLUDER_LOCATION; ?>?url=<?php echo 
$relate_me_url ?>"></script>



--
Archive: 
http://www.openplans.org/projects/opencore/lists/openplans-svn/archive/2008/05/1212177771014
To unsubscribe send an email with subject unsubscribe to [EMAIL PROTECTED]  
Please contact [EMAIL PROTECTED] for questions.

Reply via email to