********************************************************************************* * MOD NAME: MyStyle™ * ********************************************************************************* * DESCRIPTION: Lets the user choose his/her own template (color scheme). * * DEMO: http://lkubb.dns2go.com * * * ********************************************************************************* * CREATED BY: LK * * DATE: 04/13/02 * * VERSION: version 1.0 * * CREDITS: Jamin (Skorpion) + Tech-Ni-Kal * * * ********************************************************************************* ********************************************************************************* * REQUIREMENTS: Full License, Mod Wordlets * * COMPATABILITY: works with v6.3.0 * ********************************************************************************* * FILES MODIFIED: ubb_profile.cgi, public_display_profile.pl, ubb_lib.cgi, * * ubb_lib_files.cgi, ubb_registration.cgi, ultimatebb.cgi, * * public_edit_profile.pl, public_register_page.pl, * * public_register_page_kid.pl, public_reg_confirm.pl, * * public_reg_confirm_kid.pl, vars_wordlets_mods.cgi * ********************************************************************************* * DISCLAIMER: By using this modification, 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 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 US AT VISIT: * * * * http://www.ubbdev.com/ * * * ********************************************************************************* ********************************************************************************* ************************ * Open ubb_profile.cgi * ************************ Find: ===== # calibrate mass mail if ($user_profile[14] eq 'yes') { $mm_yes = 'checked="checked"'; $mm_no = ''; } else { $mm_no = 'checked="checked"'; $mm_yes = ''; } Add below: ========== # style template my @templates = &OpenFileAsArray("$vars_config{VariablesPath}/vars_style_sets.cgi"); if (!$user_profile[55]) { $selected = q^ selected="selected"^; } $TempDropDown = qq!!; Find: ===== else { $homepage = $in{homepage}; } Add below: ========== my $template = $in{template}; unless ((-e "$vars_config{NonCGIPath}/styles/vars_style_$template.cgi") || ($template eq '0')) { &StandardHTML("$vars_wordlets_mods{template_illegal}"); } Find: ===== $user_profile[38] = join("|", $avlock, $avban, $avhide); Add below: ========== $user_profile[55] = $template; ******************************* * Open public_edit_profile.pl * ******************************* Find: ===== $vars_wordlets{your_preferences} Add below: ========== $vars_wordlets_mods{template} $TempDropDown $vars_wordlets_mods{template_demo} ******************************** * Open public_register_form.pl * ******************************** Find: ===== $vars_wordlets{your_preferences} Add below: ========== $vars_wordlets_mods{template} $TempDropDown $vars_wordlets_mods{template_demo} ************************************************************ * Open public_reg_confirm.pl AND public_reg_confirm_kid.pl * ************************************************************ Find: ===== $in{homepage}   THISFIELD } # end field Add below: ========== my @templates = &OpenFileAsArray("$vars_config{VariablesPath}/vars_style_sets.cgi"); my @templateparts; my @template; foreach (@templates) { @templateparts = split(/\|\^\|/, $_); if ($templateparts[1] eq $in{template}) { @template = @templateparts; } } if ($in{template}) { print < $vars_wordlets_mods{template}: $template[0] THISFIELD } # end field ***************************** * Open ubb_registration.cgi * ***************************** Find: (TWICE) ============= &LoadTemplate("public_register_form"); Add above: ========== # style template my @templates = &OpenFileAsArray("$vars_config{VariablesPath}/vars_style_sets.cgi"); $TempDropDown = qq!!; Find: ===== else { $homepage = $in{homepage}; } Add below: ========== my $template = $in{template}; unless ((-e "$vars_config{NonCGIPath}/styles/vars_style_$template.cgi") || ($template eq '0')) { &StandardHTML("$vars_wordlets_mods{template_illegal}"); } Find: ===== $avline, #38 ); Add below: ========== $thismemarray[55] = $template; ************************** * Open ubb_lib_files.cgi * ************************** Find: ===== sub WriteFileAsString { #writes a string to a file local (*FILE); my ($path, $string) = @_; Add below: ========== if ($path =~ m/cache/ && $path !~ m/pntf/) { my $number = $user_number ? (&OpenProfile($user_number))[55] : ""; if ($number) { my @dots = split(/\./, $path); $dots[$#dots - 1] .= "_$number"; $path = join('.', @dots); } } Find: (TWICE) ===== my $maxmemfields = 39; #total fields permitted in member file Replace with: ============= my $maxmemfields = 55; #total fields permitted in member file after template modification ******************************* * Open vars_wordlets_mods.cgi * ******************************* Find: ===== %vars_wordlets_mods = ( Add below: ========== template => "Template", template_illegal => "You chose an illegal template. Please try again.", template_demo => "Demonstration", template_test => "This is a sample sentence.", template_current_theme => "Your current scheme is", template_none => "None", ********************************** * Open public_display_profile.pl * ********************************** Find: ===== $user_profile[3] THISFIELD } # end field Add below: ========== my @templates = &OpenFileAsArray("$vars_config{VariablesPath}/vars_style_sets.cgi"); my @templatez; foreach (@templates) { my @template = split(/\|\^\|/, $templates[$_]); if ($template[1] eq $user_profile[55]) { @templatez = @template; last; } } if ($user_profile[55] && @templatez) { print < $vars_wordlets_mods{template}: $templatez[0] THISFIELD } ******************** * Open ubb_lib.cgi * ******************** Find: ===== if(exists $template_match{$name}) { $number = $template_match{$name}; $vars_style_reference{"current_style"} = $name; } else { $number = 1; # saroo? } # end if Replace with: ============= if ($user_number) { $number = (&OpenProfile($user_number))[55]; $stuff = 1 if $number; } else { my @ubber_c00kie = cookie("ubber$vars_config{Cookie_Number}"); if ($ubber_c00kie[4]) { $number = (&OpenProfile($ubber_c00kie[4]))[55]; $stuff = 1 if $number; } } if (!$stuff || $in{ubb} eq 'demo') { if(exists $template_match{$name}) { $number = $template_match{$name}; $vars_style_reference{"current_style"} = $name; } else { $number = 1; # saroo? } # end if } # end if Find: ===== my $filename = "$vars_config{NonCGIPath}/cache-$vars_config{cache_pw}/$_[0]"; Add below: ========== my @dots = split(/\./, $filename); my $number = $user_number ? (&OpenProfile($user_number))[55] : ""; $dots[$#dots - 1] .= "_$number" if $number; $filename = join('.', @dots); Find: ===== if($func eq "Summary") { if($options) { $fto = "9999_$options"; } else { $fto = "9999"; } Add below: ========== my $number = $user_number ? (&OpenProfile($user_number))[55] : ""; $fto .= "-$number" if $number; Find: ===== } elsif($func eq "Forum") { if($options =~ m/^\d+$/) { my $fto = sprintf("%04d1000_0000", $options); Add below: ========== my $number = $user_number ? (&OpenProfile($user_number))[55] : ""; $fto .= "-$number" if $number; ****************************** * Open noncgi/ultimatebb.php * ****************************** Find: ===== function ubboutput ($tpath, $redirect) { global $TheFile, $CGIURL, $php_version_string; expireme(); Add below: ========== global $profile; $profile[55] = chop($profile[55]); if ($profile[55]) { $dots = split("\.", $tpath); $i = 0; $dots[count($dots) - 2] .= "_$profile[55]"; $tpath = join(".", $dots); } Find: ===== $fto = $NonCGIPath . "/cache-" . $cache_pw . "/pntf/9999"; if($category != "") { $fto .= "_$category"; } // end if Add below: ========== global $profile; $profile[55] = chop($profile[55]); if ($profile[55]) { $fto .= "-$profile[55]"; } Find: ===== $fto = $NonCGIPath . "/cache-" . $cache_pw . "/pntf/"; $fto .= sprintf("%04d1000_0000", $forum); Add below: ========== global $profile; $profile[55] = chop($profile[55]); if ($profile[55]) { $fto .= "-$profile[55]"; } *********************** * Open ultimatebb.cgi * *********************** Find: ===== if ($ubb eq '') { &RequireCode("$vars_config{CGIPath}/ubb_forum_summary.cgi"); &forum_summary; exit(0); } Add below: ========== if ($ubb eq 'demo') { if ($in{s} ne '0') { unless (-e "$vars_config{NonCGIPath}/styles/vars_style_$in{s}.cgi") { &StandardHTML("$vars_wordlets_mods{template_illegal}"); } $template_match{mystyle} = $in{s}; %vars_style = &LoadStyleTemplate("mystyle"); } &StandardHTML("$vars_wordlets_mods{template_test}"); exit(0); } ################################################################################### ################ DO THIS STEP ONLY IF YOU HAVE CHAT MOD INSTALLED ################# ################################################################################### ****************************** * Open ubb_forum_summary.cgi * ****************************** Find: ===== my $filename = "$vars_config{NonCGIPath}/cache-$cache_cookie/ubb_files/summary/summary.html"; Add below: ========== my @dots = split(/\./, $filename); $dots[$#dots - 1] .= "_$tempprofile[55]" if ($tempprofile[55]); $filename = join('.', @dots); Find: ===== my $filename = "$vars_config{NonCGIPath}/cache-$cache_cookie/ubb_files/summary/summary-$in{category}.html"; Add below: ========== my @dots = split(/\./, $filename); $dots[$#dots - 1] .= "_$tempprofile[55]" if ($tempprofile[55]); $filename = join('.', @dots);