Index: discussthis/discussthis.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/discussthis/discussthis.info,v
retrieving revision 1.2
diff -u -p -r1.2 discussthis.info
--- discussthis/discussthis.info	24 Jun 2008 01:05:27 -0000	1.2
+++ discussthis/discussthis.info	12 Sep 2008 15:41:56 -0000
@@ -1,4 +1,12 @@
-; $Id: discussthis.info,v 1.2 2008/06/24 01:05:27 spiderman Exp $
+; $Id: discussthis.info,v 1.1.2.1 2008/07/14 15:20:34 spiderman Exp $
 name = Discuss This
 description = "Adds discuss this links to a forum topic for specific node types"
-dependencies = forum token
+dependencies[] = 'forum'
+dependencies[] = 'token'
+core = 6.x
+
+; Information added by drupal.org packaging script on 2008-07-15
+version = "6.x-1.x-dev"
+project = "discussthis"
+datestamp = "1216080163"
+
Index: discussthis/discussthis.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/discussthis/discussthis.install,v
retrieving revision 1.1
diff -u -p -r1.1 discussthis.install
--- discussthis/discussthis.install	19 Jun 2008 22:00:41 -0000	1.1
+++ discussthis/discussthis.install	12 Sep 2008 15:41:56 -0000
@@ -2,53 +2,51 @@
 // $Id: discussthis.install,v 1.1 2008/06/19 22:00:41 spiderman Exp $
 
 /**
+ * @file
+ * Install file for Discuss This! module
+ */
+
+/**
+ * Implementation hook_schema
+ */
+function discussthis_schema() {
+  $schema['discussthis'] = array(
+    'fields' => array(
+      'nid' => array('type' => int,'unsigned' => TRUE,'not null' => TRUE,'default' => 0),
+      'topic_nid' => array('type' => 'int','unsigned' => TRUE,'not null' => TRUE,'default' => 0),
+    ), 'primary key' => array('nid'),
+  );
+
+  $schema['discussthis_forums'] = array(
+    'fields' => array(
+      'nid' => array('type' => 'int', 'unsigned' => TRUE,'not null' => TRUE, 'default' => 0),
+      'forum_tid' => array('type' => 'int','unsigned' => TRUE, 'not null' => TRUE,'default' => 0),
+     ), 'primary key' => array('nid'),
+  );
+
+  return $schema;
+}
+
+/**
  * Implementation of hook_install. Sets up two tables for the module's use.
  * discussthis stores nid->topic mapping, and discussthis_forums stores
- * nid->forum(tid) mapping.  
- **/
+ * nid->forum(tid) mapping.
+ */
 function discussthis_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {discussthis} (
-		nid int unsigned NOT NULL default '0',
-		topic_nid int unsigned NOT NULL default '0',
-		PRIMARY KEY (nid)
-	       ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-
-      db_query("CREATE TABLE {discussthis_forums} (
-		nid int unsigned NOT NULL default '0',
-		forum_tid int unsigned NOT NULL default '0',
-		PRIMARY KEY (nid)
-		) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-		
-      drupal_set_message(t("Discuss This! module installed. Configure !perm and !settings to continue", array('!perm' => l('Administer > User > Access Control','admin/user/access'), '!settings' => l('Administer > Site Configuration > Discuss This', 'admin/settings/discussthis'))));
-      break;
-    case 'pgsql':  // someone else?
-      break;
-  }
-}
+  //create the tables
+  $ret = drupal_install_schema('discussthis');
 
-function discussthis_update_1() {
-  $ret = array();
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      $ret[] = update_sql("CREATE TABLE {discussthis_forums} (
-	   nid int unsigned NOT NULL default '0',
-	   forum_tid int unsigned NOT NULL default '0',
-	   PRIMARY KEY (nid)
-	   ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
-  }
-  return $ret;
+  drupal_set_message(t("Discuss This! module installed. Configure !perm and !settings to continue", array('!perm' => l('Administer > User > Administer Permissions', 'admin/user/permissions'),
+   '!settings' => l('Administer > Site Configuration > Discuss This', 'admin/settings/discussthis'))));
 }
 
+
 /**
  * Implementation of hook_uninstall. Drops the two db tables used by this module.
- **/
+ */
 function discussthis_uninstall() {
-  db_query('DROP TABLE {discussthis');
-  db_query('DROP TABLE {discussthis_forums');
-  // variable_del('discussthis_nodetypes')
+  // drop my tables
+  drupal_uninstall_schema('discussthis');
 }
 
+
Index: discussthis/discussthis.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/discussthis/discussthis.module,v
retrieving revision 1.7
diff -u -p -r1.7 discussthis.module
--- discussthis/discussthis.module	25 Jun 2008 14:20:44 -0000	1.7
+++ discussthis/discussthis.module	12 Sep 2008 15:41:56 -0000
@@ -1,5 +1,12 @@
 <?php
-// $Id: discussthis.module,v 1.7 2008/06/25 14:20:44 spiderman Exp $
+// $Id: discussthis.module,v 1.3.2.2 2008/07/14 16:38:23 spiderman Exp $
+/**
+ * @file
+ *
+ * Associations discussions in forums with specific nodes
+ */
+
+
 
 // Hook Implementations
 
@@ -7,64 +14,62 @@
  * Display help and module information
  * @param section which section of the site we're displaying help for
  * @return help text for section
- **/
-function discussthis_help($section='') {
-  $output = '';
-
-  switch ($section) {
+ */
+function discussthis_help($path, $arg) {
+  switch ($path) {
     case 'admin/help#discussthis':
+      $output = '';
       $output = '<p>'. t('Displays links to discussion forums for a given node. Administrators can select the types of nodes for which this is enabled, and for each of these, which forum new topics should be created in.') .'</p>';
-      $output .= filter_filter('process', 2, null, file_get_contents(dirname(__FILE__) .'/README.txt') );
-      break;
+      //$output .= filter_filter('process', 2, NULL, file_get_contents(dirname(__FILE__) .'/README.txt') );
+      return $output;
   }
 
-  return $output;
 }
 
 /**
  * Valid permissions for this module
  * @return array An array of valid permissions for the discussthis module
- **/
+ */
 function discussthis_perm() {
   return array('administer discuss this', 'override discuss this forums', 'access discuss this links');
 }
 
 /**
  * hook_menu implementation
- * @param may_cache whether the menu items might be cached
  * @return array list of menu items
- **/
-function discussthis_menu($may_cache) {
+ */
+function discussthis_menu() {
   $items = array();
 
-  if (!$may_cache) {
-    $items[] = array(
-      'path' => 'admin/settings/discussthis',
-      'title' => t('Discuss This'),
-      'description' => t('Configure discuss this module defaults, including what node types and what forums to link to.'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => 'discussthis_admin',
-      'access' => user_access('administer discuss this'),
-      'type' => MENU_NORMAL_ITEM,
-    );
-    $items[] = array(
-      'path' => 'discussthis/new',
-      'callback' => 'discussthis_new',
-      'access' => user_access('access discuss this links'),
-      'type' => MENU_CALLBACK,
-    );
-    $items[] = array('path' => 'discussthis/autocomplete',
-      'title' => t('Autocomplete forum topics'),
-      'callback' => 'discussthis_autocomplete',
-      'access' => user_access('access content'),
-      'type' => MENU_CALLBACK);
-  } 
+  $items['admin/settings/discussthis'] = array(
+    'title' => 'Discuss This',
+    'description' => 'Configure discuss this module defaults, including what node types and what forums to link to.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('discussthis_admin'),
+    'access callback' => 'user_access',
+    'access arguments' => array('administer discuss this'),
+    'type' => MENU_NORMAL_ITEM,
+  );
+  $items['discussthis/new/%'] = array(
+    'page callback' => 'discussthis_new',
+	'page arguments' => array(2),
+    'access callback' => 'user_access',
+	'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['discussthis/autocomplete'] = array(
+    'title' => 'Autocomplete forum topics',
+    'page callback' => 'discussthis_autocomplete',
+    'access callback' => 'user_access',
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
 
-  return $items;
+return $items;
 }
 
 /**
- * hook_nodeapi implementation 
+ * hook_nodeapi implementation
  * This is the meat of the module. Here we add the
  * Discuss This link which will create a new forum topic if none exists, or
  * link to the existing one if it does. Also adds forum override dropdown on add/edit screen
@@ -74,12 +79,12 @@ function discussthis_menu($may_cache) {
  * @param op the operation being done to the node
  * @param teaser whether this is a teaser view
  * @param page whether this is a full page view
- **/
+ */
 function discussthis_nodeapi(&$node, $op, $teaser, $page) {
   $enabled = variable_get('discussthis_node_'. $node->type, 0);
 
   // If this is an discussthis-enabled node type, treat the per-node fields appropriately
-  if ($enabled) { 
+  if ($enabled) {
     switch ($op) {
       case 'validate': // validate forum override selection
         break;
@@ -97,35 +102,20 @@ function discussthis_nodeapi(&$node, $op
         _discussthis_set_topic($node->nid, $typed_title);
 
         break;
-      case 'view': 
-        if (!$teaser && user_access('access discuss this links')) {
-          $topic_nid = _discussthis_get_topic($node->nid);  // lookup a nid for the topic, if it exists (otherwise 0)
-
-          # grab X most recent comments, and attach them to the node:
-          $result = db_query_range('SELECT c.nid, c.uid, c.name, c.subject, c.cid, c.timestamp FROM {comments} c INNER JOIN {node} n ON n.nid = c.nid WHERE c.nid = %d AND n.status = 1 AND c.status = %d ORDER BY c.cid DESC', $topic_nid, COMMENT_PUBLISHED, 0, variable_get('discussthis_comments',10));
-
-          while ($comment = db_fetch_object($result)) {
-            $comments[] = theme('discussthis_comment',$topic_nid,$comment);
-          }
-
-	  $node->content['discussthis_comments'] = array(
-	    '#value' => theme('item_list',$comments),
-	    '#weight' => 50,
-	  );
-	}
+      case 'view':
         break;
       case 'load':
-	// return  array of fields => values to be merged into $node
+        // return  array of fields => values to be merged into $node
         break;
       case 'delete':
-	// drop db row for this node.. what should happen to the forum topic?
+        // drop db row for this node.. what should happen to the forum topic?
         break;
     }
-  } 
+  }
   elseif ($node->type == 'forum') {
     switch ($op) {
       case 'delete':
-	// drop db row for this forum nid
+        // drop db row for this forum nid
         $sql = 'DELETE FROM {discussthis} WHERE topic_nid = %d';
         db_query($sql, $node->nid);
         break;
@@ -140,20 +130,20 @@ function discussthis_nodeapi(&$node, $op
  * @param node A node object being passed in the case of node inks
  * @param teaser A boolean flag depending on whether the node is displayed with its teaser or full form
  * @return An array of the requested links
- **/
-function discussthis_link($type, $node = null, $teaser = false) {
+ */
+function discussthis_link($type, $node = NULL, $teaser = FALSE) {
   $links = array();
 
   if ($type == 'node') {
     $enabled = variable_get('discussthis_node_'. $node->type, 0);
-    if ($enabled && user_access('access discuss this links')) {
+    if ($enabled) {
       $topic_nid = _discussthis_get_topic($node->nid);  // lookup a nid for the topic, if it exists (otherwise 0)
       if ($topic_nid) { // link to add a comment to the existing topic
         $links['discussthis'] = array(
           'title' => t('Discuss This!'),
           'href' => 'node/'. $topic_nid,
         );
-      } 
+      }
       else {  // link to a callback page which creates a topic, then redirects to add a comment to it
         $links['discussthis'] = array(
           'title' => t('Discuss This!'),
@@ -170,8 +160,8 @@ function discussthis_link($type, $node =
  * Adds per-node override forum dropdown and topic autocomplete form for node edit forms
  * @param form_id the id of the form to be altered
  * @param form the form itself
- **/
-function discussthis_form_alter($form_id, &$form) {
+ */
+function discussthis_form_alter(&$form, &$form_state, $form_id) {
   // We're only modifying node forms, if the type field isn't set we don't need
   // to bother; otherwise, store it for later retrieval.
   if (isset($form['type'])) {
@@ -185,11 +175,13 @@ function discussthis_form_alter($form_id
   }
 
   # only modify the form if this node type is discussthis-enabled
-  if (!variable_get('discussthis_node_'.$type,0)) { return; }
+  if (!variable_get('discussthis_node_'. $type, 0)) {
+    return;
+  }
 
   // The discuss this link is enabled on a per node type basis. The variable used to store
-  // this information is named using both the name of this module, to avoid namespace 
-  // conflicts, and the node type, because we support multiple node types.  
+  // this information is named using both the name of this module, to avoid namespace
+  // conflicts, and the node type, because we support multiple node types.
 
   switch ($form_id) {
     case $type .'_node_form':
@@ -200,24 +192,26 @@ function discussthis_form_alter($form_id
       $topic = node_load(array('nid' => $forum_nid));
 
     // If discuss this is enabled for this node type, insert the fieldset
-    if ($forum_tid && user_access('override discuss this forums')) {
+    if ($forum_tid) {
       $forums = forum_get_forums();
       foreach ($forums as $tid => $forum) {
-        if (!$forum->container) { $discussthis_forums[$tid] = $forum->name; }
+        if (!$forum->container) {
+          $discussthis_forums[$tid] = $forum->name;
+        }
       }
 
       $form['discussthis'] = array(
         '#type' => 'fieldset',
         '#title' => t('Discuss This'),
-        '#collapsible' => true,
-        '#collapsed' => true,
+        '#collapsible' => TRUE,
+        '#collapsed' => TRUE,
         '#weight' => 1,
-        '#tree' => true,
+        '#tree' => TRUE,
       );
       $form['discussthis']['forum'] = array(
         '#type' => 'select',
         '#title' => t('Forum for new discussions on this node'),
-        '#required' => true,
+        '#required' => TRUE,
         '#description' => t('Select the forum where a NEW discussion will be created if none exist.'),
         '#options' => $discussthis_forums,
         '#default_value' => $forum_tid,
@@ -234,7 +228,7 @@ function discussthis_form_alter($form_id
       );
     }
     break;
-  } 
+  }
 }
 
 /**
@@ -260,7 +254,7 @@ function discussthis_block($op='list', $
  * Implementation of hook_token_list provides a list of tokens this module makes available
  * @param type the context of the tokens being requested
  * @return array of tokens grouped by context
- **/
+ */
 function discussthis_token_list($type = 'all') {
   if ($type == 'discussthis' || $type == 'all') {
     $tokens['discussthis']['node-link'] = t('A link to the original node under discussion.');
@@ -277,12 +271,12 @@ function discussthis_token_list($type = 
  * @param object the object itself
  * @param options the options, context and object-sensitive
  * @return array of token values keyed by their name
- **/
+ */
 function discussthis_token_values($type, $object = NULL, $options = array()) {
   if ($type == 'discussthis') {
     $tokens['node-link'] = l(t($object->title), 'node/'. $object->nid);
     $tokens['node-title'] = t($object->title);
-    $tokens['node-type-name'] = node_get_types('name',$object);
+    $tokens['node-type-name'] = node_get_types('name', $object);
     $tokens['node-type'] = $object->type;
     return $tokens;
   }
@@ -296,7 +290,7 @@ function discussthis_token_values($type,
  * 1. The author of newly-created forum discussions
  * 2. The set of node types for which Discuss This! links should appear
  * 3. For each selected node type, a default forum in which to create discussion topics
- **/
+ */
 function discussthis_admin() {
   $node_types = node_get_types('names');
   $discussthis_nodetypes = variable_get('discussthis_nodetypes', $node_types);
@@ -326,8 +320,8 @@ function discussthis_admin() {
   $form['discussthis_newtemplate'] = array(
     '#type' => 'textarea',
     '#title' => t('Template for auto-created Forum discussions'),
-    '#description' => theme('token_help','discussthis'),
-    '#default_value' => variable_get('discussthis_newtemplate',$default_body),
+    '#description' => theme('token_help', 'discussthis'),
+    '#default_value' => variable_get('discussthis_newtemplate', $default_body),
     '#weight' => -2,
   );
 
@@ -335,7 +329,7 @@ function discussthis_admin() {
     '#type' => 'select',
     '#title' => t('How many recent comments should be displayed with non-teaser node view?'),
     '#options' => array(1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 10 => '10'),
-    '#default_value' => variable_get('discussthis_comments',10),
+    '#default_value' => variable_get('discussthis_comments', 10),
   );
 
   $form['discussthis_nodetypes'] = array(
@@ -348,8 +342,10 @@ function discussthis_admin() {
 
   $forums = forum_get_forums();
   $discussthis_forums = array('0' => '-- select --');
-  foreach ($forums as $tid => $forum) { 
-    if (!$forum->container) { $discussthis_forums[$tid] = $forum->name; }
+  foreach ($forums as $tid => $forum) {
+    if (!$forum->container) {
+      $discussthis_forums[$tid] = $forum->name;
+    }
   }
 
   // This should probably be within the node type config page, or else use some AJAXy thing to update
@@ -362,7 +358,7 @@ function discussthis_admin() {
         '#default_value' => variable_get('discussthis_node_'. $type, 0),
         '#options' => $discussthis_forums,
       );
-    } 
+    }
     else {
       $form['defaults']['discussthis_node_'. $type] = array(
         '#type' => 'hidden',
@@ -376,16 +372,16 @@ function discussthis_admin() {
 
 /**
  * Create a new discussion forum topic for the given nid, and redirect the user
- * to post a comment on that topic 
- **/
+ * to post a comment on that topic
+ */
 function discussthis_new($nid) {
   $topic_nid = _discussthis_new_topic($nid);
-  drupal_goto('comment/reply/'. $topic_nid, null, 'comment-form');
+  drupal_goto('comment/reply/'. $topic_nid, NULL, 'comment-form');
 }
 
 /**
  * Autocomplete a forum topic discussion title
- **/
+ */
 function discussthis_autocomplete($tid, $string = '') {
   // The user enters a title for a forum topic.
   if ($string != '') {
@@ -398,7 +394,7 @@ function discussthis_autocomplete($tid, 
       $n = $node->title;
 
       // Quote any commas or doublequotes for security reasons (XSS)
-      if (strpos($node->title, ',') !== false || strpos($node->title, '"') !== false) {
+      if (strpos($node->title, ',') !== FALSE || strpos($node->title, '"') !== FALSE) {
         $n = '"'. str_replace('"', '""', $node->title) .'"';
       }
       $matches[$n] = check_plain($node->title);
@@ -413,7 +409,7 @@ function discussthis_autocomplete($tid, 
 
 /**
  * Lookup the given nid in the discussthis_forums db table, and return the corresponding forum tid, otherwise 0
- **/
+ */
 function _discussthis_get_forum($nid, $type) {
   $sql = 'SELECT forum_tid FROM {discussthis_forums} WHERE nid=%d';
   $forum_tid = db_result(db_query($sql, $nid));
@@ -425,27 +421,31 @@ function _discussthis_get_forum($nid, $t
 
 /**
  * Store a mapping between the given nid and a forum tid
- **/
+ */
 function _discussthis_set_forum($nid, $tid) {
   $sql = 'REPLACE INTO {discussthis_forums} (nid,forum_tid) VALUES (%d,%d)';
   db_query($sql, $nid, $tid);
 }
 
 /**
- * Lookup the given nid in the discussthis db table, and return the corresponding forum topic nid, otherwise 
+ * Lookup the given nid in the discussthis db table, and return the corresponding forum topic nid, otherwise
  * return the default for this node type
- **/
+ */
 function _discussthis_get_topic($nid) {
   // lookup the nid in the db table, and return it's corresponding forum topic nid, otherwise 0
   $sql = 'SELECT topic_nid FROM {discussthis} WHERE nid=%d';
   $topic = db_result(db_query($sql, $nid));
-  if ($topic) { return $topic; }
-  else { return 0; }
+  if ($topic) {
+    return $topic;
+  }
+  else {
+    return 0;
+  }
 }
 
 /**
  * Store a mapping between the given nid and a forum topic nid
- **/
+ */
 function _discussthis_set_topic($nid, $title) {
   // lookup the topic title first, and get a forum_nid from that
   $sql = 'SELECT n.nid,n.title FROM {node} n WHERE n.title like "%s" and n.type = "forum"';
@@ -456,7 +456,7 @@ function _discussthis_set_topic($nid, $t
     // now just store the mapping in the discussthis_forums table
     $sql = 'REPLACE INTO {discussthis} (nid,topic_nid) VALUES (%d,%d)';
     db_query($sql, $nid, $topic->nid);
-  } 
+  }
   else {
     // if there was no match, ignore, and remove any existing mapping?
     $sql = 'DELETE FROM {discussthis} WHERE nid=%d';
@@ -466,8 +466,11 @@ function _discussthis_set_topic($nid, $t
 
 /**
  * Create a new forum topic for the given nid, store the correspondence in the db, and return the new topic nid
- **/
+ */
 function _discussthis_new_topic($nid) {
+  
+  // this function is failing
+  
   // load the node, to get its title/details
   $node = node_load(array('nid' => $nid));
   $type = node_get_types('name', $node);
@@ -475,18 +478,21 @@ function _discussthis_new_topic($nid) {
   $admin = user_load(array('uid' => 1));
 
   // create the new forum topic with relevant stock text (and a link back to the original node)
+  $form_state = array();
+  module_load_include('inc', 'node', 'node.pages');
   $newnode = array('type' => 'forum');
-  $values = array();
-  $values['name'] = variable_get('discussthis_author', $admin->name);
-  $values['title'] = token_replace(variable_get('discussthis_newsubject','[node-title]'), 'discussthis', $node);
+  $form_state['values']['name'] = variable_get('discussthis_author', $admin->name);
+  $form_state['values']['title'] = token_replace(variable_get('discussthis_newsubject', '[node-title]'), 'discussthis', $node);
 
-  $default_body  = 'Following is a discussion on the [node-type-name] item titled: [node-link]'. 
+  $default_body  = 'Following is a discussion on the [node-type-name] item titled: [node-link]'.
                     '.<br /> Below is the discussion so far. Feel free to add your own comments!<br />';
-  $values['body'] = token_replace(variable_get('discussthis_newtemplate',$default_body), 'discussthis', $node);
+  $form_state['values']['body'] = token_replace(variable_get('discussthis_newtemplate', $default_body), 'discussthis', $node);
 
-  $values['taxonomy'][1] = $tid;
-  $values['status'] = 1;
-  drupal_execute('forum_node_form', $values, $newnode);
+  $forum_vid = variable_get('forum_nav_vocabulary', 1);
+  $form_state['values']['taxonomy'][$forum_vid] = $tid;
+  $form_state['values']['status'] = 1;
+  $form_state['values']['op'] = t('Save');
+  drupal_execute('forum_node_form', $form_state, (object)$newnode);
 
   $errors = form_get_errors();
   if (!empty($errors)) {
@@ -498,23 +504,14 @@ function _discussthis_new_topic($nid) {
 
   // get the new nid (not ideal, but using drupal_execute doesn't return a node object, so this
   // is the best way I could come up with to retrieve the nid of the node we just created)
-  $newnode['title'] = $values['title'];
+  $newnode['title'] = $form_state['values']['title'];
   $topic = node_load($newnode);
 
   // store the nid -> forum nid mapping in the db
   $sql = 'REPLACE INTO {discussthis} (nid,topic_nid) VALUES (%d,%d)';
   db_query($sql, array($node->nid, $topic->nid));
 
+ 
   // return the new topic nid
   return $topic->nid;
 }
-
-// Theme Functions
-
-function theme_discussthis_comment($topic_nid,$comment) {
-  $output  = "<div class=\"discussthis-comment\">\n";
-  $output .= ' <span class="subject">'. l($comment->subject, 'node/'. $topic_nid, null, null, "comment-$comment->cid") .'</span> ';
-  $output .= '<span class="credit">'. t('by') .' '. theme('username', $comment) ."</span>\n";
-  $output .= "</div>\n";
-  return $output; 
-}
