Index: wlw_blogapi.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wlw_blogapi/wlw_blogapi.info,v
retrieving revision 1.2
diff -u -r1.2 wlw_blogapi.info
--- wlw_blogapi.info	5 Sep 2008 17:36:53 -0000	1.2
+++ wlw_blogapi.info	22 Jan 2009 01:46:38 -0000
@@ -1,5 +1,5 @@
 ; $Id: wlw_blogapi.info,v 1.2 2008/09/05 17:36:53 jrglasgow Exp $
 name = WLW Blog API
 description = Allows users to post content using Windows Live Writer.
-core = 6.x
+core = 5.x
 
Index: wlw_blogapi.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wlw_blogapi/wlw_blogapi.install,v
retrieving revision 1.5
diff -u -r1.5 wlw_blogapi.install
--- wlw_blogapi.install	16 Oct 2008 19:32:21 -0000	1.5
+++ wlw_blogapi.install	22 Jan 2009 01:46:39 -0000
@@ -1,44 +1,37 @@
 <?php
-// $Id: wlw_blogapi.install,v 1.5 2008/10/16 19:32:21 jrglasgow Exp $
-
-/**
- *  @file
- *
- *  install and uninstall functions for wlw_blogapi function
- */
-
+// $Id: blogapi.install,v 1.2.2.3 2008/08/27 13:25:13 drumm Exp $
 
 /**
  * Implementation of hook_install().
  */
 function wlw_blogapi_install() {
-  // check to see if the blogapi module is installed,
-  // if so diasable it.
-  if (module_exists('blogapi')) {
-    module_disable(array('blogapi'));
-    drupal_set_message(t('WLW Blog API is not compatable with Blog API module. Blog API module has been disabled.'));
-    watchdog('wlw_blogapi',  'WLW Blog API is not compatable with Blog API module. Blog API module has been disabled.', array(), WATCHDOG_NOTICE);
+  // Create table.
+  switch ($GLOBALS['db_type']) {
+    case 'mysql':
+    case 'mysqli':
+      db_query("CREATE TABLE {wlw_blogapi_files} (
+        fid int NOT NULL auto_increment,
+        uid int unsigned NOT NULL default 0,
+        filepath varchar(255) NOT NULL default '',
+        filesize int unsigned NOT NULL default 0,
+        PRIMARY KEY (fid),
+        KEY uid (uid)
+      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+      break;
+
+    case 'pgsql':
+      db_query("CREATE TABLE {wlw_blogapi_files} (
+        fid serial,
+        uid int_unsigned NOT NULL default 0,
+        filepath varchar(255) NOT NULL default '',
+        filesize int_unsigned NOT NULL default 0,
+        PRIMARY KEY (fid)
+      )");
+
+      db_query("CREATE INDEX {wlw_blogapi_files}_uid_idx ON {wlw_blogapi_files} (uid)");
+      break;
   }
-  drupal_install_schema('wlw_blogapi');
-}
 
-/**
- *  Implementation of hook_schema().
- */
-function wlw_blogapi_schema() {
-  $schema = array();
-  $schema['wlw_blogapi_files'] = array(
-    'fields' => array(
-      'fid' => array('type' => 'serial', 'not null' => TRUE, 'disp-width' => '11'),
-      'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
-      'filepath' => array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => ''),
-      'filesize' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'disp-width' => '10')),
-    'primary key' => array('fid'),
-    'indexes' => array(
-      'uid' => array('uid')
-    ),
-  );
-  return $schema;
 }
 
 /**
@@ -46,7 +39,48 @@
  */
 function wlw_blogapi_uninstall() {
   // Remove table.
-  drupal_uninstall_schema('wlw_blogapi');
+  db_query("DROP TABLE {wlw_blogapi_files}");
+}
+
+/**
+ * @defgroup updates-5.x-extra Extra blogapi updates for 5.x
+ * @{
+ */
+
+/**
+ * Add blogapi_files table to enable size restriction for BlogAPI file uploads.
+ *
+ * Added in Drupal 5.10 (and 6.4).
+ */
+function wlw_blogapi_update_5000() {
+  $ret = array();
+  switch ($GLOBALS['db_type']) {
+    case 'mysql':
+    case 'mysqli':
+      $ret[] = update_sql("CREATE TABLE {wlw_blogapi_files} (
+        fid int NOT NULL auto_increment,
+        uid int unsigned NOT NULL default 0,
+        filepath varchar(255) NOT NULL default '',
+        filesize int unsigned NOT NULL default 0,
+        PRIMARY KEY (fid),
+        KEY uid (uid)
+      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+      break;
+
+    case 'pgsql':
+      $ret[] = update_sql("CREATE TABLE {wlw_blogapi_files} (
+        fid serial,
+        uid int_unsigned NOT NULL default 0,
+        filepath varchar(255) NOT NULL default '',
+        filesize int_unsigned NOT NULL default 0,
+        PRIMARY KEY (fid)
+      )");
+
+      $ret[] = update_sql("CREATE INDEX {wlw_blogapi_files}_uid_idx ON {wlw_blogapi_files} (uid)");
+      break;
+  }
+
+  return $ret;
 }
 function wlw_blogapi_update_6002() {
   $ret = array();
@@ -59,4 +93,9 @@
   // remove old menu setting
   variable_del('wlw_blogapi_menu');
   return $ret;
-}
\ No newline at end of file
+}
+
+/**
+ * @} End of "defgroup updates-5.x-extra"
+ */
+
Index: wlw_blogapi.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wlw_blogapi/wlw_blogapi.module,v
retrieving revision 1.16
diff -u -r1.16 wlw_blogapi.module
--- wlw_blogapi.module	6 Jan 2009 06:31:46 -0000	1.16
+++ wlw_blogapi.module	22 Jan 2009 02:38:17 -0000
@@ -9,7 +9,7 @@
 /**
  * Implementation of hook_help().
  */
-function wlw_blogapi_help($path, $arg) {
+function wlw_blogapi_help($path) {
   switch ($path) {
     case 'admin/help#blogapi':
       $output = '<p>'. t('The blog API module enables a post to be posted to a site via external GUI applications. Many users prefer to use external tools to improve their ability to read and post responses in a customized way. The blog api provides users the freedom to use the blogging tools they want but still have the blogging server of choice.') .'</p>';
@@ -176,7 +176,7 @@
       'firstname' => $name[0],
       'nickname' => $user->name,
       'email' => $user->mail,
-      'url' => url('blog/'. $user->uid, array('absolute', TRUE)));
+      'url' => url('blog/'. $user->uid, NULL, NULL, TRUE));
   }
   else {
     return wlw_blogapi_error($user);
@@ -581,7 +581,7 @@
 function wlw_blogapi_validate_user($username, $password) {
   global $user;
 
-  $user = user_authenticate(array('name' => $username, 'pass' => $password));
+  $user = user_authenticate($username, $password);
   if ($user->uid) {
     if (user_access('administer content with blog api', $user)) {
       return $user;
@@ -621,7 +621,7 @@
     '#description' => t('Select the content types for which you wish to enable posting via blogapi. Each type will appear as a different "blog" in the client application (if supported).')
   );
   $menus = array('none' => 'None');
-  $menus += menu_get_menus(TRUE);
+  $menus += menu_parent_options(0);
   $form['menu_settings'] = array(
     '#type' => 'fieldset',
     '#title' => 'Menu Settings',
@@ -737,10 +737,10 @@
   
   return $form;
 }
-function theme_wlw_blogapi_admin_settings_form(&$form, &$form_state) {
-  $args = func_get_args();
-  drupal_set_message('$args = <pre>'. print_r($args, TRUE) .'</pre>');
-}
+//function theme_wlw_blogapi_admin_settings_form(&$form, &$form_state) {
+//  $args = func_get_args();
+//  drupal_set_message('$args = <pre>'. print_r($args, TRUE) .'</pre>');
+//}
 /**
  *  implementation os hook_init()
  */
@@ -748,41 +748,46 @@
   drupal_add_link(array(
     'rel' => 'wlwmanifest',
     'type' => 'application/wlwmanifest+xml',
-    'href' => url('blogapi/wlwmanifest.xml', array('absolute' => TRUE))
+    'href' => url('blogapi/wlwmanifest.xml', NULL, NULL, TRUE)
   ));
   drupal_add_link(array(
     'rel' => 'EditURI',
     'type' => 'application/rsd+xml',
     'title' => t('RSD'),
-    'href' => url('blogapi/rsd', array('absolute' => TRUE))
+    'href' => url('blogapi/rsd', NULL, NULL, TRUE)
   ));
 }
 
 
-function wlw_blogapi_menu() {
+function wlw_blogapi_menu($may_cache) {
   $items = array();
 
-  $items['blogapi'] = array(
-    'title' => 'RSD',
-    'page callback' => 'wlw_blogapi_blogapi',
-    'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK
-  );
-  $items['admin/settings/wlw_blogapi'] = array(
-    'title' => 'WLW Blog API',
-    'description' => 'Configure which content types blog clients can use, as well as WLW settings.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('wlw_blogapi_admin_settings_form'),
-    'access arguments' => array('administer site configuration'),
-    'type' => MENU_NORMAL_ITEM
-  );
-  $items['blogapi/wlwmanifest.xml'] = array(
-    'title' => 'WLW Manifest',
-    'description' => 'This provides the wlwmanifest.xml file for WLW configuration',
-    'page callback' => '_wlw_blogapi_wlwmanifest',
-    'type' => MENU_CALLBACK,
-    'access callback' => TRUE,
-  );
+  if ($may_cache) {
+    $items['blogapi'] = array(
+      'path' => 'blogapi',
+      'title' => 'RSD',
+      'callback' => 'wlw_blogapi_blogapi',
+      'access' => user_access('access content'),
+      'type' => MENU_CALLBACK
+    );
+    $items['admin/settings/wlw_blogapi'] = array(
+      'path' => 'admin/settings/wlw_blogapi',
+      'title' => t('WLW Blog API'),
+      'description' => t('Configure which content types blog clients can use, as well as WLW settings.'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('wlw_blogapi_admin_settings_form'),
+      'access' => user_access('administer site configuration'),
+      'type' => MENU_NORMAL_ITEM
+    );
+    $items['blogapi/wlwmanifest.xml'] = array(
+      'path' => 'blogapi/wlwmanifest.xml',
+      'title' => t('WLW Manifest'),
+      'description' => t('This provides the wlwmanifest.xml file for WLW configuration'),
+      'callback' => '_wlw_blogapi_wlwmanifest',
+      'type' => MENU_CALLBACK,
+      'access' => user_access('access content'),
+    );
+  }
   return $items;
 }
 
@@ -926,7 +931,7 @@
   $title = $node->title;
   //watchdog('wlw_blogapi', 'func: _wlw_blogapi_mt_extra 1, title = $title', array('$title' => print_r($title, true)));
   $temp = array();
-  $title2 = 'Ž';
+  $title2 = 'ï¿½';
   for ($i = 0; $i <= 20; $i++) {
     $temp[] = $title2[$i];
   }
@@ -949,8 +954,8 @@
   $text = str_replace('<p>&#160;</p>', '', $text);
   $text = str_replace('<p>&nbsp</p>', '', $text);
   $text = str_replace('<p></p>', '', $text);
-  //$text = str_Replace('&eacute;', 'Ž', $text);
-  //$text = str_Replace('&#233;', 'Ž', $text);
+  //$text = str_Replace('&eacute;', 'ï¿½', $text);
+  //$text = str_Replace('&#233;', 'ï¿½', $text);
   //watchdog('wlw_blogapi', 'func: _wlw_blogapi_filter_extra_code, text = <pre>$text</pre>', array('$text' => print_r($text, true)));
   return $text;
 }
@@ -959,7 +964,7 @@
     case 'insert':
     case 'update':
     case 'presave':
-      //$text = str_Replace('Ž', '&#233;', $text);
+      //$text = str_Replace('ï¿½', '&#233;', $text);
       //watchdog('wlw_blogapi', 'func: wlw_blogapi_nodeapi, node = <pre>'. print_r($node, true) .'</pre>');
       break;
   }
@@ -970,8 +975,8 @@
     'dateCreated' => xmlrpc_date($node->created),
     'title' => $node->title,
     'postid' => $node->nid,
-    'link' => url('node/'. $node->nid, array('absolute', TRUE)),
-    'permaLink' => url('node/'. $node->nid, array('absolute', TRUE)),
+    'link' => url('node/'. $node->nid, NULL, NULL, TRUE),
+    'permaLink' => url('node/'. $node->nid, NULL, NULL, TRUE),
   );
   if ($bodies) {
     if ($node->comment == 1) {

