Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-07-2009, 10:22 AM
Kdicuori Kdicuori is offline
 
Join Date: Apr 2008
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 01-07-2009, 01:05 PM
Bellardia Bellardia is offline
 
Join Date: Jul 2007
Location: Hamilton, Ontario
Posts: 378
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 01-07-2009, 01:33 PM
Kdicuori Kdicuori is offline
 
Join Date: Apr 2008
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bellardia View Post
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.
Reply With Quote
  #4  
Old 01-08-2009, 02:23 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

register_activate_process
PHP Code:
$footer .= 'YOUR GOOGLE CODE HERE, ESCAPE ALL SINGLE QUOTES!'
Reply With Quote
  #5  
Old 01-08-2009, 09:20 AM
Kdicuori Kdicuori is offline
 
Join Date: Apr 2008
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
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.
Reply With Quote
  #6  
Old 01-08-2009, 09:49 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 01-08-2009, 10:13 AM
Kdicuori Kdicuori is offline
 
Join Date: Apr 2008
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
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.
Reply With Quote
  #8  
Old 01-08-2009, 10:49 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kdicuori View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:07 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.03774 seconds
  • Memory Usage 2,241KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (3)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete