--- C:/Documents and Settings/Shireling/Desktop/mibbit_irc/mibbit_irc.module	Sun Apr 13 17:34:56 2008
+++ C:/wamp/www/drupal6_module_dev-mibbit/sites/all/modules/mibbit_irc/mibbit_irc.module	Sun Sep 28 02:10:16 2008
@@ -83,20 +83,26 @@
     '#size' => 5,
     '#required' => TRUE,
   );
+  $form['mibbit_irc_custom_prompt'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Chat window welcome text'),
+    '#default_value' => variable_get('mibbit_irc_custom_prompt', t(_mibbit_irc_admin_form_irc_custom_prompt_default())),
+    '#description' => t('Default text that shows at the top of the chat window, usually as a welcome message.'),
+		'#size' => 40,
+    '#required' => FALSE,
+  );
+  $form['mibbit_irc_custom_loading'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Custom loading message'),
+    '#default_value' => variable_get('mibbit_irc_custom_loading', t(_mibbit_irc_admin_form_irc_custom_loading_default())),
+    '#description' => t('Custom message while chat channel(s) are loading for the user.'),
+		'#size' => 40,
+    '#required' => FALSE,
+  );
   $form['mibbit_irc_help'] = array(
     '#type' => 'textarea',
     '#title' => t('IRC help'),
-    '#default_value' => variable_get('mibbit_irc_help', t('<p>New to IRC? Here are some commands to get you started:</p>
-<ul>
-<li>/help  Display help.</li>
-<li>/clear  Clear the chat output in this channel.</li>
-<li>/nick [nick]  Change your nickname.</li>
-<li>/msg [nick] [msg]  Send a private message.</li>
-<li>/whois [nick]  Find out all manner of things about someone.</li>
-<li>/me [text]  Emote.</li>
-<li>/away <msg>  Set your status to away.</li>
-<li>/back  Set your status to back.</li>
-</ul>')),
+    '#default_value' => variable_get('mibbit_irc_help', t(_mibbit_irc_admin_form_irc_help_default())),
     '#description' => t('Optional help information that appears below the chat window.'),
     '#required' => FALSE,
   );
@@ -108,6 +114,44 @@
   return system_settings_form($form);
 }
 
+
+/*
+ * Default text for ...?
+ */
+function _mibbit_irc_admin_form_irc_custom_prompt_default() {
+	$default_output = 'Welcome to our live chat';
+	return  $default_output;
+}
+
+/*
+ * Default text for ...?
+ */
+function _mibbit_irc_admin_form_irc_custom_loading_default() {
+	$default_output = 'Connecting you to our chat channel...';
+	return  $default_output;
+}
+
+/*
+ * Default IRC help text.
+ */
+function _mibbit_irc_admin_form_irc_help_default() {
+	$default_output = '<p>New to IRC? Here are some commands to get you started:</p>
+<ul>
+<li>/help  Display help.</li>
+<li>/clear  Clear the chat output in this channel.</li>
+<li>/nick [nick]  Change your nickname.</li>
+<li>/msg [nick] [msg]  Send a private message.</li>
+<li>/join [channel name]  Join another channel.</li>
+<li>/whois [nick]  Find out all manner of things about someone.</li>
+<li>/me [text]  Emote.</li>
+<li>/away <msg>  Set your status to away.</li>
+<li>/back  Set your status to back.</li>
+</ul>';
+
+	return  $default_output;
+}
+
+
 // Validate the settings form.
 function mibbit_irc_admin_settings_validate($form, &$form_state) {
   if (!is_numeric($form_state['values']['mibbit_irc_width'])) {
@@ -118,6 +162,8 @@
   }
 }
 
+
+
 function mibbit_irc_page() {
   global $user;
   
@@ -127,9 +173,11 @@
   $channel = variable_get('mibbit_irc_channel', 'mibbit_test');
   $width = variable_get('mibbit_irc_width', '500');
   $height = variable_get('mibbit_irc_height', '280');
-  
+	$custom_prompt = variable_get('mibbit_irc_custom_prompt', _mibbit_irc_admin_form_irc_custom_prompt_default());
+	$custom_loading = variable_get('mibbit_irc_custom_loading', _mibbit_irc_admin_form_irc_custom_loading_default());
+
   $output = variable_get('mibbit_irc_welcome', '');
-  $output .= '<p><iframe width='. $width .' height='. $height .' scrolling=no border=0 src="http://embed.mibbit.com/e/index.html?server='. urlencode($server) .'&amp;channel=%23'. $channel .'&amp;nick='. $nick .'&amp;chatOutputShowTimes=false"></iframe></p>';
+  $output .= '<p><iframe width='. $width .' height='. $height .' scrolling=no border=0 src="http://embed.mibbit.com/e/index.html?server='. urlencode($server) .'&amp;channel=%23'. $channel .'&amp;nick='. $nick .'&amp;customprompt='. rawurlencode($custom_prompt) .'&amp;customloading='. rawurlencode($custom_loading) .'&amp;chatOutputShowTimes=false"></iframe></p>';
   $output .= variable_get('mibbit_irc_help', '');
 
   return $output;
