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 08-02-2004, 11:16 PM
btappan's Avatar
btappan btappan is offline
 
Join Date: May 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default hacking memberlist file...Help please

i needed to move one of my custom profile fields (which was "company name") to be the first column in the member list instead of the username being first. i did it using this:

http://www.vbulletin.com/forum/showthread.php?t=112058

.......now i need to have it sort alphabetically by this field as well...
can anyone help me do what Jake suggest and modify the memberlist.php file to sort by my "field 5" as well? I need this very badly for my site! thanks for your help
Reply With Quote
  #2  
Old 08-02-2004, 11:45 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In memberlist.php FIND
PHP Code:
 switch ($sortfield)
 {
         case 
'username':
                 
$sqlsort 'user.username';
                 break; 
BELOW that ADD
PHP Code:
         case 'companyname':
                 
$sqlsort 'userfield.field5';
                 break; 
Revert to the original versions of your memberlist and memberlist_resultsbit templates.

Set your Company Name field to NOT show up on members list

In template memberlist FIND
Code:
<td class="thead" align="$stylevar[left]" nowrap="nowrap"><a href="$sorturl&amp;order=ASC&amp;sort=username&amp;pp=$perpage&amp;ltr=$  ltr$usergrouplink">$vbphrase[username]</a> $sortarrow[username]</td>
ABOVE that ADD
Code:
<td class="thead" nowrap="nowrap"><a href="$sorturl&amp;order=ASC&amp;sort=companyname&amp;pp=$perpage&amp;ltr=$ltr$usergrouplink">Company Name</a> $sortarrow[companyname]</td>
In template memberlist_resultsbit FIND
Code:
<td class="alt1Active" align="$stylevar[left]" id="u$userinfo[userid]">
		<a href="member.php?$session[sessionurl]u=$userinfo[userid]">$userinfo[musername]</a>
		<if condition="$show['usertitlecol']"><div class="smallfont">$userinfo[usertitle]</div></if>
	</td>
ABOVE that ADD
Code:
<td class="alt2Active">
		$userinfo[field5]
</td>
Reply With Quote
  #3  
Old 08-03-2004, 12:35 AM
btappan's Avatar
btappan btappan is offline
 
Join Date: May 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ahhh perfect. i'll be glad when i've learned enough to accomplish things like that on my own. one more quick question. can i make it defualt to be sorted by that field when a user first visits the member list link? as it stands now, it is still sorted by username by default.

thanks so much for your help and quick response!
Reply With Quote
  #4  
Old 08-03-2004, 12:41 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes. In memberlist.php, just some lines below the place where you added the code there is
PHP Code:
default:
        
$sqlsort 'user.username';
        
$sortfield 'username'
Replace that with
PHP Code:
default:
        
$sqlsort 'userfield.field5';
        
$sortfield 'companyname'
(Untested as I was too lazy to test, but theoretically it should work )
Reply With Quote
  #5  
Old 08-03-2004, 12:58 AM
btappan's Avatar
btappan btappan is offline
 
Join Date: May 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

seems to have made no change :ermm: maybe something else?
Reply With Quote
  #6  
Old 08-03-2004, 01:04 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, there is another default being set earlier in memberlist.php

FIND
PHP Code:
// set defaults and sensible values

if ($sortfield == '')
{
        
$sortfield 'username';

Replace that with
PHP Code:
// set defaults and sensible values

if ($sortfield == '')
{
        
$sortfield 'companyname';

Reply With Quote
  #7  
Old 08-03-2004, 02:10 AM
btappan's Avatar
btappan btappan is offline
 
Join Date: May 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Voila! all worky now! thanks so much for your persistent help....
Reply With Quote
  #8  
Old 09-05-2004, 08:39 PM
btappan's Avatar
btappan btappan is offline
 
Join Date: May 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey KirbyDE, can you help Warhorse and I get the alpha search at the top of the memberlist page to sort by the added userfield, in this case, "company name" instead of by the username? It'd be greatly appreciated!
Reply With Quote
  #9  
Old 09-08-2004, 05:01 PM
btappan's Avatar
btappan btappan is offline
 
Join Date: May 2004
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone else care to help me with this?
Reply With Quote
  #10  
Old 12-12-2004, 07:08 AM
Tbird66 Tbird66 is offline
 
Join Date: Dec 2004
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

also looking for help getting the alpha search at the top of the memberlist page to sort by the added userfield.

any suggestions would be welcome!
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:03 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.07379 seconds
  • Memory Usage 2,268KB
  • Queries Executed 11 (?)
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
  • (4)bbcode_code
  • (6)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete