Index: tribune.backend.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tribune/tribune.backend.inc,v
retrieving revision 1.6.2.3
diff -u -r1.6.2.3 tribune.backend.inc
--- tribune.backend.inc	17 Dec 2008 13:49:26 -0000	1.6.2.3
+++ tribune.backend.inc	30 May 2009 19:38:14 -0000
@@ -57,9 +57,9 @@
   $contents  = "<?xml version=\"1.0\"?>\n";
   $contents .= "<rss version=\"2.0\">\n";
   $contents .= "\t<channel>\n";
-  $contents .= "\t\t<title>".variable_get("site_name", "")."</title>\n";
-  $contents .= "\t\t<link>".url('node'. $node->nid, array('absolute' => TRUE))."</link>\n";
-  $contents .= "\t\t<description>".variable_get("site_slogan", "")."</description>\n";
+  $contents .= "\t\t<title>".t('Posts in "@title"', array('@title' => $node->title))."</title>\n";
+  $contents .= "\t\t<link>".url('node/'. $node->nid, array('absolute' => TRUE))."</link>\n";
+  $contents .= "\t\t<description>".strip_tags($node->body)."</description>\n";
 
   $posts = array_reverse($posts, TRUE);
 
@@ -94,9 +94,12 @@
   * @param post Array with the following keys : id, clock, login, info, message
   */
 function theme_tribune_post_rss($post, $node) {
+  $timezone = variable_get('date_default_timezone', 0);
   $contents  = "\t\t<item>\n";
+  $contents .= "\t\t\t<title>". $post['tribune_post_id'] ."</title>\n";
+  $contents .= "\t\t\t<link>".url('node/'. $node->nid, array('absolute' => TRUE))."</link>\n";
   $contents .= "\t\t\t<description>". tribune_rss_slip($post['message'], $node) ."</description>\n";
-  $contents .= "\t\t\t<pubDate>". date('r', tribune_date_to_timestamp($post['post_time'])) ."</pubDate>\n";
+  $contents .= "\t\t\t<pubDate>". date('r', tribune_date_to_timestamp($post['post_time'])+ $timezone) ."</pubDate>\n";
   $contents .= "\t\t\t<author>". tribune_rss_slip($post['login'], $node) ." &lt;". tribune_rss_slip($post['login'], $node) ."@null&gt;</author>\n";
   $contents .= "\t\t</item>\n";
 
@@ -108,17 +111,6 @@
 
   $string = tribune_sleep($string, $node->tribune_settings['max_message_size']);
   $string = preg_replace('#((https?|ftp|gopher|file|mms|rtsp|rtmp)://.*?)((,|\.|\)|\])?(<| | |"|$))#', '<a href="\1">[url]</a>\3', $string);
-  $replacements = array(
-    '<b>' => '<strong>',
-    '</b>' => '</strong>',
-    '<i>' => '<em>',
-    '</i>' => '</em>',
-    '<s>' => '<span style="text-decoration: underline">',
-    '</s>' => '</span>',
-    '<tt>' => '<code>',
-    '</tt>' => '</code>',
-  );
-  $string = str_replace(array_keys($replacements), array_values($replacements), $string);
   $string = htmlspecialchars($string, ENT_QUOTES, 'UTF-8');
 
   return $string;
Index: tribune.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tribune/tribune.module,v
retrieving revision 1.159.2.19
diff -u -r1.159.2.19 tribune.module
--- tribune.module	20 May 2009 15:50:15 -0000	1.159.2.19
+++ tribune.module	30 May 2009 19:37:56 -0000
@@ -125,7 +125,7 @@
   $form['tribune_settings']['history_size'] = array(
     '#type'           => 'textfield',
     '#title'          => t('Number of comments displayed'),
-    '#default_value'  => isset($node->tribune_settings['history_size']) ? $node->tribune_settings['history_size'] : 25,
+    '#default_value'  => isset($node->tribune_settings['history_size']) ? $node->tribune_settings['history_size'] : 20,
     '#size'           => 3,
     '#maxlength'      => 4,
     '#description'    => t('The number of comments to display.'),
@@ -145,7 +145,7 @@
   $form['tribune_settings']['rss_size'] = array(
     '#type'           => 'textfield',
     '#title'          => t('Number of comments displayed in the RSS feed'),
-    '#default_value'  => isset($node->tribune_settings['rss_size']) ? $node->tribune_settings['rss_size'] : 50,
+    '#default_value'  => isset($node->tribune_settings['rss_size']) ? $node->tribune_settings['rss_size'] : 30,
     '#size'           => 3,
     '#maxlength'      => 4,
     '#description'    => t('The number of comments to display in the RSS feed.'),
@@ -185,7 +185,7 @@
   $form['tribune_settings']['posts_order'] = array(
     '#type'           => 'radios',
     '#title'          => t('Message order'),
-    '#default_value'  => isset($node->tribune_settings['posts_order']) ? $node->tribune_settings['posts_order'] : 1,
+    '#default_value'  => isset($node->tribune_settings['posts_order']) ? $node->tribune_settings['posts_order'] : 0,
     '#options'        => array('1' => t("Last messages at the bottom"), '0' => t("Last messages at the top")),
     '#description'    => t('How the messages are displayed. Displaying the messages top-to-bottom makes it easier to follow real discussions, but displaying the latest one at the top is sometimes less confusing.'),
   );
@@ -193,7 +193,7 @@
   $form['tribune_settings']['show_pager'] = array(
     '#type'           => 'checkbox',
     '#title'          => t('Show pager'),
-    '#default_value'  => isset($node->tribune_settings['show_pager']) ? $node->tribune_settings['show_pager'] : FALSE,
+    '#default_value'  => isset($node->tribune_settings['show_pager']) ? $node->tribune_settings['show_pager'] : TRUE,
     '#description'    => t('Show a pager (all posts will be accessible, instead of just the last ones).'),
   );
 
@@ -271,7 +271,7 @@
     $node->tribune_settings['flood_protection_delay'],
     $node->tribune_settings['posts_order'],
     $node->tribune_settings['show_pager'],
-    serialize(array('totoz' => "totoz", "url" => "url")),
+    serialize(array("url" => "url")),
     serialize(array()),
     serialize(array())
   );
@@ -319,6 +319,11 @@
 
   drupal_add_css(drupal_get_path('module', 'tribune') .'/css/tribune.page.css');
 
+      drupal_add_feed(
+        url('node/'. $node->nid.'/tribune.rss'),
+        'tribune feed'
+      );
+
   $history_size   = $node->tribune_settings['history_size'];
   $reload_delay   = $node->tribune_settings['reload_delay'] * 1000; // in milliseconds
   $idle_delay     = $node->tribune_settings['idle_delay'] * 1000; // in milliseconds
@@ -488,7 +493,7 @@
   if (user_access("configure own tribune filters", user_load($node->uid)) and is_array($node->tribune_settings['enabled_filters'])) {
     $enabled_filters = $node->tribune_settings['enabled_filters'];
   } else {
-    $enabled_filters = variable_get('tribune_enabled_filters', array('totoz' => "totoz", "url" => "url"));
+    $enabled_filters = variable_get('tribune_enabled_filters', array("url" => "url"));
   }
   foreach (_tribune_filter_files() as $filter_file) {
     $filter = $filter_file->name;
@@ -534,7 +539,7 @@
   if (user_access("configure own tribune filters", user_load($node->uid)) and is_array($node->tribune_settings['enabled_filters'])) {
     $enabled_filters = $node->tribune_settings['enabled_filters'];
   } else {
-    $enabled_filters = variable_get('tribune_enabled_filters', array('totoz' => "totoz", "url" => "url"));
+    $enabled_filters = variable_get('tribune_enabled_filters', array("url" => "url"));
   }
   foreach (_tribune_filter_files() as $filter_file) {
     $filter = $filter_file->name;
@@ -1183,7 +1188,7 @@
   if (user_access("configure own tribune filters", user_load($node->uid)) and is_array($node->tribune_settings['enabled_filters'])) {
     $enabled_filters = $node->tribune_settings['enabled_filters'];
   } else {
-    $enabled_filters = variable_get('tribune_enabled_filters', array('totoz' => "totoz", "url" => "url"));
+    $enabled_filters = variable_get('tribune_enabled_filters', array("url" => "url"));
   }
   foreach (_tribune_filter_files() as $filter_file) {
     $filter = $filter_file->name;
@@ -1619,7 +1624,13 @@
     $minute = str_pad($match[5], 2, '0', STR_PAD_LEFT);
     $second = str_pad($match[7], 2, '0', STR_PAD_LEFT);
 
-    $timezone = variable_get('date_default_timezone', 0);
+     global $user;
+      if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
+      $timezone = $user->timezone;
+      }
+      else {
+      $timezone = variable_get('date_default_timezone', 0);
+      }
     $datetime = mktime($hour, $minute, $second) - $timezone;
     $hour   = date('H', $datetime);
     $minute = date('i', $datetime);
@@ -1676,7 +1687,7 @@
 
   $posts = implode("|", tribune_get_posts_from_clock($clock));
 
-  return $space ."<span class='tribune-clock' id='post-". $_tribune_current_post_id ."-clock-". $_tribune_current_clock_id ."' ref='". $posts ."'>". $clock ."</span>";
+  return $space ."<span class='tribune-clock' id='post-". $_tribune_current_post_id ."-clock-". $_tribune_current_clock_id ."' ref='". $posts ."'>". $_tribune_current_post_id ."</span>";
 }
 
 
@@ -1896,9 +1907,9 @@
     $description .= '</div>';
 
     $description .= '<div class="description">';
-    $description .= t('You can format your message using some HTML tags. '
-      .'The allowed tags are &lt;i&gt;, &lt;b&gt;, '
-      .'&lt;u&gt;, &lt;s&gt; and &lt;tt&gt;');
+    $description .= t('You can format your message using BBCode. '
+      .'The allowed tags are [i], [b]
+      [u], [s] and [code]');
     $description .= '</div>';
 
     $description .= '<div class="description">';
@@ -1959,7 +1970,7 @@
 
     $form['submit'] = array(
       '#type'           => 'submit',
-      '#value'          => t('Post'),
+      '#value'          => '+',
       '#suffix'         => ' <img alt="'. t("Reload") .'" id="'. $tribune_id .'-reload-img" class="tribune-reload-img" src="'. base_path() . drupal_get_path('module', 'tribune') .'/images/wait.gif" />',
     );
 
@@ -2308,7 +2319,13 @@
  * Convert the timezone of a YYYYMMDDHHMMSS date
  */
 function tribune_date_to_localdate($date) {
-  $timezone = variable_get('date_default_timezone', 0);
+  global $user;
+  if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
+    $timezone = $user->timezone;
+  }
+  else {
+    $timezone = variable_get('date_default_timezone', 0);
+  }
   $timestamp = tribune_date_to_timestamp($date) + $timezone;
   return date('YmdHis', $timestamp);
 }
Index: tribune.sleep.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tribune/tribune.sleep.inc,v
retrieving revision 1.3
diff -u -r1.3 tribune.sleep.inc
--- tribune.sleep.inc	3 Nov 2008 20:50:39 -0000	1.3
+++ tribune.sleep.inc	30 May 2009 19:38:16 -0000
@@ -39,47 +39,25 @@
 function tribune_sleep($message, $length = -1) {
   $message = str_clean($message, $length);
 
-  $message = preg_replace_callback(':<(m|s|u|b|i|tt)>(.*?)</\1>:', 'tribune_sleep_replace', $message);
-
   $replacement = array(
-        "&" =>   "&amp;",
-        "<" =>    "&lt;",
-        ">" =>    "&gt;",
-        "'" =>  "&#039;",
-        '"' =>  "&quot;",
-    chr(26) =>       "<",
-    chr(27) =>       ">",
-    chr(28) =>       "'",
-    chr(29) =>       '"',
+        '&' =>   '&amp;',
+        '<' =>    '&lt;',
+        '>' =>    '&gt;',
+        "'" =>  '&#039;',
+        '"' =>  '&quot;',
+       '[b]' => '<strong>',
+       '[/b]' => '</strong>',
+       '[i]' => '<em>',
+       '[/i]' => '</em>',
+       '[s]' => '<span style="text-decoration: line-through">',
+       '[/s]' => '</span>',
+       '[u]' => '<span style="text-decoration: underline">',
+       '[/u]' => '</span>',
+       '[code]' => '<code>',
+       '[/code]' => '</code>',
   );
 
   $message = str_replace(array_keys($replacement), array_values($replacement), $message);
 
   return $message;
 }
-
-function tribune_sleep_replace($matches) {
-  $text = preg_replace_callback(':<(m|s|u|b|i|tt)>(.*?)</\1>:', 'tribune_sleep_replace', $matches[2]);
-  if ($matches[1] == 'm') {
-    $start = "====> ". chr(26) ."b". chr(27) ."Moment ";
-    $stop  = chr(26) ."/b". chr(27) ." <====";
-  }
-  else {
-    $start = chr(26) . $matches[1] . chr(27);
-    $stop  = chr(26) ."/". $matches[1] . chr(27);
-  }
-  return $start . $text . $stop;
-}
-
-function tribune_sleep_mother($matches) {
-  $text = preg_replace_callback(':<(m|s|u|b|i|tt)>([^'. chr(26) .']*)(.*)$:', 'tribune_sleep_mother', $matches[2]);
-  if ($matches[1] == 'm') {
-    $start = "====> ". chr(26) ."b". chr(27) ."Moment ";
-    $stop  = chr(26) ."/b". chr(27) ." <====";
-  }
-  else {
-    $start = chr(26) . $matches[1] . chr(27);
-    $stop  = chr(26) ."/". $matches[1] . chr(27);
-  }
-  return $start . $text . $stop . $matches[3];
-}

