#!/usr/bin/perl # Smilie Settings Area # designed by Mas*Mind # # Gives you a new cp-setting area to modify your smilies # You can modify your existing smilie code, deleting smilie code and this all at the same time # and multiples at the same time # 1 - Make sure the perl path is correct, this should probably be: #!/usr/bin/perl of #!/usr/local/bin/perl # 2 - Make a new link in cplinks.html pointing to http://yourdomain.ext/yourubbpath/smilies.cgi?action=smilieSettings # 3 - Make a separate directory for your smilies within the NonCGIPath eg: /yournoncgipath/smilies # 4 - Go into your general settings and enter the SmiliePath and SmilieURL variables and submit # 5 - Follow the instructions that come with this hack # # Ultimate Bulletin Board is copyright Infopop Corporation (formerly Madrona Park, Inc.), 1998. eval { ($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX / or Windows / ($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \ #substitute all require files here for the file require "UltBB.setup"; require "ubb_library.pl"; require "ubb_library2.pl"; require "Styles.file"; }; &ReadParse; print ("Content-type: text/html\n\n"); $SmilieCount = $in{'SmilieCount'}; foreach $row(@in) { ($Name, $Value) = split ("=", $row); $Name = &decodeURL($Name); $Value = &decodeURL($Value); if($Name eq "addsmilies") { $addsmilies = $Value; if($addsmilies eq "Yes") { $howmany = $in{'howmany'}; } else { $howmany = 0; } } if ($Name eq "UserName") { $UserName = $Value; $UserName = &UNHTMLIFY($UserName); } if ($Name eq "Password") { $Password = $Value; } for($i=1; $i<=$SmilieCount; $i++) { $smiliecode = "smilie-" . "$i"; $smiliepic = "smiliepic-" . "$i"; $smiliedel = "delete-$i"; if($Name eq "$smiliecode") { $$smiliecode = $Value; } if($Name eq "$smiliepic") { $$smiliepic = $Value; } if($Name eq "$smiliedel") { $$smiliedel = $Value; } } } $SmilieDB = "$MembersPath/SmilieDB.cgi"; if (@in == 0) { &smilieSettings; exit; } if ($in{'action'} eq "smilieSettings") { &smilieSettings; exit; } if ($in{'action'} eq "submitSmilieSettings") { &submitSmilieSettings; exit; } if ($in{'action'} eq "sendSmilieSettings") { &sendSmilieSettings; exit; } if ($in{'action'} eq "readSmilies") { &readSmilies; exit; } if ($in{'action'} eq "SmiliesLegend") { &SmiliesLegend; exit; } sub smilieSettings { $totalsmilies = 0; @smilielines; if (-e "$SmilieDB") { open (FILE, "<$SmilieDB") or die ("Can't open file: $SmilieDB!"); while( ) { push(@smilielines,$_); } close(FILE); chmod (0777, "$SmilieDB"); } else { @smilielines = &getIcons; $DBExists = "false"; } print < Smilie-Settings
C O N F I G U R E      S M I L I E S

You can easily add, modify or delete your smilies. Just fill in the code and images how you want them and press submit. If you want to delete a smilie check the delete? box.

SmilieSettingsTop foreach $smilieline (@smilielines) { chomp($smilieline); $totalsmilies++; unless ($DBExists eq "false") { ($smiliecode, $smiliepic)=split(/\|\^\|/,$smilieline); $id = $totalsmilies; } else { $smiliepic = $smilieline; $id = $totalsmilies; $smiliecode = &getsmiliecode($smiliepic); } if($totalsmilies % 2 == 0) { $backgroundcolor = "bgcolor=\"#c7c6ba\""; } else { $backgroundcolor = "bgcolor=\"#d5d2bb\""; } print < SmilieData } for($i=1; $i<=$howmany; $i++) { if($backgroundcolor eq "bgcolor=\"#c7c6ba\"") { $backgroundcolor = "bgcolor=\"#d5d2bb\""; } else { $backgroundcolor = "bgcolor=\"#c7c6ba\""; } $id = $i+$totalsmilies; print < AddedSmilies } $totalsmilies = $totalsmilies + $howmany; print <
Delete? Smilie-Code Smilie-Picture Snapshot
Add more smilies? If you want to add more smilies make sure you check this and fill in the amount of smilies you want to add
Identify yourself
Your User Name
Your Password

SmilieSettingsBottom } #END INTRO SR ### sub submitSmilieSettings { $number = 0; open (SMILIEFILE, ">$SmilieDB") or die ("Can't open file: $SmilieDB!"); for($i=1; $i<=$SmilieCount; $i++) { $smiliedel = "delete-$i"; if($$smiliedel ne "Yes") { $number++; $smiliecode = "smilie-" . "$i"; $smiliepic = "smiliepic-" . "$i"; $smilieline = "$$smiliecode" . "|^|" . "$$smiliepic\n"; unless($$smiliecode eq "" || $$smiliepic eq "") { print SMILIEFILE ("$smilieline"); } } } close(SMILIEFILE); chmod (0777, "$SmilieDB"); &smilieSettings; } sub sendSmilieSettings { &VerifyAdmin($UserName, $Password); if ($Proceed eq "true") { &submitSmilieSettings; } } sub readSmilies { print < View Existing Smilies
ICONHTML @theicons = &getIcons; $backgroundcolor = "bgcolor=\"#c7c6ba\""; foreach $item(@theicons) { if($backgroundcolor eq "bgcolor=\"#c7c6ba\"") { $backgroundcolor = "bgcolor=\"#d5d2bb\""; } else { $backgroundcolor = "bgcolor=\"#c7c6ba\""; } print< FOUNDICONS } print<
Icon-Name Icon
$item

[Close]
ENDICONHTML } sub SmiliesLegend { if ($in{'Type'} eq "edit") { $textareaname = "EditedMessage"; $formname = "REPLIER"; } elsif ($in{'Type'} eq "reply") { $textareaname = "ReplyMessage"; $formname = "REPLIER"; } else { $textareaname = "Message"; $formname = "PostTopic"; } if (-e "$SmilieDB") { open (FILE, "<$SmilieDB") or die ("Can't open file: $SmilieDB!"); while( ) { push(@smilielines,$_); } close(FILE); chmod (0777, "$SmilieDB"); } else { @smilielines = &getIcons; $DBExists = "false"; } print < Smilies Legend
S M I L I E S L E G E N D

Smilies (or Graemlins, as we like to call them) are small graphical images that can be used to convey an emotion or feeling. Let's face it, sometimes words alone do not suffice. Adding a winking smilie, for instance, may help you clarify that you are joking. Use your smilies sparingly, though - if overused, smilies can be downright annoying.

If you have used email or internet chat, you are likely familiar with the smilie concept. Certain standard emoticons are automatically converted into smilies. Here's the list of currently accepted smilies:

ICONHTML $backgroundcolor = "bgcolor=\"$AltColumnColor1\""; foreach $smilieline (@smilielines) { chomp($smilieline); unless ($DBExists eq "false") { ($smiliecode, $smiliepic)=split(/\|\^\|/,$smilieline); } else { $smiliepic = $smilieline; $smiliecode = &getsmiliecode($smiliepic); } ($smiliename, $ext)=split(/\./,$smiliepic); $smiliename = ucfirst lc $smiliename; if($backgroundcolor eq "bgcolor=\"$AltColumnColor1\"") { $backgroundcolor = "bgcolor=\"$AltColumnColor2\""; } else { $backgroundcolor = "bgcolor=\"$AltColumnColor1\""; } print< FOUNDICONS } print<
What To Type Emotion Image Icon
$smiliecode $smiliename

Note: you may disable smilies in any post you are making, if you like. Look for the "Disable Smilies" box on each post page, if you want to turn off smilie conversion in your particular post.

Powered by: Ultimate Bulletin Board
© Infopop Corporation, 1999.


[Close]
ENDICONHTML } sub getIcons { opendir(ICONS, "$SmiliePath"); my @icons = readdir(ICONS); closedir(ICONS); @theicons = grep(/\w+.gif|\w+.jpg|\w+.bmp/, @icons); @theicons = sort ByIconNum @theicons; return(@theicons); } sub getsmiliecode { my $picture = shift; if($picture eq "smile.gif") { $code = "\:\)"; } elsif($picture eq "frown.gif") { $code = "\:\("; } elsif($picture eq "biggrin.gif") { $code = "\:D"; } elsif($picture eq "wink.gif") { $code = "\;\)"; } elsif($picture eq "redface.gif") { $code = "\:o"; } elsif($picture eq "tongue.gif") { $code = "\:p"; } elsif($picture eq "cool.gif") { $code = "\:cool:"; } elsif($picture eq "rolleyes.gif") { $code = "\:rolleyes:"; } elsif($picture eq "mad.gif") { $code = "\:mad:"; } elsif($picture eq "confused.gif") { $code = "\:confused:"; } else { $code = ""; } return $code; } sub ByIconNum { local($aa,$bb); ($aa) = $a =~ m/(\d+)/; ($bb) = $b =~ m/(\d+)/; return ($aa <=> $bb); }