vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Detecting User's ID (https://vborg.vbsupport.ru/showthread.php?t=280350)

ssdevious 03-19-2012 03:18 PM

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

kh99 03-19-2012 03:43 PM

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} .

ssdevious 03-19-2012 05:33 PM

Quote:

Originally Posted by kh99 (Post 2311056)
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

kh99 03-19-2012 05:46 PM

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).

ssdevious 03-19-2012 08:52 PM

Quote:

Originally Posted by kh99 (Post 2311099)
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


All times are GMT. The time now is 04:46 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.01050 seconds
  • Memory Usage 1,724KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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