vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   displaying a piece of HTML code only on successful user activation page? (https://vborg.vbsupport.ru/showthread.php?t=200954)

Kdicuori 01-07-2009 10:22 AM

displaying a piece of HTML code only on successful user activation page?
 
Hello,

I have been asked to add a custom google tag only to be displayed on the user's activation confirmation page (the http://www.myvbulletinforum.xx/regis...r.php?a=act&u= etc etc etc page). The goal is to track users who actually complete their activation (don't ask me why they want to do it that way, marketing has its own evil and mysterious ways).

I have positively tried everything I could think of to get it done.

I can track the used template to the STANDARD_ERROR template. I tried adding this to the template:

HTML Code:

<if condition="$bAddGoogleAdsTracker">
<!-- Google Code for Conversion Page -->
blah blah blah
<!-- / Google Code for Conversion Page -->
</if>

and this hook

PHP Code:

global $bAddGoogleAdsTracker;
$bAddGoogleAdsTracker TRUE

to any hook I found it might be relevant by examining register.php, namely these:

register_activate_start
register_activate_process
register_addmember_complete

with no success at all.

I tried to add the variable as global, no global, to try and read the URI directly in the template and put that into a condition, nothing worked. I still can't make it come out.

I even tried moving the code into the "forum jump" condition, but it seems that this forum jump code gets added even on the /register.php?do=addmember pages - even though it has no content. So I would get the tag included in the wrong step.

Unfortunately I have found no way of debugging this except doing a different registration every time and after 15 gruelling test user registrations, I am at my wit's end and clueless :(

Any help would be very appreciated.

Thanks,

M.

Bellardia 01-07-2009 01:05 PM

Edit - Actually the register_addmember_complete is called after the success message is parsed, so it may be too late to add HTML at that point. Let me check a bit more first.

Kdicuori 01-07-2009 01:33 PM

Quote:

Originally Posted by Bellardia (Post 1704162)
Edit - Actually the register_addmember_complete is called after the success message is parsed, so it may be too late to add HTML at that point. Let me check a bit more first.

Thank you Bellardia, I'll be waiting for news from you.

M.

Dismounted 01-08-2009 02:23 AM

register_activate_process
PHP Code:

$footer .= 'YOUR GOOGLE CODE HERE, ESCAPE ALL SINGLE QUOTES!'


Kdicuori 01-08-2009 09:20 AM

Quote:

Originally Posted by Dismounted (Post 1704764)
register_activate_process
PHP Code:

$footer .= 'YOUR GOOGLE CODE HERE, ESCAPE ALL SINGLE QUOTES!'


Dismounted, thank you, it worked perfectly.

I wonder why my solution did not work though: maybe vbulletin does not pass all variables to templates? or do I need to pass them in a specific way for them to be seen and used in the templates? Maybe knowing the why of this will help me in implementing future fixes quicker.

Can you give some advice on this?

Thank you again,

M.

Dismounted 01-08-2009 09:49 AM

The variable you used does not exist because the error is called through standard_error(), and therefore, the variable is out-of-scope. The global keyword is used to bring a variable into scope, and does not work the way you think it does.

Kdicuori 01-08-2009 10:13 AM

Quote:

Originally Posted by Dismounted (Post 1704965)
The variable you used does not exist because the error is called through standard_error(), and therefore, the variable is out-of-scope. The global keyword is used to bring a variable into scope, and does not work the way you think it does.

Ok, so basically I hit that hurdle because of the specific situation, while I should have no such problems in other templates, correct?

Thanks again!

M.

Dismounted 01-08-2009 10:49 AM

Quote:

Originally Posted by Kdicuori (Post 1704990)
Ok, so basically I hit that hurdle because of the specific situation, while I should have no such problems in other templates, correct?

Correct, most of the time, what you did will work.


All times are GMT. The time now is 03:27 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.01036 seconds
  • Memory Usage 1,737KB
  • 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_html_printable
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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