Global Variable for IP Addresses?


Well-known member
I'm not sure if I've missed it or if it doesn't exist, but I've been looking for a variable for the current user's IP address ($bbuserinfo equivalent for vBulletin (ex-)customers), and can't find it anywhere.

Does anyone know if this exists and what it is?


XenForo developer
Staff member
That's just in the server array ($_SERVER['REMOTE_ADDR']). It's not something we ever expose to the templates though.


Well-known member
So I should just call the variable via the standard $_SERVER['REMOTE_ADDR'] approach instead of a {$user.ip} approach?

EDIT: Never mind, tried $_SERVER['REMOTE_ADDR'], {$ipInfo.confirmationIp}, {$ipInfo.registrationIp} and {$ipInfo.contentIp}.

I'm going to try to {xen:set} an IP variable now... or is it possible to map the IP variable? I'll get to work on this tomorrow.


Well-known member
Ah, of course! The only reason it didn't work last time is because I temporarily forgot that arrays use the period instead of the usual [' '].

Thanks Mike :)