I’m coding a third-party application and I cannot find anything referenced in smarty the signifies a users IP Address prior to login.
Essentially I’m tracking what the user does (google analytics style) however since the only variable that pops up ({$auth.ip}) is after the customer logs in which is useless in the case of anonymous checkout)
But I think it’s better to track by session id, because IP tracking isn’t always that accurate. I’m remember AOL users have dynamic IPs and it changes during the session.
But I think it’s better to track by session id, because IP tracking isn’t always that accurate. I’m remember AOL users have dynamic IPs and it changes during the session.[/quote]
Hi dropped the code at the bottom of init.php however smarty didn’t parse the code (cleared cache) nor did it show any reference to my IP.
Is it required to be anywhere specific in the code-block or am I missing a step?
[quote name=‘ETInteractive’]session id is already set in smarty vars, you can view that at the debugger.[/quote]
session_id isn’t what I’m looking for (is it?) as it doesnt’ contain the IP address, unless it in an array? Getting curious why it’s not parsing; although having used similar code on the front page shows the IP address
[quote name=‘JesseLeeStringer’]Hi dropped the code at the bottom of init.php however smarty didn’t parse the code (cleared cache) nor did it show any reference to my IP.
Is it required to be anywhere specific in the code-block or am I missing a step?
That way the variable $user_ip is available under smarty.
----------
Registry::set(‘user_ip’, $_SERVER[‘REMOTE_ADDR’]) // for your PHP scripts
$view->assign(‘user_ip’, $_SERVER[‘REMOTE_ADDR’]); // define the variable for smarty[/quote]
That worked beautifully! I’ve now matched the logic to report IP address unless the user is logged in so I can adequately follow respective usernames Much appreciated as this makes my life a whole lot easier