vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   DEFAULT VIEW: Memberlist -- Top Posters (https://vborg.vbsupport.ru/showthread.php?t=57881)

Xube 10-14-2003 03:47 PM

DEFAULT VIEW: Memberlist -- Top Posters
 
I'm guessing/hoping that this hack has probably already been requested and created but I haven't been able to find it while looking so far:

Right now the default view for the memberlist is to show members alphabetically. Is there a hack existing that changes the default view (the view you get when you first click on the memberlist button) so that it shows the members listed by the highest number of posts to lowest number of posts?

:) Thanks if anyone has this or knows where I can find it.

EvilLS1 10-14-2003 08:32 PM

In memberlist.php find:
Code:

  if ($what=="topposters") {
    $orderby="posts";
    $direction="DESC";
  }

Above it add:
Code:

  if ($what=="username") {
    $orderby="username";
    $direction="ASC";
  }

Find:
Code:

  if ($orderby=="" or ($orderby!="username" and $orderby!="posts" and $orderby!="joindate" and $orderby!="lastpost")) {
    $what = 'username';
    $orderby="username";
  }

Replace it with:
Code:

  if ($orderby=="" or ($orderby!="username" and $orderby!="posts" and $orderby!="joindate" and $orderby!="lastpost")) {
    $what = 'topposters';
    $orderby="posts";
    $direction="DESC";
  }

In your memberlist template find:
Code:

        <td bgcolor="{secondaltcolor}"><smallfont><a href="memberlist.php?s=$session[sessionhash]"><b>List Alphabetically</b></a></smallfont></td>
Replace it with:
Code:

        <td bgcolor="{secondaltcolor}"><smallfont><a href="memberlist.php?s=$session[sessionhash]&what=username"><b>List Alphabetically</b></a></smallfont></td>

Gary King 10-14-2003 11:19 PM

The better way would be to do the following:

open memberlist.php and find
PHP Code:

require("./global.php"); 

below it, add:
PHP Code:

$what="topposters"

Simple as that ;)

EvilLS1 10-14-2003 11:34 PM

If you do it that way the List Alphabetically and List by Date Joined links will no longer work b/c $what will always be defined as topposters.

The easiest way to do it would be to simply replace the memberlist link with this:
<a href="memberlist.php?s=$session[sessionhash]&what=topposters">

But I figured the guy has already considered that and didn't wanna do it that way for whatever reason. *shrugs*

Gary King 10-15-2003 12:05 AM

Quote:

Originally Posted by EvilLS1
If you do it that way the List Alphabetically and List by Date Joined links will no longer work b/c $what will always be defined as topposters.

The easiest way to do it would be to simply replace the memberlist link with this:
<a href="memberlist.php?s=$session[sessionhash]&what=topposters">

But I figured the guy has already considered that and didn't wanna do it that way for whatever reason. *shrugs*

True, true. Yes, replacing the link with that would be best.

Xube 10-16-2003 04:44 AM

Quote:

Originally Posted by EvilLS1
If you do it that way the List Alphabetically and List by Date Joined links will no longer work b/c $what will always be defined as topposters.

The easiest way to do it would be to simply replace the memberlist link with this:
<a href="memberlist.php?s=$session[sessionhash]&what=topposters">

But I figured the guy has already considered that and didn't wanna do it that way for whatever reason. *shrugs*

:squareeyed: Thanks for some great advice and for the codings! So, if I replace the memberlist link with that new link, then clicking on it would take me to the list of top posting users, but... would members still be able to later change the order of how the memberlist appears. (change the list into ordering by date joined, etc).

EvilLS1 10-16-2003 04:50 AM

Quote:

Originally Posted by Xube
So, if I replace the memberlist link with that new link, then clicking on it would take me to the list of top posting users, but... would members still be able to later change the order of how the memberlist appears. (change the list into ordering by date joined, etc).

Yep. :)

Xube 10-16-2003 06:17 PM

Quote:

Originally Posted by EvilLS1
Yep. :)

Many thanx!! It worked like a charm! :banana:


All times are GMT. The time now is 12:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00979 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete