vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Userid fetch and pass? (https://vborg.vbsupport.ru/showthread.php?t=287416)

BadgerDog 09-03-2012 01:44 PM

Userid fetch and pass?
 
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');">Ch at 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 .. :)

Regards,
Doug

kh99 09-03-2012 01:51 PM

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

BadgerDog 09-03-2012 02:02 PM

Quote:

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>

Thanks?

Regards,
Doug

kh99 09-03-2012 02:03 PM

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

BadgerDog 09-03-2012 02:17 PM

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

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

Thanks anyway ...

Regards,
Doug

kh99 09-03-2012 02:21 PM

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 08:22 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.01703 seconds
  • Memory Usage 1,716KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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