diff -u flickrstickr-5.x-dev/flickrstickr.info flickrstickr-6.x-dev/flickrstickr.info
--- flickrstickr-5.x-dev/flickrstickr.info	2008-07-11 07:04:27.000000000 +0700
+++ flickrstickr-6.x-dev/flickrstickr.info	2009-02-17 00:46:01.000000000 +0700
@@ -1,10 +1,5 @@
 ; $Id: flickrstickr.info,v 1.1.2.1 2008/07/10 14:16:51 wmostrey Exp $
-name = flickrstickr
-description = Flickr intergration for TinyMCE
-dependencies = image
-
-; Information added by drupal.org packaging script on 2008-07-11
-version = "5.x-1.x-dev"
-project = "flickrstickr"
-datestamp = "1215734667"
-
+name = Flickrstickr
+core = 6.x
+description = "Insert Flickr photos into your content."
+package = Flickr
diff -u flickrstickr-5.x-dev/flickrstickr.js flickrstickr-6.x-dev/flickrstickr.js
--- flickrstickr-5.x-dev/flickrstickr.js	2007-01-22 20:22:12.000000000 +0700
+++ flickrstickr-6.x-dev/flickrstickr.js	2009-02-17 00:57:29.000000000 +0700
@@ -237,4 +237,4 @@
     loadImages();
     return false;
   }
-}
\ No newline at end of file
+}
diff -u flickrstickr-5.x-dev/flickrstickr.module flickrstickr-6.x-dev/flickrstickr.module
--- flickrstickr-5.x-dev/flickrstickr.module	2008-07-10 21:16:51.000000000 +0700
+++ flickrstickr-6.x-dev/flickrstickr.module	2009-02-17 00:58:34.000000000 +0700
@@ -57,33 +57,38 @@
 /**
  * implements hook_menu
  */
-function flickrstickr_menu($may_cache) {
-  $items = array();
-  if (!$may_cache) {
-    $items[] = array('path' => 'flickrstickr/xml/user',
-                     'title' => t('xml proxy'),
-                     'callback' => 'flickrstickr_proxy_user',
-                     'access' => TRUE,
-                     'type' => MENU_CALLBACK,
-                     'weight' => 5);
-    $items[] = array('path' => 'flickrstickr/xml/images',
-                     'title' => t('xml proxy'),
-                     'callback' => 'flickrstickr_proxy_images',
-                     'access' => TRUE,
-                     'type' => MENU_CALLBACK,
-                     'weight' => 5);
-  }
-  return $items;
+function flickrstickr_menu() {
+  return array(
+    'flickrstickr/xml/user' => array(
+      'type' => MENU_CALLBACK,
+      'page callback' => 'flickrstickr_proxy_user',
+      'page arguments' => array(3),
+      'access callback' => TRUE,
+    ),
+    'flickrstickr/xml/images' => array(
+      'type' => MENU_CALLBACK,
+      'page callback' => 'flickrstickr_proxy_images',
+      'page arguments' => array(3, 5, 4),
+      'access callback' => TRUE,
+    ),
+    'admin/settings/flickrstickr' => array(
+      'title' => 'Flickrstickr',
+      'description' => t('Configure Flickrstickr.'),
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('flickrstickr_admin_settings'),
+      'access arguments' => array('flickrstickr admin'),
+    ),
+  );
 }
 
 /**
  * Public ajax proxy for user search
  * Bcause the javascript restriction
  */
-function flickrstickr_proxy_user() {
+function flickrstickr_proxy_user($username) {
   header("Content-type: text/xml; charset=UTF-8");
   $apikey = flickrstickr_getapikey();
-  $content = flickrstrick_get_url("http://www.flickr.com/services/rest/?method=flickr.people.findByUsername&api_key=".$apikey."&username=".urlencode(arg(3)), "r");
+  $content = flickrstrick_get_url("http://www.flickr.com/services/rest/?method=flickr.people.findByUsername&api_key=".$apikey."&username=".urlencode($username), "r");
   echo $content;
 }
 
@@ -91,23 +96,23 @@
  * public ajax proxy for tag search
  * Because the javascript restriction
  */
-function flickrstickr_proxy_images() {
+function flickrstickr_proxy_images($userid, $page, $tags = NULL) {
   global $user;
   $flickrstickr = flickrstickr_getuserparam();
   header("Content-type: text/xml; charset=UTF-8");
   $apikey = flickrstickr_getapikey();
-  $userid = urlencode(arg(3));
-  $page = urlencode(arg(5));
+  $userid = urlencode($userid);
+  $page = urlencode($page);
   if ($userid == "!recent!") {
     $query = "http://www.flickr.com/services/rest/?method=flickr.photos.getRecent&api_key=". $apikey ."&per_page=". $flickrstickr['imgno'] . "&page=" . $page;
   }
   else {
     $query = "http://www.flickr.com/services/rest/?method=flickr.photos.search&api_key=". $apikey ."&per_page=". $flickrstickr['imgno'] . "&page=" . $page;
-    if (arg(3) != "all") {
+    if ($user != "all") {
       $query .= "&user_id=". $userid;
     }
-    if (arg(4) != null) {
-      $query .= "&tags=". urlencode(arg(4));
+    if ($tags != null) {
+      $query .= "&tags=". urlencode($tags);
     }
     
   }
@@ -184,7 +189,7 @@
 /**
  * imlements hook_form_alter
  */
-function flickrstickr_form_alter($form_id, & $form) {
+function flickrstickr_form_alter(&$form, $form_state, $form_id) {
   if (preg_match('/_node_form$/', $form_id) && user_access('flickrstickr access')) {
     $form['flickrstickr'] = array('#type' => 'fieldset',
                                   '#title' => t('Flickr image insert'),
@@ -192,7 +197,7 @@
                                   '#collapsed' => TRUE,
                                   '#weight' => 20);
     $form['flickrstickr']['images'] = array('#type' => 'markup',
-                                            '#value' => _flickrstickr_htmlpart(),
+                                            '#value' => _flickrstickr_htmlpart($form['#node']->type),
                                             '#weight' => -1);
   }
 }
@@ -200,16 +205,13 @@
 /**
  * Create the flickr images selector
  */
-function _flickrstickr_htmlpart() {
+function _flickrstickr_htmlpart($nodetype) {
   global $user;
   global $base_url;
   $flickrstickr = flickrstickr_getuserparam();
-  $base_path = '';
-  if (flickrstickr_isdrupal47()) {
-    $base_path = base_path();
-  }
-  drupal_set_html_head('<link rel="stylesheet" type="text/css" href="'. $base_path. drupal_get_path('module', 'flickrstickr').'/flickrstickr.css" media="screen" />');
-  drupal_set_html_head('<script src="'. $base_path. drupal_get_path('module', 'flickrstickr'). '/flickrstickr.js"></script>');
+  $base_path = base_path();
+  drupal_add_css(drupal_get_path('module', 'flickrstickr') . '/flickrstickr.css');
+  drupal_add_js(drupal_get_path('module', 'flickrstickr') . '/flickrstickr.js');
   // This line is needed because of floating image selector
   drupal_set_html_head('<!-- compliance patch for microsoft browsers --><!--[if lt IE 7]><script src="'. $base_path. drupal_get_path('module', 'flickrstickr'). '/ie7/ie7-standard-p.js" type="text/javascript"></script><![endif]-->');
   $ret  = '<input type="button" value="' . t('Hide the image selector') . '" onclick="toggleSelector()" id="flickr_togglebutton" />';
@@ -261,7 +263,6 @@
   $ret .= "function getBaseUrl(){\n". "return \"". $base_url ."\";}\n";
   $ret .= "for (i=0;i<". $flickrstickr['imgno'] .";i++) {"."images[i]= new Object();}";
   $ret .= 'function insertText(id){';
-  $nodetype = arg(2);
   $cck  = strpos($nodetype, 'content-');
   if ($cck === FALSE) {
     $ret .= 'textarea = document.getElementById("edit-body");';
@@ -309,22 +310,6 @@
 }
 
 /**
- * implements hook_help
- */
-function flickrstickr_help($section) {
-  switch ($section) {
-    case 'admin/modules#description':
-      $output = t("Enable flickr image inserter in your node forms.");
-      break;
-  }
-  return $output;
-}
-
-
-global $user;
-$node = array('uid' => $user->uid, 'name' => $user->name, 'type' => 'image');
-
-/**
  * implements hook_filter
  */
 function flickrstickr_filter($op, $delta = 0, $format = -1, $text = '') {
@@ -734,27 +719,16 @@
   return array('flickrstickr access', 'flickrstickr admin');
 }
 
-
-
-/**
-* implements hook_settings
-*/
-function flickrstickr_settings() {
-  if (!function_exists('_image_build_derivatives')) {
-    drupal_set_message(t('Flickrstickr requires image module. Please install or enable it!'), 'error');
-  }
-  if (!user_access('flickrstickr admin')) {
-    drupal_access_denied();
-  }
-
-  $form['settings'] = array('#type' => 'fieldset',
-                            '#title' => t('FlickrStickr settings'));
-  $form['settings']['flickrstickr_flickrkey'] = array('#type' => 'textfield',
-                                                      '#title' => t('Flickrapi key'),
-                                                      '#default_value' => flickrstickr_getapikey(),
-                                                      '#maxlength' => 36,
-                                                      '#size' => 36);
-  return $form;
+function flickrstickr_admin_settings() {
+  $form = array();
+  $form['flickrstickr_flickrkey'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Flickrapi key'),
+    '#default_value' => flickrstickr_getapikey(),
+    '#maxlength' => 36,
+    '#size' => 36,
+  );
+  return system_settings_form($form);
 }
 
 /**
