vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Memberlist Display (https://vborg.vbsupport.ru/showthread.php?t=293871)

Rich 01-12-2013 08:24 PM

Memberlist Display
 
My memberlist is hundreds of pages long because it shows members from 9 years ago who meet the post count criteria. I am hoping that a simple plugin could change that so that it shows members who meet the post criteria but have also been active over the past year. This would drastically cut down on the number of people shown. I realize an advanced search can be done to refine the search criteria but I am optimistic that this could be easily achieved as a default setting via a plugin. Does anyone know how to achieve this? I ran several searches here, on vb.com as well as google and came up with nothing.

Thanks for your time.

Christos Teriakis 01-14-2013 05:56 PM

Just a "dirty" solution which means to manually edit the memberlist.php (repeating it on any vB upgrade). With a text editor (like Notepad) open the file memberlist.php. On line 375 you'll see:
Code:

$condition .= ' AND posts >= ' . $vbulletin->options['memberlistposts'];
just above enter:
Code:

$timecondition = time() - (365 * 24 * 60 *60);
then replace the line:
Code:

$condition .= ' AND posts >= ' . $vbulletin->options['memberlistposts'];
with:
Code:

$condition .= ' AND posts >= ' . $vbulletin->options['memberlistposts'] .' AND lastactivity >= $timecondition';
If you want you can change lastactivity with lastvisit or lastpost. This restriction will limit the memberlist to members who have an activity during last 365 days.
Finally upload memberlist.php to your vb installation.

Chris

Rich 01-15-2013 03:42 PM

It shows an error Chris.

Quote:

Invalid SQL:

SELECT COUNT(*) AS users
FROM 1user AS user


WHERE 1=1 AND posts >= 1 AND lastactivity >= $timecondition
AND (user.usergroupid IN (-1,22,39,28,15,40,42,6,7,32,2,37,5));

MySQL Error : Unknown column '$timecondition' in 'where clause'
I then put " around the timecondition variable and it got rid of the error but it still showed every listing. I even tried changing the >= to <= but that displays a completely empty memberlist. lol

Christos Teriakis 01-15-2013 04:30 PM

Quote:

Originally Posted by Rich (Post 2397071)
It shows an error Chris.



I then put " around the timecondition variable and it got rid of the error but it still showed every listing. I even tried changing the >= to <= but that displays a completely empty memberlist. lol

Let me check it please.

--------------- Added [DATE]1358271095[/DATE] at [TIME]1358271095[/TIME] ---------------

How you added '' ? Must be '.$timecondition.'

mokujin 01-15-2013 04:40 PM

The las line should be:
$condition .= ' AND posts >= ' . $vbulletin->options['memberlistposts'] .' AND lastactivity >=' $timecondition;

???

Christos Teriakis 01-15-2013 04:45 PM

Rich,

You also need to edit line 174.
Replace:
Code:

$condition = '1=1';
With:
Code:

$timecondition = time() - (365 * 24 * 60 *60);
$condition = '1=1 AND lastactivity >= '.$timecondition;

--------------- Added 15 Jan 2013 at 19:47 ---------------

Quote:

Originally Posted by mokujin (Post 2397083)
The las line should be:
$condition .= ' AND posts >= ' . $vbulletin->options['memberlistposts'] .' AND lastactivity >=' $timecondition;

???

When there is a variable (like $timecondition) must always exist a . after '. Both ways are correct:
Code:

$condition .= ' AND posts >= ' . $vbulletin->options['memberlistposts'] .' AND lastactivity >='. $timecondition;
...or...

$condition .= ' AND posts >= ' . $vbulletin->options['memberlistposts'] .' AND lastactivity >=' .$timecondition.'';


Rich 01-15-2013 10:33 PM

Thank you Chris. That did the trick!

Btw, this is what I did before I posted the issue:

Code:

$condition .= ' AND posts >= ' . $vbulletin->options['memberlistposts'] .' AND lastactivity >= "$timecondition"';
I added this: "$timecondition".


All times are GMT. The time now is 10:51 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.00989 seconds
  • Memory Usage 1,731KB
  • 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
  • (8)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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