Quick question, kind of related to my question in the other thread. I am trying to achieve some functionality that was mentioned in a blog post by Brandon Kelly.
Essentially I would like to add a couple of new global variables into index.php so that I can use them in my templates. The only problem is on Brandon’s site he is using EE 2.0, and on mine I am still on 1.6.9.
The code for adding the variables is like so:
$assign_to_config['site_url'] = 'http://'.$_SERVER['HTTP_HOST'].'/';
$assign_to_config['global_vars']['site_ssl_url'] = str_replace('http://', 'https://', $assign_to_config['site_url']);
$assign_to_config['global_vars']['site_proto_url'] = ($_SERVER['HTTPS'] == 'on' ? $assign_to_config['global_vars']['site_ssl_url'] : $assign_to_config['site_url']);What I am wondering is how I can modify these lines to work with EE 1.6.9, or if it won’t work that way on this version, where/what can I add to get what I want.
essentially this explains why I want to do this:
Now, {site_url} is being defined right in index.php, {site_ssl_url} will always be the same as {site_url} except with an https:// prefix, and {site_proto_url} is either set to the {site_url} or {site_ssl_url}, depending on whether or not the current request is coming over SSL.
From there, it was just a matter of plugging these new tags in where appropriate. Links to members/* (which would be redirected to https:// anyway) are now created using {site_ssl_url}: