vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   counter code and redir pages (https://vborg.vbsupport.ru/showthread.php?t=63093)

Jakeman 03-28-2004 06:57 PM

counter code and redir pages
 
vB3 gold.

I have counter code for my hit counter in my phpinclude_start template. The counter is being incremented on redirection pages, whether the redirection pages are disabled or not. In my case I have redir pages disabled, so the result is the counter is incremented twice when a form is submitted.

The redir pages are spawned by many different files, so checking THIS_SCRIPT will not work. Any other ideas?

filburt1 03-28-2004 07:08 PM

Try using isset() on the variable governing the redirection URL.

Jakeman 03-28-2004 09:18 PM

That's a good idea. But it didn't work.

Based on that suggestion, I looked at the STANDARD_REDIRECT template and the standard_redirect() function, looking for variables to check. I tried them all, no luck.

John 03-28-2004 09:48 PM

Quote:

Originally Posted by Jakeman
That's a good idea. But it didn't work.

Based on that suggestion, I looked at the STANDARD_REDIRECT template and the standard_redirect() function, looking for variables to check. I tried them all, no luck.

I've never liked those phpinclude templates!

For fear of saying something obvious and making myself look like an idiot, I'll suggest a long and boring way of doing things.

1. I'd put up a flag in print_standard_redirect(), functions.php.
PHP Code:

$GLOBALS['isredirect'] = true

2. I'd add the hitcounter PHP into the print_output function in functions.php, if the page isn't a redirect.
PHP Code:

if (!$GLOBALS['isredirect'])
{
     
// hit counter code


With all the global gubbins, to make sure the code worked inside the functions. Probably won't work, or I've missed the point entirely. ;)

Jakeman 03-28-2004 10:22 PM

I should have specified... I'm trying to avoid all file modifications.


All times are GMT. The time now is 02:00 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.02732 seconds
  • Memory Usage 1,718KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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