vBulletin Mods

The Official vBulletin Modifications Site

Userid fetch and pass?
by BadgerDog
03 Sep 2012 15:44

I'm trying to get a piece of code to fetch the userid of the poster in any given thread and pass it to a javascript..

Here's the code

<a href="javascript:void(0)" onclick="javascript:jqcc.mychat.chatWith('1');">Chat with me</a>

Instead of the absolute "1", what would be the variable name I substitute in order to have "1" replaced with the userid of the poster?

Thanks for any help .. :)


kh99 03 Sep 2012 15:51

If this is in the postbit, you could try {vb:raw post.userid}.

BadgerDog 03 Sep 2012 16:02


Originally Posted by kh99 (Post 2362249)
If this is in the postbit, you could try {vb:raw post.userid}.

So, this would be the correct code?

<a href="javascript:void(0)" onclick="javascript:jqcc.mychat.chatWith('{vb:raw post.userid}');">Chat with me</a>



kh99 03 Sep 2012 16:03

I'm pretty sure that's right, yes. Does it not work?

BadgerDog 03 Sep 2012 16:17

I can't seem to make it work ...

..but, I'm not a programmer, so it's probably me .. :D

Thanks anyway ...


kh99 03 Sep 2012 16:21

Well, I'm never 100% sure the code is right unless I try it. What happens when you try it? Have you tried viewing the html source of your page and seeing what that code looks like?

All times are GMT. The time now is 21:23.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.