| ############################################################################### |
| ############################################################################### |
| # UserSelect.pl # |
| # UserSelect.pm # |
| |
| # $Date: 01.05.16 $ # |
| ############################################################################### |
| ############################################################################### |
| # YaBB: Yet another Bulletin Board # |
| # YaBB: Yet another Bulletin Board # |
| # Open-Source Community Software for Webmasters # |
| # Open-Source Community Software for Webmasters # |
| # Version: YaBB 2.5.2 # |
| # Version: YaBB 2.6.12 # |
| # Packaged: October 21, 2012 # |
| # Packaged: January 5, 2016 # |
| # Distributed by: http://www.yabbforum.com # |
| # Distributed by: http://www.yabbforum.com # |
| # =========================================================================== # |
| # =========================================================================== # |
| # Copyright (c) 2000-2012 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Copyright (c) 2000-2016 YaBB (www.yabbforum.com) - All Rights Reserved. # |
| # Software by: The YaBB Development Team # |
| # Software by: The YaBB Development Team # |
| # with assistance from the YaBB community. # |
| # with assistance from the YaBB community. # |
| ############################################################################### |
| ############################################################################### |
| |
| our $VERSION = '2.6.12'; |
| |
| |
| $userselectplver = 'YaBB 2.5.2 $Revision: 1.1 $'; |
| $userselectpmver = 'YaBB 2.6.12 $Revision: 1710 $'; |
| if ($action eq 'detailedversion') { return 1; } |
| if ( $action eq 'detailedversion' ) { return 1; } |
| |
| |
| if ($iamguest && $INFO{'toid'} ne "userspec" && $action ne "checkavail") { &fatal_error("members_only"); } |
| if ( $iamguest && $INFO{'toid'} ne 'userspec' && $action ne 'checkavail' ) { |
| &LoadLanguage('UserSelect'); |
| fatal_error('members_only'); |
| |
| } |
| |
| LoadLanguage('UserSelect'); |
| |
| get_template('Memberlist'); |
| |
| |
| $MembersPerPage = 10; |
| $MembersPerPage = 10; |
| |
| |
| sub FindMem { |
| sub FindMem { |
| if (-e "$memberdir/$username.usctmp") { unlink("$memberdir/$username.usctmp"); } |
| if ( -e "$memberdir/$username.usctmp" ) { |
| |
| unlink "$memberdir/$username.usctmp"; |
| $SearchStr = $FORM{'member'}; |
| } |
| |
| |
| |
| $SearchStr = $FORM{'member'}; |
| |
| |
| |
| if ( $SearchStr eq q{} || $SearchStr eq q{*} ) { |
| |
| $INFO{'sort'} = 'username'; |
| |
| $INFO{'start'} = 0; |
| |
| } |
| |
| elsif ( $SearchStr =~ /\*/xsm ) { |
| |
| $SearchStr =~ s/\*+/\*/gxsm; |
| |
| if ( $SearchStr =~ /\*\$/xsm ) { |
| |
| $SearchStr = substr $SearchStr, 0, length($SearchStr) - 1; |
| |
| $LookFor = qq~\^$SearchStr~; |
| |
| } |
| |
| elsif ( $SearchStr =~ /^\*/xsm ) { |
| |
| $SearchStr = substr $SearchStr, 1; |
| |
| $LookFor = qq~$SearchStr\$~; |
| |
| } |
| |
| else { |
| |
| ( $before, $after ) = split /\*/xsm, $SearchStr; |
| |
| $LookFor = qq~\^($before).*?($after)\$~; |
| |
| } |
| |
| } |
| |
| else { |
| |
| $LookFor = qq~\^$SearchStr\$~; |
| |
| } |
| |
| |
| if ($SearchStr eq "" || $SearchStr eq "*") { |
| MemberList(); |
| $INFO{'sort'} = "username"; |
| return; |
| $INFO{'start'} = 0; |
| |
| } elsif($SearchStr =~ /\*/) { |
| |
| $SearchStr =~ s/\*+/\*/g; |
| |
| if($SearchStr =~ /\*\$/) { |
| |
| $SearchStr = substr($SearchStr,0,length($SearchStr)-1); |
| |
| $LookFor = qq~\^$SearchStr~; |
| |
| } elsif($SearchStr =~ /^\*/) { |
| |
| $SearchStr = substr($SearchStr,1); |
| |
| $LookFor = qq~$SearchStr\$~; |
| |
| } else { |
| |
| ($before, $after) = split(/\*/,$SearchStr); |
| |
| $LookFor = qq~\^($before).*?($after)\$~; |
| |
| } |
| |
| } else { |
| |
| $LookFor = qq~\^$SearchStr\$~; |
| |
| } |
| |
| |
| |
| &MemberList; |
| |
| } |
| } |
| |
| |
| sub MemberList { |
| sub MemberList { |
| if ($iamguest && $INFO{'toid'} ne "userspec") { &fatal_error("members_only"); } |
| if ( $iamguest && $INFO{'toid'} ne 'userspec' ) { |
| |
| fatal_error('members_only'); |
| if (-e "$memberdir/$username.usctmp" && $INFO{'sort'} ne "pmsearch") { unlink("$memberdir/$username.usctmp"); } |
| } |
| |
| if ( -e "$memberdir/$username.usctmp" && $INFO{'sort'} ne 'pmsearch' ) { |
| if ($INFO{'start'} eq '') { $start = 0; } |
| unlink "$memberdir/$username.usctmp"; |
| else { $start = $INFO{'start'}; } |
| } |
| |
| |
| $to_id = $INFO{'toid'}; |
| if ( $INFO{'start'} eq q{} ) { $start = 0; } |
| $radiobuttons = ''; |
| else { $start = $INFO{'start'}; } |
| my($tosel, $ccsel, $bccsel); |
| |
| if ($to_id =~ /toshow/) { |
| $to_id = $INFO{'toid'}; |
| $page_title = qq~$usersel_txt{'pmpagetitle'}~; |
| $radiobuttons = q{}; |
| $instruct_start = qq~$usersel_txt{'instruct'}~; |
| my ( $tosel, $ccsel, $bccsel ); |
| $instruct_end = qq~$usersel_txt{'reciepientlist'}~; |
| if ( $to_id =~ /toshow/sm ) { |
| |
| $page_title = qq~$usersel_txt{'pmpagetitle'}~; |
| if ($to_id eq 'toshowcc') { $ccsel = qq~ checked="checked"~; } |
| $instruct_start = qq~$usersel_txt{'instruct'}~; |
| elsif ($to_id eq 'toshowbcc') { $bccsel = qq~ checked="checked"~; } |
| $instruct_end = qq~$usersel_txt{'reciepientlist'}~; |
| else { $tosel = qq~ checked="checked"~; } |
| |
| if ($PMenable_cc || $PMenable_bcc) { |
| if ( $to_id eq 'toshowcc' ) { $ccsel = q~ checked="checked"~; } |
| $radiobuttons = qq~ |
| elsif ( $to_id eq 'toshowbcc' ) { $bccsel = q~ checked="checked"~; } |
| <div class="small" style="float: left; width: 50%; padding-bottom: 3px;"> |
| else { $tosel = q~ checked="checked"~; } |
| <input type="radio" name="selreciepients" id="toshow" value="toshow" class="windowbg" style="border: 0px; vertical-align: middle;" onclick="location.href='$scripturl?action=imlist;sort=$INFO{'sort'};toid=toshow;start=$start;letter=$INFO{'letter'}';"$tosel /><label for="toshow" class="small">$usersel_txt{'pmto'}</label> |
| if ( $PMenable_cc || $PMenable_bcc ) { |
| ~; |
| $my_radio_to = qq~ |
| if ($PMenable_cc) { |
| <label for="toshow" class="small">$usersel_txt{'pmto'}</label><input type="radio" name="selreciepients" id="toshow" value="toshow" class="windowbg" onclick="location.href='$scripturl?action=imlist;sort=$INFO{'sort'};toid=toshow;start=$start;letter=$INFO{'letter'}';"$tosel /> |
| $radiobuttons .= qq~ |
| ~; |
| <input type="radio" name="selreciepients" id="toshowcc" value="toshowcc" class="windowbg" style="border: 0px; vertical-align: middle;" onclick="location.href='$scripturl?action=imlist;sort=$INFO{'sort'};toid=toshowcc;start=$start;letter=$INFO{'letter'}';"$ccsel /><label for="toshowcc" class="small">$usersel_txt{'pmcc'}</label> |
| if ($PMenable_cc) { |
| ~; |
| $my_radio_cc = qq~ |
| } |
| <label for="toshowcc" class="small">$usersel_txt{'pmcc'}</label><input type="radio" name="selreciepients" id="toshowcc" value="toshowcc" class="windowbg" onclick="location.href='$scripturl?action=imlist;sort=$INFO{'sort'};toid=toshowcc;start=$start;letter=$INFO{'letter'}';"$ccsel /> |
| if ($PMenable_bcc) { |
| ~; |
| $radiobuttons .= qq~ |
| } |
| <input type="radio" name="selreciepients" id="toshowpmbcc" value="toshowbcc" class="windowbg" style="border: 0px; vertical-align: middle;" onclick="location.href='$scripturl?action=imlist;sort=$INFO{'sort'};toid=toshowbcc;start=$start;letter=$INFO{'letter'}';"$bccsel /><label for="toshowpmbcc" class="small">$usersel_txt{'pmbcc'}</label> |
| if ($PMenable_bcc) { |
| ~; |
| $my_radio_bcc = qq~ |
| } |
| <label for="toshowpmbcc" class="small">$usersel_txt{'pmbcc'}</label><input type="radio" name="selreciepients" id="toshowpmbcc" value="toshowbcc" class="windowbg" onclick="location.href='$scripturl?action=imlist;sort=$INFO{'sort'};toid=toshowbcc;start=$start;letter=$INFO{'letter'}';"$bccsel /> |
| $radiobuttons .= qq~ |
| ~; |
| </div> |
| } |
| ~; |
| $radiobuttons = $my_bcc_radio; |
| } |
| $radiobuttons =~ s/{yabb my_radio_to}/$my_radio_to/sm; |
| } |
| $radiobuttons =~ s/{yabb my_radio_cc}/$my_radio_cc/sm; |
| if ($to_id =~ /moderators\d/) { |
| $radiobuttons =~ s/{yabb my_radio_bcc}/$my_radio_bcc/sm; |
| $page_title = qq~$usersel_txt{'modpagetitle'}~; |
| } |
| $instruct_start = qq~$usersel_txt{'instruct'}~; |
| } |
| $instruct_end = qq~$usersel_txt{'moderatorlist'}~; |
| if ( $to_id =~ /moderators\d/xsm ) { |
| } |
| $page_title = qq~$usersel_txt{'modpagetitle'}~; |
| if ($to_id =~ /ignore/) { |
| $instruct_start = qq~$usersel_txt{'instruct'}~; |
| $page_title = qq~$usersel_txt{'ignorepagetitle'}~; |
| $instruct_end = qq~$usersel_txt{'moderatorlist'}~; |
| $instruct_start = qq~$usersel_txt{'instruct'}~; |
| } |
| $instruct_end = qq~$usersel_txt{'ignorelist'}~; |
| if ( $to_id =~ /ignore/sm ) { |
| } |
| $page_title = qq~$usersel_txt{'ignorepagetitle'}~; |
| if ($to_id =~ /userspec/) { |
| $instruct_start = qq~$usersel_txt{'instruct'}~; |
| $page_title = qq~$usersel_txt{'searchpagetitle'}~; |
| $instruct_end = qq~$usersel_txt{'ignorelist'}~; |
| $instruct_start = qq~$usersel_txt{'instruct1'}~; |
| } |
| $instruct_end = qq~$usersel_txt{'searchlist'}~; |
| if ( $to_id =~ /userspec/sm ) { |
| } |
| $page_title = qq~$usersel_txt{'searchpagetitle'}~; |
| if ($to_id =~ /buddylist/) { |
| $instruct_start = qq~$usersel_txt{'instruct1'}~; |
| $page_title = qq~$usersel_txt{'buddypagetitle'}~; |
| $instruct_end = qq~$usersel_txt{'searchlist'}~; |
| $instruct_start = qq~$usersel_txt{'instruct'}~; |
| } |
| $instruct_end = qq~$usersel_txt{'buddylist'}~; |
| if ( $to_id =~ /buddylist/sm ) { |
| } |
| $page_title = qq~$usersel_txt{'buddypagetitle'}~; |
| if ($to_id =~ /groups/) { |
| $instruct_start = qq~$usersel_txt{'instruct'}~; |
| $page_title = qq~$usersel_txt{'grouppagetitle'}~; |
| $instruct_end = qq~$usersel_txt{'buddylist'}~; |
| $instruct_start = qq~$usersel_txt{'instruct'}~; |
| } |
| $instruct_end = qq~$usersel_txt{'groups'}~; |
| if ( $to_id =~ /groups/sm ) { |
| } |
| $page_title = qq~$usersel_txt{'grouppagetitle'}~; |
| $page = "a"; |
| $instruct_start = qq~$usersel_txt{'instruct'}~; |
| $showpage = "A"; |
| $instruct_end = qq~$usersel_txt{'groups'}~; |
| |
| } |
| while ($page ne "z") { |
| $page = 'a'; |
| if($INFO{'letter'} && $page eq $INFO{'letter'}) { |
| $showpage = 'A'; |
| $LetterLinks .= qq~<div style="float: left; width: 11px; text-align: center; border: 1px #ffffff solid;"><span class="small"><b>$showpage</b></span></div>~; |
| |
| } |
| while ( $page ne 'z' ) { |
| else { |
| if ( $INFO{'letter'} && $page eq $INFO{'letter'} ) { |
| $LetterLinks .= qq~<div style="float: left; width: 13px; text-align: center; margin-top: 1px; margin-bottom: 1px;"><a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$page"><span class="small"><b>$showpage</b></span></a></div>~; |
| $LetterLinks .= |
| } |
| qq~<div class="letterlinks_a"><span class="small"><b>$showpage</b></span></div>~; |
| $page++; |
| } |
| $showpage++; |
| else { |
| } |
| $LetterLinks .= |
| if($INFO{'letter'} && $INFO{'letter'} eq "z") { |
| qq~<div class="letterlinks_b"><a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$page"><span class="small"><b>$showpage</b></span></a></div>~; |
| $LetterLinks .= qq~<div style="float: left; width: 11px; text-align: center; border: 1px #ffffff solid;"><span class="small"><b>Z</b></span></div>~; |
| } |
| } |
| $page++; |
| else { |
| $showpage++; |
| $LetterLinks .= qq~<div style="float: left; width: 13px; text-align: center; margin-top: 1px; margin-bottom: 1px;"><a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=z"><span class="small"><b>Z</b></span></a></div>~; |
| } |
| } |
| if ( $INFO{'letter'} && $INFO{'letter'} eq 'z' ) { |
| if($INFO{'letter'} && $INFO{'letter'} eq "other") { |
| $LetterLinks .= |
| $LetterLinks .= qq~<div style="float: left; text-align: center; border: 1px #ffffff solid; padding-left: 2px; padding-right: 2px;"><span class="small"><b>$usersel_txt{'other'}</b></span></div>~; |
| q~<div class="letterlinks_a"><span class="small"><b>Z</b></span></div>~; |
| } |
| } |
| else { |
| else { |
| $LetterLinks .= qq~<div style="float: left; text-align: center; padding-left: 2px; padding-right: 2px; margin-top: 1px; margin-bottom: 1px;"><a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=other"><span class="small"><b>$usersel_txt{'other'}</b></span></a></div>~; |
| $LetterLinks .= |
| } |
| qq~<div class="letterlinks_b"><a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=z"><span class="small"><b>Z</b></span></a></div>~; |
| |
| } |
| if ($INFO{'sort'} eq "pmsearch") { |
| if ( $INFO{'letter'} && $INFO{'letter'} eq 'other' ) { |
| if($INFO{'letter'} && $INFO{'letter'} eq "all") { |
| $LetterLinks .= |
| $LetterLinks .= qq~<div style="float: left; text-align: center; border: 1px #ffffff solid; padding-left: 2px; padding-right: 2px;"><span class="small"><b>$usersel_txt{'allsearch'}</b></span></div>~; |
| qq~<div class="letterlinks_c"><span class="small"><b>$usersel_txt{'other'}</b></span></div>~; |
| } |
| } |
| else { |
| else { |
| $LetterLinks .= qq~<div style="float: left; text-align: center; padding-left: 2px; padding-right: 2px; margin-top: 1px; margin-bottom: 1px;"><a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=all"><span class="small"><b>$usersel_txt{'allsearch'}</b></span></a></div>~; |
| $LetterLinks .= |
| } |
| qq~<div class="letterlinks_d"><a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=other"><span class="small"><b>$usersel_txt{'other'}</b></span></a></div>~; |
| } |
| } |
| if ($to_id eq 'groups') { $LetterLinks = ''; } |
| |
| unless ($INFO{'letter'} eq 'all') { $letter = lc($INFO{'letter'}); } |
| if ( $INFO{'sort'} eq 'pmsearch' ) { |
| |
| if ( $INFO{'letter'} && $INFO{'letter'} eq 'all' ) { |
| $i = 0; |
| $LetterLinks .= |
| $recent_exist = 1; |
| qq~<div class="letterlinks_c"><span class="small"><b>$usersel_txt{'allsearch'}</b></span></div>~; |
| @recentUsers = (); |
| } |
| |
| else { |
| if ($to_id =~ /toshow/ || $to_id =~ /buddylist/ || $to_id =~ /ignore/) { |
| $LetterLinks .= |
| &loadRecentPMs; |
| qq~<div class="letterlinks_d"><a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=all"><span class="small"><b>$usersel_txt{'allsearch'}</b></span></a></div>~; |
| } |
| } |
| if (!@recentUsers) { |
| } |
| $recent_exist = 0; |
| if ( $to_id eq 'groups' ) { $LetterLinks = q{}; } |
| if ($INFO{'sort'} eq "recentpm") { $INFO{'sort'} = "username"; } |
| if ( $INFO{'letter'} ne 'all' ) { $letter = lc $INFO{'letter'}; } |
| } |
| |
| $myRealname = ${$uid.$username}{'realname'}; |
| $i = 0; |
| $myEmail = ${$uid.$username}{'email'}; |
| $recent_exist = 1; |
| if ($INFO{'sort'} eq 'recentpm') { |
| @recentUsers = (); |
| foreach my $recentname (@recentUsers) { |
| |
| if (!${$uid.$recentname}{'password'}) { &LoadUser($recentname); } |
| if ( $to_id =~ /toshow/sm |
| $memberinf{$recentname} = qq~${$uid.$recentname}{'realname'}|${$uid.$recentname}{'email'}~; |
| || $to_id =~ /buddylist/sm |
| } |
| || $to_id =~ /ignore/sm ) |
| |
| { |
| } elsif ($INFO{'sort'} eq 'pmsearch') { |
| loadRecentPMs(); |
| if (!-e "$memberdir/$username.usctmp") { |
| } |
| &ManageMemberinfo("load"); |
| if ( !@recentUsers ) { |
| fopen(FILE, ">$memberdir/$username.usctmp"); |
| $recent_exist = 0; |
| foreach $membername (sort { lc $memberinf{$a} cmp lc $memberinf{$b} } keys %memberinf) { |
| if ( $INFO{'sort'} eq 'recentpm' ) { $INFO{'sort'} = 'username'; } |
| ($memrealname, $mememail, undef) = split(/\|/, $memberinf{$membername}, 3); |
| } |
| ## do not find own name - unless for search or board mods! |
| $myRealname = ${ $uid . $username }{'realname'}; |
| if ($to_id !~ /moderators\d/ && $to_id !~ /userspec/) { |
| $myEmail = ${ $uid . $username }{'email'}; |
| if ($memrealname =~ /$LookFor/ig && $membername ne $username ) { |
| if ( $INFO{'sort'} eq 'recentpm' ) { |
| print FILE "$membername,$memrealname|$mememail\n"; |
| foreach my $recentname (@recentUsers) { |
| } elsif($mememail =~ /$LookFor/ig && $membername ne $username) { |
| if ( !${ $uid . $recentname }{'password'} ) { |
| print FILE "$membername,$memrealname|$mememail\n"; |
| LoadUser($recentname); |
| } |
| } |
| } else { |
| if ( ${ $uid . $recentname}{'realname'} ) { |
| if ($memrealname =~ /$LookFor/ig) { |
| $memberinf{$recentname} = |
| print FILE "$membername,$memrealname|$mememail\n"; |
| qq~${$uid.$recentname}{'realname'}|${$uid.$recentname}{'email'}~; |
| } elsif($mememail =~ /$LookFor/ig) { |
| } |
| print FILE "$membername,$memrealname|$mememail\n"; |
| } |
| } |
| } |
| } |
| elsif ( $INFO{'sort'} eq 'pmsearch' ) { |
| } |
| if ( !-e "$memberdir/$username.usctmp" ) { |
| fclose(FILE); |
| ManageMemberinfo('load'); |
| undef %memberinf; |
| fopen( FILE, ">$memberdir/$username.usctmp" ); |
| } |
| foreach my $membername ( |
| fopen(FILE, "$memberdir/$username.usctmp"); |
| sort { lc $memberinf{$a} cmp lc $memberinf{$b} } |
| while ($line = <FILE>) { |
| keys %memberinf |
| chomp $line; |
| ) |
| ($recentname, $realinfo) = split(/\,/, $line); |
| { |
| $memberinf{$recentname} = $realinfo; |
| ( $memrealname, $mememail, undef ) = |
| } |
| split /\|/xsm, $memberinf{$membername}, 3; |
| fclose(FILE); |
| ## do not find own name - unless for search or board mods! |
| |
| if ( $to_id !~ /moderators\d/xsm && $to_id !~ /userspec/sm ) { |
| } elsif ($to_id eq 'groups') { |
| if ( $memrealname =~ /$LookFor/igxsm |
| $ToShow[0] = 'bmallmembers'; |
| && $membername ne $username ) |
| $ToShow[1] = ''; |
| { |
| $ToShow[2] = 'bmadmins'; |
| print {FILE} "$membername,$memrealname|$mememail\n" |
| $ToShow[3] = 'bmgmods'; |
| or croak "$croak{'print'} FILE"; |
| $ToShow[4] = 'bmmods'; |
| } |
| $ToShow[5] = ''; |
| elsif ($mememail =~ /$LookFor/igxsm |
| my $x = 6; |
| && $membername ne $username ) |
| foreach (@nopostorder) { |
| { |
| $ToShow[$x] = $_; |
| print {FILE} "$membername,$memrealname|$mememail\n" |
| $x++; |
| or croak "$croak{'print'} FILE"; |
| } |
| } |
| |
| } |
| } elsif ($INFO{'sort'} eq "mlletter" || $INFO{'sort'} eq "username") { |
| else { |
| &ManageMemberinfo("load"); |
| if ( $memrealname =~ /$LookFor/igxsm ) { |
| } |
| print {FILE} "$membername,$memrealname|$mememail\n" |
| |
| or croak "$croak{'print'} FILE"; |
| if ($INFO{'sort'} eq "recentpm") { $selRecent = qq~class="windowbg"~; } |
| } |
| else { $selRecent = qq~class="windowbg2"~; } |
| elsif ( $mememail =~ /$LookFor/igxsm ) { |
| if ($INFO{'sort'} eq "mlletter" || $INFO{'sort'} eq "username") { $selUser = qq~class="windowbg"~; } |
| print {FILE} "$membername,$memrealname|$mememail\n" |
| else { $selUser = qq~class="windowbg2"~; } |
| or croak "$croak{'print'} FILE"; |
| |
| } |
| unless (($to_id =~ /toshow/ && (!$PM_level || ($PM_level == 2 && !$staff) || ($PM_level == 3 && !$iamadmin && !$iamgmod))) or ($to_id =~ /userspec/ && (($ML_Allowed == 1 && $iamguest) || ($ML_Allowed == 2 && !$staff) || ($ML_Allowed == 3 && !$iamadmin && !$iamgmod)))) { |
| } |
| foreach $membername (sort { lc $memberinf{$a} cmp lc $memberinf{$b} } keys %memberinf) { |
| } |
| if ($to_id =~ /toshow/) { |
| fclose(FILE); |
| if ($PM_level == 2) { &CheckUserPM_Level($membername); next if $UserPM_Level{$membername} < 2; } |
| undef %memberinf; |
| elsif ($PM_level == 3) { &CheckUserPM_Level($membername); next if $UserPM_Level{$membername} != 3; } |
| } |
| } |
| fopen( FILE, "$memberdir/$username.usctmp" ); |
| ($memrealname, $mememail, undef) = split(/\|/, $memberinf{$membername}, 3); |
| while ( $line = <FILE> ) { |
| if ($letter) { |
| chomp $line; |
| $SearchName = lc(substr($memrealname, 0, 1)); |
| ( $recentname, $realinfo ) = split /\,/xsm, $line; |
| if ($SearchName eq $letter && ($membername ne $username || ($to_id =~ /moderators\d/ || $to_id =~ /userspec/))) { $ToShow[$i] = $membername; } |
| $memberinf{$recentname} = $realinfo; |
| elsif ($letter eq "other" && (($SearchName lt "a") || ($SearchName gt "z")) && ($membername ne $username || ($to_id =~ /moderators\d/ || $to_id =~ /userspec/))) { $ToShow[$i] = $membername; } |
| } |
| } else { |
| fclose(FILE); |
| if ($to_id =~ /moderators\d/ || $to_id =~ /userspec/) { $ToShow[$i] = $membername; } |
| |
| elsif ($membername ne $username) { $ToShow[$i] = $membername; } |
| } |
| |
| elsif ( $to_id eq 'groups' ) { |
| } |
| $ToShow[0] = 'bmallmembers'; |
| $i++ if $ToShow[$i]; |
| $ToShow[1] = q{}; |
| } |
| $ToShow[2] = 'bmadmins'; |
| undef %UserPM_Level; |
| $ToShow[3] = 'bmgmods'; |
| } |
| $ToShow[4] = 'bmfmods'; |
| undef %memberinf; |
| $ToShow[5] = 'bmmods'; |
| |
| $ToShow[6] = q{}; |
| $memcount = @ToShow; |
| my $x = 6; |
| if($memcount < $MembersPerPage) { $MembersPerPage = $memcount; } |
| |
| if (!$memcount && $letter) { |
| foreach (@nopostorder) { |
| $pageindex = ""; |
| $ToShow[$x] = $_; |
| } else { |
| $x++; |
| &buildIndex; |
| } |
| } |
| |
| &buildPages(1); |
| } |
| $b = $start; |
| elsif ( $INFO{'sort'} eq 'mlletter' || $INFO{'sort'} eq 'username' ) { |
| $numshown = 0; |
| ManageMemberinfo('load'); |
| $yymain .= qq~ |
| } |
| <tr><td height="156" class="windowbg"> |
| |
| ~; |
| if ( $INFO{'sort'} eq 'recentpm' ) { $selRecent = q~class="windowbg recentpm"~; } |
| |
| else { $selRecent = q~class="windowbg2 recentpm"~; } |
| if ($memcount) { |
| |
| $yymain .= qq~ |
| if ( $INFO{'sort'} eq 'mlletter' || $INFO{'sort'} eq 'username' ) { |
| $radiobuttons |
| $selUser = q~class="windowbg recentpm"~; |
| ~; |
| } |
| if ($to_id =~ /userspec/) { |
| else { $selUser = q~class="windowbg2 recentpm"~; } |
| $yymain .= qq~ |
| |
| <select name="rec_list" id="rec_list" size="10" style="width: 456px; font-size: 11px; font-weight: bold;" ondblclick="copy_option('$to_id')">\n |
| if ( |
| ~; |
| ( |
| } else { |
| $to_id !~ /toshow/sm || ( $PM_level |
| $yymain .= qq~ |
| && ( $PM_level != 2 || $staff ) |
| <select name="rec_list" id="rec_list" multiple="multiple" size="10" style="width: 456px; font-size: 11px; font-weight: bold;" ondblclick="copy_option('$to_id')">\n |
| && ( $PM_level != 3 || $iamadmin || $iamgmod ) |
| ~; |
| && ( $PM_level != 4 || $iamadmin || $iamgmod || $iamfmod ) ) |
| } |
| ) |
| while ($numshown < $MembersPerPage) { |
| or ( |
| $user = $ToShow[$b]; |
| $to_id !~ /userspec/sm |
| if ($to_id ne 'groups') { |
| || ( ( $ML_Allowed != 1 || !$iamguest ) |
| my $cloakedUserName; |
| && ( $ML_Allowed != 2 || $staff ) |
| if ($user ne '') { |
| && ( $ML_Allowed != 3 || $iamadmin || $iamgmod ) |
| $color = ''; |
| && ( $ML_Allowed != 4 || $iamadmin || $iamgmod || $iamfmod ) ) |
| $colorstyle = qq~ style="font-weight: bold;~; |
| ) |
| !${$uid.$user}{'password'} ? &LoadUser($user) : &LoadMiniUser($user); |
| ) |
| if ($color) { $colorstyle .= qq~ color: $color;~; } |
| { |
| $colorstyle .= qq~"~; |
| foreach my $membername ( |
| if (${$uid.$user}{'realname'} eq "") { ${$uid.$user}{'realname'} = $user; } |
| sort { lc $memberinf{$a} cmp lc $memberinf{$b} } |
| if ($do_scramble_id) { $cloakedUserName = &cloak($user); } else { $cloakedUserName = $user; } |
| keys %memberinf |
| $yymain .= qq~<option value="$cloakedUserName"$colorstyle>${$uid.$user}{'realname'}</option>\n~; |
| ) |
| } |
| { |
| } else { |
| if ( $to_id =~ /toshow/sm ) { |
| my $groupName = ''; |
| if ( $PM_level == 2 ) { |
| my $groupdisabled = ''; |
| CheckUserPM_Level($membername); |
| if ($user ne '') { |
| next if $UserPM_Level{$membername} < 2; |
| $groupName = $usersel_txt{$user}; |
| } |
| if ($groupName eq '') { $groupName = (split /\|/, $NoPost{$user})[0]; } |
| elsif ( $PM_level == 3 ) { |
| $user = $user eq 'bmallmembers' ? 'all' : ($user eq 'bmadmins' ? 'admins' : ($user eq 'bmgmods' ? 'gmods' : ($user eq 'bmmods' ? 'mods' : $user))); |
| CheckUserPM_Level($membername); |
| $yymain .= qq~<option value="$user">$groupName</option>\n~; |
| next if $UserPM_Level{$membername} != 3; |
| } else { |
| } |
| $groupName = qq~-------~; |
| elsif ( $PM_level == 4 ) { |
| $yymain .= qq~<optgroup label="$groupName"></optgroup>\n~; |
| CheckUserPM_Level($membername); |
| } |
| next if $UserPM_Level{$membername} != 4; |
| } |
| } |
| $numshown++; |
| } |
| $b++; |
| ( $memrealname, $mememail, undef ) = |
| } |
| split /\|/xsm, $memberinf{$membername}, 3; |
| $yymain .= qq~ |
| if ($letter) { |
| </select>\n |
| $SearchName = lc( substr $memrealname, 0, 1 ); |
| <input type="button" class="button" onclick="copy_option('$to_id')" value="$usersel_txt{'addselected'}" style="width: 228px;" /><input type="button" class="button" onclick="window.close()" value="$usersel_txt{'pageclose'}" style="width: 228px;" /> |
| if ( |
| ~; |
| $SearchName eq $letter |
| |
| && ( |
| } else { |
| $membername ne $username |
| $yymain .= qq~ |
| || ( $to_id =~ /moderators\d/xsm |
| <div style="float: left; width: 456px; height: 139px;"> |
| || $to_id =~ /userspec/sm ) |
| <br /><br /> |
| ) |
| ~; |
| ) |
| if ($letter) { |
| { |
| $yymain .= qq~<center><b>$usersel_txt{'noentries'}</b><br /></center>~; |
| $ToShow[$i] = $membername; |
| } |
| } |
| elsif ($INFO{'sort'} eq "pmsearch") { |
| elsif ( |
| $yymain .= qq~<center><b>$usersel_txt{'nofound'} <i>$SearchStr</i></b></center>~; |
| $letter eq 'other' |
| } |
| && ( ( $SearchName lt 'a' ) || ( $SearchName gt 'z' ) ) |
| $yymain .= qq~ |
| && ( |
| </div> |
| $membername ne $username |
| <input type="button" class="button" onclick="window.close()" value="$usersel_txt{'pageclose'}" style="width: 456px;" /> |
| || ( $to_id =~ /moderators\d/xsm |
| ~; |
| || $to_id =~ /userspec/sm ) |
| } |
| ) |
| |
| ) |
| $yymain .= qq~ |
| { |
| </td></tr> |
| $ToShow[$i] = $membername; |
| ~; |
| } |
| |
| } |
| undef @ToShow; |
| else { |
| &buildPages(0); |
| if ( $to_id =~ /moderators\d/xsm || $to_id =~ /userspec/sm ) { |
| $yytitle = $page_title; |
| $ToShow[$i] = $membername; |
| &userselectTemplate; |
| } |
| |
| elsif ( $membername ne $username ) { |
| |
| $ToShow[$i] = $membername; |
| |
| } |
| |
| } |
| |
| if ( $ToShow[$i] ) { $i++; } |
| |
| } |
| |
| undef %UserPM_Level; |
| |
| } |
| |
| undef %memberinf; |
| |
| |
| |
| $memcount = @ToShow; |
| |
| if ( $memcount < $MembersPerPage ) { $MembersPerPage = $memcount; } |
| |
| if ( !$memcount && $letter ) { |
| |
| $pageindex = q{}; |
| |
| } |
| |
| else { |
| |
| buildIndex(); |
| |
| } |
| |
| buildPages(1); |
| |
| $bb = $start; |
| |
| $numshown = 0; |
| |
| if ($memcount) { |
| |
| $yymain_inner .= qq~ |
| |
| $radiobuttons |
| |
| ~; |
| |
| if ( $to_id =~ /userspec/sm ) { |
| |
| $yymain_inner .= qq~ |
| |
| <select name="rec_list" id="rec_list" size="10" class="reclist" ondblclick="copy_option('$to_id')">\n |
| |
| ~; |
| |
| } |
| |
| else { |
| |
| $yymain_inner .= qq~ |
| |
| <select name="rec_list" id="rec_list" multiple="multiple" size="10" class="reclist" ondblclick="copy_option('$to_id')">\n |
| |
| ~; |
| |
| } |
| |
| while ( $numshown < $MembersPerPage ) { |
| |
| $user = $ToShow[$bb]; |
| |
| if ( $to_id ne 'groups' ) { |
| |
| my $cloakedUserName; |
| |
| if ( $user ne q{} ) { |
| |
| $color = q{}; |
| |
| $colorstyle = q~ style="font-weight: bold;~; |
| |
| !${ $uid . $user }{'password'} |
| |
| ? LoadUser($user) |
| |
| : LoadMiniUser($user); |
| |
| if ($color) { $colorstyle .= qq~ color: $color;~; } |
| |
| $colorstyle .= q~"~; |
| |
| if ( ${ $uid . $user }{'realname'} eq q{} ) { |
| |
| ${ $uid . $user }{'realname'} = $user; |
| |
| } |
| |
| if ($do_scramble_id) { $cloakedUserName = cloak($user); } |
| |
| else { $cloakedUserName = $user; } |
| |
| $yymain_inner .= |
| |
| qq~<option value="$cloakedUserName"$colorstyle>${$uid.$user}{'realname'}</option>\n~; |
| |
| } |
| |
| } |
| |
| else { |
| |
| my $groupName = q{}; |
| |
| my $groupdisabled = q{}; |
| |
| if ( $user ne q{} ) { |
| |
| $groupName = $usersel_txt{$user}; |
| |
| if ( $groupName eq q{} ) { |
| |
| $groupName = ( split /\|/xsm, $NoPost{$user} )[0]; |
| |
| } |
| |
| $user = |
| |
| $user eq 'bmallmembers' ? 'all' |
| |
| : ( |
| |
| $user eq 'bmadmins' ? 'admins' |
| |
| : ( |
| |
| $user eq 'bmgmods' ? 'gmods' |
| |
| : ( |
| |
| $user eq 'bmfmods' ? 'fmods' |
| |
| : ( $user eq 'bmmods' ? 'mods' : $user ) |
| |
| ) |
| |
| ) |
| |
| ); |
| |
| $yymain_inner .= |
| |
| qq~<option value="$user">$groupName</option>\n~; |
| |
| } |
| |
| else { |
| |
| $groupName = q~-------~; |
| |
| $yymain_inner .= |
| |
| qq~<optgroup label="$groupName"></optgroup>\n~; |
| |
| } |
| |
| } |
| |
| $numshown++; |
| |
| $bb++; |
| |
| } |
| |
| $yymain_inner .= qq~ |
| |
| </select>\n |
| |
| <input type="button" class="button reclist_sub" onclick="copy_option('$to_id')" value="$usersel_txt{'addselected'}" /><input type="button" class="button reclist_sub" onclick="window.close()" value="$usersel_txt{'pageclose'}" /> |
| |
| ~; |
| |
| } |
| |
| else { |
| |
| $yymain_inner .= q~ |
| |
| <div class="reclist_no"> |
| |
| <br /><br /> |
| |
| ~; |
| |
| if ($letter) { |
| |
| $yymain_inner .= qq~<b>$usersel_txt{'noentries'}</b><br />~; |
| |
| } |
| |
| elsif ( $INFO{'sort'} eq 'pmsearch' ) { |
| |
| $yymain_inner .= |
| |
| qq~<b>$usersel_txt{'nofound'} <i>$SearchStr</i></b>~; |
| |
| } |
| |
| $yymain_inner .= qq~ |
| |
| </div> |
| |
| <input type="button" class="button reclist_b" onclick="window.close()" value="$usersel_txt{'pageclose'}" /> |
| |
| ~; |
| |
| } |
| |
| $yymain .= $my_sel_box; |
| |
| $yymain =~ s/{yabb yymain_inner}/$yymain_inner/sm; |
| |
| |
| |
| undef @ToShow; |
| |
| buildPages(0); |
| |
| $yytitle = $page_title; |
| |
| userselectTemplate(); |
| |
| return; |
| } |
| } |
| |
| |
| sub buildIndex { |
| sub buildIndex { |
| unless ($memcount == 0) { |
| if ( $memcount != 0 ) { |
| if (!$iamguest) { |
| if ( !$iamguest ) { |
| (undef, undef, $usermemberpage, undef) = split(/\|/, ${$uid.$username}{'pageindex'}); |
| ( undef, undef, $usermemberpage, undef ) = |
| } |
| split /\|/xsm, ${ $uid . $username }{'pageindex'}; |
| my ($pagetxtindex, $pagetextindex, $pagedropindex, $all, $allselected); |
| } |
| $indexdisplaynum = 3; |
| my ( $pagetxtindex, $pagedropindex, $all, $allselected ); |
| $dropdisplaynum = 10; |
| $indexdisplaynum = 3; |
| if ($FORM{'sortform'} eq "") { $FORM{'sortform'} = $INFO{'sort'}; } |
| $dropdisplaynum = 10; |
| $postdisplaynum = 3; |
| if ( $FORM{'sortform'} eq q{} ) { $FORM{'sortform'} = $INFO{'sort'}; } |
| $startpage = 0; |
| $postdisplaynum = 3; |
| $max = $memcount; |
| $startpage = 0; |
| if ($INFO{'start'} eq "all") { $MembersPerPage = $max; $all = 1; $allselected = qq~ selected="selected"~; $start = 0 } |
| $max = $memcount; |
| else { $start = $INFO{'start'} || 0; } |
| |
| $start = $start > $memcount - 1 ? $memcount - 1 : $start; |
| if ( $INFO{'start'} eq 'all' ) { |
| $start = (int($start / $MembersPerPage)) * $MembersPerPage; |
| $MembersPerPage = $max; |
| $tmpa = 1; |
| $all = 1; |
| $pagenumb = int(($memcount - 1) / $MembersPerPage) + 1; |
| $allselected = q~ selected="selected"~; |
| |
| $start = 0; |
| if ($start >= (($postdisplaynum - 1) * $MembersPerPage)) { |
| } |
| $startpage = $start - (($postdisplaynum - 1) * $MembersPerPage); |
| else { $start = $INFO{'start'} || 0; } |
| $tmpa = int($startpage / $MembersPerPage) + 1; |
| $start = $start > $memcount - 1 ? $memcount - 1 : $start; |
| } |
| $start = ( int( $start / $MembersPerPage ) ) * $MembersPerPage; |
| if ($memcount >= $start + ($postdisplaynum * $MembersPerPage)) { $endpage = $start + ($postdisplaynum * $MembersPerPage); } |
| $tmpa = 1; |
| else { $endpage = $memcount } |
| $pagenumb = int( ( $memcount - 1 ) / $MembersPerPage ) + 1; |
| $lastpn = int(($memcount - 1) / $MembersPerPage) + 1; |
| |
| $lastptn = ($lastpn - 1) * $MembersPerPage; |
| if ( $start >= ( ( $postdisplaynum - 1 ) * $MembersPerPage ) ) { |
| $pageindex = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;">$usersel_txt{'pages'}: $pagenumb</span>~; |
| $startpage = $start - ( ( $postdisplaynum - 1 ) * $MembersPerPage ); |
| if ($pagenumb > 1 || $all) { |
| $tmpa = int( $startpage / $MembersPerPage ) + 1; |
| if ($usermemberpage == 1 || $iamguest) { |
| } |
| $pagetxtindexst = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;">~; |
| if ( $memcount >= $start + ( $postdisplaynum * $MembersPerPage ) ) { |
| $pagetxtindexst .= qq~ $usersel_txt{'pages'}: ~; |
| $endpage = $start + ( $postdisplaynum * $MembersPerPage ); |
| if ($startpage > 0) { $pagetxtindex = qq~<a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter" style="font-weight: normal;">1</a> ... ~; } |
| } |
| if ($startpage == $MembersPerPage) { $pagetxtindex = qq~<a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter" style="font-weight: normal;">1</a> ~; } |
| else { $endpage = $memcount } |
| for ($counter = $startpage; $counter < $endpage; $counter += $MembersPerPage) { |
| $lastpn = int( ( $memcount - 1 ) / $MembersPerPage ) + 1; |
| $pagetxtindex .= $start == $counter ? qq~<b>$tmpa</b> ~ : qq~<a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=$counter" style="font-weight: normal;">$tmpa</a> ~; |
| $lastptn = ( $lastpn - 1 ) * $MembersPerPage; |
| $tmpa++; |
| $pageindex = |
| } |
| qq~<span class="small pgindex">$usersel_txt{'pages'}: $pagenumb</span>~; |
| if ($endpage < $memcount - $MembersPerPage) { $pageindexadd = qq~... ~; } |
| if ( $pagenumb > 1 || $all ) { |
| if ($endpage != $memcount) { $pageindexadd .= qq~<a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=$lastptn" style="font-weight: normal;">$lastpn</a>~; } |
| if ( $usermemberpage == 1 || $iamguest ) { |
| $pagetxtindex .= qq~$pageindexadd~; |
| $pagetxtindexst = q~<span class="small pgindex">~; |
| $pageindex = qq~$pagetxtindexst$pagetxtindex</span>~; |
| $pagetxtindexst .= qq~ $usersel_txt{'pages'}: ~; |
| } else { |
| if ( $startpage > 0 ) { |
| $pagedropindex = qq~<div style="float: left; width: 456px; height: 21px; margin: 0px; margin-top: 2px; border: 0px;">~; |
| $pagetxtindex = |
| $tstart = $start; |
| qq~<a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter"><span class="small">1</span></a> ... ~; |
| if (substr($INFO{'start'}, 0, 3) eq "all") { ($tstart, $start) = split(/\-/, $INFO{'start'}); } |
| } |
| $d_indexpages = $pagenumb / $dropdisplaynum; |
| if ( $startpage == $MembersPerPage ) { |
| $i_indexpages = int($pagenumb / $dropdisplaynum); |
| $pagetxtindex = |
| if ($d_indexpages > $i_indexpages) { $indexpages = int($pagenumb / $dropdisplaynum) + 1; } |
| qq~<a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter"><span class="small">1</span></a> ~; |
| else { $indexpages = int($pagenumb / $dropdisplaynum) } |
| } |
| $selectedindex = int(($start / $MembersPerPage) / $dropdisplaynum); |
| for my $counter ( $startpage .. ( $endpage - 1 ) ) { |
| |
| if ( $counter % $MembersPerPage == 0 ) { |
| if ($pagenumb > $dropdisplaynum) { |
| $pagetxtindex .= |
| $pagedropindex .= qq~<div style="float: left; height: 21px; margin: 0;"><select size="1" name="decselector" id="decselector" style="font-size: 9px; border: 2px inset;" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~; |
| $start == $counter |
| } |
| ? qq~<b>[$tmpa]</b> ~ |
| for ($i = 0; $i < $indexpages; $i++) { |
| : qq~<a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=$counter"><span class="small">$tmpa</span></a> ~; |
| $indexpage = ($i * $dropdisplaynum) * $MembersPerPage; |
| $tmpa++; |
| $indexstart = ($i * $dropdisplaynum) + 1; |
| } |
| $indexend = $indexstart + ($dropdisplaynum - 1); |
| } |
| if ($indexend > $pagenumb) { $indexend = $pagenumb; } |
| if ( $endpage < $memcount - $MembersPerPage ) { |
| if ($indexstart == $indexend) { $indxoption = qq~$indexstart~; } |
| $pageindexadd = q~... ~; |
| else { $indxoption = qq~$indexstart-$indexend~; } |
| } |
| $selected = ""; |
| if ( $endpage != $memcount ) { |
| if ($i == $selectedindex) { |
| $pageindexadd .= |
| $selected = qq~ selected="selected"~; |
| qq~<a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=$lastptn"><span class="small">$lastpn</span></a>~; |
| $pagejsindex = qq~$indexstart|$indexend|$MembersPerPage|$indexpage~; |
| } |
| } |
| $pagetxtindex .= qq~$pageindexadd~; |
| if ($pagenumb > $dropdisplaynum) { |
| $pageindex = qq~$pagetxtindexst$pagetxtindex</span>~; |
| $pagedropindex .= qq~<option value="$indexstart|$indexend|$MembersPerPage|$indexpage"$selected>$indxoption</option>\n~; |
| } |
| } |
| else { |
| } |
| $pagedropindex = |
| if ($pagenumb > $dropdisplaynum) { |
| q~<div class="pagedrp">~; |
| $pagedropindex .= qq~</select>\n</div>~; |
| $tstart = $start; |
| } |
| if ( substr( $INFO{'start'}, 0, 3 ) eq 'all' ) { |
| $pagedropindex .= qq~<div id="ViewIndex" class="droppageindex" style="height: 14px; visibility: hidden"> </div>~; |
| ( $tstart, $start ) = split /\-/xsm, $INFO{'start'}; |
| $tmpMembersPerPage = $MembersPerPage; |
| } |
| if (substr($INFO{'start'}, 0, 3) eq "all") { $MembersPerPage = $MembersPerPage * $dropdisplaynum; } |
| $d_indexpages = $pagenumb / $dropdisplaynum; |
| $prevpage = $start - $tmpMembersPerPage; |
| $i_indexpages = int( $pagenumb / $dropdisplaynum ); |
| $nextpage = $start + $MembersPerPage; |
| if ( $d_indexpages > $i_indexpages ) { |
| $pagedropindexpvbl = qq~<img src="$imagesdir/index_left0.gif" height="14" width="13" border="0" alt="" style="margin: 0px; display: inline; vertical-align: middle;" />~; |
| $indexpages = int( $pagenumb / $dropdisplaynum ) + 1; |
| $pagedropindexnxbl = qq~<img src="$imagesdir/index_right0.gif" height="14" width="13" border="0" alt="" style="margin: 0px; display: inline; vertical-align: middle;" />~; |
| } |
| if ($start < $MembersPerPage) { $pagedropindexpv .= qq~<img src="$imagesdir/index_left0.gif" height="14" width="13" border="0" alt="" style="display: inline; vertical-align: middle;" />~; } |
| else { $indexpages = int( $pagenumb / $dropdisplaynum ) } |
| else { $pagedropindexpv .= qq~<img src="$imagesdir/index_left.gif" border="0" height="14" width="13" alt="$pidtxt{'02'}" title="$pidtxt{'02'}" style="display: inline; vertical-align: middle; cursor: pointer;" onclick="location.href=\\'$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=$prevpage\\'" ondblclick="location.href=\\'$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=0\\'" />~; } |
| $selectedindex = |
| if ($nextpage > $lastptn) { $pagedropindexnx .= qq~<img src="$imagesdir/index_right0.gif" border="0" height="14" width="13" alt="" style="display: inline; vertical-align: middle;" />~; } |
| int( ( $start / $MembersPerPage ) / $dropdisplaynum ); |
| else { $pagedropindexnx .= qq~<img src="$imagesdir/index_right.gif" height="14" width="13" border="0" alt="$pidtxt{'03'}" title="$pidtxt{'03'}" style="display: inline; vertical-align: middle; cursor: pointer;" onclick="location.href=\\'$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=$nextpage\\'" ondblclick="location.href=\\'$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=$lastptn\\'" />~; } |
| |
| $pageindex = qq~$pagedropindex</div>~; |
| if ( $pagenumb > $dropdisplaynum ) { |
| |
| $pagedropindex .= |
| $pageindexjs = qq~ |
| qq~<div class="decselector"><select size="1" name="decselector" id="decselector" class="decselector_sel" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~; |
| <script language="JavaScript1.2" type="text/javascript"> |
| } |
| <!-- |
| for my $i ( 0 .. ( $indexpages - 1 ) ) { |
| function SelDec(decparam, visel) { |
| $indexpage = ( $i * $dropdisplaynum ) * $MembersPerPage; |
| splitparam = decparam.split("|"); |
| $indexstart = ( $i * $dropdisplaynum ) + 1; |
| var vistart = parseInt(splitparam[0]); |
| $indexend = $indexstart + ( $dropdisplaynum - 1 ); |
| var viend = parseInt(splitparam[1]); |
| if ( $indexend > $pagenumb ) { $indexend = $pagenumb; } |
| var maxpag = parseInt(splitparam[2]); |
| if ( $indexstart == $indexend ) { |
| var pagstart = parseInt(splitparam[3]); |
| $indxoption = qq~$indexstart~; |
| var allpagstart = parseInt(splitparam[3]); |
| } |
| if(visel == 'xx' && decparam == '$pagejsindex') visel = '$tstart'; |
| else { $indxoption = qq~$indexstart-$indexend~; } |
| var pagedropindex = '<table border="0" cellpadding="0" cellspacing="0"><tr>'; |
| $selected = q{}; |
| for(i=vistart; i<=viend; i++) { |
| if ( $i == $selectedindex ) { |
| if(visel == pagstart) pagedropindex += '<td class="titlebg" height="14" style="height: 14px; padding-left: 1px; padding-right: 1px; font-size: 9px; font-weight: bold;">' + i + '<\/td>'; |
| $selected = q~ selected="selected"~; |
| else pagedropindex += '<td height="14" class="droppages" style="height: 14px;"><a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=' + pagstart + '">' + i + '<\/a><\/td>'; |
| $pagejsindex = |
| pagstart += maxpag; |
| qq~$indexstart|$indexend|$MembersPerPage|$indexpage~; |
| } |
| } |
| ~; |
| if ( $pagenumb > $dropdisplaynum ) { |
| if ($showpageall) { |
| $pagedropindex .= |
| $pageindexjs .= qq~ |
| qq~<option value="$indexstart|$indexend|$MembersPerPage|$indexpage"$selected>$indxoption</option>\n~; |
| if (vistart != viend) { |
| } |
| if(visel == 'all') pagedropindex += '<td class="titlebg" height="14" style="height: 14px; padding-left: 1px; padding-right: 1px; font-size: 9px; font-weight: normal;"><b>$pidtxt{"01"}<\/b><\/td>'; |
| } |
| else pagedropindex += '<td height="14" class="droppages" style="height: 14px;"><a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=all-' + allpagstart + '">$pidtxt{"01"}<\/a><\/td>'; |
| if ( $pagenumb > $dropdisplaynum ) { |
| } |
| $pagedropindex .= qq~</select>\n~; |
| ~; |
| } |
| } |
| $pagedropindex .= |
| $pageindexjs .= qq~ |
| q~<div id="ViewIndex" class="droppageindex pages" style="visibility: hidden; padding-bottom:5px"> </div>~; |
| if(visel != 'xx') pagedropindex += '<td height="14" class="small" style="height: 14px; padding-left: 4px;">$pagedropindexpv$pagedropindexnx<\/td>'; |
| $tmpMembersPerPage = $MembersPerPage; |
| else pagedropindex += '<td height="14" class="small" style="height: 14px; padding-left: 4px;">$pagedropindexpvbl$pagedropindexnxbl<\/td>'; |
| if ( substr( $INFO{'start'}, 0, 3 ) eq 'all' ) { |
| pagedropindex += '<\/tr><\/table>'; |
| $MembersPerPage = $MembersPerPage * $dropdisplaynum; |
| document.getElementById("ViewIndex").innerHTML=pagedropindex; |
| } |
| document.getElementById("ViewIndex").style.visibility = "visible"; |
| $prevpage = $start - $tmpMembersPerPage; |
| ~; |
| $nextpage = $start + $MembersPerPage; |
| if ($pagenumb > $dropdisplaynum) { |
| $pagedropindexpvbl = |
| $pageindexjs .= qq~ |
| qq~<img src="$imagesdir/$ml_index_left0" height="14" width="13" alt="" />~; |
| document.getElementById("decselector").value = decparam; |
| $pagedropindexnxbl = |
| ~; |
| qq~<img src="$imagesdir/$ml_index_right0" height="14" width="13" alt="" />~; |
| } |
| if ( $start < $MembersPerPage ) { |
| $pageindexjs .= qq~ |
| $pagedropindexpv .= |
| } |
| qq~<img src="$imagesdir/$ml_index_left0" height="14" width="13" alt="" />~; |
| document.onload = SelDec('$pagejsindex', '$tstart'); |
| } |
| //--> |
| else { |
| |
| $pagedropindexpv .= |
| |
| qq~<img src="$imagesdir/$ml_index_left" height="14" width="13" alt="$pidtxt{'02'}" title="$pidtxt{'02'}" class="cursor" onclick="location.href=\\'$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=$prevpage\\'" ondblclick="location.href=\\'$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=0\\'" />~; |
| |
| } |
| |
| if ( $nextpage > $lastptn ) { |
| |
| $pagedropindexnx .= |
| |
| qq~<img src="$imagesdir/$ml_index_right0" height="14" width="13" alt="" />~; |
| |
| } |
| |
| else { |
| |
| $pagedropindexnx .= |
| |
| qq~<img src="$imagesdir/$ml_index_right" height="14" width="13" alt="$pidtxt{'03'}" title="$pidtxt{'03'}" class="cursor" onclick="location.href=\\'$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=$nextpage\\'" ondblclick="location.href=\\'$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=$lastptn\\'" />~; |
| |
| } |
| |
| $pageindex = qq~$pagedropindex</div>~; |
| |
| |
| |
| $pageindexjs = qq~ |
| |
| <script type="text/javascript"> |
| |
| function SelDec(decparam, visel) { |
| |
| splitparam = decparam.split("|"); |
| |
| var vistart = parseInt(splitparam[0]); |
| |
| var viend = parseInt(splitparam[1]); |
| |
| var maxpag = parseInt(splitparam[2]); |
| |
| var pagstart = parseInt(splitparam[3]); |
| |
| var allpagstart = parseInt(splitparam[3]); |
| |
| if(visel == 'xx' && decparam == '$pagejsindex') visel = '$tstart'; |
| |
| var pagedropindex = '$visel_0'; |
| |
| for(i=vistart; i<=viend; i++) { |
| |
| if(visel == pagstart) pagedropindex += '$visel_1a<b>' + i + '<\/b>$visel_1b'; |
| |
| else pagedropindex += '$visel_2a<a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=' + pagstart + '">' + i + '<\/a>$visel_1b'; |
| |
| pagstart += maxpag; |
| |
| } |
| |
| ~; |
| |
| if ($showpageall) { |
| |
| $pageindexjs .= qq~ |
| |
| if (vistart != viend) { |
| |
| if(visel == 'all') pagedropindex += '$visel_1a<b>$pidtxt{"01"}<\/b>$visel_1b'; |
| |
| else pagedropindex += '$visel_2a<a href="$scripturl?action=imlist;sort=$INFO{'sort'};toid=$to_id;letter=$letter;start=all-' + allpagstart + '">$pidtxt{"01"}<\/a>$visel_1b'; |
| |
| } |
| |
| ~; |
| |
| } |
| |
| $pageindexjs .= qq~ |
| |
| if(visel != 'xx') pagedropindex += '$visel_3a$pagedropindexpv$pagedropindexnx$visel_1b'; |
| |
| else pagedropindex += '$visel_3a$pagedropindexpvbl$pagedropindexnxbl$visel_1b'; |
| |
| pagedropindex += '$visel_4'; |
| |
| document.getElementById("ViewIndex").innerHTML=pagedropindex; |
| |
| document.getElementById("ViewIndex").style.visibility = "visible"; |
| |
| ~; |
| |
| if ( $pagenumb > $dropdisplaynum ) { |
| |
| $pageindexjs .= q~ |
| |
| document.getElementById("decselector").value = decparam; |
| |
| ~; |
| |
| } |
| |
| $pageindexjs .= qq~ |
| |
| } |
| |
| document.onload = SelDec('$pagejsindex', '$tstart'); |
| </script> |
| </script> |
| ~; |
| ~; |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| return; |
| } |
| } |
| |
| |
| sub buildPages { |
| sub buildPages { |
| if ($to_id eq 'groups') { $instructtext = $usersel_txt{'instruct4'}; } |
| my @x = @_; |
| else { $instructtext = qq~<label for="member">$usersel_txt{'instruct2'}</label>~ ; } |
| if ( $to_id eq 'groups' ) { $instructtext = $usersel_txt{'instruct4'}; } |
| $TableHeader .= qq~ |
| else { |
| <tr> |
| $instructtext = |
| <td class="titlebg" align="left" valign="middle"> |
| qq~<label for="member">$usersel_txt{'instruct2'}</label>~; |
| <div class="small" style="float: left; width: 258px; padding-top: 3px;"> |
| } |
| $instructtext |
| if ( $to_id ne 'groups' ) { |
| </div> |
| $not_groups = qq~ |
| <div class="small" style="float: left; width: 198px; text-align: right;"> |
| <form action="$scripturl?action=findmember;sort=pmsearch;toid=$to_id" method="post" id="form1" name="form1" enctype="application/x-www-form-urlencoded" style="display:inline; vertical-align:middle;" accept-charset="$yymycharset"> |
| ~; |
| <input type="text" name="member" id="member" value="$usersel_txt{'wildcardinfo'}" onfocus="txtInFields(this, '$usersel_txt{'wildcardinfo'}');" onblur="txtInFields(this, '$usersel_txt{'wildcardinfo'}')" class="wildcard" /> |
| unless ($to_id eq 'groups') { |
| <input type="submit" class="button" style="font-size: 10px;" value="$usersel_txt{'gobutton'}" /> |
| $TableHeader .= qq~ |
| </form>~; |
| <form action="$scripturl?action=findmember;sort=pmsearch;toid=$to_id" method="post" id="form1" name="form1" enctype="application/x-www-form-urlencoded" style="display:inline; vertical-align:middle;"> |
| } |
| <input type="text" name="member" id="member" value="$usersel_txt{'wildcardinfo'}" onfocus="this.value=''" style="font-size: 11px; width: 140px" /> |
| if ( $recent_exist && $to_id =~ /toshow/sm ) { |
| <input name="submit" type="submit" class="button" style="font-size: 10px;" value="$usersel_txt{'gobutton'}" /> |
| $not_groups_b = qq~ |
| </form>~; |
| <div $selRecent onclick="location.href='$scripturl?action=imlist;sort=recentpm;toid=$to_id';"><b>$usersel_txt{'recentlist'}</b></div> |
| } |
| <div $selUser onclick="location.href='$scripturl?action=imlist;sort=username;toid=$to_id';"><b>$usersel_txt{'alllist'}</b></div> |
| $TableHeader .= qq~ |
| ~; |
| </div> |
| } |
| </td> |
| elsif ( $to_id ne 'groups' ) { |
| </tr> |
| $not_groups_b = qq~ |
| </table> |
| <div $selUser onclick="location.href='$scripturl?action=imlist;sort=username;toid=$to_id';" style="width: 454px;"><b>$usersel_txt{'alllist'}</b></div> |
| <form method="post" action="" name="selectuser"> |
| ~; |
| <table border="0" width="464" cellspacing="1" cellpadding="3" class="bordercolor" style="height: 275px; table-layout: fixed;"> |
| } |
| <tr> |
| elsif ( $to_id eq 'groups' ) { |
| <td class="catbg" align="center"> |
| $not_groups_b = qq~ |
| ~; |
| <div $selUser onclick="location.href='$scripturl?action=imlist;sort=username;toid=$to_id';" style="width: 454px;"><b>$usersel_txt{'groups'}</b></div> |
| if ($recent_exist && $to_id =~ /toshow/) { |
| ~; |
| $TableHeader .= qq~ |
| } |
| <div $selRecent onclick="location.href='$scripturl?action=imlist;sort=recentpm;toid=$to_id';" style="float: left; width: 226px; text-align: center; padding-top: 2px; padding-bottom: 2px; border: 1px; border-style: outset; cursor: pointer;"><b>$usersel_txt{'recentlist'}</b></div> |
| if ( $LetterLinks ne q{} ) { |
| <div $selUser onclick="location.href='$scripturl?action=imlist;sort=username;toid=$to_id';" style="float: left; width: 226px; text-align: center; padding-top: 2px; padding-bottom: 2px; border: 1px; border-style: outset; cursor: pointer;"><b>$usersel_txt{'alllist'}</b></div> |
| $TableHeader_lt .= $my_tableHeader_lt; |
| ~; |
| $TableHeader_lt =~ s/{yabb LetterLinks}/$LetterLinks/sm; |
| } |
| } |
| elsif ($to_id ne 'groups') { |
| |
| $TableHeader .= qq~ |
| $TableHeader .= $my_tableHeader; |
| <div $selUser onclick="location.href='$scripturl?action=imlist;sort=username;toid=$to_id';" style="float: left; width: 454px; text-align: center; padding-top: 2px; padding-bottom: 2px; border: 1px; border-style: outset; cursor: pointer;"><b>$usersel_txt{'alllist'}</b></div> |
| $TableHeader =~ s/{yabb instructtext}/$instructtext/sm; |
| ~; |
| $TableHeader =~ s/{yabb not_groups}/$not_groups/sm; |
| } |
| $TableHeader =~ s/{yabb not_groups_b}/$not_groups_b/sm; |
| elsif ($to_id eq 'groups') { |
| $TableHeader =~ s/{yabb TableHeader_lt}/$TableHeader_lt/sm; |
| $TableHeader .= qq~ |
| |
| <div $selUser onclick="location.href='$scripturl?action=imlist;sort=username;toid=$to_id';" style="float: left; width: 454px; text-align: center; padding-top: 2px; padding-bottom: 2px; border: 1px; border-style: outset; cursor: pointer;"><b>$usersel_txt{'groups'}</b></div> |
| $numbegin = ( $start + 1 ); |
| ~; |
| $numend = ( $start + $MembersPerPage ); |
| } |
| if ( $numend > $memcount ) { $numend = $memcount; } |
| $TableHeader .= qq~ |
| if ( $memcount == 0 ) { $numshow = q{}; } |
| </td> |
| else { $numshow = qq~($numbegin - $numend $usersel_txt{'of'} $memcount)~; } |
| </tr> |
| |
| ~; |
| if ( $x[0] ) { |
| if ($LetterLinks ne "") { |
| $yymain .= $my_usersel; |
| $TableHeader .= qq~ |
| $yymain =~ s/{yabb TableHeader}/$TableHeader/sm; |
| <tr> |
| $yymain =~ s/{yabb pageindex}/$pageindex/sm; |
| <td class="titlebg">$LetterLinks</td> |
| } |
| </tr> |
| else { |
| ~; |
| if ( $to_id ne 'groups' ) { |
| } |
| $my_inst3 = $usersel_txt{'instruct3'}; |
| $numbegin = ($start + 1); |
| } |
| $numend = ($start + $MembersPerPage); |
| $yymain .= $my_usersel_inst; |
| if ($numend > $memcount) { $numend = $memcount; } |
| $yymain =~ s/{yabb instruct_start}/$instruct_start/sm; |
| if ($memcount == 0) { $numshow = ''; } |
| $yymain =~ s/{yabb instruct_end}/$instruct_end/sm; |
| else { $numshow = qq~($numbegin - $numend $usersel_txt{'of'} $memcount)~; } |
| $yymain =~ s/{yabb pageindexjs}/$pageindexjs/sm; |
| |
| } |
| if ($_[0]) { |
| return; |
| $yymain .= qq~ |
| |
| <table border="0" width="464" cellspacing="1" cellpadding="3" class="bordercolor" style="table-layout: fixed;"> |
| |
| $TableHeader |
| |
| <tr> |
| |
| <td class="catbg" width="100%" height="26" align="left" valign="middle"> |
| |
| $pageindex |
| |
| </td> |
| |
| </tr> |
| |
| ~; |
| |
| } else { |
| |
| $yymain .= qq~ |
| |
| <tr> |
| |
| <td class="windowbg2" height="62" align="left" valign="middle"> |
| |
| <span class="small"> |
| |
| $instruct_start $instruct_end |
| |
| <br /> |
| |
| ~; |
| |
| |
| |
| unless ($to_id eq 'groups') { |
| |
| $usersel_txt{'instruct3'} |
| |
| } |
| |
| |
| |
| $yymain .= qq~ |
| |
| </span> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| </form> |
| |
| $pageindexjs |
| |
| ~; |
| |
| } |
| |
| } |
| } |
| |
| |
| sub userselectTemplate { |
| sub userselectTemplate { |
| &print_output_header; |
| print_output_header(); |
| |
| |
| $output = qq~<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| |
| <head> |
| |
| <title>$yytitle</title> |
| |
| <meta http-equiv="Content-Type" content="text/html; charset=$yycharset" /> |
| |
| <link rel="stylesheet" href="$forumstylesurl/$usestyle.css" type="text/css" /> |
| |
| <script language="JavaScript1.2" src="$yyhtml_root/ajax.js" type="text/javascript"></script> |
| |
| <script language="JavaScript1.2" type="text/javascript"> |
| |
| <!-- |
| |
| var scripturl = '$scripturl'; |
| |
| var noresults = '$usersel_txt{'noresults'}'; |
| |
| var imageurl = '$imagesdir'; |
| |
| |
| |
| function copy_option(to_select) { |
| |
| if (to_select == 'groups') { to_select = 'toshow'; var groupflag = true; } |
| |
| if (to_select == 'userspec') { |
| |
| opener.document.getElementById(to_select).value = document.selectuser.rec_list.options[document.selectuser.rec_list.selectedIndex].value; |
| |
| opener.document.getElementById('userspectext').value = document.selectuser.rec_list.options[document.selectuser.rec_list.selectedIndex].text; |
| |
| opener.document.getElementById('usrsel').style.display = 'none'; |
| |
| opener.document.getElementById('usrrem').style.display = 'inline'; |
| |
| opener.document.getElementById('searchme').disabled = true; |
| |
| window.close(); |
| |
| return; |
| |
| } |
| |
| var to_array = new Array(); |
| |
| var tmp_array = new Array(); |
| |
| var from_select = 'rec_list'; |
| |
| var z = 0; |
| |
| var pmtoshow = false; |
| |
| var alt_select1 = ''; |
| |
| var alt_select2 = ''; |
| |
| opener.document.getElementById(to_select).style.display = 'inline'; |
| |
| if (to_select == 'toshow' || to_select == 'toshowcc' || to_select == 'toshowbcc' || to_select == 'groups') { |
| |
| ~; |
| |
| |
| |
| if ($to_id ne 'groups') { |
| |
| if ($PMenable_cc && $PMenable_bcc) { |
| |
| $output .= qq~ |
| |
| alt_select1 = 'toshowcc'; alt_select2 = 'toshowbcc'; pmtoshow = true; |
| |
| if (to_select == 'toshowcc') { alt_select1 = 'toshow'; alt_select2 = 'toshowbcc'; } |
| |
| if (to_select == 'toshowbcc') { alt_select1 = 'toshow'; alt_select2 = 'toshowcc'; } |
| |
| ~; |
| |
| } elsif ($PMenable_cc) { |
| |
| $output .= qq~ |
| |
| alt_select1 = 'toshowcc'; pmtoshow = true; |
| |
| if (to_select == 'toshowcc') { alt_select1 = 'toshow'; pmtoshow = true; } |
| |
| ~; |
| |
| } elsif ($PMenable_bcc) { |
| |
| $output .= qq~ |
| |
| alt_select1 = 'toshowbcc'; pmtoshow = true; |
| |
| if (to_select == 'toshowbcc') { alt_select1 = 'toshow'; pmtoshow = true; } |
| |
| ~; |
| |
| } |
| |
| } |
| |
| |
| |
| $output .= qq~ |
| |
| } |
| |
| if (pmtoshow) { |
| |
| for (j = 0; j < document.getElementById(from_select).options.length; j++) { |
| |
| if (document.getElementById(from_select).options[j].selected) { |
| |
| for (x = 0; x < opener.document.getElementById(alt_select1).options.length; x++) { |
| |
| if (document.getElementById(from_select).options[j].text == opener.document.getElementById(alt_select1).options[x].text) document.getElementById(from_select).options[j].selected = false; |
| |
| } |
| |
| if (alt_select2 > '') { |
| |
| for (y = 0; y < opener.document.getElementById(alt_select2).options.length; y++) { |
| |
| if (document.getElementById(from_select).options[j].text == opener.document.getElementById(alt_select2).options[y].text) document.getElementById(from_select).options[j].selected = false; |
| |
| } |
| |
| } |
| |
| } |
| |
| } |
| |
| } |
| |
| for(i = 0; i < opener.document.getElementById(to_select).options.length; i++) { |
| |
| keep_this = true; |
| |
| for(j = 0; j < document.getElementById(from_select).options.length; j++) { |
| |
| if(document.getElementById(from_select).options[j].selected) { |
| |
| if(document.getElementById(from_select).options[j].text == opener.document.getElementById(to_select).options[i].text) keep_this = false; |
| |
| } |
| |
| } |
| |
| if(keep_this) { |
| |
| tmp_array[opener.document.getElementById(to_select).options[i].text] = opener.document.getElementById(to_select).options[i].value; |
| |
| to_array[z] = opener.document.getElementById(to_select).options[i].text; |
| |
| z++; |
| |
| } |
| |
| } |
| |
| var from_length = 0; |
| |
| var to_length = to_array.length; |
| |
| for(i = 0; i < document.getElementById(from_select).options.length; i++) { |
| |
| tmp_array[document.getElementById(from_select).options[i].text] = document.getElementById(from_select).options[i].value; |
| |
| if(document.getElementById(from_select).options[i].selected && document.getElementById(from_select).options[i].value != "") { |
| |
| to_array[to_length] = document.getElementById(from_select).options[i].text; |
| |
| to_length++; |
| |
| } |
| |
| } |
| |
| opener.document.getElementById(to_select).length = 0; |
| |
| to_array.sort(); |
| |
| for(i = 0; i < to_array.length; i++) { |
| |
| var tmp_option = opener.document.createElement("option"); |
| |
| opener.document.getElementById(to_select).appendChild(tmp_option); |
| |
| tmp_option.value = tmp_array[to_array[i]]; |
| |
| tmp_option.text = to_array[i]; |
| |
| } |
| |
| } |
| |
| // --> |
| |
| </script> |
| |
| </head> |
| |
| <body class="windowbg" style="margin: 0px; padding: 0px;"> |
| |
| $yymain |
| |
| </body> |
| |
| </html>~; |
| |
| |
| |
| $addsession = qq~<input type="hidden" name="formsession" value="$formsession" /></form>~; |
| $show_cc = q{}; |
| $output =~ s~</form>~$addsession~g; |
| if ( $to_id ne 'groups' ) { |
| |
| if ( $PMenable_cc && $PMenable_bcc ) { |
| |
| $show_cc .= q~ |
| |
| alt_select1 = 'toshowcc'; alt_select2 = 'toshowbcc'; pmtoshow = true; |
| |
| if (to_select == 'toshowcc') { alt_select1 = 'toshow'; alt_select2 = 'toshowbcc'; } |
| |
| if (to_select == 'toshowbcc') { alt_select1 = 'toshow'; alt_select2 = 'toshowcc'; } |
| |
| ~; |
| |
| } |
| |
| elsif ($PMenable_cc) { |
| |
| $show_cc .= q~ |
| |
| alt_select1 = 'toshowcc'; pmtoshow = true; |
| |
| if (to_select == 'toshowcc') { alt_select1 = 'toshow'; pmtoshow = true; } |
| |
| ~; |
| |
| } |
| |
| elsif ($PMenable_bcc) { |
| |
| $show_cc .= q~ |
| |
| alt_select1 = 'toshowbcc'; pmtoshow = true; |
| |
| if (to_select == 'toshowbcc') { alt_select1 = 'toshow'; pmtoshow = true; } |
| |
| ~; |
| |
| } |
| |
| } |
| |
| |
| |
| $output = $my_usersel_tem; |
| |
| $output =~ s/{yabb noresults}/$usersel_txt{'noresults'}/sm; |
| |
| $output =~ s/{yabb title}/$yytitle/sm; |
| |
| $output =~ s/{yabb show_cc}/$show_cc/sm; |
| |
| $output =~ s/{yabb main}/$yymain/sm; |
| |
| |
| |
| $addsession = |
| |
| qq~<input type="hidden" name="formsession" value="$formsession" /></form>~; |
| |
| $output =~ s/<\/form>/$addsession/gxsm; |
| |
| |
| &print_HTML_output_and_finish; |
| print_HTML_output_and_finish(); |
| |
| return; |
| } |
| } |
| |
| |
| sub loadRecentPMs { |
| sub loadRecentPMs { |
| my ($pack, $file, $line) = caller; |
| my ( $pack, $file, $line ) = caller; |
| $yytrace .= qq~<br>loadrecentpms from ($pack, $file, $line)<br />=========================~; |
| $yytrace .= |
| |
| qq~<br />loadrecentpms from ($pack, $file, $line)<br />=========================~; |
| ## put simple, this reads the msg , outbox and storage files to |
| |
| ## harvest already-used membernames |
| ## put simple, this reads the msg , outbox and storage files to |
| my (@userinbox, @useroutbox, @userstore, @usermessages); |
| ## harvest already-used membernames |
| if (-e "$memberdir/$username.msg") { |
| my ( @userinbox, @useroutbox, @userstore, @usermessages ); |
| fopen(USERMSG,"$memberdir/$username.msg"); |
| if ( -e "$memberdir/$username.msg" ) { |
| @userinbox = <USERMSG>; |
| fopen( USERMSG, "$memberdir/$username.msg" ); |
| fclose(USERMSG); |
| @userinbox = <USERMSG>; |
| if (@userinbox) { push(@usermessages, @userinbox); } |
| fclose(USERMSG); |
| undef @userinbox; |
| if (@userinbox) { push @usermessages, @userinbox; } |
| } |
| undef @userinbox; |
| if (-e "$memberdir/$username.outbox") { |
| } |
| fopen(USEROUT,"$memberdir/$username.outbox"); |
| if ( -e "$memberdir/$username.outbox" ) { |
| @useroutbox = <USEROUT>; |
| fopen( USEROUT, "$memberdir/$username.outbox" ); |
| fclose(USEROUT); |
| @useroutbox = <USEROUT>; |
| if (@useroutbox) { push(@usermessages, @useroutbox); } |
| fclose(USEROUT); |
| undef @useroutbox; |
| if (@useroutbox) { push @usermessages, @useroutbox; } |
| } |
| undef @useroutbox; |
| if (-e "$memberdir/$username.imstore") { |
| } |
| fopen(USERSTR,"$memberdir/$username.imstore"); |
| if ( -e "$memberdir/$username.imstore" ) { |
| @userstore = <USERSTR>; |
| fopen( USERSTR, "$memberdir/$username.imstore" ); |
| fclose(USERSTR); |
| @userstore = <USERSTR>; |
| if (@userstore) { push(@usermessages, @userstore); } |
| fclose(USERSTR); |
| undef @userstore; |
| if (@userstore) { push @usermessages, @userstore; } |
| } |
| undef @userstore; |
| if (!@usermessages) { return; } |
| } |
| @recentUsers = (); |
| if ( !@usermessages ) { return; } |
| foreach my $usermessage (@usermessages) { |
| @recentUsers = (); |
| ## split down to all strings of names |
| foreach my $usermessage (@usermessages) { |
| my ($messid, $fromName, $toNames, $toCCNames, $toBCCNames, undef, undef, undef, undef, undef, undef, $messStatus, undef) = split(/\|/, $usermessage); # pull name from PM |
| ## split down to all strings of names |
| if ($messStatus =~ /b/ || $messStatus =~ /g/) { next; } |
| my ( |
| ## push all name strings |
| $messid, $fromName, $toNames, $toCCNames, $toBCCNames, |
| if ($fromName && $fromName ne $username) { push(@recentUsers, $fromName); } |
| undef, undef, undef, undef, undef, |
| if ($toNames) { |
| undef, $messStatus, undef |
| foreach my $listItem (split(/\,/, $toNames)) { |
| ) = split /\|/xsm, $usermessage; # pull name from PM |
| if ($listItem ne $username) { push(@recentUsers, $listItem); } |
| if ( $messStatus =~ m/b/sm || $messStatus =~ m/g/sm ) { next; } |
| } |
| ## push all name strings |
| } |
| if ( $fromName && $fromName ne $username ) { |
| if ($toCCNames) { |
| push @recentUsers, $fromName; |
| foreach $listItem (split(/\,/, $toCCNames)) { |
| } |
| if ($listItem ne $username) { push(@recentUsers, $listItem); } |
| if ($toNames) { |
| } |
| foreach my $listItem ( split /\,/xsm, $toNames ) { |
| } |
| if ( $listItem ne $username ) { push @recentUsers, $listItem; } |
| if ($toBCCNames) { |
| } |
| foreach my $listItem (split(/\,/, $toBCCNames)) { |
| } |
| if ($listItem ne $username) { push(@recentUsers, $listItem); } |
| if ($toCCNames) { |
| } |
| foreach my $listItem ( split /\,/xsm, $toCCNames ) { |
| } |
| if ( $listItem ne $username ) { |
| } |
| push @recentUsers, $listItem; |
| @recentUsers = &undupe(@recentUsers); |
| } |
| @recentUsers = sort @recentUsers; |
| } |
| return @recentUsers; |
| } |
| |
| if ($toBCCNames) { |
| |
| foreach my $listItem ( split /\,/xsm, $toBCCNames ) { |
| |
| if ( $listItem ne $username ) { |
| |
| push @recentUsers, $listItem; |
| |
| } |
| |
| } |
| |
| } |
| |
| } |
| |
| @recentUsers = undupe(@recentUsers); |
| |
| @recentUsers = sort @recentUsers; |
| |
| return @recentUsers; |
| } |
| } |
| |
| |
| sub quickSearch { |
| sub quickSearch { |
| &fatal_error("no_access") if !$iamadmin && !$iamgmod; |
| if ( !$iamadmin && !$iamgmod ) { fatal_error('no_access'); } |
| |
| |
| $to_id = $INFO{'toid'}; |
| |
| $yymain = qq~ |
| |
| <div class="bordercolor" style="width:300px"> |
| |
| <table cellpadding="3" cellspacing="1" border="0" width="300"> |
| |
| <tr> |
| |
| <td class="titlebg"><label for="letter">$usersel_txt{'qsearch'}</label></td> |
| |
| </tr><tr> |
| |
| <td class="windowbg2"> |
| |
| <div style="float:left"><input type="text" name="letter" id="letter" onkeyup="LetterChange(this.value)" style="width:270px" /></div> |
| |
| <div style="float:right"><img src="$imagesdir/mozilla_gray.gif" id="load" alt="" /></div> |
| |
| </td> |
| |
| </tr><tr> |
| |
| <td class="windowbg"> |
| |
| <select name="rec_list" multiple="multiple" id="rec_list" size="10" style="width: 290px; font-size: 11px;" ondblclick="copy_option('$to_id')"><option></option></select> |
| |
| </td> |
| |
| </tr><tr> |
| |
| <td class="windowbg"> |
| |
| <input type="button" class="button" onclick="copy_option('$to_id')" value="$usersel_txt{'addselected'}" style="width: 145px;" /><input type="button" class="button" onclick="window.close()" value="$usersel_txt{'pageclose'}" style="width: 145px;" /> |
| |
| </td> |
| |
| </tr><tr> |
| |
| <td class="windowbg2"> |
| |
| <br /><span class="small">$usersel_txt{'instruct0'} $usersel_txt{'moderatorlist'}</span><br /><br /> |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| </div> |
| |
| <div id="response" style="display:none"> </div> |
| |
| ~; |
| |
| |
| |
| $yytitle = $usersel_txt{'modpagetitle'}; |
| $to_id = $INFO{'toid'}; |
| &userselectTemplate; |
| $yymain = $my_quickSearch; |
| |
| $yymain =~ s/{yabb to_id}/$to_id/gsm; |
| |
| |
| |
| $yytitle = $usersel_txt{'modpagetitle'}; |
| |
| userselectTemplate(); |
| |
| return; |
| } |
| } |
| |
| |
| sub doquicksearch { |
| sub doquicksearch { |
| &fatal_error("no_access") if !$iamadmin && !$iamgmod; |
| if ( !$iamadmin && !$iamgmod ) { fatal_error('no_access'); } |
| |
| |
| &ManageMemberinfo("load"); |
| ManageMemberinfo('load'); |
| my (@matches,$realname,$membername); |
| my (@matches); |
| foreach $membername (sort { lc $memberinf{$a} cmp lc $memberinf{$b} } keys %memberinf) { |
| foreach my $membername ( |
| ($realname,undef) = split(/\|/, $memberinf{$membername}, 2); |
| sort { lc $memberinf{$a} cmp lc $memberinf{$b} } |
| if ($realname =~ /^$INFO{'letter'}/i) { |
| keys %memberinf |
| push(@matches, $realname,$membername); |
| ) |
| } |
| { |
| } |
| my ( $realname, undef ) = split /\|/xsm, $memberinf{$membername}, 2; |
| print "Content-type: text/plain\n\n"; |
| if ( $realname =~ /^$INFO{'letter'}/ixsm ) { |
| print join(",", @matches); |
| push @matches, $realname, $membername; |
| |
| } |
| |
| } |
| |
| print "Content-type: text/plain\n\n" |
| |
| or croak "$croak{'print'} content-type"; |
| |
| print join q{,}, @matches or croak "$croak{'print'} matches"; |
| |
| |
| CORE::exit; # This is here only to avoid server error log entries! |
| CORE::exit; # This is here only to avoid server error log entries! |
| |
| return; |
| } |
| } |
| |
| |
| sub checkUserAvail { |
| sub checkUserAvail { |
| |
| LoadLanguage('Register'); |
| |
| my $taken = 'false'; |
| |
| |
| &LoadLanguage('Register'); |
| fopen( RESERVE, "$vardir/reserve.txt" ) |
| |
| or fatal_error( 'cannot_open', "$vardir/reserve.txt", 1 ); |
| my $taken = "false"; |
| @reserve = <RESERVE>; |
| |
| fclose(RESERVE); |
| fopen(RESERVE, "$vardir/reserve.txt") || &fatal_error("cannot_open","$vardir/reserve.txt", 1); |
| fopen( RESERVECFG, "$vardir/reservecfg.txt" ) |
| @reserve = <RESERVE>; |
| or fatal_error( 'cannot_open', "$vardir/reservecfg.txt", 1 ); |
| fclose(RESERVE); |
| @reservecfg = <RESERVECFG>; |
| fopen(RESERVECFG, "$vardir/reservecfg.txt") || &fatal_error("cannot_open","$vardir/reservecfg.txt", 1); |
| fclose(RESERVECFG); |
| @reservecfg = <RESERVECFG>; |
| |
| fclose(RESERVECFG); |
| for my $i ( 0 .. $#reservecfg ) { |
| for ($a = 0; $a < @reservecfg; $a++) { |
| chomp $reservecfg[$i]; |
| chomp $reservecfg[$a]; |
| } |
| } |
| $matchword = $reservecfg[0] eq 'checked'; |
| $matchword = $reservecfg[0] eq 'checked'; |
| $matchcase = $reservecfg[1] eq 'checked'; |
| $matchcase = $reservecfg[1] eq 'checked'; |
| $matchuser = $reservecfg[2] eq 'checked'; |
| $matchuser = $reservecfg[2] eq 'checked'; |
| $matchname = $reservecfg[3] eq 'checked'; |
| $matchname = $reservecfg[3] eq 'checked'; |
| $namecheck = $matchcase eq 'checked' ? $INFO{'user'} : lc $INFO{'user'}; |
| $namecheck = $matchcase eq 'checked' ? $INFO{'user'} : lc $INFO{'user'}; |
| $realnamecheck = |
| $realnamecheck = $matchcase eq 'checked' ? $INFO{'display'} : lc $INFO{'display'}; |
| $matchcase eq 'checked' ? $INFO{'display'} : lc $INFO{'display'}; |
| |
| |
| if ($INFO{'type'} eq "email") { |
| if ( $INFO{'type'} eq 'email' ) { |
| $INFO{'email'} =~ s~\A\s+|\s+\z~~g; |
| $INFO{'email'} =~ s/\A\s+|\s+\z//gxsm; |
| $type = $register_txt{'112'}; |
| $type = $register_txt{'112'}; |
| if (lc $INFO{'email'} eq lc &MemberIndex("check_exist", $INFO{'email'})) { $taken = "true"; } |
| if ( |
| } elsif ($INFO{'type'} eq "display") { |
| lc $INFO{'email'} eq lc MemberIndex( 'check_exist', $INFO{'email'}, 2 ) |
| $INFO{'display'} =~ s~\A\s+|\s+\z~~g; |
| ) |
| $type = $register_txt{'111'}; |
| { |
| if ((lc $INFO{'display'} eq lc &MemberIndex("check_exist", $INFO{'display'})) && (lc $INFO{'display'} ne lc ${$uid.$username}{'realname'})) { |
| $taken = 'true'; |
| $taken = "true"; |
| } |
| } |
| } |
| if ($matchname) { |
| elsif ( $INFO{'type'} eq 'display' ) { |
| foreach $reserved (@reserve) { |
| $INFO{'display'} =~ s/\A\s+|\s+\z//gxsm; |
| chomp $reserved; |
| $type = $register_txt{'111'}; |
| $reservecheck = $matchcase ? $reserved : lc $reserved; |
| if ( |
| if ($matchword) { |
| ( |
| if ($realnamecheck eq $reservecheck) { $taken = "reg"; break; } |
| lc $INFO{'display'} eq |
| } else { |
| lc MemberIndex( 'check_exist', $INFO{'display'}, 1 ) |
| if ($realnamecheck =~ $reservecheck) { $taken = "reg"; break; } |
| ) |
| } |
| && ( lc $INFO{'display'} ne lc ${ $uid . $username }{'realname'} ) |
| } |
| ) |
| } |
| { |
| } elsif ($INFO{'type'} eq "user") { |
| $taken = 'true'; |
| $INFO{'user'} =~ s~\A\s+|\s+\z~~g; |
| } |
| $INFO{'user'} =~ s/\s/_/g; |
| if ($matchname) { |
| $type = $register_txt{'110'}; |
| foreach my $reserved (@reserve) { |
| if (lc $INFO{'user'} eq lc &MemberIndex("check_exist", $INFO{'user'})) { |
| chomp $reserved; |
| $taken = "true"; |
| $reservecheck = $matchcase ? $reserved : lc $reserved; |
| } |
| if ($matchword) { |
| if ($matchuser) { |
| if ( $realnamecheck eq $reservecheck ) { |
| foreach $reserved (@reserve) { |
| $taken = 'reg'; |
| chomp $reserved; |
| break; |
| $reservecheck = $matchcase ? $reserved : lc $reserved; |
| } |
| if ($matchword) { |
| } |
| if ($namecheck eq $reservecheck) { $taken = "reg"; break; } |
| else { |
| } else { |
| if ( $realnamecheck =~ $reservecheck ) { |
| if ($namecheck =~ $reservecheck) { $taken = "reg"; break; } |
| $taken = 'reg'; |
| } |
| break; |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| } |
| if ($taken eq "false") { |
| } |
| $avail = qq~<img src="$imagesdir/check.png"> <span style="color:#00dd00">$type$register_txt{'114'}</span>~; |
| elsif ( $INFO{'type'} eq 'user' ) { |
| } elsif ($taken eq "true") { |
| $INFO{'user'} =~ s/\A\s+|\s+\z//gxsm; |
| $avail = qq~<img src="$imagesdir/cross.png"> <span style="color:#dd0000">$type$register_txt{'113'}</span>~; |
| $INFO{'user'} =~ s/\s/_/gxsm; |
| } else { |
| $type = $register_txt{'110'}; |
| $avail = qq~<img src="$imagesdir/cross.png"> <span style="color:#dd0000">$type$register_txt{'115'}</span>~; |
| if ( |
| } |
| lc $INFO{'user'} eq lc MemberIndex( 'check_exist', $INFO{'user'}, 0 ) ) |
| |
| { |
| |
| $taken = 'true'; |
| |
| } |
| |
| if ($matchuser) { |
| |
| foreach my $reserved (@reserve) { |
| |
| chomp $reserved; |
| |
| $reservecheck = $matchcase ? $reserved : lc $reserved; |
| |
| if ($matchword) { |
| |
| if ( $namecheck eq $reservecheck ) { |
| |
| $taken = 'reg'; |
| |
| break; |
| |
| } |
| |
| } |
| |
| else { |
| |
| if ( $namecheck =~ $reservecheck ) { |
| |
| $taken = 'reg'; |
| |
| break; |
| |
| } |
| |
| } |
| |
| } |
| |
| } |
| |
| } |
| |
| |
| |
| if ( $taken eq 'false' ) { |
| |
| $avail = |
| |
| qq~<img src="$imagesdir/check.png"> <span style="color:#00dd00">$type$register_txt{'114'}</span>~; |
| |
| } |
| |
| elsif ( $taken eq 'true' ) { |
| |
| $avail = |
| |
| qq~<img src="$imagesdir/cross.png"> <span style="color:#dd0000">$type$register_txt{'113'}</span>~; |
| |
| } |
| |
| else { |
| |
| $avail = |
| |
| qq~<img src="$imagesdir/cross.png"> <span style="color:#dd0000">$type$register_txt{'115'}</span>~; |
| |
| } |
| |
| |
| print "Content-type: text/plain\n\n$INFO{'type'}|$avail"; |
| print "Content-type: text/plain;charset=$yymycharset;\n\n$INFO{'type'}|$avail" |
| |
| or croak "$croak{'print'} avail"; |
| |
| |
| CORE::exit; # This is here only to avoid server error log entries! |
| CORE::exit; # This is here only to avoid server error log entries! |
| |
| return; |
| } |
| } |
| |
| |
| 1; |
| 1; |
| |
| |