PDA

View Full Version : Detecting User's ID


ssdevious
03-19-2012, 03:18 PM
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?

<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
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:

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