News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

Using the name tag/identifier?

Started by OrosEcho_, September 02, 2010, 04:51:05 PM

Previous topic - Next topic

OrosEcho_

I have signed up for this website called Reinvigorate which is a stats tracking. There this feature for nametags. Using this code will show me who is browsing the site.

var re_name_tag = "<?php echo $is_logged_in ? $username : " ?>

replacing the $is_logged_in? $username :" with the actually tag in SMF  so

var re_name_tag = "<?php echo $context['user']['name']:"?>

Adding the "$context['user']['name']" gives me a syntax error, Any ideas?

Oya

var re_name_tag = <?php echo JavaScriptEscape($context['user']['name']); ?>;

OrosEcho_

still isn't working. Is enough detail given?

Oya

in what way isnt it working

errors in the error log? where did you put that code

OrosEcho_

http://img521.imageshack.us/img521/3344/errormz.png

Thats the error i get.

This isn't suppose to be part of the forums. Its for a  third party analytics site.

Oya

see i didnt know where you were putting that code and since i didnt know that i broke your forum

var re_name_tag = ', JavaScriptEscape($context['user']['name']), ';

OrosEcho_

I'm putting the code into the footer of the index.template.php of my theme. Was kinda in a rush. sorry about that

Thanks for the help!

Advertisement: