vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Order results by VIP Members first (https://vborg.vbsupport.ru/showthread.php?t=294674)

KimK 02-02-2013 12:03 AM

Order results by VIP Members first
 
Hello.

I want to add an option to the order results combo box so the user can order the search results by VIP members (which the group ID for them = 10) and that's mean the VIP members appear first in the search results page before the other members in the other groups.

Thanks.

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

Does anyone know how to do this?

LifesGreatestGift 02-05-2013 03:45 AM

Only put vip posts at the top if it is the thread starter post? (post 1)

KimK 02-06-2013 01:00 PM

I would like the featured members to show up first on the the member search results, maybe highlighted in a different color in the result indicated as a featured member.
http://www.agentlinkus.com/memberlist.php?do=search
and the members list page:
http://www.agentlinkus.com/members/list/

Thanks

LifesGreatestGift 02-07-2013 02:35 AM

1 Attachment(s)
Open template memberlist

Find
Code:

                <vb:each from="memberlistbits" value="userinfo">
                        <tr>
                                <td class="alt1 username">

Replace With:
Code:

                <vb:each from="memberlistbits" value="userinfo">
                        <tr<vb:if condition="is_member_of($userinfo, 6)"> style="background:red;"</vb:if>>
                                <td class="alt1 username"<vb:if condition="is_member_of($userinfo, 6)"> style="background:red;"</vb:if>>

Enter your usergroup ID in the is_member_of function. It is currently set for usergroup 6. you can add additional groups separated by commas. Also change the
Code:

style="background:red;"
to what suites you.

KimK 02-07-2013 10:09 AM

Thank you so much LifesGreatestGift but how can I get the featured members to show up first on the the member list page?

LifesGreatestGift 02-07-2013 12:21 PM

you would probably need to look into the queries that memberlist.php makes

KimK 02-07-2013 12:58 PM

I don't know anything about the queries in the memberlist.php. Can you help me?

LifesGreatestGift 02-07-2013 02:50 PM

Create a new plugin

Product: vBulletin
Hook Location: memberlist_fetch
Title: Sort admin first
Code:
Code:

$sqlsort = 'user.usergroupid=6';
$sortorder = 'desc';

Where 6 is the group id you want to show first.

KimK 02-11-2013 08:30 AM

A million billion thanks to you LifesGreatestGift for your help.

Thank you sooooo much :)

KimK 02-16-2013 06:00 PM

Sorry for disturbing you again. Can I create a featured members widget to include the same VIP group (group id = 10)?

Thanks :)

LifesGreatestGift 02-16-2013 06:24 PM

what all do you want displayed? Username, register date? etc...

KimK 02-16-2013 07:12 PM

No, just the username and the avatar for each member.

KimK 03-01-2013 10:58 PM

I found the solution for how to show random members with picture from specific group.
The following code will allow you to:

1- Show random members which have profile picture from specific group.
2- Clickable picture and username to go to member's profile page.

Installation:

1- Go to Admin CP > vBulletin CMS > Widgets > create new widget.
2- Widget type > PHP Direct Execution . Title > Random Members . Description > Show random members.
3- Click save.
4- Then click configure and put the code below.

Code:

PHP Code:


$member_count 
3;
$usergroup_limit 6;

  
ob_start();
  require_once(
'./includes/functions_user.php');
  require_once(
'./includes/functions_bigthree.php');
  
// Get Random Members
  
$newusers_get vB::$db->query_read("
    SELECT "
.TABLE_PREFIX."user.userid AS userid, ".TABLE_PREFIX."user.username AS username, ".TABLE_PREFIX."user.avatarrevision AS avatarrevision, ".TABLE_PREFIX."customavatar.dateline AS dateline FROM ".TABLE_PREFIX."customavatar
    LEFT JOIN "
.TABLE_PREFIX."user
            ON "
.TABLE_PREFIX."customavatar.userid=".TABLE_PREFIX."user.userid
   
   WHERE "
.TABLE_PREFIX."customavatar.visible = 1 AND ".TABLE_PREFIX."user.usergroupid = $usergroup_limit
   ORDER BY RAND()
   LIMIT 
$member_count");
  
$output_bits '<p align="center">';
  while(
$newuser vB::$db->fetch_array($newusers_get))
  {
        
$output_bits .= '<a href="member.php?u='.$newuser[userid].'"><img src="/customavatars/avatar'.$newuser[userid].'_'.$newuser[avatarrevision].'.gif" alt="'.$newuser[username].'"/><br />'.$newuser[username].'</a><br />';
  }
  
$output_bits .= '</p>';
  
$output $output_bits;
  
ob_end_clean(); 


Note: You can edit the amount of members you want to show by changing the $member_count from 3 to whatever value you want. Also you can change the usergroup_limit number to match the usergroup you want to display. 6 for example is Administrators.

Reference: https://vborg.vbsupport.ru/showthread.php?t=235460

Finally: Share what you know, learn what you don't.

Thanks

daniel_pet 04-10-2013 07:34 AM

Quote:

Originally Posted by KimK (Post 2407289)
I found the solution for how to show random members with picture from specific group.
The following code will allow you to:

1- Show random members which have profile picture from specific group.
2- Clickable picture and username to go to member's profile page.

Installation:

1- Go to Admin CP > vBulletin CMS > Widgets > create new widget.
2- Widget type > PHP Direct Execution . Title > Random Members . Description > Show random members.
3- Click save.
4- Then click configure and put the code below.

Code:

PHP Code:


$member_count 
3;
$usergroup_limit 6;

  
ob_start();
  require_once(
'./includes/functions_user.php');
  require_once(
'./includes/functions_bigthree.php');
  
// Get Random Members
  
$newusers_get vB::$db->query_read("
    SELECT "
.TABLE_PREFIX."user.userid AS userid, ".TABLE_PREFIX."user.username AS username, ".TABLE_PREFIX."user.avatarrevision AS avatarrevision, ".TABLE_PREFIX."customavatar.dateline AS dateline FROM ".TABLE_PREFIX."customavatar
    LEFT JOIN "
.TABLE_PREFIX."user
            ON "
.TABLE_PREFIX."customavatar.userid=".TABLE_PREFIX."user.userid
   
   WHERE "
.TABLE_PREFIX."customavatar.visible = 1 AND ".TABLE_PREFIX."user.usergroupid = $usergroup_limit
   ORDER BY RAND()
   LIMIT 
$member_count");
  
$output_bits '<p align="center">';
  while(
$newuser vB::$db->fetch_array($newusers_get))
  {
        
$output_bits .= '<a href="member.php?u='.$newuser[userid].'"><img src="/customavatars/avatar'.$newuser[userid].'_'.$newuser[avatarrevision].'.gif" alt="'.$newuser[username].'"/><br />'.$newuser[username].'</a><br />';
  }
  
$output_bits .= '</p>';
  
$output $output_bits;
  
ob_end_clean(); 


Note: You can edit the amount of members you want to show by changing the $member_count from 3 to whatever value you want. Also you can change the usergroup_limit number to match the usergroup you want to display. 6 for example is Administrators.

Reference: https://vborg.vbsupport.ru/showthread.php?t=235460

Finally: Share what you know, learn what you don't.

Thanks

Please help me to get with this script and user custom fields, like location, Biography, etc..
Thanks in advance.


All times are GMT. The time now is 04:54 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.01200 seconds
  • Memory Usage 1,787KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)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