Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2013, 08:24 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 01-14-2013, 05:56 PM
Christos Teriakis Christos Teriakis is offline
 
Join Date: Jul 2011
Location: Thessaloniki, Greece
Posts: 1,228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Благодарность от:
Rich
  #3  
Old 01-15-2013, 03:42 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 01-15-2013, 04:30 PM
Christos Teriakis Christos Teriakis is offline
 
Join Date: Jul 2011
Location: Thessaloniki, Greece
Posts: 1,228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Rich View Post
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.'
Reply With Quote
  #5  
Old 01-15-2013, 04:40 PM
mokujin's Avatar
mokujin mokujin is offline
 
Join Date: Oct 2005
Location: Czech
Posts: 345
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

???
Reply With Quote
  #6  
Old 01-15-2013, 04:45 PM
Christos Teriakis Christos Teriakis is offline
 
Join Date: Jul 2011
Location: Thessaloniki, Greece
Posts: 1,228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 View Post
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.'';
Reply With Quote
  #7  
Old 01-15-2013, 10:33 PM
Rich's Avatar
Rich Rich is offline
 
Join Date: Mar 2004
Location: U.S.A
Posts: 921
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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".
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:09 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05115 seconds
  • Memory Usage 2,233KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (8)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (1)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete