Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding variable to tep_href_link


dave111

Recommended Posts

Posted

I need to add a variable to all links.

 

I want to make it so that when you type http://www.site.com/index.php?flash=yes

 

Then all links have flash=yes added to the end of the link.

 

I've tried adding in includes/functions/html_output.php:

if ($flash == 'yes') { $link .= $separator . 'flash=yes';}

 

After:

// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined

 

But it doesnt add the link when http://www.site.com/index.php?flash=yes is typed.

 

(If i remove the IF statement then it adds the flash=yes fine *all the time though*)

 

Any ideas?

Posted

Hi David, you will need to retrieve the 'yes' to the flash variable so say in application_top.php you add this

 

if( isset($HTTP_GET_VARS['flash']) && $HTTP_GET_VARS['flash'] == 'yes' )
?$g_flash_on = true;
else
?$g_flash_on = false;

 

add it in application top say before the line

// Shopping cart options

should be ok there

 

 

Then you setup this $g_flash_on flag which you can now test in the tep_href_link function for each link:

if ($g_flash_on) { $link .= $separator . 'flash=yes';}

 

Havent tried it exactly like this here but should do what you need.

Posted

Still not working :'(

 

I've tried tons of ways around it, and tried putting the code just about everywhere (apptop, config, html_output) still nothing.

Posted

can you try the $_GET array instead of the $HTTP_GET_VARS with the code I posted earlier.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...