A arcaneex Active member Aug 19, 2012 #1 A member , admin or a guest. Every person which visit a page should have his IP logged and stored. Is it possible to do it?
A member , admin or a guest. Every person which visit a page should have his IP logged and stored. Is it possible to do it?
A arcaneex Active member Aug 19, 2012 #2 Okay I found the code to store/show the IP. But how do I make it work on the page and how to I make it store it on the database?
Okay I found the code to store/show the IP. But how do I make it work on the page and how to I make it store it on the database?
Jake Bunce Well-known member Aug 19, 2012 #3 Which page exactly? You will likely need a small addon to do the IP logging.
A arcaneex Active member Aug 19, 2012 #4 Jake Bunce said: Which page exactly? You will likely need a small addon to do the IP logging. Click to expand... A simple xenforo page , added using the new page through ACP.
Jake Bunce said: Which page exactly? You will likely need a small addon to do the IP logging. Click to expand... A simple xenforo page , added using the new page through ACP.
Jake Bunce Well-known member Aug 19, 2012 #5 You can specify a callback for your page node. Code example: http://xenforo.com/community/thread...er-custom-fields-on-a-page.33744/#post-384478 With your callback you can add code to log the IP. Here is code taken from the register controller for logging the IP: Code: XenForo_Model_Ip::log($user['user_id'], 'user', $user['user_id'], 'register'); You need to pass in your own values when calling this function.
You can specify a callback for your page node. Code example: http://xenforo.com/community/thread...er-custom-fields-on-a-page.33744/#post-384478 With your callback you can add code to log the IP. Here is code taken from the register controller for logging the IP: Code: XenForo_Model_Ip::log($user['user_id'], 'user', $user['user_id'], 'register'); You need to pass in your own values when calling this function.
A arcaneex Active member Aug 19, 2012 #6 Okay I found this: http://teamtutorials.com/web-develo...-into-a-mysql-database-using-php#.UDEHnN3ibDs to store it. How do I combine this and the IP log things together in one callback?
Okay I found this: http://teamtutorials.com/web-develo...-into-a-mysql-database-using-php#.UDEHnN3ibDs to store it. How do I combine this and the IP log things together in one callback?
Jake Bunce Well-known member Aug 19, 2012 #7 XenForo already has a system for IP logging. Just use the XenForo_Model_Ip class (code example above).
XenForo already has a system for IP logging. Just use the XenForo_Model_Ip class (code example above).
Jake Bunce Well-known member Aug 19, 2012 #9 XenForo_Model_Ip logs the IP of the visitor. Just call that log() function as shown in the above code example. See this file for the class code: library/XenForo/Model/Ip.php
XenForo_Model_Ip logs the IP of the visitor. Just call that log() function as shown in the above code example. See this file for the class code: library/XenForo/Model/Ip.php
A arcaneex Active member Aug 19, 2012 #10 I really don't understand what this means : ($user['user_id'], 'user', $user['user_id'], 'register'); can you please explain?
I really don't understand what this means : ($user['user_id'], 'user', $user['user_id'], 'register'); can you please explain?
Jake Bunce Well-known member Aug 19, 2012 #11 You need to be a programmer to implement something like this. You should post a request if you need some one to write this for you: http://xenforo.com/community/forums/custom-service-development-requests.69/
You need to be a programmer to implement something like this. You should post a request if you need some one to write this for you: http://xenforo.com/community/forums/custom-service-development-requests.69/