Michael,
Here is the original that I had (just in case corrupted) followed by the modified. And an update on Mods installed.
[code]<id> Enable HTML </id>
<version> 1.4 for SP1.3 </version>
<mod info> This mod allows you to define certain grounds and users which are allowed to use HTML in their posts. To set the permission, goto Admin Center -> "Forum Preferences and Settings" and set the group- and/or userlist. Please concern that allowing HTML is a serious security risk! Only allow to reliable persons.
THIS MOD IS FOR SP1.3
In this mod, HTML is disabled per default. When someone has permission to use HTML, he will have an additional checkbox when posting messages where he can enable HTML. Note that when HTML is enabled in a post, UBBC will be disabled for it to prevent conflicts (for example with auto-url).
Version history: v1.4: - linebreaks in text input box are no longer shown as <br> in message display - fixed autourl beeing applied although UBBC has been disabled - compatible with SP1.2 and SP1.3.x v1.3: - added checkbox in post form, so you no longer have to add #enable_html yourself - added html support for IMs - added missing html support user's recent posts - fixed html support in recent posts v1.2: - added html to recent posts, user's recent posts, search, printpage and topic summary v1.1: - fixed security issue. When someone modifies a post which contains HTML then the user must have HTML access too or HTML will be disabled on that post. - fixed HTML in post preview </mod info>
<author> Michael Prager </author>
<homepage> http://www.boardmod.org </homepage>
<edit file> Sources/Display.pl </edit file>
<search for> # Should we show "last modified by?" </search for>
<add before> $lastmoduser = $mlmb; </add before>
<search for> &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod if ($message =~ /\#enable_html/isg) { $html_username = $musername; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<edit file> english.lng </edit file>
<search for> 1; </search for>
<add before> %txt_allow_html_mod = ( '1' => "Enable HTML", '2' => "Allow HTML for the following groups (Example: Administrator,group2,Group3):", '3' => "Allow HTML for the following users (Example: admin,username2,username3):", '4' => "Here you can allow certain people to use HTML in their posts. They'll have to enable HTML in every post seperately.<br>Please concern that <b>allowing HTML is a security risk</b>! Only allow to reliable persons!<br><br>", '5' => "Enabled HTML for this post (note: this will <b>disable UBBC</b> code)" );
</add before>
<edit file> Sources/AdminEdit.pl </edit file>
<search for> </tr><tr> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="2">$txt{'690'}</font></td> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><input type=text name="clicklogtime" size="5" value="$ClickLogTime"></td> </tr><tr> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="2">$txt{'376'}</font></td> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><input type=text name="max_log_days_old" size="5" value="$max_log_days_old"></td> </tr><tr> <td colspan=2 class="windowbg2" bgcolor="$color{'windowbg2'}"> <HR size=1 width="100%" class="hr"></td> </search for>
<add after> </tr><tr> <td colspan="2" class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="1">$txt_allow_html_mod{'4'}</font></td> </tr><tr> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="2">$txt_allow_html_mod{'2'}</font></td> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><input type=text name="allow_html_to_groups" size="30" value="$allow_html_to_groups"></td> </tr><tr> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="2">$txt_allow_html_mod{'3'}</font></td> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><input type=text name="allow_html_to_users" size="30" value="$allow_html_to_users"></td> </tr><tr> <td colspan=2 class="windowbg2" bgcolor="$color{'windowbg2'}"> <HR size=1 width="100%" class="hr"></td> </add after>
<search for> $userpic_limits = $FORM{'userpic_limits'} || 'Please note that your image has to be <b>gif</b> or <b>jpg</b> and that it will be resized!'; $userpic_limits =~ s/\"/\'/g; </search for>
<add after> $allow_html_to_groups = $FORM{'allow_html_to_groups'}; $allow_html_to_users = $FORM{'allow_html_to_users'}; </add after>
<search for> ########## File Locking ########## </search for>
<add before> ########## Enable HTML Mod ##########
\$allow_html_to_groups = "$allow_html_to_groups"; # Allow HTML for all users which are in one of these groups. List groups with commas. e.g. 'Administrator,Mod Writer' \$allow_html_to_users = "$allow_html_to_users"; # Allow HTML for all users with these usernames. e.g. 'admin,michael,dave,guests'
</add before>
<edit file> Sources/Post.pl </edit file>
<search for> if($enable_ubbc && $showyabbcbutt) { </search for>
<add before> ### Begin Enable HTML Mod if ($post eq "post" || $post eq "postmodify" || $post eq "imsend") { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($username); $message = $message_backup; if ($enable_html == 1) { if ($message =~ /\#enable_html/isg || $FORM{enable_html} eq "1") { $enable_html_check = ' checked'; $message =~ s/\#enable_html//isg; } else { $enable_html_check = '' } $enable_html_checkbox = qq~<tr> <td class="windowbg" bgcolor="$color{'windowbg'}" width="23%"><font size=2><b>$txt_allow_html_mod{'1'}:</b></font></td> <td class="windowbg" bgcolor="$color{'windowbg'}"><input type=checkbox name="enable_html" value="1"$enable_html_check> <font size="1"> $txt_allow_html_mod{'5'}</font></td> </tr>~; } else { $enable_html_checkbox = ''; } } ### End Enable HTML Mod
</add before>
<search for> $notification $lastmod </search for>
<add before> $enable_html_checkbox </add before>
<search for> &wrap; $displayname = $settings[1]; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod $html_username = $username; if($FORM{enable_html} eq "1") { $message .= qq~#enable_html~; } if ($message =~ /\#enable_html/isg) { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; $displayname = $settings[1]; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<search for> if(-e("$datadir/.txt")) { unlink("$datadir/.txt"); } </search for>
<add before> ### Begin Enable HTML Mod $message =~ s/\#enable_html//isg; if($FORM{enable_html} eq "1") { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($username); $message = $message_backup; if ($enable_html == 1) { $message .= qq~#enable_html~; } } ### End Enable HTML Mod
</add before>
<search for> sub doshowthread { my( $line, $trash, $tempname, $tempdate, $temppost ); </search for>
<add after> my( $html_username, $lastmoduser, $enable_html ); </add after>
<search for> ($trash, $tempname, $trash, $tempdate, $trash, $trash, $trash, $trash, $message, $ns) = split(/\|/,$line); </search for>
<replace> ($trash, $tempname, $trash, $tempdate, $html_username, $trash, $trash, $trash, $message, $ns, $trash, $lastmoduser) = split(/\|/,$line); </replace>
<search for> &wrap; $displayname = $tempname; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod if ($message =~ /\#enable_html/isg) { $lastmoduser =~ s~\n~~g; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; $displayname = $tempname; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<edit file> Sources/Subs.pl </edit file>
<search for> sub Sticky_remove { </search for>
<add before> sub HTML_allow { my ($enable_html,$usrname,@myuserprofile,$groupname); my $username = $_[0];
$enable_html = 0; # disallow guests to use HTML at all cost if ($username ne 'Guest') { if(! $yyUDLoaded{$username} && -e("$memberdir/$username.dat") && $allow_html_to_groups ne '') { &LoadUserDisplay($username); # If user is not in memory, s/he must be loaded. } # check if user is in autorized group if($yyUDLoaded{$username}) { if ($allow_html_to_groups ne '') { @myuserprofile = @{$userprofile{$username}}; foreach $groupname (split( /\,/, $allow_html_to_groups)) { if ($myuserprofile[7] eq $groupname && $groupname ne '') { $enable_html = 1; last; } } } } # check if user's name is in list if ($enable_html == 0 && $allow_html_to_users ne '') { foreach $usrname (split( /\,/, $allow_html_to_users)) { if ($username eq $usrname && $usrname ne '') { $enable_html = 1; last; } } } } return $enable_html; }
</add before>
<edit file> Sources/Recent.pl </edit file>
<search for> sub RecentPosts { </search for>
<add after> my( $lastmoddate, $lastmoduser ); </add after>
<search for> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = split(/\|/,$message); </search for>
<replace> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $lastmoddate, $lastmoduser) = split(/\|/,$message); </replace>
<search for> $data{$mtime} = [$curboard, $tnum, $treplies, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate]; </search for>
<replace> $data{$mtime} = [$curboard, $tnum, $treplies, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate, $lastmoddate, $lastmoduser]; </replace>
<search for> ($board, $tnum, $c, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate) = @{ $data{$messages[$i]} }; </search for>
<replace> ($board, $tnum, $c, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate, $lastmoddate, $lastmoduser) = @{ $data{$messages[$i]} }; </replace>
<search for> &wrap; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod $html_username = $musername; if ($message =~ /\#enable_html/isg) { $lastmoduser =~ s~\n~~g; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<edit file> Sources/Search.pl </edit file>
<search for> sub plushSearch2 { </search for>
<add after> my( $lastmoddate, $lastmoduser ); </add after>
<search for> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = split(/\|/,$curpost); </search for>
<replace> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $lastmoddate, $lastmoduser) = split(/\|/,$curpost); </replace>
<search for> $data{$mtime} = [$curboard, $tnum, $msgnum, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate]; </search for>
<replace> $data{$mtime} = [$curboard, $tnum, $msgnum, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate, $lastmoddate, $lastmoduser]; </replace>
<search for> &wrap; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod $html_username = $musername; if ($message =~ /\#enable_html/isg) { $lastmoduser =~ s~\n~~g; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<edit file> Sources/Printpage.pl </edit file>
<search for> ($threadtitle, $threadposter, $trash, $threaddate, $trash, $trash, $trash, $trash, $threadpost) = split (/\|/,$thread); </search for>
<replace> ($threadtitle, $threadposter, $trash, $threaddate, $html_username, $trash, $trash, $trash, $threadpost, $ns, $lastmoddate, $lastmoduser) = split (/\|/,$thread);
### Begin HTML MOD if ($threadpost =~ /\#enable_html/isg) { $lastmoduser =~ s~\n~~g; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $threadpost; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $threadpost = $message_backup; if ($enable_html == 1) { $threadpost =~ s/\#enable_html//isg; $threadpost =~ s/<br>/\n/ig; &FromHTML($threadpost); } } else { $enable_html = 0; } ### End HTML MOD
### Do/Undo YaBBC Stuff ### if($enable_ubbc && $enable_html != 1) { </replace>
<search for> $threadpost =~ s~\n~<br>~g; </search for>
<add after> } </add after>
<edit file> Sources/Profile.pl </edit file>
<search for> sub usersrecentposts { </search for>
<add after> my( $lastmoddate, $lastmoduser ); </add after>
<search for> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = split(/\|/,$messages[$c]); </search for>
<replace> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $lastmoddate, $lastmoduser) = split(/\|/,$messages[$c]); </replace>
<search for> $data{$mtime} = [$curboard, $tnum, $c, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns]; </search for>
<replace> $data{$mtime} = [$curboard, $tnum, $c, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $lastmoddate, $lastmoduser]; </replace>
<search for> ($board, $tnum, $c, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = @{ $data{$messages[$i]} }; </search for>
<replace> ($board, $tnum, $c, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $lastmoddate, $lastmoduser) = @{ $data{$messages[$i]} }; </replace>
<search for> &wrap; $displayname = $mname; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod $html_username = $musername; if ($message =~ /\#enable_html/isg) { $lastmoduser =~ s~\n~~g; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; $displayname = $mname; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<edit file> Sources/ModifyMessage.pl </edit file>
<search for> if( $postid == 0 ) { $tsub = $subject; $ticon = $icon; } </search for>
<add after> ### Begin Enable HTML Mod $message =~ s/\#enable_html//isg; if($FORM{enable_html} eq "1") { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($username); $message = $message_backup; if ($enable_html == 1) { $message .= qq~#enable_html~; } } ### End Enable HTML Mod </add after>
<edit file> Sources/InstantMessage.pl </edit file>
<search for> &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod if ($message =~ /\#enable_html/isg) { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($musername); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<search for> &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod if ($message =~ /\#enable_html/isg) { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($musername); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<search for> &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod if ($message =~ /\#enable_html/isg) { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($musername); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<search for> if ($FORM{'ns'} eq "NS") {$message .= "";} </search for>
<add after> ### Begin Enable HTML Mod $message =~ s/\#enable_html//isg; if($FORM{enable_html} eq "1") { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($username); $message = $message_backup; if ($enable_html == 1) { $message .= qq~#enable_html~; } } ### End Enable HTML Mod </add after>[/code]
Modified:
[code]<id> Enable HTML </id>
<version> 1.4 for SP1.3 </version>
<mod info> This mod allows you to define certain grounds and users which are allowed to use HTML in their posts. To set the permission, goto Admin Center -> "Forum Preferences and Settings" and set the group- and/or userlist. Please concern that allowing HTML is a serious security risk! Only allow to reliable persons.
THIS MOD IS FOR SP1.3
In this mod, HTML is disabled per default. When someone has permission to use HTML, he will have an additional checkbox when posting messages where he can enable HTML. Note that when HTML is enabled in a post, UBBC will be disabled for it to prevent conflicts (for example with auto-url).
Version history: v1.4: - linebreaks in text input box are no longer shown as <br> in message display - fixed autourl beeing applied although UBBC has been disabled - compatible with SP1.2 and SP1.3.x v1.3: - added checkbox in post form, so you no longer have to add #enable_html yourself - added html support for IMs - added missing html support user's recent posts - fixed html support in recent posts v1.2: - added html to recent posts, user's recent posts, search, printpage and topic summary v1.1: - fixed security issue. When someone modifies a post which contains HTML then the user must have HTML access too or HTML will be disabled on that post. - fixed HTML in post preview </mod info>
<author> Michael Prager </author>
<homepage> http://www.boardmod.org </homepage>
<edit file> Sources/Display.pl </edit file>
<search for> # Should we show "last modified by?" </search for>
<add before> $lastmoduser = $mlmb; </add before>
<search for> &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod if ($message =~ /\#enable_html/isg) { $html_username = $musername; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<edit file> english.lng </edit file>
<search for> 1; </search for>
<add before> %txt_allow_html_mod = ( '1' => "Enable HTML", '2' => "Allow HTML for the following groups (Example: Administrator,group2,Group3):", '3' => "Allow HTML for the following users (Example: admin,username2,username3):", '4' => "Here you can allow certain people to use HTML in their posts. They'll have to enable HTML in every post seperately.<br>Please concern that <b>allowing HTML is a security risk</b>! Only allow to reliable persons!<br><br>", '5' => "Enabled HTML for this post (note: this will <b>disable UBBC</b> code)" );
</add before>
<edit file> Sources/AdminEdit.pl </edit file>
<search for> </tr><tr> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="2">$txt{'690'}</font></td> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><input type=text name="clicklogtime" size="5" value="$ClickLogTime"></td> </tr><tr> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="2">$amv_txt{'13'}</font></td> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><input type=text name="OnlineLogTime" size="5" value="$OnlineLogTime"></td> </tr><tr> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="2">$txt{'376'}</font></td> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><input type=text name="max_log_days_old" size="5" value="$max_log_days_old"></td> </tr><tr> <td colspan=2 class="windowbg2" bgcolor="$color{'windowbg2'}"> <HR size=1 width="100%" class="hr"></td> </search for>
<add after> </tr><tr> <td colspan="2" class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="1">$txt_allow_html_mod{'4'}</font></td> </tr><tr> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="2">$txt_allow_html_mod{'2'}</font></td> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><input type=text name="allow_html_to_groups" size="30" value="$allow_html_to_groups"></td> </tr><tr> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="2">$txt_allow_html_mod{'3'}</font></td> <td class="windowbg2" bgcolor="$color{'windowbg2'}"><input type=text name="allow_html_to_users" size="30" value="$allow_html_to_users"></td> </tr><tr> <td colspan=2 class="windowbg2" bgcolor="$color{'windowbg2'}"> <HR size=1 width="100%" class="hr"></td> </add after>
<search for> $userpic_limits = $FORM{'userpic_limits'} || 'Please note that your image has to be <b>gif</b> or <b>jpg</b> and that it will be resized!'; $userpic_limits =~ s/\"/\'/g; </search for>
<add after> $allow_html_to_groups = $FORM{'allow_html_to_groups'}; $allow_html_to_users = $FORM{'allow_html_to_users'}; </add after>
<search for> ########## File Locking ########## </search for>
<add before> ########## Enable HTML Mod ##########
\$allow_html_to_groups = "$allow_html_to_groups"; # Allow HTML for all users which are in one of these groups. List groups with commas. e.g. 'Administrator,Mod Writer' \$allow_html_to_users = "$allow_html_to_users"; # Allow HTML for all users with these usernames. e.g. 'admin,michael,dave,guests'
</add before>
<edit file> Sources/Post.pl </edit file>
<search for> if($enable_ubbc && $showyabbcbutt) { </search for>
<add before> ### Begin Enable HTML Mod if ($post eq "post" || $post eq "postmodify" || $post eq "imsend") { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($username); $message = $message_backup; if ($enable_html == 1) { if ($message =~ /\#enable_html/isg || $FORM{enable_html} eq "1") { $enable_html_check = ' checked'; $message =~ s/\#enable_html//isg; } else { $enable_html_check = '' } $enable_html_checkbox = qq~<tr> <td class="windowbg" bgcolor="$color{'windowbg'}" width="23%"><font size=2><b>$txt_allow_html_mod{'1'}:</b></font></td> <td class="windowbg" bgcolor="$color{'windowbg'}"><input type=checkbox name="enable_html" value="1"$enable_html_check> <font size="1"> $txt_allow_html_mod{'5'}</font></td> </tr>~; } else { $enable_html_checkbox = ''; } } ### End Enable HTML Mod
</add before>
<search for> $notification $lastmod </search for>
<add before> $enable_html_checkbox </add before>
<search for> &wrap; $displayname = $settings[1]; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod $html_username = $username; if($FORM{enable_html} eq "1") { $message .= qq~#enable_html~; } if ($message =~ /\#enable_html/isg) { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; $displayname = $settings[1]; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<search for> if(-e("$datadir/.txt")) { unlink("$datadir/.txt"); } </search for>
<add before> ### Begin Enable HTML Mod $message =~ s/\#enable_html//isg; if($FORM{enable_html} eq "1") { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($username); $message = $message_backup; if ($enable_html == 1) { $message .= qq~#enable_html~; } } ### End Enable HTML Mod
</add before>
<search for> sub doshowthread { my( $line, $trash, $tempname, $tempdate, $temppost ); </search for>
<add after> my( $html_username, $lastmoduser, $enable_html ); </add after>
<search for> ($trash, $tempname, $trash, $tempdate, $trash, $trash, $trash, $trash, $message, $ns) = split(/\|/,$line); </search for>
<replace> ($trash, $tempname, $trash, $tempdate, $html_username, $trash, $trash, $trash, $message, $ns, $trash, $lastmoduser) = split(/\|/,$line); </replace>
<search for> &wrap; $displayname = $tempname; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod if ($message =~ /\#enable_html/isg) { $lastmoduser =~ s~\n~~g; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; $displayname = $tempname; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<edit file> Sources/Subs.pl </edit file>
<search for> sub Sticky_remove { </search for>
<add before> sub HTML_allow { my ($enable_html,$usrname,@myuserprofile,$groupname); my $username = $_[0];
$enable_html = 0; # disallow guests to use HTML at all cost if ($username ne 'Guest') { if(! $yyUDLoaded{$username} && -e("$memberdir/$username.dat") && $allow_html_to_groups ne '') { &LoadUserDisplay($username); # If user is not in memory, s/he must be loaded. } # check if user is in autorized group if($yyUDLoaded{$username}) { if ($allow_html_to_groups ne '') { @myuserprofile = @{$userprofile{$username}}; foreach $groupname (split( /\,/, $allow_html_to_groups)) { if ($myuserprofile[7] eq $groupname && $groupname ne '') { $enable_html = 1; last; } } } } # check if user's name is in list if ($enable_html == 0 && $allow_html_to_users ne '') { foreach $usrname (split( /\,/, $allow_html_to_users)) { if ($username eq $usrname && $usrname ne '') { $enable_html = 1; last; } } } } return $enable_html; }
</add before>
<edit file> Sources/Recent.pl </edit file>
<search for> sub RecentPosts { </search for>
<add after> my( $lastmoddate, $lastmoduser ); </add after>
<search for> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = split(/\|/,$message); </search for>
<replace> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $lastmoddate, $lastmoduser) = split(/\|/,$message); </replace>
<search for> $data{$mtime} = [$curboard, $tnum, $treplies, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate]; </search for>
<replace> $data{$mtime} = [$curboard, $tnum, $treplies, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate, $lastmoddate, $lastmoduser]; </replace>
<search for> ($board, $tnum, $c, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate) = @{ $data{$messages[$i]} }; </search for>
<replace> ($board, $tnum, $c, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate, $lastmoddate, $lastmoduser) = @{ $data{$messages[$i]} }; </replace>
<search for> &wrap; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod $html_username = $musername; if ($message =~ /\#enable_html/isg) { $lastmoduser =~ s~\n~~g; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<edit file> Sources/Search.pl </edit file>
<search for> sub plushSearch2 { </search for>
<add after> my( $lastmoddate, $lastmoduser ); </add after>
<search for> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = split(/\|/,$curpost); </search for>
<replace> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $lastmoddate, $lastmoduser) = split(/\|/,$curpost); </replace>
<search for> $data{$mtime} = [$curboard, $tnum, $msgnum, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate]; </search for>
<replace> $data{$mtime} = [$curboard, $tnum, $msgnum, $tusername, $tname, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $tstate, $lastmoddate, $lastmoduser]; </replace>
<search for> &wrap; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod $html_username = $musername; if ($message =~ /\#enable_html/isg) { $lastmoduser =~ s~\n~~g; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<edit file> Sources/Printpage.pl </edit file>
<search for> ($threadtitle, $threadposter, $trash, $threaddate, $trash, $trash, $trash, $trash, $threadpost) = split (/\|/,$thread); </search for>
<replace> ($threadtitle, $threadposter, $trash, $threaddate, $html_username, $trash, $trash, $trash, $threadpost, $ns, $lastmoddate, $lastmoduser) = split (/\|/,$thread);
### Begin HTML MOD if ($threadpost =~ /\#enable_html/isg) { $lastmoduser =~ s~\n~~g; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $threadpost; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $threadpost = $message_backup; if ($enable_html == 1) { $threadpost =~ s/\#enable_html//isg; $threadpost =~ s/<br>/\n/ig; &FromHTML($threadpost); } } else { $enable_html = 0; } ### End HTML MOD
### Do/Undo YaBBC Stuff ### if($enable_ubbc && $enable_html != 1) { </replace>
<search for> $threadpost =~ s~\n~<br>~g; </search for>
<add after> } </add after>
<edit file> Sources/Profile.pl </edit file>
<search for> sub usersrecentposts { </search for>
<add after> my( $lastmoddate, $lastmoduser ); </add after>
<search for> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = split(/\|/,$messages[$c]); </search for>
<replace> ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $lastmoddate, $lastmoduser) = split(/\|/,$messages[$c]); </replace>
<search for> $data{$mtime} = [$curboard, $tnum, $c, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns]; </search for>
<replace> $data{$mtime} = [$curboard, $tnum, $c, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $lastmoddate, $lastmoduser]; </replace>
<search for> ($board, $tnum, $c, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = @{ $data{$messages[$i]} }; </search for>
<replace> ($board, $tnum, $c, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns, $lastmoddate, $lastmoduser) = @{ $data{$messages[$i]} }; </replace>
<search for> &wrap; $displayname = $mname; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod $html_username = $musername; if ($message =~ /\#enable_html/isg) { $lastmoduser =~ s~\n~~g; if ($lastmoduser ne $html_username && $lastmoduser ne '') { $html_username = $lastmoduser; } $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($html_username); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; $displayname = $mname; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<edit file> Sources/ModifyMessage.pl </edit file>
<search for> if( $postid == 0 ) { $tsub = $subject; $ticon = $icon; } </search for>
<add after> ### Begin Enable HTML Mod $message =~ s/\#enable_html//isg; if($FORM{enable_html} eq "1") { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($username); $message = $message_backup; if ($enable_html == 1) { $message .= qq~#enable_html~; } } ### End Enable HTML Mod </add after>
<edit file> Sources/InstantMessage.pl </edit file>
<search for> &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod if ($message =~ /\#enable_html/isg) { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($musername); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<search for> &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod if ($message =~ /\#enable_html/isg) { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($musername); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<search for> &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; </search for>
<replace> ### Begin Enable HTML Mod if ($message =~ /\#enable_html/isg) { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($musername); $message = $message_backup; if ($enable_html == 1) { $message =~ s/\#enable_html//isg; $message =~ s/<br>/\n/ig; &FromHTML($message); } } else { $enable_html = 0; }
if ($enable_html != 1) { &wrap; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; } ### End Enable HTML Mod </replace>
<search for> if ($FORM{'ns'} eq "NS") {$message .= "";} </search for>
<add after> ### Begin Enable HTML Mod $message =~ s/\#enable_html//isg; if($FORM{enable_html} eq "1") { $message_backup = $message; # since $message is no local variable, it often gets overwritten accidently somehwere (couldn't find out where) $enable_html = HTML_allow($username); $message = $message_backup; if ($enable_html == 1) { $message .= qq~#enable_html~; } } ### End Enable HTML Mod </add after>[/code]
Mod install log:
YaBB 1 Gold - SP 1.3\adv_memberview_plus_31b.mod YaBB 1 Gold - SP 1.3\hotlinks_12_sp131.mod YaBB 1 Gold - SP 1.3\chat_v1_98a_SP_1_3.mod YaBB 1 Gold - SP 1.3\mbc2_sp13.mod YaBB 1 Gold - SP 1.3\yams_502_sp13.mod YaBB 1 Gold - SP 1.3\ratings_45_sp13.mod YaBB 1 Gold - SP 1.3\yams_502_profil_add_ip.mod YaBB 1 Gold - SP 1.3\YaBBCHelpSP1_3.mod YaBB 1 Gold - SP 1.3\Board Search.mod Quick Repy Box\quick_reply_box_13.mod YaBB 1 Gold - SP 1.3\SplitSplice_1_SP13.mod YaBB 1 Gold - SP 1.3\Latest Subject SP1-1.3.mod YaBB 1 Gold - SP 1.3\better_add_board.mod YaBB 1 Gold - SP 1.3\rating45_mbco2_sp13_addon_13.mod YaBB 1 Gold - SP 1.3\Message_Sort_SP11.mod YaBB 1 Gold - SP 1.3\PreviousNext Page mod.mod YaBB 1 Gold - SP 1.3\new_topic_in_next.mod YaBB 1 Gold - SP 1.3\Recent Users List.mod YaBB 1 Gold - SP 1.3\TopStats_102_sp131.mod
Thanks for the help,
Craig
|