###### # WebBBS 5.xx Mod # Title: Clickable Smileys and Format Buttons. # Description: # Dynamically generates clickable smileys & format buttons in Post Message # Form. For future maintenance, need only to edit webbbs_settings.pl. # SmileyPlus feature (optional): Show a subset of smileys in Post Form # and the remainder (also clickable) in a popup window. # Clickable Smileys mod & Format Buttons mod are independent of each other. # You may install either mod, or both. # Estimated Installation Level/Time: Moderate/20 minutes. # Files to Include/Edit: # c_smiley.js (include) # smileyplus.pl (include -- optional) # MetaFile (include/edit) # FramedMessageHeaderFile (include/edit) # webbbs_settings.pl (edit) # webbbs_form.pl (edit) # [2003-3-14: Modded copy of webbbs_form.pl (5.12 only) available # for download. Post your request to Tarty's Test Board -- # http://shell.ipoline.com/~wiceyto/test/webbbs_config.pl # ] ###### # Known Issues: # Problems with browsers other than IE 5.5 or up: # "Apply format code to *selected* text" may not work; # format code gets appended to the end of text. # Cursor may return to the beginning instead of the end of # text after a smiley or format code is chosen. # Format buttons may not work with IEMac. # Demo: http://shell.ipoline.com/~wiceyto/test/webbbs_config.pl?form=0 # Credit: Tarty thanks Rainer for the suggested Perl coding. # History: # 2003-3-13 Rewrote instructions. # 2002-11-25 Added FramedMessageHeaderFile. # 2002-10-31 Erratum: "if (%SmileyPostForm)", not "if ($SmileyPostForm)" # - John Campbell # 2002-6-16 Moved c_smiley.js to outside cgi-bin. # 2002-5-9 Added SmileyPlus feature. # 2002-5-2 Created mod. ###### # Before adding this mod to your site, back up all files relating to this mod. ###### # Installation: # [! Replace the URL and path in the mod with your own URL and path] 1. Download c_smiley.js -- From http://shell.ipoline.com/~wiceyto/misc/c_smiley.txt -- Rename it to c_smiley.js -- Upload it in ASCII mode to your smiley image file directory. [! Having c_smiley.js in your cgi-bin directory may NOT work] -- CHMOD it to 644 (readable.) 2. Download smileyplus.pl (optional) -- From http://shell.ipoline.com/~wiceyto/misc/smileyplus.txt -- Check that the path to perl is correct. -- Specify the location of your webbbs_settings.pl -- Rename the file to smileyplus.pl -- Upload it in ASCII mode to your WebBBS script file directory. -- CHMOD it to 755. 3. & 4. Edit MetaFile and FramedMessageHeaderFile -- Paste this script tags into your MetaFile and FramedMessageHeaderFile -- [IF you're already using MetaFile and FramedMessageHeaderFile, skip this and go to Step (5). How to create and use MetaFile and FramedHeaderFile: -- Paste the script tags shown above into a new text file. -- Save the file as meta.txt. -- Paste the script tag into another new text file. -- Save the file as framedmsgheader.txt. -- Upload the two files in ASCII mode to your WebBBS script file directory. -- CHMOD them to 644 (readable.) -- Redefine these variables in your webbbs_settings.pl as follow: $MetaFile = "$scripts_dir/meta.txt"; $FramedMessageHeaderFile = "$scripts_dir/framedmsgheader.txt."; ] 5. Edit webbbs_settings.pl [Paste the entire of the code shown below (from START to END) into your _settings.pl, edit the path to smilies, and use it as-is for installation. (Edit it ONLY AFTER installation is successful if you want to use your own smileys or format code.) Note.. [The 1st 10 of the SmileyCode shown below are from WebBBS script download. The last 6 are for SmileyPlus DEMO only. If you're NOT using SmileyPlus feature, remove the last 6 from %SmileyCode and remove %SmileyPlus. If you're using SmileyPlus, edit the code to use your own additional smileys.] -- Find -- %SmileyCode = (); %FormatCode = (); -- Replace with -- ## START Edit webbbs_settings.pl %SmileyCode = ( ':)',':)', ':(',':(', ':O',':O', ':D',':D', ';)',';)', '8)','8)', ':b',':b', ':\\',':\\', '>:(','>:(', ':|',':|', ':happy',':happy', ':vhappy',':vhappy', ':lol',':lol', ':sad',':sad', ':vsad',':vsad', ':cry',':cry' ); # If you are NOT using SmileyPlus feature, remove %SmileyPostForm and %SmileyPlus. ###### SmileyPlus (optional) # %SmileyPostForm: Specifies a subset (10 in this eg) of smileys to show in Post Form. # You may arrange the smileys in the order you want by assigning a key to each. Eg: # %SmileyPostForm = ( # 'a'=>[':)',':)'], # 'b'=>[':D',':D'], # 'c'=>[':cry',':cry'] # ..etc # ); # $SmileyMax: If %SmileyPostForm is *undefined*, specify the maximum number # of smileys to show in Post Form. (They will be shown in *random order*.) # %SmileyPlus: Specifies the remainder of smileys to show in a popup window. # You may want to somewhat divide the smileys in groups by assigning each an # alpha-numeric key (eg, 'a1', 'a2', 'b1', 'b2', 'c1',..) Say, 'a' for # 'happy' smileys, 'b' for 'sad' smileys, 'c' for 'mad'.. etc. # $smileyform_per_row: The number of smileys to show per row in Post Form. # $smileyplus_per_row: The number of smileys to show per row in the popup window. # TIP: To get the images show up faster, add the width and height dimensions # of the images in both %SmileyPostForm and %SmileyPlus. # Right-click on the image to find out the dimensions. ###### %SmileyPostForm = ( 'a'=>[':)',':)'], 'b'=>[':D',':D'], 'c'=>[';)',';)'], 'd'=>['8)','8)'], 'e'=>[':b',':b'], 'f'=>[':(',':('], 'g'=>['>:(','>:('], 'h'=>[':O',':O'], 'i'=>[':\\',':\\'], 'j'=>[':|',':|'] ); %SmileyPlus = ( 'a1'=>[':happy',':happy'], 'a2'=>[':vhappy',':vhappy'], 'a3'=>[':lol',':lol'], 'b1'=>[':sad',':sad'], 'b2'=>[':vsad',':vsad'], 'b3'=>[':cry',':cry'] ); $text{'smiley'} = "Clickable smileys"; $SmileyMax = 15; $smileyform_per_row = 3; $text{'smileyplus'} = "View more smileys"; $smileyplus_per_row = 6; %FormatCode = ( '[b]','', '[/b]','', '[i]','', '[/i]','', '[c]','
', '[/c]','
', '[list]','', '[*]','
  • ', '[q]','
    ', '[/q]','
    ', '[code]','
    ',
    '[/code]','
    ', '[big]','', '[/big]','', '[small]','', '[/small]','', '[red]','', '[/red]','', '[hi]','', '[/hi]','', '[img]','' ); ###### Format Buttons Mod: # %click_format = (); # Purpose: Generates format code buttons in Post Message Form. # Syntax: button_order=>[open_tag, close_tag, JS_array, accesskey, # label, style, JS_function, helpline_message] # Description: # button_order are in alphabetical order: 'a', 'b', 'c', 'd', 'e',..etc. # open_tag and close_tag must match those in %FormatCode. # JS_array are in numerical sequence: '0', '2', '4', '6', '8',..etc. # accesskey can be any unique letter NOT already used by other format code. # Example: To add a new format code, blue text, and displays the # new "Blue" button right after the existing "Hi-light" button. # In %FormatCode, Add -- # '[blue]','', # '[/blue]','', # In %click_format, Find -- # 'k'=>['hi','/hi','20','h','Hi-light',...], # After, Add -- # 'l'=>['blue','/blue','22','u','Blue','width=35px;font-size:11px;color:blue;','bbstyle','Blue text: [blue]text[/blue]'], ###### # DO NOT change anything in 'y' and 'z' (Image button and Close tags button.) ###### %click_format = ( 'a'=>['b','/b','0','b',' B ','width=30px;font-weight:bold;font-size:11','bbstyle','Bold text: [b]text[/b]'], 'b'=>['i','/i','2','i',' I ','width=30px;font-style:italic;font-size:11','bbstyle','Italic text: [i]text[/i]'], 'c'=>['c','/c','4','n','Center','width=50px;font-size:11','bbstyle','Center text: [c]text[/c]'], 'd'=>['list','/list','6','l','List','width=35px;font-size:11','bbstyle','List: [list][*]item.1[*]item.2[/list]'], 'e'=>['*','*','8','t','Item','font-size:11','ibItem','List items: [*]item.1[*]item.2'], 'f'=>['q','/q','10','q','Quote','width=40px;font-size:11','bbstyle','Quote text: [q]text[/q]'], 'g'=>['code','/code','12','c','Code','width=40px;font-size:11','bbstyle','Code display: [code]code[/code]'], 'h'=>['big','/big','14','g','Big','width=35px;font-size:11','bbstyle','Big text: [big]text[/big]'], 'i'=>['small','/small','16','s','Small','width=40px;font-size:11','bbstyle','Small text: [small]text[/small]'], 'j'=>['red','/red','18','r','Red','width=35px;color:#ff0000;font-size:11','bbstyle','Red text: [red]text[/red]'], 'k'=>['hi','/hi','20','h','Hi-light','width=50px;background-color:#ffff00;font-size:11','bbstyle','Hi-light text: [hi]text[/hi]'], 'y'=>['img','/img','42','p','Image','font-size:11','IBCimage','Insert image: [img]http://image_url[/img]'], 'z'=>['a','a','-1','a','Close tags','font-size:11','bbstyle','Close all open format code tags'] ); $text{'formathelp'} = "Styles can be applied quickly to selected text"; ## END Edit webbbs_settings.pl #### For WebBBS 5.12: End of mod IF you are using the modded webbbs_form.pl from Tarty. #### For other versions: Go to Step (6). 6. Edit webbbs_form.pl 6.1 -- Find -- print "post\" NAME=\"message\" TARGET=\"_self\">\n"; [! If you're using WebBBS 4.33, Find -- print "post\" TARGET=\"_self\">\n"; ] -- Replace with -- print qq|post" name="message" target="_self" onSubmit="return checkForm(this);">\n|; 6.2 (final) [! Replace the URL to smileyplus.pl with your own URL] -- Find -- print ">\n"; print "$TableCellStart"; print "$text{'1514'}:\n"; print "