;
fclose(MOSTUSERS);
( $mostmemb, $datememb ) = split /\|/xsm, $mostentries[0];
( $mostguest, $dateguest ) = split /\|/xsm, $mostentries[1];
( $mostusers, $dateusers ) = split /\|/xsm, $mostentries[2];
( $mostbots, $datebots ) = split /\|/xsm, $mostentries[3];
chomp $datememb;
chomp $dateguest;
chomp $dateusers;
chomp $datebots;
$themostmembdate = timeformat($datememb);
$themostguestdate = timeformat($dateguest);
$themostuserdate = timeformat($dateusers);
$themostbotsdate = timeformat($datebots);
$themostuser = $mostusers;
$themostmemb = $mostmemb;
$themostguest = $mostguest;
$themostbots = $mostbots;
}
else {
$themostmembdate = timeformat($date);
$themostguestdate = timeformat($date);
$themostuserdate = timeformat($date);
$themostbotsdate = timeformat($date);
$themostuser = 23;
$themostmemb = 12;
$themostguest = 19;
$themostbots = 4;
}
$grpcolors = q{};
( $title, undef, undef, $color, $noshow ) = split /\|/xsm,
$Group{'Administrator'}, 5;
my $admcolor = qq~$color~;
if ( $color && $noshow != 1 ) {
$grpcolors .=
qq~lllll $title
~;
}
( $title, undef, undef, $color, $noshow ) =
split /\|/xsm, $Group{'Global Moderator'}, 5;
if ( $color && $noshow != 1 ) {
$grpcolors .=
qq~lllll $title
~;
}
( $title, undef, undef, $color, $noshow ) =
split /\|/xsm, $Group{'Mid Moderator'}, 5;
if ( $color && $noshow != 1 ) {
$grpcolors .=
qq~lllll $title
~;
}
foreach my $nopostamount ( sort { $a <=> $b } keys %NoPost ) {
( $title, undef, undef, $color, $noshow ) = split /\|/xsm,
$NoPost{$nopostamount}, 5;
if ( $color && $noshow != 1 ) {
$grpcolors .=
qq~lllll $title
~;
}
}
foreach my $postamount ( reverse sort { $a <=> $b } keys %Post ) {
( $title, undef, undef, $color, $noshow ) = split /\|/xsm,
$Post{$postamount}, 5;
if ( $color && $noshow != 1 ) {
$grpcolors .=
qq~lllll $title
~;
}
}
my $latestmemberlink =
qq~$boardindex_txt{'201'} ${$uid.$username}{'realname'}.
~;
my $tempims =
qq~$boardindex_txt{'795'} 2 $boardindex_txt{'796'} $boardindex_imtxt{'24'} 2 $boardindex_imtxt{'26'}.~;
my $tempforumurl = $mbname;
my $tempnew = qq~$admin_img{'off'}~;
my $tempcurboard = $templ_txt{'77'};
my $tempcurboardurl = q~javascript:;~;
my $tempboardanchor = $templ_txt{'78'};
my $tempbddescr = $templ_txt{'79'};
my $tempshowmods =
qq~$boardindex_txt{'63'}: $templ_txt{'74'}
$boardindex_txt{'63a'}: $templ_txt{'74a'}~;
my $templastposttme = timeformat($date);
my $templastpostlink =
qq~$img{'lastpost'} $templastposttme~;
my $templastposter =
qq~${$uid.$username}{'realname'}~;
my $tmplasttopiclink = qq~$templ_txt{'80'}~;
$tempcatlink =
qq~
$templ_txt{'81'}~;
my $templatecat = $catheader;
$templatecat =~ s/(\{|<)yabb catlink(}|>)/$tempcatlink/gsm;
my $tmptemplateblock = $templatecat;
my $templastpostdate = timeformat($date);
$templastpostdate = qq~($templastpostdate).
~;
my $temprecentposts =
qq~$boardindex_txt{'791'} $boardindex_txt{'792'} $boardindex_txt{'793'}~;
my $tempguestson =
qq~$boardindex_txt{'141'}: 2~;
my $tempbotson =
qq~$boardindex_txt{'143'}: 3~;
my $tempbotlist =
q~Googlebot (1), MSN Search (2)~;
my $tempuserson =
qq~$boardindex_txt{'142'}: 1~;
my $tempusers =
qq~${$uid.$username}{'realname'}
~;
my $tempmembercount = q~2~;
my $tempboardpic =
qq~
~;
for my $i ( 1 .. 2 ) {
my $templateblock = $boardblock;
$templateblock =~ s/(\{|<)yabb new(}|>)/$tempnew/gsm;
$templateblock =~ s/(\{|<)yabb boardrss(}|>)//gsm; ### RSS on Board Index ###
$templateblock =~ s/(\{|<)yabb boardanchor(}|>)/$tempboardanchor_$i/gsm;
$templateblock =~ s/(\{|<)yabb boardurl(}|>)/$tempcurboardurl/gsm;
$templateblock =~ s/(\{|<)yabb boardpic(}|>)/$tempboardpic/gsm;
$templateblock =~ s/(\{|<)yabb boardname(}|>)/$tempcurboard $i/gsm;
$templateblock =~ s/(\{|<)yabb boardviewers(}|>)/$boardviewers/gsm;
$templateblock =~ s/(\{|<)yabb boarddesc(}|>)/$tempbddescr/gsm;
$templateblock =~ s/(\{|<)yabb moderators(}|>)/$tempshowmods/gsm;
$templateblock =~ s/(\{|<)yabb threadcount(}|>)/$i/gsm;
$templateblock =~ s/(\{|<)yabb messagecount(}|>)/$i/gsm;
$templateblock =~ s/(\{|<)yabb lastpostlink(}|>)/$templastpostlink/gsm;
$templateblock =~ s/(\{|<)yabb lastposter(}|>)/$templastposter/gsm;
$templateblock =~ s/(\{|<)yabb lasttopiclink(}|>)/$tmplasttopiclink/gsm;
$tmptemplateblock .= $templateblock;
}
$tmptemplateblock .= $catfooter;
$boardindex_template =~ s/(\{|<)yabb pollshowcase(}|>)//sm;
$boardindex_template =~ s/(\{|<)yabb catsblock(}|>)/$tmptemplateblock/gsm;
require Sources::Menu;
$collapselink = SetImage('collapse', $UseMenuType);
$markalllink = SetImage('markallread', $UseMenuType);
$menusep = q{ };
if ( $UseMenuType == 1 ) {
$menusep = q{ | };
}
my $templasttopiclink =
qq~$boardindex_txt{'236'} $templ_txt{'80'}~;
$boardhandellist =~ s/(\{|<)yabb collapse(}|>)/$menusep$collapselink/gsm;
$boardhandellist =~ s/(\{|<)yabb expand(}|>)//gsm;
$boardhandellist =~ s/(\{|<)yabb markallread(}|>)/$menusep$markalllink/gsm;
$boardhandellist =~ s/\Q$menusep//ism;
$boardindex_template =~
s/(\{|<)yabb boardhandellist(}|>)/$boardhandellist/gsm;
$boardindex_template =~ s/(\{|<)yabb catimage(}|>)//gsm;
$boardindex_template =~ s/(\{|<)yabb catrss(}|>)//gsm; ### RSS on Board Index ###
$boardindex_template =~
s/img src\=\"$tmpimagesdir\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm;
$boardindex_template =~ s/(\{|<)yabb newmsg start(}|>)//gsm;
$boardindex_template =~ s/(\{|<)yabb newmsg icon(}|>)//gsm;
$boardindex_template =~ s/(\{|<)yabb newmsg(}|>)//gsm;
$boardindex_template =~ s/(\{|<)yabb newmsg end(}|>)//gsm;
$boardindex_template =~ s/(\{|<)yabb totaltopics(}|>)/3/gsm;
$boardindex_template =~ s/(\{|<)yabb totalmessages(}|>)/3/gsm;
$boardindex_template =~
s/(\{|<)yabb lastpostlink(}|>)/$templasttopiclink/gsm;
$boardindex_template =~ s/(\{|<)yabb lastpostdate(}|>)/$templastpostdate/gsm;
$boardindex_template =~ s/(\{|<)yabb recentposts(}|>)/$temprecentposts/gsm;
$boardindex_template =~ s/(\{|<)yabb recenttopics(}|>)//gsm;
$boardindex_template =~ s/(\{|<)yabb mostusers(}|>)/$themostuser/gsm;
$boardindex_template =~ s/(\{|<)yabb mostmembers(}|>)/$themostmemb/gsm;
$boardindex_template =~ s/(\{|<)yabb mostguests(}|>)/$themostguest/gsm;
$boardindex_template =~ s/(\{|<)yabb mostbots(}|>)/$themostbots/gsm;
$boardindex_template =~ s/(\{|<)yabb mostusersdate(}|>)/$themostuserdate/gsm;
$boardindex_template =~
s/(\{|<)yabb mostmembersdate(}|>)/$themostmembdate/gsm;
$boardindex_template =~
s/(\{|<)yabb mostguestsdate(}|>)/$themostguestdate/gsm;
$boardindex_template =~ s/(\{|<)yabb mostbotsdate(}|>)/$themostbotsdate/gsm;
$boardindex_template =~ s/(\{|<)yabb groupcolors(}|>)/$grpcolors/gsm;
$boardindex_template =~ s/(\{|<)yabb membercount(}|>)/$tempmembercount/gsm;
$boardindex_template =~ s/(\{|<)yabb expandmessages(}|>)/$temp_expandmessages/gsm;
$boardindex_template =~ s/(\{|<)yabb latestmember(}|>)/$latestmemberlink/gsm;
$boardindex_template =~ s/(\{|<)yabb ims(}|>)/$tempims/gsm;
$boardindex_template =~ s/(\{|<)yabb users(}|>)/$tempuserson/gsm;
$boardindex_template =~ s/(\{|<)yabb spc(}|>)//gsm;
$boardindex_template =~ s/(\{|<)yabb onlineusers(}|>)/$tempusers/gsm;
$boardindex_template =~ s/(\{|<)yabb guests(}|>)/$tempguestson/gsm;
$boardindex_template =~ s/(\{|<)yabb onlineguests(}|>)//gsm;
$boardindex_template =~ s/(\{|<)yabb bots(}|>)/$tempbotson/gsm;
$boardindex_template =~ s/(\{|<)yabb onlinebots(}|>)/$tempbotlist/gsm;
$boardindex_template =~ s/(\{|<)yabb caldisplay(}|>)/$cal_display/gsm;
$boardindex_template =~ s/(\{|<)yabb sharedlogin(}|>)//gsm;
$boardindex_template =~ s/(\{|<)yabb selecthtml(}|>)//gsm;
$boardindex_template =~ s/(\{|<)yabb new_load(}|>)//gsm;
$boardindex_template =~
s/(\{|<)yabb subboardlist(}|>)//gsm;
$boardindex_template =~
s/(\{|<)yabb messagedropdown(}|>)//gsm;
## Mod Hook BoardIndex ##
## End Mod Hook BoardIndex ##
$boardindex_template =~
s/img src\=\"$x[1]\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm;
$boardindex_template =~ s/^\s+//gsm;
$boardindex_template =~ s/\s+$//gsm;
$imagesdir = $tmpimagesdir;
return $boardindex_template;
}
sub MessageTempl {
my @x = @_;
LoadLanguage('MessageIndex');
my $tmpimagesdir = $imagesdir;
$imagesdir = "$x[1]";
require "$templatesdir/$x[0]/MessageIndex.template";
my $tempcatnm = $templ_txt{'72'};
my $tempboardnm = $templ_txt{'73'};
my $tempmodslink =
qq~($messageindex_txt{'298'}: $templ_txt{'74'} - $messageindex_txt{'298a'}: $templ_txt{'74a'})~;
my $tempbdescrip = $templ_txt{'79'};
my $temppageindextgl = qq~
~;
my $temppageindex =
qq~ $messageindex_txt{'139'}: 1~;
my $tempthreadpic = qq~
~;
my $tempmicon = qq~
~;
my $tempnew = qq~
~;
my $tempmsublink = $templ_txt{'83'};
my $tempmname = ${ $uid . $username }{'realname'};
my $templastpostlink =
qq~
$templ_txt{'82'}~;
my $templastposter = $tempmname;
my $tempyabbicons = qq~
$messageindex_txt{'457'}
$messageindex_txt{'454'} x $messageindex_txt{'454a'}
$messageindex_txt{'455'} x $messageindex_txt{'454a'}
$messageindex_txt{'456'}
$messageindex_txt{'845'}
~;
my $tempyabbadminicons .= qq~
$messageindex_txt{'458'}
$messageindex_txt{'459'}
$messageindex_txt{'460'}
$messageindex_txt{'461'}
$messageindex_txt{'779a'}
$messageindex_txt{'779b'}
$messageindex_txt{'779'}
$messageindex_txt{'780'}
~;
$bdpic = qq~
~;
$message_permalink = $messageindex_txt{'10'};
$temp_attachment =
qq~
~;
$messageindex_template =~ s/(\{|<)yabb home(}|>)/$mbname/gsm;
$messageindex_template =~ s/(\{|<)yabb category(}|>)/$tempcatnm/gsm;
$messageindex_template =~ s/(\{|<)yabb board(}|>)/$tempboardnm/gsm;
$messageindex_template =~ s/(\{|<)yabb moderators(}|>)/$tempmodslink/gsm;
$messageindex_template =~ s/(\{|<)yabb sortsubject(}|>)/$messageindex_txt{'70'}/gsm;
$messageindex_template =~ s/(\{|<)yabb sortstarter(}|>)/$messageindex_txt{'109'}/gsm;
$messageindex_template =~ s/(\{|<)yabb sortanswer(}|>)/$messageindex_txt{'110'}/gsm;
$messageindex_template =~ s/(\{|<)yabb sortlastpostim(}|>)/$messageindex_txt{'22'}/gsm;
$messageindex_template =~ s/(\{|<)yabb bdpicture(}|>)/$bdpic/gsm;
$messageindex_template =~ s/(\{|<)yabb threadcount(}|>)/1/gsm;
$messageindex_template =~ s/(\{|<)yabb messagecount(}|>)/2/gsm;
$boarddescription =~ s/(\{|<)yabb boarddescription(}|>)/$tempbdescrip/gsm;
$messageindex_template =~ s/(\{|<)yabb description(}|>)/$boarddescription/gsm;
$messageindex_template =~ s/(\{|<)yabb colspan(}|>)/7/gsm;
$messageindex_template =~
s/(\{|<)yabb pageindex top(}|>)/$temppageindex1/gsm;
$messageindex_template =~
s/(\{|<)yabb pageindex bottom(}|>)/$temppageindex1/gsm;
$messageindex_template =~ s/(\{|<)yabb new_load(}|>)//gsm;
require Sources::Menu;
$notify_board = SetImage('notify', $UseMenuType);
$markalllink = SetImage('markboardread', $UseMenuType);
$postlink = SetImage('newthread', $UseMenuType);
$polllink = SetImage('createpoll', $UseMenuType);
$menusep = q{ };
if ( $UseMenuType == 1 ) {
$menusep = q{ | };
}
$topichandellist = q~{yabb notify button}{yabb markall button}~;
if ( $useThreadtools == 1 ) {
$notify_board = SetImage('notify', 3);
($notify_board_img, $notify_board_txt ) = split /[|]/xsm, $notify_board;
$markall_board = SetImage('markboardread', 3);
($markall_board_img, $markall_board_txt ) = split /[|]/xsm, $markall_board;
$topichandellist = qq~
|
~;
}
$outside_threadtools = q~{yabb new post button}{yabb new poll button}~;
$outside_threadtools =~ s/{yabb new post button}/$menusep$postlink/gsm;
$outside_threadtools =~ s/{yabb new poll button}/$menusep$polllink/gsm;
$topichandellist =~ s/{yabb notify button}/$menusep$notify_board/gsm;
$topichandellist =~ s/{yabb markall button}/$menusep$markalllink/gsm;
$topichandellist = $outside_threadtools . $topichandellist;
$topichandellist =~ s/\Q$menusep//ism;
$messageindex_template =~
s/(\{|<)yabb topichandellist(}|>)/$topichandellist/gsm;
$messageindex_template =~
s/(\{|<)yabb topichandellist2(}|>)/$topichandellist/gsm;
$messageindex_template =~
s/class="post_tools center" style="width:10em"/class="right"/gsm;
$messageindex_template =~ s/(\{|<)yabb pageindex(}|>)/$temppageindex/gsm;
$messageindex_template =~
s/(\{|<)yabb pageindex toggle(}|>)/$temppageindextgl/gsm;
$messageindex_template =~ s/(\{|<)yabb admin column(}|>)//gsm;
$messageindex_template =~ s/(\{|<)yabb outsidethreadtools(}|>)//gsm;
$messageindex_template =~ s/(\{|<)yabb topicpreview(}|>)//gsm;
my $tempbar = $threadbar;
$tempbar =~ s/(\{|<)yabb admin column(}|>)//gsm;
$tempbar =~ s/(\{|<)yabb threadpic(}|>)/$tempthreadpic/gsm;
$tempbar =~ s/(\{|<)yabb icon(}|>)/$tempmicon/gsm;
$tempbar =~ s/(\{|<)yabb new(}|>)/$tempnew/gsm;
$tempbar =~ s/(\{|<)yabb poll(}|>)//gsm;
$tempbar =~ s/(\{|<)yabb favorite(}|>)//gsm;
$tempbar =~ s/(\{|<)yabb subjectlink(}|>)/$tempmsublink/gsm;
$tempbar =~ s/(\{|<)yabb pages(}|>)//gsm;
$tempbar =~ s/(\{|<)yabb attachmenticon(}|>)/$temp_attachment/gsm;
$tempbar =~ s/(\{|<)yabb starter(}|>)/$tempmname/gsm;
$tempbar =~ s/(\{|<)yabb starttime(}|>)/ timeformat($date)/egsm;
$tempbar =~ s/(\{|<)yabb replies(}|>)/2/gsm;
$tempbar =~ s/(\{|<)yabb views(}|>)/12/gsm;
$tempbar =~ s/(\{|<)yabb lastpostlink(}|>)/$templastpostlink/gsm;
$tempbar =~ s/(\{|<)yabb lastposter(}|>)/$templastposter/gsm;
if ( $accept_permalink == 1 ) {
$tempbar =~ s/(\{|<)yabb permalink(}|>)/$message_permalink/gsm;
}
else {
$tempbar =~ s/(\{|<)yabb permalink(}|>)//gsm;
}
$tmptempbar .= $tempbar;
$messageindex_template =~ s/(\{|<)yabb threadblock(}|>)/$tmptempbar/gsm;
$messageindex_template =~ s/(\{|<)yabb modupdate(}|>)//gsm;
$messageindex_template =~ s/(\{|<)yabb modupdateend(}|>)//gsm;
$messageindex_template =~ s/(\{|<)yabb stickyblock(}|>)//gsm;
$messageindex_template =~ s/(\{|<)yabb adminfooter(}|>)//gsm;
$messageindex_template =~ s/(\{|<)yabb icons(}|>)/$tempyabbicons/gsm;
$messageindex_template =~
s/(\{|<)yabb admin icons(}|>)/$tempyabbadminicons/gsm;
$messageindex_template =~ s/(\{|<)yabb access(}|>)//gsm;
$messageindex_template =~
s/img src\=\"$tmpimagesdir\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm;
$messageindex_template =~
s/img src\=\"$x[1]\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm;
$messageindex_template =~ s/^\s+//gsm;
$messageindex_template =~ s/\s+$//gsm;
$imagesdir = $tmpimagesdir;
return $messageindex_template;
}
sub DisplayTempl {
my @x = @_;
LoadLanguage('Display');
my $tmpimagesdir = $imagesdir;
$imagesdir = $x[1];
require "$templatesdir/$x[0]/Display.template";
(
$title, $stars, $starpic, $color, $noshow,
$viewperms, $topicperms, $replyperms, $pollperms, $attachperms
) = split /\|/xsm, $Group{'Administrator'};
my $template_home = qq~$mbname~;
my $tempcatnm = $templ_txt{'72'};
my $tempboardnm = $templ_txt{'73'};
my $tempmodslink =
qq~($display_txt{'298'}: $templ_txt{'74'} - $display_txt{'298a'}: $templ_txt{'74a'})~;
my $template_prev = $display_txt{'768'};
my $template_next = $display_txt{'767'};
my $temppageindextgl = qq~ ~;
my $temppageindex1 =
qq~ $display_txt{'139'}: 1~;
## Make Buttons ##
require Sources::Menu;
$replybutton = SetImage('reply', $UseMenuType);
$pollbutton = SetImage('addpoll', $UseMenuType);
$notify = SetImage('notify', $UseMenuType);
$favorite = SetImage('favorites', $UseMenuType);
$template_sendtopic = SetImage('sendtopic', $UseMenuType);
$template_print = SetImage('print', $UseMenuType);
$template_alertmod = SetImage('alertmod', $UseMenuType);
$template_quote = SetImage('quote', $UseMenuType);
$template_modify = SetImage('modify', $UseMenuType);
$template_split = SetImage('admin_split', $UseMenuType);
$template_delete = SetImage('delete', $UseMenuType);
$template_print_post = SetImage('printp', $UseMenuType);
$template_email = SetImage('email_sm', $UseMenuType);
$template_pm = SetImage('message_sm', $UseMenuType);
$template_remove = SetImage('admin_rem', $UseMenuType);
$template_splice = SetImage('admin_move_split_splice', $UseMenuType);
$template_lock = SetImage('admin_lock', $UseMenuType);
$template_hide = SetImage('hide', $UseMenuType);
$template_sticky = SetImage('admin_sticky', $UseMenuType);
$replybutton = qq~$menusep$replybutton~;
$pollbutton = qq~$menusep$pollbutton~;
$notify = qq~$menusep$notify~;
$favorite = qq~$menusep$favorite~;
$template_sendtopic = qq~$menusep$template_sendtopic~;
$template_print = qq~$menusep$template_print~;
$menusep = q{ };
if ( $UseMenuType == 1 ) {
$menusep = q{ | };
}
$outside_threadtools = q~{yabb reply}{yabb poll}~;
$threadhandellist = q~{yabb notify}{yabb favorite}{yabb sendtopic}{yabb print}{yabb markunread}~;
if ( $useThreadtools == 1 ) {
$notify = SetImage('notify', 3);
($notify_board_img, $notify_board_txt ) = split /[|]/xsm, $notify;
$favorite = SetImage('favorites', 3);
($fav_board_img, $fav_board_txt ) = split /[|]/xsm, $favorite;
$template_sendtopic = SetImage('sendtopic', 3);
($send_board_img, $send_board_txt ) = split /[|]/xsm, $template_sendtopic;
$template_print = SetImage('print', 3);
($print_board_img, $print_board_txt ) = split /[|]/xsm, $template_print;
$threadhandellist = qq~ |
|
~;
}
$outside_threadtools =~ s/{yabb reply}/$menusep$replybutton/gsm;
$outside_threadtools =~ s/{yabb poll}/$menusep$pollbutton/gsm;
my $template_threadimage = qq~ ~;
my $threadurl = $templ_txt{'75'};
$template_alertmod = qq~$menusep$template_alertmod~;
$template_quote = qq~$menusep$template_quote~;
$template_modify = qq~$menusep$template_modify~;
$template_split = qq~$menusep$template_split~;
$template_delete = qq~$menusep$template_delete~;
$template_print_post = qq~$menusep$template_print_post~;
my $memberinfo = qq~$title~;
my $usernamelink =
qq~${$uid.$username}{'realname'} ~;
for ( 1 .. 5 ) {
$star .= qq( );
}
my $msub = $templ_txt{'76'};
my $msgimg = qq~ ~;
my $messdate = timeformat($date);
my $template_postinfo =
qq~$display_txt{'21'}: ${$uid.$username}{'postcount'} ~;
my $template_usertext = qq~${$uid.$username}{'usertext'} ~;
my $px = 'px';
my $avatar =
qq~ ~;
my $message =
qq~$templ_txt{'65'} $templ_txt{'66'}~;
$template_email = qq~$menusep$template_email~;
$template_pm = qq~$menusep$template_pm~;
my $ipimg = qq~ ~;
$template_remove = qq~$menusep$template_remove~;
$template_splice = qq~$menusep$template_splice~;
$template_lock = qq~$menusep$template_lock~;
$template_hide = qq~$menusep$template_hide~;
$template_sticky = qq~$menusep$template_sticky~;
$online = qq~$maintxt{'60'}~;
for my $i ( 0 .. 1 ) {
my $outblock = $messageblock;
my $posthandelblock = $posthandellist;
my $contactblock = $contactlist;
if ( $i == 0 ) {
$css = q~windowbg~;
$counterwords = q{};
}
else {
$css = q~windowbg2~;
$counterwords = "$display_txt{'146'} #$i";
}
$posthandelblock =~ s/(\{|<)yabb modalert(}|>)/$template_alertmod/gsm;
$posthandelblock =~ s/(\{|<)yabb quote(}|>)/$template_quote/gsm;
$posthandelblock =~ s/(\{|<)yabb modify(}|>)/$template_modify/gsm;
$posthandelblock =~ s/(\{|<)yabb split(}|>)/$template_split/gsm;
$posthandelblock =~ s/(\{|<)yabb delete(}|>)/$template_delete/gsm;
$posthandelblock =~ s/(\{|<)yabb admin(}|>)/$template_admin/gsm;
$posthandelblock =~ s/(\{|<)yabb print_post(}|>)/$template_print_post/gsm;
$posthandelblock =~ s/\Q$menusep//ism;
$outside_posttools = qq~{yabb quote}{yabb markquote}~;
$posthandellist = qq~{yabb modalert}{yabb print_post}{yabb modify}{yabb split}{yabb delete}~;
if ( $usePosttools == 1 ) {
$template_alertmod = SetImage('alertmod', 3);
($template_alertmod_img, $template_alertmod_txt ) = split /[|]/xsm, $template_alertmod;
$template_modify = SetImage('modify', 3);
($template_modify_img, $template_modify_txt ) = split /[|]/xsm, $template_modify;
$template_split = SetImage('admin_split', 3);
($template_split_img, $template_split_txt ) = split /[|]/xsm, $template_split;
$template_delete = SetImage('delete', 3);
($template_delete_img, $template_delete_txt ) = split /[|]/xsm, $template_delete;
$template_print_post = SetImage('printp', 3);
($template_print_post_img, $template_print_post_txt ) = split /[|]/xsm, $template_print_post;
$posthandelblock = qq~ |
|
~;
}
$contactblock =~ s/(\{|<)yabb email(}|>)/$template_email/gsm;
$contactblock =~ s/(\{|<)yabb profile(}|>)//gsm;
$contactblock =~ s/(\{|<)yabb pm(}|>)/$template_pm/gsm;
$contactblock =~ s/(\{|<)yabb www(}|>)//gsm;
$contactblock =~ s/(\{|<)yabb gtalk(}|>)//gsm;
$contactblock =~ s/(\{|<)yabb skype(}|>)//gsm;
$contactblock =~ s/(\{|<)yabb myspace(}|>)//gsm;
$contactblock =~ s/(\{|<)yabb facebook(}|>)//gsm;
$contactblock =~ s/(\{|<)yabb X(}|>)//gsm;
$contactblock =~ s/(\{|<)yabb youtube(}|>)//gsm;
$contactblock =~ s/(\{|<)yabb addbuddy(}|>)//gsm;
$contactblock =~ s/\Q$menusep//ism;
$outblock =~ s/(\{|<)yabb images(}|>)/$tmpimagesdir/gsm;
$outblock =~ s/(\{|<)yabb messageoptions(}|>)//gsm;
$outblock =~ s/(\{|<)yabb memberinfo(}|>)/$memberinfo/gsm;
$outblock =~ s/(\{|<)yabb userlink(}|>)/$usernamelink/gsm;
$outblock =~ s/(\{|<)yabb stars(}|>)/$star/gsm;
$outblock =~ s/(\{|<)yabb subject(}|>)/$msub/gsm;
$outblock =~ s/(\{|<)yabb msgimg(}|>)/$msgimg/gsm;
$outblock =~ s/(\{|<)yabb msgdate(}|>)/$messdate/gsm;
$outblock =~ s/(\{|<)yabb replycount(}|>)/$counterwords/gsm;
$outblock =~ s/(\{|<)yabb count(}|>)//gsm;
$outblock =~ s/(\{|<)yabb att(}|>)//gsm;
$outblock =~ s/(\{|<)yabb css(}|>)/$css/gsm;
$outblock =~ s/(\{|<)yabb gender(}|>)//gsm;
$outblock =~ s/(\{|<)yabb age(}|>)//gsm;
$outblock =~ s/(\{|<)yabb regdate(}|>)//gsm;
$outblock =~ s/(\{|<)yabb ext_prof(}|>)/$template_ext_prof/gsm;
$outblock =~ s/(\{|<)yabb location(}|>)//gsm;
$outblock =~ s/(\{|<)yabb isbuddy(}|>)//gsm;
$outblock =~ s/(\{|<)yabb useronline(}|>)/$online/gsm;
$outblock =~ s/(\{|<)yabb postinfo(}|>)/$template_postinfo/gsm;
$outblock =~ s/(\{|<)yabb usertext(}|>)/$template_usertext/gsm;
$outblock =~ s/(\{|<)yabb userpic(}|>)/$avatar/gsm;
$outblock =~ s/(\{|<)yabb message(}|>)/$message/gsm;
$outblock =~ s/(\{|<)yabb showatt(}|>)//gsm;
$outblock =~ s/(\{|<)yabb showatthr(}|>)//gsm;
$outblock =~ s/(\{|<)yabb modified(}|>)//gsm;
$outblock =~ s/(\{|<)yabb signature(}|>)//gsm;
$outblock =~ s/(\{|<)yabb signaturehr(}|>)//gsm;
$outblock =~ s/(\{|<)yabb ipimg(}|>)/$ipimg/gsm;
$outblock =~ s/(\{|<)yabb ip(}|>)//gsm;
$outblock =~ s/(\{|<)yabb permalink(}|>)//gsm;
$outblock =~ s/(\{|<)yabb posthandellist(}|>)/$posthandelblock/gsm;
$outblock =~ s/(\{|<)yabb outsideposttools(}|>)//gsm;
$outblock =~ s/(\{|<)yabb admin(}|>)//gsm;
$outblock =~ s/(\{|<)yabb contactlist(}|>)/$contactblock/gsm;
## Mod Hook Outblock ##
## End Mod Hook Outblock ##
$tempoutblock .= $outblock;
}
$threadhandellist = $outside_threadtools . $threadhandellist;
$threadhandellist =~ s/(\{|<)yabb notify(}|>)/$notify/gsm;
$threadhandellist =~ s/(\{|<)yabb favorite(}|>)/$favorite/gsm;
$threadhandellist =~ s/(\{|<)yabb sendtopic(}|>)/$template_sendtopic/gsm;
$threadhandellist =~ s/(\{|<)yabb print(}|>)/$template_print/gsm;
$threadhandellist =~ s/(\{|<)yabb markunread(}|>)//gsm;
$threadhandellist =~ s/ | / | /gsm;
$threadhandellist =~ s/ | / | /gsm;
$threadhandellist =~ s/\Q$menusep//ism;
$adminhandellist =~ s/(\{|<)yabb remove(}|>)/$template_remove/gsm;
$adminhandellist =~ s/(\{|<)yabb splice(}|>)/$template_splice/gsm;
$adminhandellist =~ s/(\{|<)yabb lock(}|>)/$template_lock/gsm;
$adminhandellist =~ s/(\{|<)yabb hide(}|>)/$template_hide/gsm;
$adminhandellist =~ s/(\{|<)yabb sticky(}|>)/$template_sticky/gsm;
$adminhandellist =~ s/(\{|<)yabb multidelete(}|>)/$template_multidelete/gsm;
$adminhandellist =~ s/\Q$menusep//ism;
$display_template =~ s/(\{|<)yabb pollmain(}|>)//gsm;
$display_template =~ s/(\{|<)yabb topicviewers(}|>)//gsm;
$display_template =~ s/(\{|<)yabb home(}|>)/$template_home/gsm;
$display_template =~ s/(\{|<)yabb category(}|>)/$tempcatnm/gsm;
$display_template =~ s/(\{|<)yabb board(}|>)/$tempboardnm/gsm;
$display_template =~ s/(\{|<)yabb moderators(}|>)/$tempmodslink/gsm;
$display_template =~ s/(\{|<)yabb prev(}|>)/$template_prev/gsm;
$display_template =~ s/(\{|<)yabb next(}|>)/$template_next/gsm;
$display_template =~
s/(\{|<)yabb pageindex toggle(}|>)/$temppageindextgl/gsm;
$display_template =~ s/(\{|<)yabb pageindex top(}|>)/$temppageindex1/gsm;
$display_template =~ s/(\{|<)yabb pageindex bottom(}|>)/$temppageindex1/gsm;
$display_template =~ s/(\{|<)yabb bookmarks(}|>)//gsm; # Social Bookmarks
$display_template =~
s/(\{|<)yabb threadhandellist(}|>)/$threadhandellist/gsm;
$display_template =~
s/(\{|<)yabb threadhandellist2(}|>)/$threadhandellist/gsm;
$display_template =~ s/(\{|<)yabb outsidethreadtools(}|>)//gsm;
$display_template =~ s/(\{|<)yabb threadimage(}|>)/$template_threadimage/gsm;
$display_template =~ s/(\{|<)yabb threadurl(}|>)/$threadurl/gsm;
$display_template =~ s/(\{|<)yabb views(}|>)/12/gsm;
$display_template =~ s/(\{|<)yabb multistart(}|>)//gsm;
$display_template =~ s/(\{|<)yabb multiend(}|>)//gsm;
$display_template =~ s/(\{|<)yabb postsblock(}|>)/$tempoutblock/gsm;
$display_template =~ s/(\{|<)yabb adminhandellist(}|>)/$adminhandellist/gsm;
$display_template =~ s/(\{|<)yabb forumselect(}|>)//gsm;
$display_template =~ s/(\{|<)yabb guestview(}|>)//gsm;
$display_template =~ s/(\{|<)yabb reason(}|>)//gsm;
$display_template =~ s/ | / | /gsm;
$display_template =~ s/ | / | /gsm;
$display_template =~ s/class="post_tools center" style="width:100px"/class="right"/gsm;
$display_template =~ s/class="post_tools center" style="width:10em"/class="right"/gsm;
$display_template =~ s/class="windowbg2 vtop" style="height:10em" colspan="3"/class="windowbg2 vtop" colspan="4" style="height:10em"/gsm;
$display_template =~ s/class="windowbg vtop" style="height:10em" colspan="3"/class="windowbg vtop" colspan="4" style="height:10em"/gsm;
$display_template =~ s/class="windowbg2 bottom" style="height:12px" colspan="3"/class="windowbg2 bottom" colspan="4" style="height:12px"/gsm;
$display_template =~ s/class="windowbg bottom" style="height:12px" colspan="3"/class="windowbg bottom" colspan="4" style="height:12px"/gsm;
$display_template =~ s/class="windowbg2 bottom" colspan="3"/class="windowbg2 bottom" colspan="4"/gsm;
$display_template =~ s/class="windowbg bottom" colspan="3"/class="windowbg bottom" colspan="4"/gsm;
$display_template =~ s/class="windowbg2 bottom dividertop" colspan="3"/class="windowbg2 bottom dividertop" colspan="4"/gsm;
$display_template =~ s/class="windowbg bottom dividertop" colspan="3"/class="windowbg bottom dividertop" colspan="4"/gsm;
$display_template =~
s/img src\=\"$tmpimagesdir\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm;
$display_template =~
s/img src\=\"$x[1]\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm;
$display_template =~ s/^\s+//gsm;
$display_template =~ s/\s+$//gsm;
$imagesdir = $tmpimagesdir;
return $display_template;
}
sub MyCenterTempl {
my @x = @_;
LoadLanguage('InstantMessage');
LoadLanguage('MyCenter');
my $tmpimagesdir = $imagesdir;
$imagesdir = $x[1];
require "$templatesdir/$x[0]/MyCenter.template";
$tabsep = q{};
$tabfill = qq~ ~;
if ( $PM_level == 1
|| ( $PM_level == 2 && ( $iamadmin || $iamgmod || $iammod ) )
|| ( $PM_level == 3 && ( $iamadmin || $iamgmod ) ) )
{
$yymcmenu .=
qq~$tabsep$tabfill$mc_menus{'messages'}$tabfill
~;
}
$yymcmenu .=
qq~$tabsep$tabfill$mc_menus{'profile'}$tabfill~;
$yymcmenu .=
qq~$tabsep$tabfill$mc_menus{'posts'}$tabfill~;
$yymcmenu .= qq~$tabsep~;
$mycenter_template =~ s/{yabb mcviewmenu}/$MCViewMenu/gsm;
$mycenter_template =~ s/{yabb mcmenu}/$yymcmenu/gsm;
$mycenter_template =~ s/{yabb mcpmmenu}/$MCPmMenu/gsm;
$mycenter_template =~ s/{yabb mcprofmenu}/$MCProfMenu/gsm;
$mycenter_template =~ s/{yabb mcpostsmenu}/$MCPostsMenu/gsm;
$mycenter_template =~ s/{yabb mcglobformstart}/$MCGlobalFormStart/gsm;
$mycenter_template =~
s/{yabb mcglobformend}/ ($MCGlobalFormStart ? "<\/form>" : q{}) /esm;
$mycenter_template =~ s/{yabb mccontent}/$MCContent/gsm;
$mycenter_template =~ s/{yabb mctitle}/$mctitle/gsm;
$mycenter_template =~ s/{yabb selecthtml}/$selecthtml/gsm;
$mycenter_template =~
s/img src\=\"$tmpimagesdir\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm;
$mycenter_template =~
s/img src\=\"$x[1]\/(.+?)\"/TmpImgLoc($1, $x[1], $x[2])/eisgm;
$mycenter_template =~ s/^\s+//gsm;
$mycenter_template =~ s/\s+$//gsm;
$imagesdir = $tmpimagesdir;
return $mycenter_template;
}
sub UpdateTemplates {
my ( $tempelement, $tempjob ) = @_;
if ( $tempjob eq 'save' ) {
$templateset{"$tempelement"} = "$template_css";
$templateset{"$tempelement"} .= "|$template_images";
$templateset{"$tempelement"} .= "|$template_head";
$templateset{"$tempelement"} .= "|$template_board";
$templateset{"$tempelement"} .= "|$template_message";
$templateset{"$tempelement"} .= "|$template_display";
$templateset{"$tempelement"} .= "|$template_mycenter";
$templateset{"$tempelement"} .= "|$template_menutype";
$templateset{"$tempelement"} .= "|$template_threadtools";
$templateset{"$tempelement"} .= "|$template_posttools";
}
elsif ( $tempjob eq 'delete' ) {
delete $templateset{$tempelement};
}
require Admin::NewSettings;
SaveSettingsTo('Settings.pm');
return;
}
sub ModifyStyle {
is_admin_or_gmod();
my ( $fullcss, $line, $csstype );
$admincs = 0;
if ( $FORM{'cssfile'} ) {
$cssfile = $FORM{'cssfile'};
$csstype = qq~$htmldir/Templates/Forum/$cssfile~;
}
elsif ( $FORM{'admcssfile'} ) {
$cssfile = $FORM{'admcssfile'};
$csstype = qq~$htmldir/Templates/Admin/$cssfile~;
$admincs = 1;
}
else { $cssfile = 'default.css';
$csstype = qq~$htmldir/Templates/Forum/$cssfile~;
}
opendir TMPLDIR, "$htmldir/Templates/Forum";
@styles = readdir TMPLDIR;
closedir TMPLDIR;
$forumcss = qq~\n~;
foreach my $file ( sort @styles ) {
if ( $file ne 'calscroller.css' && $file ne 'setup.css' ) {
( $name, $ext, $bak ) = split /\./xsm, $file;
$selected = q{};
if ( !$bak && $ext eq 'css' ) {
if ( $file eq $cssfile && !$admincs ) {
$selected = q~ selected="selected"~;
}
$forumcss .= qq~\n~;
}
}
}
opendir TMPLDIR, "$htmldir/Templates/Admin";
@astyles = readdir TMPLDIR;
closedir TMPLDIR;
$admincss = qq~\n~;
foreach my $file ( sort @astyles ) {
( $name, $ext, $bak ) = split /\./xsm, $file;
$selected = q{};
if ( !$bak && $ext eq 'css' ) {
if ( $file eq $cssfile && $admincs ) {
$selected = q~ selected="selected"~;
}
$admincss .= qq~\n~;
}
}
fopen( CSS, "$csstype" ) or fatal_error( 'cannot_open', "$csstype" );
while ( $line = ) {
$line =~ s/[\r\n]//gxsm;
$line =~ s/ / /gsm;
$line =~ s/&/&/gsm;
FromHTML($line);
$fullcss .= qq~$line\n~;
}
fclose(CSS);
$yymain .= qq~
~;
$yytitle = $templ_txt{'1'};
$action_area = 'modcss';
AdminTemplate();
return;
}
sub ModifyStyle2 {
is_admin_or_gmod();
$FORM{'css'} =~ tr/\r//d;
$FORM{'css'} =~ s/\A\n//xsm;
$FORM{'css'} =~ s/\n\Z//xsm;
if ( $FORM{'filename'} ) { $cssfile = $FORM{'filename'}; }
else { $cssfile = 'default.css'; }
if ( $FORM{'type'} ) {
fopen( CSS, ">$htmldir/Templates/Admin/$cssfile" )
|| fatal_error( 'cannot_open', "$htmldir/Templates/Admin/$cssfile", 1 );
}
else {
fopen( CSS, ">$htmldir/Templates/Forum/$cssfile" )
|| fatal_error( 'cannot_open', "$htmldir/Templates/Forum/$cssfile", 1 );
}
print {CSS} "$FORM{'css'}\n" or croak "$croak{'print'} CSS";
fclose(CSS);
$yySetLocation = qq~$adminurl?action=modcss;cssfile=$cssfile~;
redirectexit();
return;
}
sub ModifyCSS {
is_admin_or_gmod();
if ( $INFO{'templateset'} ) { $thistemplate = $INFO{'templateset'}; }
else { $thistemplate = "$template"; }
while ( ( $curtemplate, $value ) = each %templateset ) {
if ( $curtemplate eq $thistemplate ) { $akttemplate = $curtemplate; }
}
( $aktstyle, $aktimages, $akthead, $aktboard, $aktmessage, $aktdisplay, $aktmenutype, $aktthreadtools, $aktposttools ) =
split /\|/xsm, $templateset{$akttemplate};
my ( $fullcss, $line );
if ( $INFO{'cssfile'} ) { $cssfile = $INFO{'cssfile'}; }
else { $cssfile = "$aktstyle.css"; }
$tempimages = qq~$yyhtml_root/Templates/Forum/$aktimages~;
my $istabbed = 0;
$cssbuttons = 0;
$stylestr = q{};
opendir TMPLDIR, "$htmldir/Templates/Forum";
@styles = readdir TMPLDIR;
closedir TMPLDIR;
$forumcss = q{};
$imgdirs = q{};
foreach my $file ( sort @styles ) {
if ( $file ne 'calscroller.css' && $file ne 'setup.css' ) {
( $name, $ext ) = split /\./xsm, $file;
$selected = q{};
if ( $ext eq 'css' ) {
if ( $file eq $cssfile ) {
$selected = q~ selected="selected"~;
$viewcss = $name;
}
$forumcss .= qq~\n~;
}
}
}
fopen( CSS, "$htmldir/Templates/Forum/$cssfile" )
or fatal_error( 'cannot_open', "$htmldir/Templates/Forum/$cssfile" );
@thecss = ;
fclose(CSS);
foreach my $style_sgl (@thecss) {
$style_sgl =~ s/[\n\r]//gxsm;
$style_sgl =~ s/\A\s*//xsm;
$style_sgl =~ s/\s*\Z//xsm;
$style_sgl =~ s/\t//gsm;
$style_sgl =~ s/^\s+//gsm;
$style_sgl =~ s/\s+$//gsm;
$style_sgl =~ s/\.\/default/$yyhtml_root\/Templates\/Forum\/default/gsm;
$style_sgl =~ s/\.\/$viewcss/$yyhtml_root\/Templates\/Forum\/$viewcss/gsm;
$style_sgl =~ s/\.\.\/\.\.\/Buttons/$yyhtml_root\/Buttons/gsm;
$stylestr .= qq~$style_sgl ~;
}
$stylestr =~ s/\s{2,}/ /gsm;
my (
$selstyl, $postsstyle, $seperatorstyle,
$bodycontainerstyle, $bodystyle, $containerstyle,
$titlestyle, $titlestyle_a, $categorystyle,
$categorystyle_a, $window1style, $window2style,
$inputstyle, $textareastyle, $selectstyle,
$quotestyle, $codestyle, $editbgstyle,
$highlightstyle, $gen_fontsize, $userinfostyle
);
$gen_fontsize =
q~ ~;
$gen_fontface =
q~ ~;
$gen_borderweigth =
q~ ~;
$gen_borderstyle =
qq~ ~;
if ( $stylestr =~ /body/sm ) {
$bodystyle = $stylestr;
$bodystyle =~ s/.*?(body\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /\#container/sm ) {
$containerstyle = $stylestr;
$containerstyle =~ s/.*?(\#container.*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /\#header/sm ) {
$headerstyle = $stylestr;
$headerstyle =~ s/.*?(\#header.*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /\#header a/sm ) {
$headerastyle = $stylestr;
$headerastyle =~ s/.*?(\#header a.*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /\.tabmenu/sm ) {
$istabbed = 1;
$tabmenustyle = $stylestr;
$tabmenustyle =~ s/.*?(\.tabmenu\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /\.tabtitle/sm && $istabbed ) {
$tabtitlestyle = $stylestr;
$tabtitlestyle =~ s/.*?(\.tabtitle\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
if ( $stylestr =~ /\.tabtitle a, .tabtitle-bottom a/ ) {
$tabtitlestyle_a = $stylestr;
$tabtitlestyle_a =~ s/.*?(\.tabtitle a, \.tabtitle-bottom a\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
}
if ( $stylestr =~ /\.buttonleft/sm && $stylestr =~ /\.buttonright/sm && $stylestr =~ /\.buttonimage/sm && $stylestr =~ /\.buttontext/sm ) {
$cssbuttons = 1;
$buttonstyle = $stylestr;
$buttonstyle =~ s/.*?(\.buttontext\s*?\{.+?\}).*/$1/igsm;
$selstyl .= qq~\n~;
$prevtext = $buttonstyle;
$prevtext =~ s/\.buttontext\s*?\{(.+?)\}/$1/igsm;
$drawtxtpos = $prevtext;
$drawtxtpos =~ m/.*?top\s*?\:\s*?(\d{1,2})px.*/ism;
$viewtxty = $1;
$viewtxty .= 'px';
$drawpos4 = ($1 * 5) + 213;
$drawpos4 .= 'px';
$buttonleftstyle = $stylestr;
$buttonleftstyle =~ s/.*?(\.buttonleft\s*?\{.+?\}).*/$1/igsm;
$buttonleftbg = qq~\n~;
$buttonbg = $buttonleftstyle;
$buttonbg =~ s~.*?($yyhtml_root/Buttons/)(.*?)\.(.*)~$2~gsm;
$prevleft = $buttonleftstyle;
$prevleft =~ s/\.buttonleft\s*?\{(.+?)\}/$1/igsm;
$buttonrightstyle = $stylestr;
$buttonrightstyle =~ s/.*?(\.buttonright\s*?\{.+?\}).*/$1/igsm;
$buttonrightbg = qq~\n~;
$prevright = $buttonrightstyle;
$prevright =~ s/\.buttonright\s*?\{(.+?)\}/$1/igsm;
$buttonimagestyle = $stylestr;
$buttonimagestyle =~ s/.*?(\.buttonimage\s*?\{.+?\}).*/$1/igsm;
$buttonimagebg = qq~\n~;
$previmage = $buttonimagestyle;
$previmage =~ s/\.buttonimage\s*?\{(.+?)\}/$1/igsm;
$drawimgpos = $previmage;
$drawimgpos =~ m/.*?background\-position\s*?\:\s*?(\d{1,2})px\s*?(\d{1,2})px.*/ism;
$viewimgy = $2;
$viewimgy .= 'px';
$drawpos1 = ($2 * 5) + 213;
$drawpos1 .= 'px';
$viewimgx = $1;
$viewimgx .= 'px';
$drawpos2 = $1 + 213;
$drawpos2 .= 'px';
$drawimgwd = $previmage;
$drawimgwd =~ m/.*?padding\s*?\:\s*?\d{1,2}px\s*?\d{1,2}px\s*?\d{1,2}px\s*?(\d{1,2})px.*/ism;
$viewimgpad = $1;
$viewimgpad .= 'px';
$drawpos3 = $1 + 213;
$drawpos3 .= 'px';
}
if ( $stylestr =~ /\.seperator/sm ) {
$seperatorstyle = $stylestr;
$seperatorstyle =~ s/.*?(\.seperator\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /\.bordercolor/sm ) {
$bordercolorstyle = $stylestr;
$bordercolorstyle =~ s/.*?(\.bordercolor\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /\.hr/sm ) {
$hrstyle = $stylestr;
$hrstyle =~ s/.*?(\.hr\s*?\{.+?\}).*/$1/igsm;
$selstyl .= qq~ \n~;
}
if ( $stylestr =~ /\.titlebg/sm ) {
$titlestyle = $stylestr;
$titlestyle =~ s/.*?(\.titlebg\s*?\{.+?\}).*/$1/igsm;
$titlestyle = $titlestyle;
$selstyl .= qq~ \n~;
if ( $stylestr =~ /\.titlebg a/sm ) {
$titlestyle_a = $stylestr;
$titlestyle_a =~ s/.*?(\.titlebg a\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
}
if ( $stylestr =~ /\.catbg/sm ) {
$categorystyle = $stylestr;
$categorystyle =~ s/.*?(\.catbg\s*?\{.+?\}).*/$1/igsm;
$categorystyle = $categorystyle;
$selstyl .=
qq~ \n~;
if ( $stylestr =~ /\.catbg a/sm ) {
$categorystyle_a = $stylestr;
$categorystyle_a =~ s/.*?(\.catbg a\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
}
if ( $stylestr =~ /\.windowbg/sm ) {
$window1style = $stylestr;
$window1style =~ s/.*?(\.windowbg\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /\.windowbg2/sm ) {
$window2style = $stylestr;
$window2style =~ s/.*?(\.windowbg2.*?\{.+?\}).*/$1/igsm;
$windowcol2 = $window2style;
$windowcol2 =~ s/.*?(\#[a-f0-9]{3,6}).*/$1/ism;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /\.post-userinfo/sm ) {
$userinfostyle = $stylestr;
$userinfostyle =~ s/.*?(\.post-userinfo.*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /\.message/sm ) {
$postsstyle = $stylestr;
$postsstyle =~ s/.*?(\.message\s*?\{.+?\}).*/$1/igsm;
$selstyl .= qq~ \n~;
if ( $stylestr =~ /\.message a/sm ) {
$postsstyle_a = $stylestr;
$postsstyle_a =~ s/.*?(\.message a\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
}
if ( $stylestr =~ /input/sm ) {
$inputstyle = $stylestr;
$inputstyle =~ s/.*?(input\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /button/sm ) {
$buttonstyle = $stylestr;
$buttonstyle =~ s/.*?(button\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /textarea/sm ) {
$textareastyle = $stylestr;
$textareastyle =~ s/.*?(textarea\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /select/sm ) {
$selectstyle = $stylestr;
$selectstyle =~ s/.*?(select\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
}
if ( $stylestr =~ /.quote/sm ) {
$quotestyle = $stylestr;
$quotestyle =~ s/.*?(\.quote\s*?\{.+?\}).*/$1/igsm;
$selstyl .= qq~ \n~;
$message = qq~\[quote\]$templ_txt{'53'}\[/quote\]~;
if ($enable_ubbc) {
enable_yabbc();
DoUBBC();
}
$aquote = $message;
}
if ( $stylestr =~ /.code/sm ) {
$codestyle = $stylestr;
$codestyle =~ s/.*?(\.code\s*?\{.+?\}).*/$1/igsm;
$selstyl .= qq~ \n~;
$message = qq~\[code\]$templ_txt{'54'}\[/code\]~;
if ($enable_ubbc) {
enable_yabbc();
DoUBBC();
}
$acode = $message;
}
if ( $stylestr =~ /.editbg/sm ) {
$editbgstyle = $stylestr;
$editbgstyle =~ s/.*?(\.editbg\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
$message = qq~\[edit\]$templ_txt{'55'}\[/edit\]~;
if ($enable_ubbc) {
enable_yabbc();
DoUBBC();
}
$aedit = $message;
}
if ( $stylestr =~ /.highlight/sm ) {
$highlightstyle = $stylestr;
$highlightstyle =~ s/.*?(\.highlight\s*?\{.+?\}).*/$1/igsm;
$selstyl .=
qq~ \n~;
$message = qq~\[highlight\]$templ_txt{'56'}\[/highlight\]~;
if ($enable_ubbc) {
enable_yabbc();
DoUBBC();
}
$ahighlight = $message;
}
if ( $stylestr =~ /\.bodycontainer/sm ) {
$bodycontainerstyle = 1;
}
$yymain .= qq~
~;
$yytitle = $templ_txt{'1'};
$action_area = 'modcss';
AdminTemplate();
return;
}
sub ModifyCSS2 {
is_admin_or_gmod();
if ( $FORM{'button'} == 1 ) {
$yySetLocation = qq~$adminurl?action=modcss;cssfile=$FORM{'cssfile'}~;
redirectexit();
}
elsif ( $FORM{'button'} == 2 ) {
$style_name = $FORM{'savecssas'};
if ( $style_name eq 'default' ) {
fatal_error('no_delete_default');
}
if ( $style_name !~ m{\A[0-9a-zA-Z_\.\#\%\-\:\+\?\$\&\~\.\,\@/]+\Z}sm
|| $style_name eq q{} )
{
fatal_error('invalid_template');
}
$style_cnt = $FORM{'stylelink'};
FromHTML($style_cnt);
$style_cnt =~ s/(\*\/)/$1\n\n/gsm;
$style_cnt =~ s/(\/\*)/\n$1/gsm;
$style_cnt =~ s/(\{)/$1\n/gsm;
$style_cnt =~ s/(\})/$1\n/gsm;
$style_cnt =~ s/(\;)/$1\n/gsm;
@style_arr = split /\n/xsm, $style_cnt;
fopen( TMPCSS, ">$htmldir/Templates/Forum/$style_name.css" )
|| fatal_error( 'cannot_open',
"$htmldir/Templates/Forum/$style_name.css", 1 );
foreach my $style_sgl (@style_arr) {
$style_sgl =~ s/\A\s+?//gxsm;
if ( $style_sgl =~ m{\;+\Z}sm ) { $style_sgl = qq~\t$style_sgl~; }
$style_sgl =~ s/$yyhtml_root\/Templates\/Forum/\./gsm;
$style_sgl =~ s/$yyhtml_root/\.\.\/\.\./gsm;
print {TMPCSS} "$style_sgl\n" or croak "$croak{'print'} TMPCSS";
}
fclose(TMPCSS);
$yySetLocation = qq~$adminurl?action=modcss;cssfile=$style_name.css~;
redirectexit();
}
elsif ( $FORM{'button'} == 3 ) {
$style_name = $FORM{'cssfile'};
if ( $style_name eq 'default.css' ) {
fatal_error('no_delete_default');
}
unlink "$htmldir/Templates/Forum/$style_name";
$yySetLocation = qq~$adminurl?action=modcss;cssfile=default.css~;
redirectexit();
}
return;
}
1;
|