| ############################################################################### |
| ############################################################################### |
| # Memberlist.pl # |
| # Memberlist.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. # |
| ############################################################################### |
| ############################################################################### |
| |
| # use strict; |
| |
| #use warnings; |
| |
| #no warnings qw(uninitialized once redefine); |
| |
| use CGI::Carp qw(fatalsToBrowser); |
| |
| our $VERSION = '2.6.12'; |
| |
| |
| |
| $memberlistpmver = 'YaBB 2.6.12 $Revision: 1710 $'; |
| |
| if ( $action eq 'detailedversion' ) { return 1; } |
| |
| |
| |
| if ( $iamguest && $ML_Allowed ) { fatal_error('no_access'); } |
| |
| if ( $ML_Allowed == 2 && !$staff ) { |
| |
| fatal_error('no_access'); |
| |
| } |
| |
| if ( ( $ML_Allowed == 3 && !$iamadmin && !$iamgmod ) |
| |
| || ( $ML_Allowed == 4 && !$iamadmin && !$iamgmod && !$iamfmod ) ) |
| |
| { |
| |
| fatal_error('no_access'); |
| |
| } |
| |
| |
| $memberlistplver = 'YaBB 2.5.2 $Revision: 1.0 $'; |
| LoadLanguage('MemberList'); |
| if ($action eq 'detailedversion') { return 1; } |
| get_micon(); |
| |
| get_template('Memberlist'); |
| if ($iamguest && $ML_Allowed) { &fatal_error('no_access'); } |
| |
| if ($ML_Allowed == 2 && !$iamadmin && !$iamgmod && !$iammod) { &fatal_error('no_access'); } |
| |
| if ($ML_Allowed == 3 && !$iamadmin && !$iamgmod) { &fatal_error('no_access'); } |
| |
| |
| |
| &LoadLanguage('MemberList'); |
| |
| |
| |
| $MembersPerPage = $TopAmmount; |
| $MembersPerPage = $TopAmmount; |
| $maxbar = 100; |
| $maxbar = 100; |
| $dr_warning = ''; |
| $dr_warning = q{}; |
| $forumstart = $forumstart ? &stringtotime($forumstart) : "1104537600"; |
| $forumstart = $forumstart ? stringtotime($forumstart) : '1104537600'; |
| |
| |
| |
| |
| sub Ml { |
| sub Ml { |
| # Decides how to sort memberlist, and gives default sort order |
| |
| |
| |
| if (!$barmaxnumb) { $barmaxnumb = 500; } |
| # Decides how to sort memberlist, and gives default sort order |
| if ($barmaxdepend == 1) { |
| |
| $barmax = 1; |
| |
| &ManageMemberinfo("load"); |
| |
| while (($key, $value) = each(%memberinf)) { |
| |
| (undef, undef, undef, $memposts) = split(/\|/, $value); |
| |
| if ($memposts > $barmax) { $barmax = $memposts; } |
| |
| } |
| |
| undef %memberinf; |
| |
| } else { |
| |
| $barmax = $barmaxnumb; |
| |
| } |
| |
| |
| |
| $FORM{'sortform'} ||= $INFO{'sortform'}; # Fix for Javascript disabled |
| |
| if ($INFO{'sort'} eq "" && $FORM{'sortform'} eq "") { $INFO{'sort'} = $defaultml; $FORM{'sortform'} = $defaultml; } |
| |
| |
| |
| if ($FORM{'sortform'} eq "username" || $INFO{'sort'} eq "mlletter" || $INFO{'sort'} eq "username") { |
| |
| $page = "a"; |
| |
| $showpage = "A"; |
| |
| while ($page ne "z") { |
| |
| $LetterLinks .= qq(<a href="$scripturl?action=ml;sort=mlletter;letter=$page" class="catbg a"><b>$showpage </b></a> ); |
| |
| $page++; |
| |
| $showpage++; |
| |
| } |
| |
| $LetterLinks .= qq(<a href="$scripturl?action=ml;sort=mlletter;letter=z" class="catbg a"><b>Z</b></a> <a href="$scripturl?action=ml;sort=mlletter;letter=other" class="catbg a"><b>$ml_txt{'800'}</b></a> ); |
| |
| } |
| |
| |
| |
| if ($INFO{'start'} eq "") { $start = 0; } |
| |
| else { $start = "$INFO{'start'}"; } |
| |
| if ($FORM{'sortform'} eq "posts" || $INFO{'sort'} eq "posts") { $selcPost .= qq( selected="selected"); $selPost .= qq(class="windowbg"); } |
| |
| else { $selPost .= qq(class="windowbg2"); } |
| |
| if ($FORM{'sortform'} eq "regdate" || $INFO{'sort'} eq "regdate") { $selcReg .= qq( selected="selected"); $selReg .= qq(class="windowbg"); } |
| |
| else { $selReg .= qq(class="windowbg2"); } |
| |
| if ($FORM{'sortform'} eq "position" || $INFO{'sort'} eq "position") { $selcPos .= qq( selected="selected"); $selPos .= qq(class="windowbg"); } |
| |
| else { $selPos .= qq(class="windowbg2"); } |
| |
| if ($FORM{'sortform'} eq "username" || $INFO{'sort'} eq "mlletter" || $INFO{'sort'} eq "username") { $selcUser .= qq( selected="selected"); $selUser .= qq(class="windowbg"); } |
| |
| else { $selUser .= qq(class="windowbg2"); } |
| |
| |
| |
| if ($FORM{'sortform'} eq "posts" || $INFO{'sort'} eq "posts") { &MLTop; } |
| |
| if ($FORM{'sortform'} eq "regdate" || $INFO{'sort'} eq "regdate") { &MLDate; } |
| |
| if ($FORM{'sortform'} eq "position" || $INFO{'sort'} eq "position") { &MLPosition; } |
| |
| if ($FORM{'sortform'} eq "memsearch" || $INFO{'sort'} eq "memsearch") { &FindMembers; } |
| |
| if ($INFO{'sort'} eq "" || $INFO{'sort'} eq "mlletter" || $INFO{'sort'} eq "username") { &MLByLetter; } |
| |
| |
| |
| |
| if ( !$barmaxnumb ) { $barmaxnumb = 500; } |
| |
| if ( $barmaxdepend == 1 ) { |
| |
| $barmax = 1; |
| |
| ManageMemberinfo('load'); |
| |
| while ( ( $key, $value ) = each %memberinf ) { |
| |
| ( undef, undef, undef, $memposts ) = split /\|/xsm, $value; |
| |
| if ( $memposts > $barmax ) { $barmax = $memposts; } |
| |
| } |
| |
| undef %memberinf; |
| |
| } |
| |
| else { |
| |
| $barmax = $barmaxnumb; |
| |
| } |
| |
| |
| |
| $FORM{'sortform'} ||= $INFO{'sortform'}; # Fix for Javascript disabled |
| |
| if ( $INFO{'sort'} eq q{} && $FORM{'sortform'} eq q{} ) { |
| |
| $INFO{'sort'} = $defaultml; |
| |
| $FORM{'sortform'} = $defaultml; |
| |
| } |
| |
| |
| |
| if ( $FORM{'sortform'} eq 'username' |
| |
| || $INFO{'sort'} eq 'mlletter' |
| |
| || $INFO{'sort'} eq 'username' ) |
| |
| { |
| |
| $page = 'a'; |
| |
| $showpage = 'A'; |
| |
| while ( $page ne 'z' ) { |
| |
| $LetterLinks .= |
| |
| qq(<a href="$scripturl?action=ml;sort=mlletter;letter=$page" class="$letterclass"><b>$showpage </b></a> ); |
| |
| $page++; |
| |
| $showpage++; |
| |
| } |
| |
| $LetterLinks .= |
| |
| qq(<a href="$scripturl?action=ml;sort=mlletter;letter=z" class="$letterclass"><b>Z</b></a> <a href="$scripturl?action=ml;sort=mlletter;letter=other" class="$letterclass"><b>$ml_txt{'800'}</b></a> ); |
| |
| } |
| |
| |
| |
| if ( $INFO{'start'} eq q{} ) { $start = 0; } |
| |
| else { $start = "$INFO{'start'}"; } |
| |
| if ( $FORM{'sortform'} eq 'posts' || $INFO{'sort'} eq 'posts' ) { |
| |
| $selcPost .= q~ selected="selected"~; |
| |
| $selPost .= qq~class="$header_class_selected"~; |
| |
| } |
| |
| else { $selPost .= qq~class="$header_class"~; } |
| |
| if ( $FORM{'sortform'} eq 'regdate' || $INFO{'sort'} eq 'regdate' ) { |
| |
| $selcReg .= q~ selected="selected"~; |
| |
| $selReg .= qq~class="$header_class_selected"~; |
| |
| } |
| |
| else { $selReg .= qq~class="$header_class"~; } |
| |
| if ( $FORM{'sortform'} eq 'position' || $INFO{'sort'} eq 'position' ) { |
| |
| $selcPos .= q~ selected="selected"~; |
| |
| $selPos .= qq~class="$header_class_selected"~; |
| |
| } |
| |
| else { $selPos .= qq~class="$header_class"~; } |
| |
| if ( $FORM{'sortform'} eq 'username' |
| |
| || $INFO{'sort'} eq 'mlletter' |
| |
| || $INFO{'sort'} eq 'username' ) |
| |
| { |
| |
| $selcUser .= q~ selected="selected"~; |
| |
| $selUser .= qq~class="$header_class_selected"~; |
| |
| } |
| |
| else { $selUser .= qq~class="$header_class"~; } |
| |
| |
| |
| if ( $FORM{'sortform'} eq 'posts' || $INFO{'sort'} eq 'posts' ) { MLTop(); } |
| |
| if ( $FORM{'sortform'} eq 'regdate' || $INFO{'sort'} eq 'regdate' ) { |
| |
| MLDate(); |
| |
| } |
| |
| if ( $FORM{'sortform'} eq 'position' || $INFO{'sort'} eq 'position' ) { |
| |
| MLPosition(); |
| |
| } |
| |
| if ( $FORM{'sortform'} eq 'memsearch' || $INFO{'sort'} eq 'memsearch' ) { |
| |
| FindMembers(); |
| |
| } |
| |
| if ( $INFO{'sort'} eq q{} |
| |
| || $INFO{'sort'} eq 'mlletter' |
| |
| || $INFO{'sort'} eq 'username' ) |
| |
| { |
| |
| MLByLetter(); |
| |
| } |
| |
| return; |
| } |
| } |
| |
| |
| sub MLByLetter { |
| sub MLByLetter { |
| $letter = lc($INFO{'letter'}); |
| $letter = lc $INFO{'letter'}; |
| $i = 0; |
| $i = 0; |
| &ManageMemberinfo("load"); |
| ManageMemberinfo('load'); |
| foreach $membername (sort { lc $memberinf{$a} cmp lc $memberinf{$b} } keys %memberinf) { |
| foreach my $membername ( |
| ($memrealname, $mememail, undef, undef) = split(/\|/, $memberinf{$membername}); |
| sort { lc $memberinf{$a} cmp lc $memberinf{$b} } |
| if ($letter) { |
| keys %memberinf |
| $SearchName = lc(substr($memrealname, 0, 1)); |
| ) |
| if ($SearchName eq $letter) { $ToShow[$i] = $membername; $i++; } |
| { |
| elsif ($letter eq "other" && (($SearchName lt "a") || ($SearchName gt "z"))) { $ToShow[$i] = $membername; $i++; } |
| ( $memrealname, $mememail, undef, undef ) = |
| } else { |
| split /\|/xsm, $memberinf{$membername}; |
| $ToShow[$i] = $membername; |
| if ($letter) { |
| $i++; |
| $SearchName = lc( substr $memrealname, 0, 1 ); |
| } |
| if ( $SearchName eq $letter ) { $ToShow[$i] = $membername; $i++; } |
| } |
| elsif ( $letter eq 'other' |
| undef %memberinf; |
| && ( ( $SearchName lt 'a' ) || ( $SearchName gt 'z' ) ) ) |
| $memcount = @ToShow; |
| { |
| if (!$memcount && $letter) { |
| $ToShow[$i] = $membername; |
| $pageindex1 = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;"><img src="$imagesdir/index_togl.gif" border="0" alt="" style="vertical-align: middle;" /></span>~; |
| $i++; |
| $pageindex2 = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;"><img src="$imagesdir/index_togl.gif" border="0" alt="" style="vertical-align: middle;" /></span>~; |
| } |
| } else { |
| } |
| &buildIndex; |
| else { |
| } |
| $ToShow[$i] = $membername; |
| &buildPages(1); |
| $i++; |
| $b = $start; |
| } |
| $numshown = 0; |
| } |
| if ($memcount) { |
| undef %memberinf; |
| while ($numshown < $MembersPerPage) { |
| $memcount = @ToShow; |
| &showRows($ToShow[$b]); |
| if ( !$memcount && $letter ) { |
| $numshown++; |
| $pageindex1 = |
| $b++; |
| q~<span ~ |
| } |
| . $pgindex_class |
| } else { |
| . qq~><img src="$index_togl{'index_togl'}" alt="" /></span>~; |
| if ($letter) { $yymain .= qq~<tr><td class="windowbg" colspan="$headercount" align="center"><br /><b>$ml_txt{'760'}</b><br /><br /></td></tr>~; } |
| $pageindex2 = |
| } |
| q~<span ~ |
| undef @ToShow; |
| . $pgindex_class |
| &buildPages(0); |
| . qq~><img src="$index_togl{'index_togl'}" alt="" /></span>~; |
| $yytitle = "$ml_txt{'312'} $numshow"; |
| } |
| &template; |
| else { |
| |
| buildIndex(); |
| |
| } |
| |
| buildPages(1); |
| |
| $bb = $start; |
| |
| $numshown = 0; |
| |
| if ($memcount) { |
| |
| while ( $numshown < $MembersPerPage ) { |
| |
| showRows( $ToShow[$bb] ); |
| |
| $numshown++; |
| |
| $bb++; |
| |
| } |
| |
| } |
| |
| else { |
| |
| if ($letter) { |
| |
| $yymain .= $my_letter; |
| |
| $yymain =~ s/{yabb headercount}/$headercount/sm; |
| |
| } |
| |
| } |
| |
| undef @ToShow; |
| |
| buildPages(0); |
| |
| $yytitle = "$ml_txt{'312'} $numshow"; |
| |
| template(); |
| |
| return; |
| } |
| } |
| |
| |
| sub MLTop { |
| sub MLTop { |
| %top_list = (); |
| %top_list = (); |
| &ManageMemberinfo("load"); |
| ManageMemberinfo('load'); |
| while (($membername, $value) = each(%memberinf)) { |
| while ( ( $membername, $value ) = each %memberinf ) { |
| ($memrealname, undef, undef, $memposts) = split(/\|/, $value); |
| ( $memrealname, undef, undef, $memposts ) = split /\|/xsm, $value; |
| $memposts = sprintf("%06d", (999999 - $memposts)); |
| $memposts = sprintf '%06d', ( 999_999 - $memposts ); |
| $top_list{$membername} = qq~$memposts|$memrealname~; |
| $top_list{$membername} = qq~$memposts|$memrealname~; |
| } |
| } |
| undef %memberinf; |
| undef %memberinf; |
| my @toplist = sort { lc $top_list{$a} cmp lc $top_list{$b} } keys %top_list; |
| my @toplist = sort { lc $top_list{$a} cmp lc $top_list{$b} } keys %top_list; |
| $memcount = @toplist; |
| $memcount = @toplist; |
| &buildIndex; |
| buildIndex(); |
| &buildPages(1); |
| buildPages(1); |
| $b = $start; |
| $bb = $start; |
| $numshown = 0; |
| $numshown = 0; |
| |
| |
| while ($numshown < $MembersPerPage) { |
| while ( $numshown < $MembersPerPage ) { |
| &showRows($toplist[$b]); |
| showRows( $toplist[$bb] ); |
| $numshown++; |
| $numshown++; |
| $b++; |
| $bb++; |
| } |
| } |
| undef @toplist; |
| undef @toplist; |
| &buildPages(0); |
| buildPages(0); |
| $yytitle = "$ml_txt{'313'} $ml_txt{'314'} $numshow"; |
| $yytitle = "$ml_txt{'313'} $ml_txt{'314'} $numshow"; |
| &template; |
| template(); |
| |
| return; |
| } |
| } |
| |
| |
| sub MLPosition { |
| sub MLPosition { |
| %TopMembers = (); |
| %TopMembers = (); |
| &ManageMemberinfo("load"); |
| ManageMemberinfo('load'); |
| |
| |
| my %nopostorder; |
| my %nopostorder; |
| for (my $i = 0; $i < @nopostorder; $i++) { $nopostorder{$nopostorder[$i]} = $i;} |
| for my $i ( 0 .. $#nopostorder ) { |
| |
| $nopostorder{ $nopostorder[$i] } = $i; |
| memberposition: while (($membername, $value) = each(%memberinf)) { |
| } |
| ($memberrealname, undef, $memposition, $memposts) = split(/\|/, $value); |
| |
| $memposts = 9999999999 - $memposts; |
| MEMBERPOSITION: while ( ( $membername, $value ) = each %memberinf ) { |
| |
| ( $memberrealname, undef, $memposition, $memposts ) = |
| foreach (keys %Group) { |
| split /\|/xsm, $value; |
| if ($memposition eq $_) { |
| $memposts = 9_999_999_999 - $memposts; |
| if ($_ eq "Administrator") { |
| |
| $TopMembers{$membername} = "a$memposts$memberrealname"; |
| foreach ( keys %Group ) { |
| next memberposition; |
| if ( $memposition eq $_ ) { |
| } elsif ($_ eq "Global Moderator") { |
| if ( $_ eq 'Administrator' ) { |
| $TopMembers{$membername} = "b$memposts$memberrealname"; |
| $TopMembers{$membername} = "a$memposts$memberrealname"; |
| next memberposition; |
| next MEMBERPOSITION; |
| } |
| } |
| } |
| elsif ( $_ eq 'Global Moderator' ) { |
| } |
| $TopMembers{$membername} = "b$memposts$memberrealname"; |
| |
| next MEMBERPOSITION; |
| foreach (keys %NoPost) { |
| } |
| if ($_ == $memposition) { |
| elsif ( $_ eq 'Mid Moderator' ) { |
| $memposition = sprintf("%06d", $nopostorder{$_}); |
| $TopMembers{$membername} = "bc$memposts$memberrealname"; |
| $TopMembers{$membername} = "d$memposition$memposts$memberrealname"; |
| next MEMBERPOSITION; |
| next memberposition; |
| } |
| } |
| } |
| } |
| } |
| |
| |
| $TopMembers{$membername} = "e$memposts$memberrealname"; |
| foreach ( keys %NoPost ) { |
| } |
| if ( $_ == $memposition ) { |
| my @toplist = sort { lc($TopMembers{$a}) cmp lc($TopMembers{$b})} keys %TopMembers; |
| $memposition = sprintf '%06d', $nopostorder{$_}; |
| $memcount = @toplist; |
| $TopMembers{$membername} = |
| &buildIndex; |
| "d$memposition$memposts$memberrealname"; |
| &buildPages(1); |
| next MEMBERPOSITION; |
| $b = $start; |
| } |
| $numshown = 0; |
| } |
| while ($numshown < $MembersPerPage) { |
| |
| &showRows($toplist[$b]); |
| $TopMembers{$membername} = "e$memposts$memberrealname"; |
| $numshown++; |
| } |
| $b++; |
| my @toplist = |
| } |
| sort { lc( $TopMembers{$a} ) cmp lc $TopMembers{$b} } keys %TopMembers; |
| undef @toplist; |
| $memcount = @toplist; |
| undef %memberinf; |
| buildIndex(); |
| &buildPages(0); |
| buildPages(1); |
| $yytitle = "$ml_txt{'313'} $ml_txt{'4'} $ml_txt{'87'} $numshow"; |
| $bb = $start; |
| &template; |
| $numshown = 0; |
| |
| while ( $numshown < $MembersPerPage ) { |
| |
| showRows( $toplist[$bb] ); |
| |
| $numshown++; |
| |
| $bb++; |
| |
| } |
| |
| undef @toplist; |
| |
| undef %memberinf; |
| |
| buildPages(0); |
| |
| $yytitle = "$ml_txt{'313'} $ml_txt{'4'} $ml_txt{'87'} $numshow"; |
| |
| template(); |
| |
| return; |
| } |
| } |
| |
| |
| sub MLDate { |
| sub MLDate { |
| ($memcount, undef) = &MembershipGet; |
| ( $memcount, undef ) = MembershipGet(); |
| &buildIndex; |
| buildIndex(); |
| &buildPages(1); |
| buildPages(1); |
| fopen(MEMBERLISTREAD, "$memberdir/memberlist.txt"); |
| fopen( MEMBERLISTREAD, "$memberdir/memberlist.txt" ); |
| $counter = 0; |
| $counter = 0; |
| while ($counter < $start && ($buffer = <MEMBERLISTREAD>)) { $counter++; } |
| while ( $counter < $start && ( $buffer = <MEMBERLISTREAD> ) ) { |
| for ($counter = 0; $counter < $MembersPerPage && ($buffer = <MEMBERLISTREAD>); $counter++) { |
| $counter++; |
| chomp $buffer; |
| } |
| if ($buffer) { |
| foreach my $counter ( 0 .. ( $MembersPerPage - 1 ) ) { |
| ($membername, undef) = split(/\t/, $buffer, 2); |
| if ( $buffer = <MEMBERLISTREAD> ) { |
| &showRows($membername); |
| chomp $buffer; |
| } |
| if ($buffer) { |
| } |
| ( $membername, undef ) = split /\t/xsm, $buffer, 2; |
| fclose(MEMBERLISTREAD); |
| showRows($membername); |
| &buildPages(0); |
| } |
| $yytitle = "$ml_txt{'313'} $ml_txt{'4'} $ml_txt{'233'} $numshow"; |
| } |
| &template; |
| } |
| |
| fclose(MEMBERLISTREAD); |
| |
| buildPages(0); |
| |
| $yytitle = "$ml_txt{'313'} $ml_txt{'4'} $ml_txt{'233'} $numshow"; |
| |
| template(); |
| |
| return; |
| } |
| } |
| |
| |
| sub showRows { |
| sub showRows { |
| my ($user) = $_[0]; |
| my ($user) = @_; |
| my ($wwwshow); |
| |
| if ($user ne '') { |
| my $wwwshow = qq~<img src="$imagesdir/$ml_trans" width="15" alt="" />~; |
| &LoadUser($user); |
| if ( $user ne q{} ) { |
| if (${$uid.$user}{'realname'} eq "") { ${$uid.$user}{'realname'} = $user; } |
| LoadUser($user); |
| if (!$minlinkweb) { $minlinkweb = 0; } |
| my $group_stars = q{}; |
| if (${$uid.$user}{'weburl'} && (${$uid.$user}{'postcount'} >= $minlinkweb || ${$uid.$user}{'position'} eq 'Administrator' || ${$uid.$user}{'position'} eq 'Global Moderator')) { $wwwshow = qq~<a href="${$uid.$user}{'weburl'}" target="_blank"><img src="$imagesdir/www.gif" border="0" alt="${$uid.$user}{'webtitle'}" title="${$uid.$user}{'webtitle'}" /></a>~; } |
| if ($group_stars_ml) { |
| $barchart = ${$uid.$user}{'postcount'}; |
| if ( $user eq $username ) { LoadMiniUser($user); } |
| $bartemp = (${$uid.$user}{'postcount'} * $maxbar); |
| $memberstar{$user} =~ s/<br \/>//gsm; |
| $barwidth = ($bartemp / $barmax); |
| $group_stars = qq~<br />$memberstar{$user}~; |
| $barwidth = ($barwidth + 0.5); |
| } |
| $barwidth = int($barwidth); |
| if ( ${ $uid . $user }{'realname'} eq q{} ) { |
| if ($barwidth > $maxbar) { $barwidth = $maxbar } |
| ${ $uid . $user }{'realname'} = $user; |
| if ($barchart < 1) { $Bar = ''; } |
| } |
| else { $Bar = qq~<img src="$imagesdir/bar.gif" width="$barwidth" height="10" alt="" border="0" />~; } |
| if ( !$minlinkweb ) { $minlinkweb = 0; } |
| if ($Bar eq "") { $Bar = " "; } |
| if ( |
| my $additional_tds = $extendedprofiles ? &ext_memberlist_tds($user) : ''; |
| ${ $uid . $user }{'weburl'} |
| |
| && ( ${ $uid . $user }{'postcount'} >= $minlinkweb |
| $dr_regdate = ''; |
| || ${ $uid . $user }{'position'} eq 'Administrator' |
| if(${$uid.$user}{'regtime'}) { |
| || ${ $uid . $user }{'position'} eq 'Global Moderator' |
| $dr_regdate = &timeformat(${$uid.$user}{'regtime'}); |
| || ${ $uid . $user }{'position'} eq 'Mid Moderator' ) |
| $dr_regdate =~ s~(.*)(, 1?[0-9]):[0-9][0-9].*~$1~; |
| ) |
| if($iamadmin && ${$uid.$user}{'regtime'} < $forumstart) { |
| { |
| $dr_regdate = qq~<span style="color: #AA0000;">$dr_regdate *</span>~; |
| $wwwshow = |
| $dr_warning = qq~$ml_txt{'dr_warning'} <a href="$boardurl/AdminIndex.$yyaext?action=newsettings;page=main">$ml_txt{'dr_warnurl'}</a>~; |
| qq~<a href="${$uid.$user}{'weburl'}" target="_blank"><img src="$micon_bg{'www'}" alt="${$uid.$user}{'webtitle'}" title="${$uid.$user}{'webtitle'}" /></a>~; |
| } |
| } |
| } |
| $barchart = ${ $uid . $user }{'postcount'}; |
| |
| $bartemp = ( ${ $uid . $user }{'postcount'} * $maxbar ); |
| $yymain .= qq~ |
| $barwidth = ( $bartemp / $barmax ); |
| <tr> |
| $barwidth = ( $barwidth + 0.5 ); |
| <td class="windowbg">$link{$user}</td> |
| $barwidth = int $barwidth; |
| ~; |
| if ( $barwidth > $maxbar ) { $barwidth = $maxbar } |
| if (${$uid.$user}{'hidemail'} && !$iamadmin && $allow_hide_email == 1) { |
| if ( $barchart < 1 ) { $Bar = q{}; } |
| $yymain .= qq~ |
| else { |
| <td align="center" class="windowbg2"><img src="$imagesdir/lockmail.gif" alt="$ml_txt{'308'}" title="$ml_txt{'308'}" /></td> |
| $Bar = |
| ~; |
| qq~<img src="$imagesdir/$ml_bar" width="$barwidth" height="10" alt="" />~; |
| } else { |
| } |
| if (!$iamguest){ |
| if ( $Bar eq q{} ) { $Bar = ' '; } |
| $yymain .= qq~ |
| my $additional_tds = |
| <td align="center" class="windowbg2">~ . &enc_eMail(qq~<img src="$imagesdir/email.gif" border="0" alt="$img_txt{'69'}" title="~ . ($iamadmin ? ${$uid.$user}{'email'} : $img_txt{'69'}) . qq~" />~,${$uid.$user}{'email'},'','') . qq~</td> |
| $extendedprofiles ? ext_memberlist_tds($user) : q{}; |
| ~; |
| |
| } else { |
| $dr_regdate = q{}; |
| $yymain .= qq~ |
| if ( ${ $uid . $user }{'regtime'} ) { |
| <td align="center" class="windowbg2"><img src="$imagesdir/lockmail.gif" alt="$ml_txt{'308'}" title="$ml_txt{'308'}" /></td> |
| $dr_regdate = timeformat( ${ $uid . $user }{'regtime'} ); |
| ~; |
| $dr_regdate =~ s/(.*)(, 1?[0-9]):[0-9][0-9].*/$1/sm; |
| } |
| if ( $iamadmin && ${ $uid . $user }{'regtime'} < $forumstart ) { |
| } |
| $dr_regdate = |
| $yymain .= qq~ |
| qq~<span style="color: #AA0000;">$dr_regdate *</span>~; |
| <td align="center" class="windowbg2">$wwwshow</td> |
| $dr_warning = |
| <td class="windowbg">$memberinfo{$user} </td> |
| qq~$ml_txt{'dr_warning'} <a href="$boardurl/AdminIndex.$yyaext?action=newsettings;page=main">$ml_txt{'dr_warnurl'}</a>~; |
| <td class="windowbg2" width="5%" align="center">~ . &NumberFormat(${$uid.$user}{'postcount'}) . qq~ </td> |
| } |
| <td class="windowbg" width="18%">$Bar</td> |
| } |
| <td class="windowbg">$dr_regdate </td> |
| |
| $additional_tds |
| if ( $showuserpicml && $allowpics ) { |
| </tr>~; |
| ${ $uid . $user }{'userpic'} ||= $my_blank_avatar; |
| } |
| $my_userpic = q~<img src="~ |
| |
| . ( |
| |
| ${ $uid . $user }{'userpic'} =~ m/\A[\s\n]*https?:\/\//ism |
| |
| ? ${ $uid . $user }{'userpic'} |
| |
| : ( $default_avatar |
| |
| && ${ $uid . $user }{'userpic'} eq $my_blank_avatar ) |
| |
| ? "$imagesdir/$default_userpic" |
| |
| : "$facesurl/${$uid.$user}{'userpic'}" |
| |
| ) . q~" id="avatarml_img_resize" alt="" style="display:none" />~; |
| |
| if ( !$iamguest ) { |
| |
| $my_userpic = |
| |
| qq~<a href="$scripturl?action=viewprofile;username=$useraccount{$user}">$my_userpic</a>~; |
| |
| } |
| |
| $userpic = $my_userpic_td; |
| |
| $userpic =~ s/{yabb my_userpic}/$my_userpic/sm; |
| |
| } |
| |
| else { |
| |
| $userpic = q{}; |
| |
| } |
| |
| if ( ${ $uid . $user }{'hidemail'} |
| |
| && !$iamadmin |
| |
| && $allow_hide_email == 1 ) |
| |
| { |
| |
| $lock = qq~ |
| |
| <img src="$micon_bg{'lockmail'}" alt="$ml_txt{'308'}" title="$ml_txt{'308'}" />~; |
| |
| } |
| |
| else { |
| |
| if ( !$iamguest ) { |
| |
| $lock = enc_eMail( |
| |
| qq~<img src="$micon_bg{'email'}" alt="$img_txt{'69'}" title="~ |
| |
| . ( |
| |
| $iamadmin ? ${ $uid . $user }{'email'} : $img_txt{'69'} |
| |
| ) |
| |
| . q~" />~, |
| |
| ${ $uid . $user }{'email'}, |
| |
| q{}, q{} |
| |
| ); |
| |
| } |
| |
| else { |
| |
| $lock = qq~ |
| |
| <img src="$micon_bg{'lockmail'}" alt="$ml_txt{'308'}" title="$ml_txt{'308'}" />~; |
| |
| } |
| |
| } |
| |
| |
| |
| $yypostcount = NumberFormat( ${ $uid . $user }{'postcount'} ); |
| |
| |
| |
| $yymain .= $my_memrow; |
| |
| $yymain =~ s/{yabb add_tds}/$additional_tds/sm; |
| |
| $yymain =~ s/{yabb userpic}/$userpic/sm; |
| |
| $yymain =~ s/{yabb userlink}/$link{$user}/sm; |
| |
| $yymain =~ s/{yabb lock}/$lock/sm; |
| |
| $yymain =~ s/{yabb wwwshow}/$wwwshow/sm; |
| |
| $yymain =~ s/{yabb meminfo}/$memberinfo{$user}$group_stars/sm; |
| |
| $yymain =~ s/{yabb bar}/$Bar/sm; |
| |
| $yymain =~ s/{yabb postcount}/$yypostcount/sm; |
| |
| $yymain =~ s/{yabb dr_regdate}/$dr_regdate/sm; |
| |
| ## Mod Hook ## |
| |
| } |
| |
| return $yymain; |
| } |
| } |
| |
| |
| 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'}; |
| |
| } |
| # Build the page links list. |
| |
| my ($pagetxtindex, $pagetextindex, $pagedropindex1, $pagedropindex2, $all, $allselected); |
| # Build the page links list. |
| $indexdisplaynum = 3; |
| my ( $pagetxtindex, $pagedropindex1, $pagedropindex2, $all, |
| $dropdisplaynum = 10; |
| $allselected ); |
| if ($FORM{'sortform'} eq "") { $FORM{'sortform'} = $INFO{'sort'}; } |
| $indexdisplaynum = 3; |
| $postdisplaynum = 3; |
| $dropdisplaynum = 10; |
| $startpage = 0; |
| if ( $FORM{'sortform'} eq q{} ) { $FORM{'sortform'} = $INFO{'sort'}; } |
| $max = $memcount; |
| $postdisplaynum = 3; |
| if ($SearchStr ne '') { $findmember = qq~;member=$SearchStr~; } |
| $startpage = 0; |
| if ($INFO{'start'} eq "all") { $MembersPerPage = $max; $all = 1; $allselected = qq~ selected="selected"~; $start = 0 } |
| $max = $memcount; |
| else { $start = $INFO{'start'} || 0; } |
| if ( $SearchStr ne q{} ) { $findmember = qq~;member=$SearchStr~; } |
| $start = $start > $memcount - 1 ? $memcount - 1 : $start; |
| |
| $start = (int($start / $MembersPerPage)) * $MembersPerPage; |
| if ( $INFO{'start'} eq 'all' ) { |
| $tmpa = 1; |
| $MembersPerPage = $max; |
| $pagenumb = int(($memcount - 1) / $MembersPerPage) + 1; |
| $all = 1; |
| |
| $allselected = q~ selected="selected"~; |
| if ($start >= (($postdisplaynum - 1) * $MembersPerPage)) { |
| $start = 0; |
| $startpage = $start - (($postdisplaynum - 1) * $MembersPerPage); |
| } |
| $tmpa = int($startpage / $MembersPerPage) + 1; |
| else { $start = $INFO{'start'} || 0; } |
| } |
| $start = $start > $memcount - 1 ? $memcount - 1 : $start; |
| if ($memcount >= $start + ($postdisplaynum * $MembersPerPage)) { $endpage = $start + ($postdisplaynum * $MembersPerPage); } |
| $start = ( int( $start / $MembersPerPage ) ) * $MembersPerPage; |
| else { $endpage = $memcount } |
| $tmpa = 1; |
| $lastpn = int(($memcount - 1) / $MembersPerPage) + 1; |
| $pagenumb = int( ( $memcount - 1 ) / $MembersPerPage ) + 1; |
| $lastptn = ($lastpn - 1) * $MembersPerPage; |
| |
| $pageindex1 = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;"><img src="$imagesdir/index_togl.gif" border="0" alt="" style="vertical-align: middle;" /> $ml_txt{'139'}: $pagenumb</span>~; |
| if ( $start >= ( ( $postdisplaynum - 1 ) * $MembersPerPage ) ) { |
| $pageindex2 = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;"><img src="$imagesdir/index_togl.gif" border="0" alt="" style="vertical-align: middle;" /> $ml_txt{'139'}: $pagenumb</span>~; |
| $startpage = $start - ( ( $postdisplaynum - 1 ) * $MembersPerPage ); |
| if ($pagenumb > 1 || $all) { |
| $tmpa = int( $startpage / $MembersPerPage ) + 1; |
| |
| } |
| if ($usermemberpage == 1 || $iamguest) { |
| if ( $memcount >= $start + ( $postdisplaynum * $MembersPerPage ) ) { |
| $pagetxtindexst = qq~<span class="small" style="float: left; height: 21px; margin: 0px; margin-top: 2px;">~; |
| $endpage = $start + ( $postdisplaynum * $MembersPerPage ); |
| if (!$iamguest) { $pagetxtindexst .= qq~<a href="$scripturl?sort=$FORM{'sortform'};letter=$letter;start=$start;action=memberpagedrop$findmember"><img src="$imagesdir/index_togl.gif" border="0" alt="$ml_txt{'19'}" title="$ml_txt{'19'}" style="vertical-align: middle;" /></a> $ml_txt{'139'}: ~; } |
| } |
| else { $pagetxtindexst .= qq~<img src="$imagesdir/xx.gif" border="0" alt="" style="vertical-align: middle;" /> $ml_txt{'139'}: ~; } |
| else { $endpage = $memcount } |
| if ($startpage > 0) { $pagetxtindex = qq~<a href="$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter$findmember" style="font-weight: normal;">1</a> ... ~; } |
| $lastpn = int( ( $memcount - 1 ) / $MembersPerPage ) + 1; |
| if ($startpage == $MembersPerPage) { $pagetxtindex = qq~<a href="$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter$findmember" style="font-weight: normal;">1</a> ~; } |
| $lastptn = ( $lastpn - 1 ) * $MembersPerPage; |
| for ($counter = $startpage; $counter < $endpage; $counter += $MembersPerPage) { |
| $pageindex1 = |
| $pagetxtindex .= $start == $counter ? qq~<b>$tmpa</b> ~ : qq~<a href="$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=$counter$findmember" style="font-weight: normal;">$tmpa</a> ~; |
| q~<span ~ |
| $tmpa++; |
| . $pgindex_class |
| } |
| . qq~><img src="$index_togl{'index_togl'}" alt="" /> $ml_txt{'139'}: $pagenumb</span>~; |
| if ($endpage < $memcount - $MembersPerPage) { $pageindexadd = qq~... ~; } |
| $pageindex2 = |
| if ($endpage != $memcount) { $pageindexadd .= qq~<a href="$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=$lastptn$findmember" style="font-weight: normal;">$lastpn</a>~; } |
| q~<span ~ |
| $pagetxtindex .= qq~$pageindexadd~; |
| . $pgindex_class |
| $pageindex1 = qq~$pagetxtindexst$pagetxtindex</span>~; |
| . qq~><img src="$index_togl{'index_togl'}" alt="" /> $ml_txt{'139'}: $pagenumb</span>~; |
| $pageindex2 = qq~$pagetxtindexst$pagetxtindex</span>~; |
| if ( $pagenumb > 1 || $all ) { |
| } else { |
| |
| $pagedropindex1 = qq~<span style="float: left; width: 350px; margin: 0px; margin-top: 2px; border: 0px;">~; |
| if ( $usermemberpage == 1 || $iamguest ) { |
| $pagedropindex1 .= qq~<span style="float: left; height: 21px; margin: 0; margin-right: 4px;"><a href="$scripturl?sort=$FORM{'sortform'};letter=$letter;start=$start;action=memberpagetext$findmember"><img src="$imagesdir/index_togl.gif" border="0" alt="$ml_txt{'19'}" title="$ml_txt{'19'}" /></a></span>~; |
| $pagetxtindexst = q~<span ~ . $pgindex_class . q~>~; |
| $pagedropindex2 = $pagedropindex1; |
| if ( !$iamguest ) { |
| $tstart = $start; |
| $pagetxtindexst .= |
| if (substr($INFO{'start'}, 0, 3) eq "all") { ($tstart, $start) = split(/\-/, $INFO{'start'}); } |
| qq~<a href="$scripturl?sort=$FORM{'sortform'};letter=$letter;start=$start;action=memberpagedrop$findmember"><img src="$index_togl{'index_togl'}" alt="$ml_txt{'19'}" title="$ml_txt{'19'}" /></a> $ml_txt{'139'}: ~; |
| $d_indexpages = $pagenumb / $dropdisplaynum; |
| } |
| $i_indexpages = int($pagenumb / $dropdisplaynum); |
| else { |
| if ($d_indexpages > $i_indexpages) { $indexpages = int($pagenumb / $dropdisplaynum) + 1; } |
| $pagetxtindexst .= |
| else { $indexpages = int($pagenumb / $dropdisplaynum) } |
| qq~<img src="$micon_bg{'xx'}" alt="" /> $ml_txt{'139'}: ~; |
| $selectedindex = int(($start / $MembersPerPage) / $dropdisplaynum); |
| } |
| |
| if ( $startpage > 0 ) { |
| if ($pagenumb > $dropdisplaynum) { |
| $pagetxtindex = |
| $pagedropindex1 .= qq~<span style="float: left; height: 21px; margin: 0;"><select size="1" name="decselector1" id="decselector1" style="font-size: 9px; border: 2px inset;" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~; |
| qq~<a href="$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter$findmember"><span class="small">1</span></a> ... ~; |
| $pagedropindex2 .= qq~<span style="float: left; height: 21px; margin: 0;"><select size="1" name="decselector2" id="decselector2" style="font-size: 9px; border: 2px inset;" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~; |
| } |
| } |
| if ( $startpage == $MembersPerPage ) { |
| for ($i = 0; $i < $indexpages; $i++) { |
| $pagetxtindex = |
| $indexpage = ($i * $dropdisplaynum) * $MembersPerPage; |
| qq~<a href="$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter$findmember"><span class="small">1</span></a> ~; |
| $indexstart = ($i * $dropdisplaynum) + 1; |
| } |
| $indexend = $indexstart + ($dropdisplaynum - 1); |
| foreach my $counter ( $startpage .. ( $endpage - 1 ) ) { |
| if ($indexend > $pagenumb) { $indexend = $pagenumb; } |
| if ( $counter % $MembersPerPage == 0 ) { |
| if ($indexstart == $indexend) { $indxoption = qq~$indexstart~; } |
| $pagetxtindex .= |
| else { $indxoption = qq~$indexstart-$indexend~; } |
| $start == $counter |
| $selected = ""; |
| ? qq~<b>[$tmpa]</b> ~ |
| if ($i == $selectedindex) { |
| : qq~<a href="$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=$counter$findmember"><span class="small">$tmpa</span></a> ~; |
| $selected = qq~ selected="selected"~; |
| $tmpa++; |
| $pagejsindex = qq~$indexstart|$indexend|$MembersPerPage|$indexpage~; |
| } |
| } |
| } |
| if ($pagenumb > $dropdisplaynum) { |
| if ( $endpage < $memcount - $MembersPerPage ) { |
| $pagedropindex1 .= qq~<option value="$indexstart|$indexend|$MembersPerPage|$indexpage"$selected>$indxoption</option>\n~; |
| $pageindexadd = q~... ~; |
| $pagedropindex2 .= qq~<option value="$indexstart|$indexend|$MembersPerPage|$indexpage"$selected>$indxoption</option>\n~; |
| } |
| } |
| if ( $endpage != $memcount ) { |
| } |
| $pageindexadd .= |
| if ($pagenumb > $dropdisplaynum) { |
| qq~<a href="$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=$lastptn$findmember"><span class="small">$lastpn</span></a>~; |
| $pagedropindex1 .= qq~</select>\n</span>~; |
| } |
| $pagedropindex2 .= qq~</select>\n</span>~; |
| $pagetxtindex .= qq~$pageindexadd~; |
| } |
| $pageindex1 = qq~$pagetxtindexst$pagetxtindex</span>~; |
| $pagedropindex1 .= qq~<span id="ViewIndex1" class="droppageindex" style="height: 14px; visibility: hidden"> </span>~; |
| $pageindex2 = qq~$pagetxtindexst$pagetxtindex</span>~; |
| $pagedropindex2 .= qq~<span id="ViewIndex2" class="droppageindex" style="height: 14px; visibility: hidden"> </span>~; |
| } |
| $tmpMembersPerPage = $MembersPerPage; |
| else { |
| if (substr($INFO{'start'}, 0, 3) eq "all") { $MembersPerPage = $MembersPerPage * $dropdisplaynum; } |
| $pagedropindex1 = q~<span class="pagedropindex">~; |
| $prevpage = $start - $tmpMembersPerPage; |
| $pagedropindex1 .= |
| $nextpage = $start + $MembersPerPage; |
| qq~<span class="pagedropindex_inner"><a href="$scripturl?sort=$FORM{'sortform'};letter=$letter;start=$start;action=memberpagetext$findmember"><img src="$index_togl{'index_togl'}" alt="$ml_txt{'19'}" title="$ml_txt{'19'}" /></a></span>~; |
| $pagedropindexpvbl = qq~<img src="$imagesdir/index_left0.gif" height="14" width="13" border="0" alt="" style="margin: 0px; display: inline; vertical-align: middle;" />~; |
| $pagedropindex2 = $pagedropindex1; |
| $pagedropindexnxbl = qq~<img src="$imagesdir/index_right0.gif" height="14" width="13" border="0" alt="" style="margin: 0px; display: inline; vertical-align: middle;" />~; |
| $tstart = $start; |
| if ($start < $MembersPerPage) { $pagedropindexpv .= qq~<img src="$imagesdir/index_left0.gif" height="14" width="13" border="0" alt="" style="display: inline; vertical-align: middle;" />~; } |
| if ( substr( $INFO{'start'}, 0, 3 ) eq 'all' ) { |
| 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=ml;sort=$FORM{'sortform'};letter=$letter;start=$prevpage$findmember\\'" ondblclick="location.href=\\'$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=0$findmember\\'" />~; } |
| ( $tstart, $start ) = split /\-/xsm, $INFO{'start'}; |
| if ($nextpage > $lastptn) { $pagedropindexnx .= qq~<img src="$imagesdir/index_right0.gif" border="0" height="14" width="13" alt="" style="display: inline; vertical-align: middle;" />~; } |
| } |
| 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=ml;sort=$FORM{'sortform'};letter=$letter;start=$nextpage$findmember\\'" ondblclick="location.href=\\'$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=$lastptn$findmember\\'" />~; } |
| $d_indexpages = $pagenumb / $dropdisplaynum; |
| $pageindex1 = qq~$pagedropindex1</span>~; |
| $i_indexpages = int( $pagenumb / $dropdisplaynum ); |
| $pageindex2 = qq~$pagedropindex2</span>~; |
| if ( $d_indexpages > $i_indexpages ) { |
| |
| $indexpages = int( $pagenumb / $dropdisplaynum ) + 1; |
| $pageindexjs = qq~ |
| } |
| <script language="JavaScript1.2" type="text/javascript"> |
| else { $indexpages = int( $pagenumb / $dropdisplaynum ) } |
| <!-- |
| $selectedindex = |
| function SelDec(decparam, visel) { |
| int( ( $start / $MembersPerPage ) / $dropdisplaynum ); |
| splitparam = decparam.split("|"); |
| |
| var vistart = parseInt(splitparam[0]); |
| if ( $pagenumb > $dropdisplaynum ) { |
| var viend = parseInt(splitparam[1]); |
| $pagedropindex1 .= |
| var maxpag = parseInt(splitparam[2]); |
| qq~<span class="decselector"><select size="1" name="decselector1" id="decselector1" class="decselector_sel" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~; |
| var pagstart = parseInt(splitparam[3]); |
| $pagedropindex2 .= |
| var allpagstart = parseInt(splitparam[3]); |
| qq~<span class="decselector"><select size="1" name="decselector2" id="decselector2" class="decselector_sel" onchange="if(this.options[this.selectedIndex].value) SelDec(this.options[this.selectedIndex].value, 'xx')">\n~; |
| if(visel == 'xx' && decparam == '$pagejsindex') visel = '$tstart'; |
| } |
| var pagedropindex = '<table border="0" cellpadding="0" cellspacing="0"><tr>'; |
| for my $i ( 0 .. ( $indexpages - 1 ) ) { |
| for(i=vistart; i<=viend; i++) { |
| $indexpage = ( $i * $dropdisplaynum ) * $MembersPerPage; |
| 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>'; |
| $indexstart = ( $i * $dropdisplaynum ) + 1; |
| else pagedropindex += '<td height="14" class="droppages"><a href="$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=' + pagstart + '$findmember">' + i + '</a></td>'; |
| $indexend = $indexstart + ( $dropdisplaynum - 1 ); |
| pagstart += maxpag; |
| if ( $indexend > $pagenumb ) { $indexend = $pagenumb; } |
| } |
| if ( $indexstart == $indexend ) { |
| ~; |
| $indxoption = qq~$indexstart~; |
| if ($showpageall) { |
| } |
| $pageindexjs .= qq~ |
| else { $indxoption = qq~$indexstart-$indexend~; } |
| if (vistart != viend) { |
| $selected = q{}; |
| 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>'; |
| if ( $i == $selectedindex ) { |
| else pagedropindex += '<td height="14" class="droppages"><a href="$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=all-' + allpagstart + '$findmember">$pidtxt{'01'}</a></td>'; |
| $selected = q~ selected="selected"~; |
| } |
| $pagejsindex = |
| ~; |
| qq~$indexstart|$indexend|$MembersPerPage|$indexpage~; |
| } |
| } |
| $pageindexjs .= qq~ |
| if ( $pagenumb > $dropdisplaynum ) { |
| if(visel != 'xx') pagedropindex += '<td height="14" class="small" style="height: 14px; padding-left: 4px;">$pagedropindexpv$pagedropindexnx</td>'; |
| $pagedropindex1 .= |
| else pagedropindex += '<td height="14" class="small" style="height: 14px; padding-left: 4px;">$pagedropindexpvbl$pagedropindexnxbl</td>'; |
| qq~<option value="$indexstart|$indexend|$MembersPerPage|$indexpage"$selected>$indxoption</option>\n~; |
| pagedropindex += '</tr></table>'; |
| $pagedropindex2 .= |
| document.getElementById("ViewIndex1").innerHTML=pagedropindex; |
| qq~<option value="$indexstart|$indexend|$MembersPerPage|$indexpage"$selected>$indxoption</option>\n~; |
| document.getElementById("ViewIndex1").style.visibility = "visible"; |
| } |
| document.getElementById("ViewIndex2").innerHTML=pagedropindex; |
| } |
| document.getElementById("ViewIndex2").style.visibility = "visible"; |
| if ( $pagenumb > $dropdisplaynum ) { |
| ~; |
| $pagedropindex1 .= qq~</select>\n</span>~; |
| if ($pagenumb > $dropdisplaynum) { |
| $pagedropindex2 .= qq~</select>\n</span>~; |
| $pageindexjs .= qq~ |
| } |
| document.getElementById("decselector1").value = decparam; |
| $pagedropindex1 .= |
| document.getElementById("decselector2").value = decparam; |
| q~<span id="ViewIndex1" class="droppageindex viewindex_hid"> </span>~; |
| ~; |
| $pagedropindex2 .= |
| } |
| q~<span id="ViewIndex2" class="droppageindex viewindex_hid"> </span>~; |
| $pageindexjs .= qq~ |
| $tmpMembersPerPage = $MembersPerPage; |
| } |
| if ( substr( $INFO{'start'}, 0, 3 ) eq 'all' ) { |
| document.onload = SelDec('$pagejsindex', '$tstart'); |
| $MembersPerPage = $MembersPerPage * $dropdisplaynum; |
| //--> |
| } |
| |
| $prevpage = $start - $tmpMembersPerPage; |
| |
| $nextpage = $start + $MembersPerPage; |
| |
| $pagedropindexpvbl = |
| |
| qq~<img src="$index_togl{'index_left0'}" height="14" width="13" alt="" />~; |
| |
| $pagedropindexnxbl = |
| |
| qq~<img src="$index_togl{'index_right0'}" height="14" width="13" alt="" />~; |
| |
| if ( $start < $MembersPerPage ) { |
| |
| $pagedropindexpv .= |
| |
| qq~<img src="$index_togl{'index_left0'}" height="14" width="13" alt="" />~; |
| |
| } |
| |
| else { |
| |
| $pagedropindexpv .= |
| |
| qq~<img src="$index_togl{'index_left'}" height="14" width="13" alt="$pidtxt{'02'}" title="$pidtxt{'02'}" class="cursor" onclick="location.href=\\'$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=$prevpage$findmember\\'" ondblclick="location.href=\\'$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=0$findmember\\'" />~; |
| |
| } |
| |
| if ( $nextpage > $lastptn ) { |
| |
| $pagedropindexnx .= |
| |
| qq~<img src="$index_togl{'index_right0'}" height="14" width="13" alt="" />~; |
| |
| } |
| |
| else { |
| |
| $pagedropindexnx .= |
| |
| qq~<img src="$index_togl{'index_right'}" height="14" width="13" alt="$pidtxt{'03'}" title="$pidtxt{'03'}" class="cursor" onclick="location.href=\\'$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=$nextpage$findmember\\'" ondblclick="location.href=\\'$scripturl?action=ml;sort=$FORM{'sortform'};letter=$letter;start=$lastptn$findmember\\'" />~; |
| |
| } |
| |
| $pageindex1 = qq~$pagedropindex1</span>~; |
| |
| $pageindex2 = qq~$pagedropindex2</span>~; |
| |
| |
| |
| $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=ml;sort=$FORM{'sortform'};letter=$letter;start=' + pagstart + '$findmember">' + 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=ml;sort=$FORM{'sortform'};letter=$letter;start=all-' + allpagstart + '$findmember">$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("ViewIndex1").innerHTML=pagedropindex; |
| |
| document.getElementById("ViewIndex1").style.visibility = "visible"; |
| |
| document.getElementById("ViewIndex2").innerHTML=pagedropindex; |
| |
| document.getElementById("ViewIndex2").style.visibility = "visible"; |
| |
| ~; |
| |
| if ( $pagenumb > $dropdisplaynum ) { |
| |
| $pageindexjs .= q~ |
| |
| document.getElementById("decselector1").value = decparam; |
| |
| document.getElementById("decselector2").value = decparam; |
| |
| ~; |
| |
| } |
| |
| $pageindexjs .= qq~ |
| |
| } |
| |
| document.onload = SelDec('$pagejsindex', '$tstart'); |
| </script> |
| </script> |
| ~; |
| ~; |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| return; |
| sub buildPages { |
| |
| |
| |
| $FindForm .= qq~ |
| |
| <form action="$scripturl?action=ml;sort=memsearch" method="post" id="form1" name="form1" enctype="application/x-www-form-urlencoded" style="display: inline;"> |
| |
| <input type="text" name="member" id="member" value="$ml_txt{'801'}" style="font-size: 11px; width: 180px;" onfocus="txtInFields(this, '$ml_txt{'801'}');" onblur="txtInFields(this, '$ml_txt{'801'}')" /> |
| |
| <input name="submit" type="submit" class="button" style="font-size: 10px;" value="$ml_txt{'2'}" /> |
| |
| </form> |
| |
| ~; |
| |
| |
| |
| $SortJump .= qq( |
| |
| <label for="sortform">$ml_txt{'1'}</label> |
| |
| <form action="$scripturl?action=ml" method="get" style="display: inline;"> |
| |
| <select name="sortform" id="sortform" onchange="submit()"> |
| |
| <option value="username"$selcUser>$ml_txt{'35'}</option> |
| |
| <option value="position"$selcPos>$ml_txt{'87'}</option> |
| |
| <option value="posts"$selcPost>$ml_txt{'21'}</option> |
| |
| <option value="regdate"$selcReg>$ml_txt{'233'}</option> |
| |
| </select> |
| |
| <input type="hidden" name="action" value="ml" /> |
| |
| <noscript><input type="submit" /></noscript> |
| |
| </form> |
| |
| ); |
| |
| |
| |
| my $additional_headers; |
| |
| $headercount = 7; |
| |
| if ($extendedprofiles) { |
| |
| require "$sourcedir/ExtendedProfiles.pl"; |
| |
| $additional_headers = &ext_memberlist_tableheader(); |
| |
| $headercount += &ext_memberlist_get_headercount($additional_headers); |
| |
| } |
| |
| |
| |
| $TableHeader .= qq( |
| |
| <tr> |
| |
| <td $selUser onclick="location.href='$scripturl?action=ml;sort=username';" width="23%" align="center" style="border: 1px; border-style: outset; cursor: pointer;"><a href="$scripturl?action=ml;sort=username"><b>$ml_txt{'35'}</b></a></td> |
| |
| <td class="catbg" width="4%" align="center"><img src="$imagesdir/email.gif" border="0" alt="$ml_txt{'307'}" title="$ml_txt{'307'}" /></td> |
| |
| <td class="catbg" width="4%" align="center"><img src="$imagesdir/www.gif" border="0" alt="$ml_txt{'96'}" title="$ml_txt{'96'}" /></td> |
| |
| <td $selPos onclick="location.href='$scripturl?action=ml;sort=position';" width="23%" align="center" style="border: 1px; border-style: outset; cursor: pointer;"><a href="$scripturl?action=ml;sort=position"><b>$ml_txt{'87'}</b></a></td> |
| |
| <td $selPost onclick="location.href='$scripturl?action=ml;sort=posts';" width="23%" colspan="2" align="center" style="border: 1px; border-style: outset; cursor: pointer;"><a href="$scripturl?action=ml;sort=posts"><b>$ml_txt{'21'}</b></a></td> |
| |
| <td $selReg onclick="location.href='$scripturl?action=ml;sort=regdate';" width="23%" align="center" style="border: 1px; border-style: outset; cursor: pointer;"><a href="$scripturl?action=ml;sort=regdate"><b>$ml_txt{'234'}</b></a></td> |
| |
| $additional_headers |
| |
| </tr> |
| |
| ); |
| |
| |
| |
| if ($LetterLinks ne "") { |
| |
| $TableHeader .= qq(<tr> |
| |
| <td class="catbg" colspan="$headercount"><span class="small">$LetterLinks</span></td> |
| |
| </tr> |
| |
| ); |
| |
| } |
| |
| |
| |
| $numbegin = ($start + 1); |
| |
| $numend = ($start + $MembersPerPage); |
| |
| if ($numend > $memcount) { $numend = $memcount; } |
| |
| if ($memcount == 0) { $numshow = ""; } |
| |
| else { $numshow = qq~($numbegin - $numend $ml_txt{'309'} $memcount)~; } |
| |
| if ($_[0]) { |
| |
| $yynavigation = qq~› $ml_txt{'331'} $numshow~; |
| |
| $yymain .= qq~ |
| |
| <table border="0" width="100%" cellspacing="1" cellpadding="3" class="bordercolor"> |
| |
| <tr> |
| |
| <td class="catbg" colspan="$headercount" width="100%" align="left" valign="middle"> |
| |
| <div style="float: left; width: 25%; text-align: left;">$pageindex1</div> |
| |
| <div class="small" style="float: left; width: 74%; text-align: right;">$FindForm $SortJump</div> |
| |
| </td> |
| |
| </tr> |
| |
| $TableHeader |
| |
| ~; |
| |
| } else { |
| |
| $yymain .= qq~ |
| |
| <tr> |
| |
| <td class="catbg" colspan="$headercount" width="100%" align="left" valign="middle"> |
| |
| <div style="float: left; width: 50%; text-align: left;">$pageindex2</div> |
| |
| <div style="float: left; width: 49%; color: #AA0000; font-weight: normal; vertical-align: middle; text-align: right;">$dr_warning</div> |
| |
| $pageindexjs |
| |
| </td> |
| |
| </tr> |
| |
| </table> |
| |
| ~; |
| |
| } |
| |
| } |
| |
| } |
| } |
| |
| |
| |
| sub buildPages { |
| |
| my ($inp) = @_; |
| |
| |
| |
| $FindForm .= $my_findform; |
| |
| |
| |
| $SortJump .= qq( |
| |
| <label for="sortform">$ml_txt{'1'}</label> |
| |
| <form action="$scripturl?action=ml" method="get" style="display: inline;"> |
| |
| <select name="sortform" id="sortform" onchange="submit()"> |
| |
| <option value="username"$selcUser>$ml_txt{'35'}</option> |
| |
| <option value="position"$selcPos>$ml_txt{'87'}</option> |
| |
| <option value="posts"$selcPost>$ml_txt{'21'}</option> |
| |
| <option value="regdate"$selcReg>$ml_txt{'233'}</option> |
| |
| </select> |
| |
| <input type="hidden" name="action" value="ml" /> |
| |
| </form> |
| |
| ); |
| |
| if ( $showuserpicml && $allowpics ) { |
| |
| $headertop = 8; |
| |
| } |
| |
| else { |
| |
| $headertop = 7; |
| |
| } |
| |
| |
| |
| my $additional_headers; |
| |
| $headercount = $headertop; |
| |
| if ($extendedprofiles) { |
| |
| require Sources::ExtendedProfiles; |
| |
| $additional_headers = ext_memberlist_tableheader(); |
| |
| $headercount += ext_memberlist_get_headercount($additional_headers); |
| |
| } |
| |
| if ( $showuserpicml && $allowpics ) { |
| |
| $row_userpic = $my_row_userpic; |
| |
| $col_userpic = q~<col style="width:auto" />~; |
| |
| } |
| |
| else { |
| |
| $row_userpic = q{}; |
| |
| $col_userpic = q{}; |
| |
| } |
| |
| |
| |
| $TableHeader .= $my_header; |
| |
| $TableHeader =~ s/{yabb row_userpic}/$row_userpic/sm; |
| |
| $TableHeader =~ s/{yabb selUser}/$selUser/sm; |
| |
| $TableHeader =~ s/{yabb selPos}/$selPos/sm; |
| |
| $TableHeader =~ s/{yabb selPost}/$selPost/sm; |
| |
| $TableHeader =~ s/{yabb selReg}/$selReg/sm; |
| |
| $TableHeader =~ s/{yabb add_headers}/$additional_headers/sm; |
| |
| |
| |
| if ( $LetterLinks ne q{} ) { |
| |
| $TableHeader .= $my_letterlinks; |
| |
| $TableHeader =~ s/{yabb letterlinks}/$LetterLinks/sm; |
| |
| $TableHeader =~ s/{yabb headercount}/$headercount/sm; |
| |
| } |
| |
| |
| |
| $numbegin = ( $start + 1 ); |
| |
| $numend = ( $start + $MembersPerPage ); |
| |
| if ( $numend > $memcount ) { $numend = $memcount; } |
| |
| if ( $memcount == 0 ) { $numshow = q{}; } |
| |
| else { $numshow = qq~($numbegin - $numend $ml_txt{'309'} $memcount)~; } |
| |
| if ($inp) { |
| |
| $yynavigation = qq~› $ml_txt{'331'} $numshow~; |
| |
| $yymain .= qq~$my_memberlist_main |
| |
| $TableHeader |
| |
| ~; |
| |
| $yymain =~ s/{yabb col_userpic}/$col_userpic/sm; |
| |
| $yymain =~ s/{yabb pageindex1}/$pageindex1/sm; |
| |
| $yymain =~ s/{yabb findform}/$FindForm/sm; |
| |
| $yymain =~ s/{yabb sortjump}/$SortJump/sm; |
| |
| |
| |
| } |
| |
| else { |
| |
| $yymain .= $my_memberlist_bottom; |
| |
| $yymain =~ s/{yabb headercount}/$headercount/gsm; |
| |
| $yymain =~ s/{yabb pageindex2}/$pageindex2/sm; |
| |
| $yymain =~ s/{yabb dr_warning}/$dr_warning/sm; |
| |
| $yymain =~ s/{yabb pageindexjs}/$pageindexjs/sm; |
| |
| } |
| |
| return; |
| |
| } |
| |
| |
| sub FindMembers { |
| sub FindMembers { |
| $SearchStr = $FORM{'member'} || $INFO{'member'}; |
| $SearchStr = $FORM{'member'} || $INFO{'member'}; |
| $LookFor = qq~^$SearchStr\$~; |
| $LookFor = qq~^$SearchStr\$~; |
| $LookFor =~ s/\*+/.*?/g; |
| $LookFor =~ s/\*+/.*?/gsm; |
| |
| |
| &ManageMemberinfo("load"); |
| ManageMemberinfo('load'); |
| my %memberfind = (); |
| my %memberfind = (); |
| while (($membername, $value) = each(%memberinf)) { |
| while ( ( $membername, $value ) = each %memberinf ) { |
| ($memrealname, $mememail, undef) = split(/\|/, $value, 3); |
| ( $memrealname, $mememail, undef ) = split /\|/xsm, $value, 3; |
| if ($memrealname =~ /$LookFor/i) { |
| if ( $memrealname =~ /$LookFor/ism ) { |
| $memberfind{$membername} = $memrealname; |
| $memberfind{$membername} = $memrealname; |
| } elsif ($mememail =~ /$LookFor/i) { |
| } |
| &LoadUser($membername) if !$iamadmin && !$iamgmod; |
| elsif ( $mememail =~ /$LookFor/ism ) { |
| $memberfind{$membername} = $memrealname if $iamadmin || $iamgmod || !${$uid.$membername}{'hidemail'}; |
| if ( !$iamadmin && !$iamgmod ) { LoadUser($membername); } |
| } |
| if ( $iamadmin || $iamgmod || !${ $uid . $membername }{'hidemail'} ) |
| } |
| { |
| @findmemlist = sort { lc $memberfind{$a} cmp lc $memberfind{$b} } keys %memberfind; |
| $memberfind{$membername} = $memrealname; |
| undef (%memberfind); |
| } |
| $memcount = @findmemlist; |
| } |
| &buildIndex; |
| } |
| &buildPages(1); |
| @findmemlist = |
| if ($memcount > 0) { |
| sort { lc $memberfind{$a} cmp lc $memberfind{$b} } keys %memberfind; |
| my $i = $start; |
| undef %memberfind; |
| $numshown = 0; |
| $memcount = @findmemlist; |
| while ($numshown < $MembersPerPage) { |
| buildIndex(); |
| chomp $findmemlist[$i]; |
| buildPages(1); |
| &showRows($findmemlist[$i]); |
| if ( $memcount > 0 ) { |
| $numshown++; |
| my $i = $start; |
| $i++; |
| $numshown = 0; |
| } |
| while ( $numshown < $MembersPerPage ) { |
| } else { |
| chomp $findmemlist[$i]; |
| $yymain .= qq~ |
| showRows( $findmemlist[$i] ); |
| <tr> |
| $numshown++; |
| <td class="windowbg2" valign="middle" align="center" colspan="7"><br />$ml_txt{'802'} <i>$FORM{'member'}</i><br /><br /></td> |
| $i++; |
| </tr>~; |
| } |
| } |
| } |
| undef @findmemlist; |
| else { |
| undef %memberinf; |
| $yymain .= $my_findmember; |
| &buildPages(0); |
| $yymain =~ s/{yabb formmember}/$FORM{'member'}/sm; |
| $yytitle = "$ml_txt{'313'} $ml_txt{'4'} $ml_txt{'87'} $numshow"; |
| } |
| &template; |
| undef @findmemlist; |
| |
| undef %memberinf; |
| |
| buildPages(0); |
| |
| $yytitle = "$ml_txt{'313'} $ml_txt{'4'} $ml_txt{'87'} $numshow"; |
| |
| template(); |
| |
| return; |
| } |
| } |
| |
| |
| 1; |
| 1; |
| |
| |