Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-27-2010, 11:24 AM
TrigZu TrigZu is offline
 
Join Date: Jul 2010
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Google Chrome gets correct results, but FF and IE do not? (User Set Username Color)

RESOLVED

Hey guys, thanks for checking out my thread, I don't really know if this part is considered coding, but here I go...

This is from the memberaction_dropdown template; the goal is to have VIP member's usernames to show up as a custom color that they set. I realize I could concatenate the VIP and Field check in the example below, but I didn't to break things up more clearly. The issue is that on Firefox & IE $memberinfo['field7'] is showing up as empty, but on Google Chrome it works fine.

Modified Snippet From memberaction_dropdown template:
HTML Code:
<vb:if condition="$memberinfo['musername']">
	//If the user is VIP
	<vb:if condition="is_member_of($memberinfo,17)">
		//And the user has a custom color set
		<vb:if condition="$memberinfo['field7']">
			//Display the user's name in the color they want
			<span style="color: {vb:raw memberinfo.field7};">{vb:raw memberinfo.username}</span>
		//If the VIP member doesn't have a custom color
		<vb:else />
			//Display the regular color for that member group (VIP)
			{vb:raw memberinfo.musername}
		</vb:if>
	//If the member isn't a VIP then display the regular color set for that member group
	<vb:else />
		{vb:raw memberinfo.musername}
	</vb:if>
//It never gets here, but just display the username if it does
<vb:else />
	{vb:raw memberinfo.username}
</vb:if>
Original Snippet From memberaction_dropdown template:
HTML Code:
<vb:if condition="$memberinfo['musername']">
	{vb:raw memberinfo.musername}
<vb:else />
	{vb:raw memberinfo.username}
</vb:if>

Obviously I don't use the comments in the template like that, those are just there for you guys. At one point I had said "++++ it, I'm just going to edit the musername part in functions.php," but that didn't work either. The same issue happened. It's like when I try to check if they're part of the VIP usergroup (#17) it breaks field7, otherwise it works fine (but then it's applied to everyone instead of just VIPs).

Here's the changes I made to functions.php later.


Modified Snippet From functions.php:
PHP Code:
    $user['musername'] = $vbulletin->usergroupcache["$displaygroupid"]['opentag'] . $username $vbulletin->usergroupcache["$displaygroupid"]['closetag'];
    
    
//If the user is VIP then set $user['musername'] to the VIPs color, otherwise leave it alone.
    
$user['musername'] = is_member_of($user,17) ? '<span style="color: ' $user['field7'] . 'font-weight: bold;">' $username '</span>' $user['musername']; 
Original Snippet From functions.php:
PHP Code:
$user['musername'] = $vbulletin->usergroupcache["$displaygroupid"]['opentag'] . $username $vbulletin->usergroupcache["$displaygroupid"]['closetag']; 
Here's a link to a thread if you'd like to see what's going on visually. Test is the VIP member in question.
http://darklandservers.com/showthrea...6177#post36177

His name should show up white if it's working, and blue if it's not (the default VIP color). You can test it in Chrome and Firefox and see what I'm talking about, I've already had other people test it.

Honestly, I'm really disappointed in myself for not being able to get this to work out. Asking for help was the last thing I wanted to do, but I've set my (coder's) pride aside for now because I've been pulling my hair out for too long trying to get this to work. I'm going on vacation today and won't be able to work on it for another 3 or 4 days so I'm trying to get this resolved now rather than later. Big thanks to anyone who can help.

/rage
What really makes me angry is that I know that this should be easy. I mean, just the concept is so basic. Maybe if I get some sleep this will be easier. I think it would make my day if it turned out not to be me just being stupid, but I have a feeling that's not the case.

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

Nevermind. It appears as though only people in my forum moderator group can see the name's properly. I'm trying to find out what permissions they might have that would do that.

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

Got it, because the field was private it wouldn't let the regular members get anything. When I was testing on Google Chrome I was using a moderator account.
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 11:23 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.04178 seconds
  • Memory Usage 2,221KB
  • 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
  • (2)bbcode_html
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)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)showthread_list
  • (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_threadedmode.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_threaded
  • showthread_threaded_construct_link
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete