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 03-19-2012, 03:18 PM
ssdevious ssdevious is offline
 
Join Date: Apr 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Detecting User's ID

Hello,

I'm having sort of a problem with the following - I created a custom user field and linked a JavaScript to it, however, when it opens, it doesn't recognize the user.

Anybody any ideas?

Code:
<vb:if condition="$social['msn']">
<a href="javascript://" onclick="imwindow('msn', '{vb:raw userinfo.userid}', 440, 270); return false;"><img src="images/postbit_social/msn.png" onmouseover="this.src='images/postbit_social/msn_a.png'" onmouseout="this.src='images/postbit_social/msn.png'" alt="{vb:rawphrase send_message_via_msn_to_x, {vb:raw post.username}}." /></a>
</vb:if>
This MSN is just an example, vBulletin has something like this by default, I know that, I'm just trying to use the mechanics for a mod.

Will be grateful for any ideas.

Best Regards,
~tEh'P?r4d0x
Reply With Quote
  #2  
Old 03-19-2012, 03:43 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What does it look like when you view the page html source? You have {vb:raw post.username} near the end, maybe it should be {vb:raw userinfo.username} .
Reply With Quote
  #3  
Old 03-19-2012, 05:33 PM
ssdevious ssdevious is offline
 
Join Date: Apr 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
What does it look like when you view the page html source? You have {vb:raw post.username} near the end, maybe it should be {vb:raw userinfo.username} .
Hi,

HTML:

Code:
<a href="javascript://" onclick="imwindow('msn', '', 440, 270); return false;"><img src="images/postbit_social/msn.png" onmouseover="this.src='images/postbit_social/msn_a.png'" onmouseout="this.src='images/postbit_social/msn.png'" alt="Send a message via MSN to Admin." /></a>

The "{vb:raw userinfo.userid}" displays as (, '',), which indicates my problem.

The "{vb:raw userinfo.username}" is fine, it's just a Var for this yellow Windows box, when you mouse the icon in postbit, it displays the: "Send a message via MSN to *Your Forum Username*."

Any ideas on how the vBulletin .js or the code recognizes the user?

When I'm using custom "User Profile Fields", the mod itself was using {vb:raw social.facebook} for example, but it registered its own template and the concept was to simply redirect and I want to modify parts of it to pop out. Not sure, if you can still follow this.

Well, thanks for some more suggestions anyway,
~tEh'P?r4d0x
Reply With Quote
  #4  
Old 03-19-2012, 05:46 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, it looks like the phrase in the alt tag is showing the user as "Admin", so maybe what you want to use for the userid is {vb:raw post.userid} (is this going in the postbit? If so then that's definitely what you want).
Reply With Quote
  #5  
Old 03-19-2012, 08:52 PM
ssdevious ssdevious is offline
 
Join Date: Apr 2011
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
OK, it looks like the phrase in the alt tag is showing the user as "Admin", so maybe what you want to use for the userid is {vb:raw post.userid} (is this going in the postbit? If so then that's definitely what you want).
Works as charm.

Many thanks,
~tEh'P?r4d0x
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 09:59 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.05439 seconds
  • Memory Usage 2,197KB
  • 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
  • (2)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete