vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Profile Enhancements - Customizable Roster (Member List) (https://vborg.vbsupport.ru/showthread.php?t=141311)

grecostimpy 03-26-2007 08:52 PM

Quote:

Originally Posted by Sarcoth (Post 1212744)
grecostimpy - I've looked over your process a dozen times and I don't see anything wrong with it. The only thing I can think of is that one of the templates are spelled incorrectly; typo maybe. Double check and let me know.

I triple checked.....unfortunately, they are all good.

Edit: Figured it out...see two posts down.

m002.p 03-26-2007 09:58 PM

Ok ive managed to understand the variant and add images. This is my example below:

www.sog-team.co.uk/forum/showroster.php

This is the information contained in the templates:

showroster_usergroup

Code:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat" colspan="8">$user[title]</td>
</tr>
<tr>
        <td class="thead">$vbphrase[user_name]</td>
        <td align="center" class="thead">Real Name</td>
        <td align="center" class="thead">Country</td>
        <td align="center" class="thead">Flag</td>
        <td align="center" class="thead">Games</td>
        <td align="center" class="thead">Contact</td>
        <td align="center" class="thead">Xfire</td>
       
       
$usergroupbits
</table>
<br />

showroster_usergroupbit

Code:

<tr>
       
        <td class="$bgclass">
                <a href="member.php?$session[sessionurl]u=$user[userid]">$user[musername]</a>
        </td>
       
        <td align="center" class="$bgclass" nowrap="nowrap">$user[field12]</td>
        <td align="center" class="$bgclass" nowrap="nowrap">$user[field10]
                                </td>
        <td align="center" class="$bgclass" nowrap="nowrap"><img src="images/flags/$user[field10].gif"></td>
        <td align="center" class="$bgclass" nowrap="nowrap">$user[field8]</td>
        <td align="center" class="$bgclass" nowrap="nowrap"><a href="private.php?$session[sessionurl]do=newpm&amp;u=$user[userid]" rel="nofollow"><img src="images/imagesblue/sendpm.gif" Border=0></a>
                <a href="sendmessage.php?$session[sessionurl]do=mailmember&amp;u=$user[userid]" rel="nofollow"><img src="images/imagesblue/email.gif" Border=0></a>
        <td align="center" class="$bgclass" nowrap="nowrap"><if condition="$user[field14]"><a href="xfire:add_friend?user=$user[field14]"><IMG STYLE="border: none;" SRC="images/misc/icon_xfire.gif"></a></if></td>

       

</tr>

And of course in order to do that (add images) you need to user the "$user" variant opposed to "$post" even though it could be added to the php file

Hope that helps

grecostimpy 03-26-2007 11:03 PM

OK...I figured it out.

I had ALL of my usergroups included on the View Forum Leaders. (Namely because I want all my users to show on this special page if they filled out the custom field irregardless of their usergroup).

Problem is, there's too many to list...so the white page.

When I took the biggest usergroup off of the View Forum Leaders...the page started displaying perfectly.

So...two things:
  1. Is there a way to not display users who do not have the custom profile field filled out? (Filter them out) This way, only the users whohave a value in the field show on the page and users who have not filled out the custom profile field are ignored
  2. Can we have it so it displays 50 or so users, then starts a new page (a la the memberlist)

Sarcoth 03-27-2007 11:55 AM

Quote:

field10 is set to the country of a user. Like UK, Germany, France etc

This is linked to a image (.gif) on the server which means using $post[field10].gif will result in it displaying the members country flag on the roster
Are your gif files in the same format as the country names?

Meaning. If Germany is their country, are you referring to Germany.gif?

EDIT: I just saw your second post. That's exactly what I was going to be suggesting as long as the files were in the same format as the country name. Otherwise, I was going to put some code in the PHP file that would make the whole word lowercase. Glad you got it working.

Sarcoth 03-27-2007 12:05 PM

Quote:

Originally Posted by grecostimpy (Post 1213187)
OK...I figured it out.

I had ALL of my usergroups included on the View Forum Leaders. (Namely because I want all my users to show on this special page if they filled out the custom field irregardless of their usergroup).

Problem is, there's too many to list...so the white page.

When I took the biggest usergroup off of the View Forum Leaders...the page started displaying perfectly.

Well that's something I never expected. How many users do you have?

Quote:

Originally Posted by grecostimpy (Post 1213187)
Is there a way to not display users who do not have the custom profile field filled out? (Filter them out) This way, only the users whohave a value in the field show on the page and users who have not filled out the custom profile field are ignored

I can definitely do that, should be very easy. How many profile fields are you using and I'm guessing you only want them filtered out if all the fields are blank? Meaning, if they even fill in one of the fields, they'll be on the list.


Quote:

Originally Posted by grecostimpy (Post 1213187)
Can we have it so it displays 50 or so users, then starts a new page (a la the memberlist)

Sorry, that's not the direction I'll be going with the the roster.

grecostimpy 03-27-2007 02:34 PM

Thanks Sarcoth,

I'd like it to only show users who have entered anything into field5. (so if nothing was entered in field5, they would not be included)

Thanks a lot for your assistance!

Sarcoth 03-27-2007 03:05 PM

Quote:

Originally Posted by grecostimpy (Post 1213636)
I'd like it to only show users who have entered anything into field5. (so if nothing was entered in field5, they would not be included)

Open the showroster.php file and find:
Code:

if (sizeof($groupcache) >= 1)
{
        ksort($groupcache); // alphabetically sort usergroups
        foreach ($groupcache AS $users)
        {
                ksort($users); // alphabetically sort users
                $usergroupbits = '';
                foreach ($users AS $user)
                {
                        exec_switch_bg();
                        $user = process_showgroups_userinfo($user);

                        ($hook = vBulletinHook::fetch_hook('showgroups_user')) ? eval($hook) : false;
                        eval('$usergroupbits .= "' . fetch_template('showroster_usergroupbit') . '";');
                }

                ($hook = vBulletinHook::fetch_hook('showroster_usergroup')) ? eval($hook) : false;
                eval('$usergroups .= "' . fetch_template('showroster_usergroup') . '";');
        }
}

Change to:
Code:

if (sizeof($groupcache) >= 1)
{
        ksort($groupcache); // alphabetically sort usergroups
        foreach ($groupcache AS $users)
        {
                ksort($users); // alphabetically sort users
                $usergroupbits = '';
                foreach ($users AS $user)
                {
                        if ($user['field5'] != '') {
                                exec_switch_bg();
                                $user = process_showgroups_userinfo($user);

                                ($hook = vBulletinHook::fetch_hook('showgroups_user')) ? eval($hook) : false;
                                eval('$usergroupbits .= "' . fetch_template('showroster_usergroupbit') . '";');
                        }
                }

                ($hook = vBulletinHook::fetch_hook('showroster_usergroup')) ? eval($hook) : false;
                eval('$usergroups .= "' . fetch_template('showroster_usergroup') . '";');
        }
}

Let me know how that works.

SgtOliver 03-27-2007 04:17 PM

I managed to get the users avatar working in mine using https://vborg.vbsupport.ru/showthread.php?t=83150

I am using this for more of an "About Us" page http://www.goblinarmy.com/community/aboutus.php

My showroster_usergroup

Code:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat" colspan="3">$user[title]</td>
</tr>
<tr>
        <td class="thead">Member</td>
        <td class="thead">Biography</td>
        <td class="thead">Favorites</td>

       
$usergroupbits
</table>
<br />


My showroster_usergroupbit

Code:

<tr height=150>
       
<td class="$bgclass">
<a href="member.php?$session[sessionurl]u=$user[userid]">$user[musername]</a><br>$user[usertitle]<br>
<if condition="$vbulletin->userinfo['avatarid']">
<img src="$user[avatarpath]" alt="$bbuserinfo[username]'s Avatar" border="0" />
<else />
        <if condition="$vbulletin->userinfo['hascustomavatar']">
                  <if condition="$vbulletin->options['usefileavatar']">
                        <img src="$vboptions[avatarurl]/avatar$user[userid]_$user[avatarrevision].gif" title="$user[username]'s Avatar" alt="Avatar" border="0" />
                  <else />
                        <img src="image.php?u=$user[userid]&amp;dateline=$avatar[dateline]" title="$user[username]'s Avatar" alt="Avatar" border="0" />
                  </if>
          <else />
                <img src="$stylevar[imgdir_misc]/noavatar.gif" alt="guestavatar.gif" title="No Avatar Specified" border="0" />
          </if> 
</if>
</td>



        <td class="$bgclass"><b>Real name:</b><br>
                                $user[field14]<br><br>
                            <b>Location:</b><br>
                                $user[field2]<br><br>
                            <b>Ocupation:</b><br>
                                $user[field4]<br><br>
                            <b>Interests:</b><br>
                                $user[field3]</td>


        <td class="$bgclass"><b>Map:</b><br>
                            $user[field13]<br><br>
                            <b>Second Map:</b><br>
                            $user[field15]<br><br>
                            <b>Weapon:</b><br>
                            $user[field11]<br><br>
                            <b>Sec Weapon:</b><br>
                            $user[field12]</td>




       

</tr>


Sarcoth 03-27-2007 05:18 PM

That great SgtOliver. The funny thing is I have been working on it since yesterday and just got it work about an hour ago but went out to lunch. I'll post my changes here for you anyhow. Use them if you are interested.

Open the showroster.php file.

***************************

Find:
Code:

require_once('./global.php');
Below it add:
Code:

require_once(DIR . '/includes/functions_user.php');
***************************

Find:
Code:

                        ($hook = vBulletinHook::fetch_hook('showgroups_user')) ? eval($hook) : false;
                        eval('$usergroupbits .= "' . fetch_template('showroster_usergroupbit') . '";');

Above it add:
Code:

                        $avatarurl=fetch_avatar_url($user[userid]);
                       
                        if (!$avatarurl) {
                                $avatarurl = 'images/spacer.gif';
                        } else {
                                $avatarurl = $vbulletin->options['bburl'] . '/' . $avatarurl[0];
                        }
                       
                        $avatarimage='<img src="'.$avatarurl.'" border="0">';

***************************

Add a column for the Avatar header to your showroster_usergroup template.
Code:

<td class="thead">Avatar</td>
***************************

Add a column for the Avatar image to your showroster_usergroupbit template.
Code:

<td class="$bgclass">$avatarimage</td>
***************************

You would also have to make some table adjustments (ie. colspan) to get it all even again.

The spacer.gif image I am using is attached if you want to use that as well.

That's it.

m002.p 03-27-2007 08:27 PM

Thanks Sacroth.

I have another question, how do you create the title for the page like the one in your demo "Clan Roster"?

Ie the title you have "Sacred Haven - Vanguard Guild Roster"


All times are GMT. The time now is 04:01 AM.

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.01419 seconds
  • Memory Usage 1,800KB
  • 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
  • (12)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete