IP-Address in Profile
+3
Ape
SLGray
Eugeo Igvalt
7 posters
Page 1 of 3
Page 1 of 3 • 1, 2, 3
IP-Address in Profile
Hello. I have been working as Administrator for a forum and They have asked me they want in the Profile area and only Administrators to see it. I need the IP to appear automatically in the text box without me having to fill each text box of each member manually. I have already created the field I just need the IP to be added automatically. is there any CSS, Javascript or Html code to make this a possibility?
Screenshot of text box: http://prntscr.com/5esvgg
Screenshot of text box: http://prntscr.com/5esvgg
Last edited by Eugeo Ayano on December 16th 2014, 3:56 pm; edited 1 time in total
Re: IP-Address in Profile
So you want the IP address to automatically appear in a customized profile field?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: IP-Address in Profile
This can not be done as far as i know i think you will need server side data for that and we don't have access to that sort of thing.
Re: IP-Address in Profile
This is indeed possible!Eugeo Ayano wrote:Yes that's what they asked me for. Only the Admins can see it though
New code: https://help.forumotion.com/t137330p30-ip-address-in-profile#927986
JS
Last edited by JScript on December 10th 2014, 3:50 pm; edited 2 times in total (Reason for editing : New code!)
Re: IP-Address in Profile
Wow i learn something every day lol
EDIT: i could not get it to work thou it messes up other codes
EDIT: i could not get it to work thou it messes up other codes
Re: IP-Address in Profile
So it did not work in your tests???APE wrote:i could not get it to work thou it messes up other codes
Let us analyze the code:
This line: if (location["search"] == "?agreed=true\x26step=2") {
Awaits the registration page where the data should be filled;
This: var profileID = "PROFILE_FIELD_ID";
It is where is stored the new profile field ID;
This: var IPLocation = setInterval(function() { .... }, 10);
It is an infinite loop of 10 milliseconds;
This: if (document["getElementById"](profileID) !== null) {
Awaits the ID to be interpreted by DOM;
This: jQuery("#" + profileID)["closest"]("dl")["hide"]();
Hides the field so that the member not edit manually;
This: clearInterval(IPLocation);
Stop the loop;
This: jQuery["getJSON"]("http://api.ipify.org?format=jsonp\x26callback=?", function(IP) {
Returns the public IP;
This: jQuery("#" + profileID)["val"](IP["ip"]);
Adds the returned value (IP) in the predefined field;
And this: })["fail"](function() {alert("Warning!\x0A\x0 A An error occurred while requesting registration, wait 0 seconds and refresh the page to re-register!"); });
If there is any error, shows that message!
So after this analysis, I can not imagine how it could have some conflict with other code!
JS
Re: IP-Address in Profile
Not sure but i am happy to not have it lol It just kills my java codes so i don't know lol
Re: IP-Address in Profile
Okay, but do not give up so easy!APE wrote:Not sure but i am happy to not have it lol It just kills my java codes so i don't know lol
Works on my forum and if you find it interesting, I have to do work in your too, of course!
Please try the code below:
- Code:
jQuery(function() {
if (location.search == "?agreed=true\x26step=2") {
var profileID = "PROFILE_FIELD_ID";
if (document.getElementById(profileID) !== null) {
jQuery("#" + profileID).closest("dl").hide();
jQuery.get("http://api.ipify.org?format=jsonp\x26callback=?", function(IP) {
jQuery("#" + profileID).val(IP.ip);
}).fail(function() {
alert("Warning!\n\nA An error occurred while requesting registration, wait 10 seconds and refresh the page to re-register!");
});
};
};
});
I will wait for your reply ok?
JS
Re: IP-Address in Profile
Nope still having the same problem lol i will send you an account in a pm to take a look your self
Re: IP-Address in Profile
Yes thats how i did mine lol did you try and make a new account on your forum ?
if not send me your URL and i will try
EDIT:you don't have it set so it has to be filled in when making a new account
if not send me your URL and i will try
EDIT:you don't have it set so it has to be filled in when making a new account
Re: IP-Address in Profile
@Eugeo Ayano
Hello friend, wait just me finish this one and therefore your will be ready ok?
@APE
I found this error in your forum:
But it's nothing to do with my code!
Replace my code with this code below (no need to modify it):
JS
Hello friend, wait just me finish this one and therefore your will be ready ok?
@APE
I found this error in your forum:
But it's nothing to do with my code!
Replace my code with this code below (no need to modify it):
- Code:
if (location.search == "?agreed=true\x26step=2") {
var profileID = 'profile_field_13_14';
var IPLocation = setInterval(function() {
if (document.getElementById(profileID) !== null) {
jQuery("#" + profileID).closest("dl").hide();
clearInterval(IPLocation);
jQuery.getJSON("http://api.ipify.org?format=jsonp\x26callback=?", function(json) {
jQuery("#" + profileID).val(json.ip);
}).fail(function() {
alert("Warning!\n\nAn error occurred while requesting registration, wait 10 seconds and refresh the page to re-register!");
});
};
}, 10);
};
JS
Last edited by JScript on December 10th 2014, 4:08 am; edited 2 times in total
Re: IP-Address in Profile
I created a dummy account and nothing happened.
link is http://angelsjewelacademy.forumotion.com/
link is http://angelsjewelacademy.forumotion.com/
Re: IP-Address in Profile
let me know when you join so I can activate your account and promote you to admin on your temporary account
Re: IP-Address in Profile
YES @Jsript that worked Woop woop i did have to change the 13_13 To 13_14 thou lol
Re: IP-Address in Profile
Yoou have to have it set as it is here
see it says you need to make it a Necessarily filled ? YESJScript wrote:This is indeed possible!Eugeo Ayano wrote:Yes that's what they asked me for. Only the Admins can see it though
Create a new field in the profile as follows:
Then go on editing your profile and with the help of the browser console, locate the new field identifier that was created as illustrated below:
Use this code:Change this: PROFILE_FIELD_ID ] by the identifier that you found in step above!
- Code:
if (location["search"] == "?agreed=true\x26step=2") {
var profileID = "PROFILE_FIELD_ID";
var IPLocation = setInterval(function() {
if (document["getElementById"](profileID) !== null) {
jQuery("#" + profileID)["closest"]("dl")["hide"]();
clearInterval(IPLocation);
jQuery["getJSON"]("http://api.ipify.org?format=jsonp\x26callback=?", function(IP) {
jQuery("#" + profileID)["val"](IP["ip"]);
})["fail"](function() {
alert("Warning!\x0A\x0 A An error occurred while requesting registration, wait 10 seconds and refresh the page to re-register!");
});
};
}, 10);
};
Result:
JS
Re: IP-Address in Profile
but then doesn't that mean the user has to find his own IP and insert it on his own?
Re: IP-Address in Profile
Yes, it should be as shown in the picture!!!
I edited my post: https://help.forumotion.com/t137330-ip-address-in-profile#927897
Then use this other, if it works, will work for @Eugeo Ayano too.
JS
Just missed you change this which we sealed in the image below:APE wrote:YES @Jsript that worked Woop woop i did have to change the 13_13 To 13_14 thou lol
I edited my post: https://help.forumotion.com/t137330-ip-address-in-profile#927897
Then use this other, if it works, will work for @Eugeo Ayano too.
No, the field will be hidden!Eugeo Ayano wrote:but then doesn't that mean the user has to find his own IP and insert it on his own?
JS
Re: IP-Address in Profile
Note it will only add the ip address when a member makes an account it will not fill in the ip address of the members that are already on your forum as members
Re: IP-Address in Profile
No problem! So what you want is that the IP is recorded whenever the member login?APE wrote:Note it will only add the ip address when a member makes an account it will not fill in the ip address of the members that are already on your forum as members
If it is, I will do the way you want ok?
JS
Re: IP-Address in Profile
it would be really good if it would find the ips of the members we already have aswell as find the new members ip address but dont worry if its gonna take ya all night lol its good just the way it is
Thank you J
Thank you J
Re: IP-Address in Profile
@Eugeo Ayano
I'm very happy to have helped you!
@APE
Ok, keep this topic open that tomorrow I will do the code!
JS
I'm very happy to have helped you!
@APE
Ok, keep this topic open that tomorrow I will do the code!
JS
Re: IP-Address in Profile
ok no problem
APE
To staff please Leave this post open From Ape i will close it tomorrow
APE
Page 1 of 3 • 1, 2, 3
Similar topics
» Why was the SSL certificate given to the .forumotion address instead of .com address?
» Profile Rank and Avatar profile problem
» [QUERY] How to show the members' group joined in their post profile and even in their profile?
» Profile field, multiple words with different colors in the same profile filed
» Private Message, Profile buttons (and any other) in Profile / how to get rid of the boarder under the posts?
» Profile Rank and Avatar profile problem
» [QUERY] How to show the members' group joined in their post profile and even in their profile?
» Profile field, multiple words with different colors in the same profile filed
» Private Message, Profile buttons (and any other) in Profile / how to get rid of the boarder under the posts?
Page 1 of 3
Permissions in this forum:
You cannot reply to topics in this forum