***************************************************************************************** ***************************************************************************************** * Mod NAME: Avatars Hack (redoc'd for v5.46) * ***************************************************************************************** * DESCRIPTION: This mod places a user chosen icon under their name on their posts. * ***************************************************************************************** * CREATED BY: Mutt (Jeff Hey), AllenAyres and MasterMind * * DATE: 02/19/2000 * * VERSION: 3.0 * ***************************************************************************************** * MODIFIED BY: MasterMind (MasterMind@ubbdev.com) * * MODIFY DATE: 10/27/2000 * * VERSION: 5.45-5.47 (probably more) * * * * Credits: Dark_Wizard and AllenAyres - previous update 4-22-00 * * * ***************************************************************************************** * REQUIREMENTS: full version * * COMPATABILITY: 5.46 * ***************************************************************************************** * FILES ADDED: your uploaded avatars * * FILES MODIFIED: ubb_library.pl, ubb_library2.pl, Ultimate.cgi, ubbmisc.cgi, * * Register_lib.cgi, cpanel2.cgi, cpanel4.cgi * ***************************************************************************************** * DISCLAIMER: By using this hack, the user implicitly agrees that they * * are willingly modifying any and all files at their own * * risk. Should any errors occur either as a direct or * * indirect result of said modifications the user agrees not * * to hold Infopop Corporation or any of the individuals * * listed above accountable. * * * * * * IN OTHER WORDS: PLEASE MAKE BACKUP COPIES OF EVERY FILE YOU PLAN TO * * MODIFY PRIOR TO MODIFICATION!! * * * * * * FOR MORE TIPS AND TRICKS FOR USE WITH THE ULTIMATE BULLETIN BOARD * * PLEASE VISIT US AT: * * * * http://www.ubbdev.com * * * ***************************************************************************************** ***************************************************************************************** **IF YOU NEED HELP, ASK AT UBBDEV.COM!!!!** Make a dir called 'avatars' in your noncgi (/ubb/) dir. name your avatars and up them to that dir. (avatars can be .gif and .jpg files) if you'd like a space in the name use the '_' underscore character. make another dir inside the avatar dir called 'custom'. if you'd like a special avatar that only one person can use, name it UserName.gif (example: MasterMind.gif) and upload it to the custom dir. YOU MUST USE THE USERS USERNAME AND UPLOAD TO THE CUSTOM DIRECTORY FOR THAT TO ONLY BE VISABLE FOR THAT USER!!! modify the following files after the mods are finished, goto the cp general vars and set your avataer settings. allow avatars yes/no avatar height avatar width i suggest 32x32 or 64x64 What's New? - Allows JPG files and GIF files - Displays the avatar when you view a profile - Bug Fixes - Instead of using the users profile number, you can use the username of the user in the custom directory. - Redoced! - MORE Bug Fixes ############################# ubb_library.pl ############################# ## FIND: $maxmemfields = 14; ## INCREASE THIS 14 BY ONE, IF YOU HAVE PREVIOUSLY ADDED ADDITIONAL PROFILE FIELDS THE NUMBER WILL BE DIFFERENT. ############################# ubbmisc.cgi ############################# ## FIND: if ($Name eq "Location") { $Location = &CleanThis($Value); $Location = &PipeCleaner($Location); } ## PASTE THIS AFTER: if ($Name eq "Avatar") { $Avatar = &CleanThis($Value); $Avatar = &PipeCleaner($Avatar); } ## FIND: if ($in{'Password'} eq "$thisprofile[1]") { $pwmatch = "true"; $Password = $thisprofile[1]; $Email = $thisprofile[2]; $URL = $thisprofile[3]; $Occupation = $thisprofile[5]; $Location = $thisprofile[6]; $Interests = $thisprofile[9]; $Status = $thisprofile[8]; $TotalPosts = $thisprofile[7]; $Permissions = $thisprofile[4]; $DateRegistered = $thisprofile[10]; $EmailView = $thisprofile[11]; $Signature = $thisprofile[12]; $ICQnumber = $thisprofile[13]; $AllowMassMail = $thisprofile[14]; ## NOTE: (VERY IMPORTANT) ## look at the last $thisprofile item. in this block of code ## 14 is the last one. if you've already modified your code ## it might be different. use the next sequential number for this next part. ## in this case it's 15. you'll use this number for every $thisprofile[15] item ## in the rest of the mod. ## PASTE THIS AFTER: $Avatar = $thisprofile[15]; ## FIND: print MEMBERSHIP ("$Signature\n"); print MEMBERSHIP ("$in{'ICQnum'}\n"); print MEMBERSHIP ("$in{'AllowMassMail'}\n"); ## PASTE THIS AFTER: print MEMBERSHIP ("$in{'Avatar'}\n"); ## NOTE: (VERY IMPORTANT) ## if you've already added to the profile, this is where you'll ## screw it up. the print statements need to be in the same order ## as the thisprofile items were numbered. ## FIND: $SearchName = "$thisprofile[0]"; $SearchName = &HTMLIFY($SearchName); $SearchName =~ tr/ /+/; ## PASTE THIS AFTER: if ($AvatarAllow eq "YES") { if ($thisprofile[15] ne "") { if ($AvatarW ne "") {$AvatarW = qq(width="$AvatarW");} else { $AvatarW = ""; } if ($AvatarH ne "") {$AvatarH = qq(height="$AvatarH");} else { $AvatarH = ""; } $Avatar = qq(); } else { $Avatar = " "; } $AvatarLine = qq(Avatar:$Avatar); } else { $AvatarLine = ""; } ## FIND: Date Registered: ## PASTE THIS AFTER: $AvatarLine ## FIND: print< $HeaderInsert $Header ## REPLACE WITH: # START HACK - Avatar # print< # $HeaderInsert # # $Header if ($AvatarAllow eq "YES") { $NOTE = $CUSTOM = ""; $AvatarWording = &AvatarDropDownHTML; if ($AvatarW ne "") { $CellWidth = ($AvatarW + 10); $AvatarW = qq(width="$AvatarW"); } else { $CellWidth = "110"; $AvatarW = ""; } if ($AvatarH ne "") { $LayerHeight = ($AvatarH + 2); $AvatarH = qq(height="$AvatarH"); } else { $LayerHeight = "102"; $AvatarH = ""; } $CellHeight = ($LayerHeight + 10); $AvatarLine = qq(
Avatar
Optional image you may use to appear with each of your posts.

$NOTE ); } else { $AvatarLine = qq(); } print< $HeaderInsert $Header $END_HACK_Avatar ## FIND: $AMM $BorderTop ## REPLACE WITH: $BorderTop
$AvatarLine $AMM ## FIND:
## REPLACE WITH:
## FIND: print MEMBERSHIP ("$in{'ICQnum'}\n"); print MEMBERSHIP ("$in{'AllowMassMail'}\n"); ## PASTE THIS UNDER: print MEMBERSHIP ("$in{'Avatar'}\n"); ## FIND: sub PrintRegistrationHTML { &GetCookieInfo; if ($SetCookies eq "DirectorySpecific") { $ExtraInfo = qq(domain=$TheDomain;path=/$ThePath;); } else { $ExtraInfo = ""; } ## PASTE THIS UNDER: if ($AvatarAllow eq "YES") { if ($AvatarW ne "") {$AvatarW = qq(width="$AvatarW");} else { $AvatarW = ""; } if ($AvatarH ne "") {$AvatarH = qq(height="$AvatarH");} else { $AvatarH = ""; } $AvatarLine = qq(
); } else { $AvatarLine = ""; } ## FIND: ## PASTE THIS UNDER: $AvatarLine ############################# Ultimate.cgi ############################# ## FIND: require "ubb_library.pl"; ## PASTE THIS AFTER: require "ubb_library2.pl"; ############################# Register_lib.cgi (for older versions, it is in Ultimate.cgi ############################# ## FIND: print< $BBName Registration $HeaderInsert ## REPLACE WITH: if ($AvatarAllow eq "YES") { $NOTE = $CUSTOM = ""; $AvatarWording = &AvatarDropDownHTML; if ($AvatarW ne "") { $CellWidth = ($AvatarW + 10); $AvatarW = qq(width="$AvatarW"); } else { $CellWidth = "110"; $AvatarW = ""; } if ($AvatarH ne "") { $LayerHeight = ($AvatarH + 2); $AvatarH = qq(height="$AvatarH"); } else { $LayerHeight = "102"; $AvatarH = ""; } $CellHeight = ($LayerHeight + 10); $AvatarLine = qq(); } else { $AvatarLine = qq(); } print< $BBName Registration $HeaderInsert ## FIND: ## REPLACE WITH: $AvatarLine ## FIND: (TWICE) ## REPLACE WITH: (EACH TIME) ## FIND: print< $BBName Registration for Children Under 13 $HeaderInsert ## REPLACE WITH: if ($AvatarAllow eq "YES") { $NOTE = $CUSTOM = ""; $AvatarWording = &AvatarDropDownHTML; if ($AvatarW ne "") { $CellWidth = ($AvatarW + 10); $AvatarW = qq(width="$AvatarW"); } else { $CellWidth = "110"; $AvatarW = ""; } if ($AvatarH ne "") { $LayerHeight = ($AvatarH + 2); $AvatarH = qq(height="$AvatarH"); } else { $LayerHeight = "102"; $AvatarH = ""; } $CellHeight = ($LayerHeight + 10); $AvatarLine = qq(); } else { $AvatarLine = qq(); } print< $BBName Registration for Children Under 13 $HeaderInsert ## FIND: (SECOND TIME) ## REPLACE WITH: $AvatarLine ############################# cpanel2.cgi ############################# ## FIND: if ($Name eq "Footer") { $Footer = $Value; $Footer = &LimitReturns($Footer); } ## PASTE THIS AFTER: if ($Name eq "AvatarAllow") { $AvatarAllow = $Value; } if ($Name eq "AvatarH") { $AvatarH = $Value; } if ($Name eq "AvatarW") { $AvatarW = $Value; } ## FIND: if ($EmailCheck eq "true") { $EmailTrue = "CHECKED"; } else { $EmailFalse = "CHECKED"; } ## PASTE THIS AFTER: if ($AvatarAllow eq "NO") { $AvatarAllowNO = "CHECKED"; } else { $AvatarAllowYES = "CHECKED"; } ## FIND: print<
Avatar
Email $Email
Avatar
Optional image you may use to appear with each of your posts.

$NOTE
User Name*
User Name*
Avatar
Optional image you may use to appear with each of your posts.

$NOTE
User Name*
User Name*
## REPLACE WITH: &InputRadioRow("#dedfdf", "Allow Avatars?", "An avatar is a user chosen image which will appear under the UserName in that user's posts.", " Allow avatars
Do not allow avatars"); print< Avatar Height and Width
Standard icon sizes are 32x32 and 64x64. If you'd like to use varying sizes, leave these fields blank.
Height:
Width:
############################# cpanel4.cgi ############################# ## FIND: chomp($theprofile[14]); chomp($theprofile[13]); ## PASTE THIS ABOVE: chomp($theprofile[15]); ## FIND: print MEMBERSHIP ("$theprofile[13]\n"); print MEMBERSHIP ("$theprofile[14]\n"); ## PASTE THIS AFTER: print MEMBERSHIP ("$theprofile[15]\n"); ############################# ubb_library2.pl ############################# ## FIND: $EmailView = $thisprofile[11]; $ThisStatus = $thisprofile[8]; ## PASTE THIS UNDER: $ThisAvatar = $thisprofile[15]; *Change the profile number to the profile you used ## FIND: if ($RegName ne "unreg"){ ## PASTE THIS UNDER: if ($AvatarAllow eq "YES") { if ($ThisAvatar ne "") { if ($AvatarW ne "") {$AvatarWidth = qq(width="$AvatarW");} else { $AvatarWidth = ""; } if ($AvatarH ne "") {$AvatarHeight = qq(height="$AvatarH");} else { $AvatarHeight = ""; } $AvatarLine = qq(
); } else { $AvatarLine = ""; } } else { $AvatarLine = ""; } ## FIND: } else { $EmailString = " "; $ThisStatus = "unregistered"; $ProfileString = " "; $AuthorExtra = ""; ## PASTE THIS UNDER: $AvatarLine = ""; ## FIND: $thisline[2]
## PASTE THIS AFTER: You may want to adjust this depending on where you want to see it in relation to user name) $AvatarLine (So it looks like this : $thisline[2]
$AvatarLine) ## FIND: 1; ## PASTE THIS ABOVE: sub AvatarDropDownHTML { opendir(CUSTOMAVATARS, "$NonCGIPath/avatars/custom"); my @customavatars = readdir(CUSTOMAVATARS); closedir(CUSTOMAVATARS); @thecustomavatars = grep(/\w+.(gif|jpg)/, @customavatars); foreach $customavataritem(@thecustomavatars) { if ($customavataritem eq "$UserName.gif") { $CUSTOM = qq(); $NOTE = qq(Note: There is a Custom Avatar available for you!); } } opendir(AVATARS, "$NonCGIPath/avatars"); my @avatars = readdir(AVATARS); closedir(AVATARS); @unsortedavatars = grep(/\w+.(gif|jpg)/, @avatars); @theavatars = sort {lc($a) cmp lc($b)} @unsortedavatars; foreach $avataritem(@theavatars) { ($avatarname, $ext)=split(/\./,$avataritem); $avatarname =~ s/_/ /g; #convert spaces $Avatars .= qq(); } return($Avatars); return($NOTE); return($CUSTOM); } ## FINISHED! ## IF YOU HAVE PROBLEMS, IT IS MOST LIKELY DUE TO PROFILE FIELD NUMBER PROBLEMS / ORDER