Thread: Profile Enhancements - Customizable Roster
View Single Post
  #20  
Old 05-29-2008, 07:19 PM
IR15H IR15H is offline
 
Join Date: Feb 2007
Location: England
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A few things...

Firstly, thanks for releasing this .

Some Questions
  • How do I sort user groups in a custom order, say id 1, 4, 5, 3, 2 or name A, D, E, C, B? A similar thing is done for user groups in a legend by Cyberntec in his "Visitors in Last X Hours" mod, but not being a coder I can't work it out myself.
  • How would I pull a user's age (not DOB), provided they haven't set it to private (Hide Age + DOB, Display Only Day and Month of Birth)? I spent quite a while trying to figure it out, with no joy.
  • How would I do the feature that is in ADMIN CP > Forums & Moderators > Show All Moderators, whereby it displays the last online in different colours, based on their last activity? I managed to find the code in forum/admincp/moderator.php;

PHP Code:
if ($supergroup['lastactivity'] >= $unixtoday)
{
$onlinecolor 'modtoday';
}
else if (
$supergroup['lastactivity'] >= ($unixtoday 86400))
{
$onlinecolor 'modyesterday';
}
else if (
$supergroup['lastactivity'] >= ($unixtoday 864000))
{
$onlinecolor 'modlasttendays';
}
else if (
$supergroup['lastactivity'] >= ($unixtoday 2592000))
{
$onlinecolor 'modsincetendays';
}
else
{
$onlinecolor 'modsincethirtydays';

Which I unsuccessfully tried to convert into;

PHP Code:
<if condition="$user['lastactivity'] >= $unixtoday">$user[lastonline]
<else />
<if 
condition="$user['lastactivity'] >= ($unixtoday - 86400)"><span style="color:green">$user[lastonline]</span>
<else />
<if 
condition="$user['lastactivity'] >= ($unixtoday - 864000)"><span style="color:blue">$user[lastonline]</span>
<else />
<if 
condition="$user['lastactivity'] >= ($unixtoday - 2592000)"><span style="color:orange">$user[lastonline]</span>
<else />
<
span style="color:red">$user[lastonline]</span>
</if></if></if></if> 
What am I doing wrong?

Some Suggestions
  • postbit_onlinestatus is uncached. Opening up showroster.php, and adding the following appears to fix this;

    Quote:
    // pre-cache templates used by all actions
    $globaltemplates = array(
    'SHOWROSTER',
    'showroster_header',
    'showroster_userbits',
    'postbit_onlinestatus'

    );
  • Replace all instances of <br> (9) with <br /> for XHTML validation.
  • Continuing with XHTML, still in showroster.php change the following line to include;

    Quote:
    $avatarimage='<img src="'.$avatarurl.'" border="0" alt="" />'; //Use $avatarimage in userbits to display avatars
  • Also XHTML, in product-showroster.xml, find and edit;

    Quote:
    Originally Posted by (showroster_header template)
    <td class="thead">Avatars</td>
    </tr>
    $rosterbits
    </table>
  • "Last Online" can be phrased using $vbphrase[last_online].

A Request

Rather than decide who appears/can view a roster via bitfields, would it be possible to do it via a ADMIN CP > vBulletin Options > Edit Settings Option (Similar to Cyb's mod I mentioned earlier)? I have quite a lot of usergroups, and I imagine most people who have clans/guilds use their forums do too, and it's a bit of a pain having to update each user group manually for those permissions, particularly if you use more than one roster. Those options would ideally include;
  • "User groups to show in roster" and a input area, where by the user group ids entered would be shown on the roster, in the order entered.
  • "User groups who can view roster" where you enter the user groups id that can view it, and where 0 means all groups can view it.

If doing it via that method is a lot of work/you think bit fields is a better way then no worries, I just thought I'd ask .



----------------------------

Quote:
Originally Posted by michael5472 View Post
Done any chance ?
I don't know how to enable BB code in the field, and I can't view users profiles without signing up, so don't know what else you use the "Play Monitor" field for, but a possible idea that may you might find suitable is;
  • Change your "Play Monitor" description to say "Enter the server IP you wish to track".
  • Enter the IP in that field: eg; 217.163.28.224:28960
  • In your showroster_userbits template, put this;
Quote:
<if condition="$user[fieldX]"><img src="http://www.gametracker.com/server_info/$user[fieldX]/b_560x95.png" alt="$user[fieldX]" border="0" /><else />No Server Tracked</if>
If that's not of any use to you then I'm afraid you'll have to wait for someone else to reply regarding enabling BB code, as I can't help you.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01117 seconds
  • Memory Usage 1,817KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete