Any idea on how to make this as a componet

Moneya Posted in Component Development 10 years ago

any idea on how to make this as a component

http://www.geoplugin.com/examples

tried all i could still doesn't work

Replies
ng Moneya Replied 10 years ago

ok thanks...
i was thinking about metadata..
we need advanced settings i guess

German Michael Zülsdorff Replied 10 years ago

Yes, I understand. And I was trying to explain that you can't. As long as you don't know the IPs of those other users.

First, there's the technical aspect that OSSN simply does not store user IPs in the database.

Even more, doing so would lead to a privacy problem, too. Which way would you want to handle all those users who don't agree to tell us their location? You'd have to enhance user settings with an additional switch.

To my opinion, all this is a lot overhead. A much simpler approach would be to ask Arsalan if he's willing to add an ordinary location field to the user settings page. :) With the option to leave it blank.

ng Moneya Replied 10 years ago

>To my understanding it is able to tell you YOUR OWN location
i want to show user's location after upadating their status,
just like twitter.
i hope you understand

German Michael Zülsdorff Replied 10 years ago

I don't know what you're expecting the geo-plugin to do for you?
To my understanding it is able to tell you YOUR OWN location. Most likely resolved from your current internet connection. That's all.

And if you're sending a request like

echo var_export(unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$_SERVER['REMOTE_ADDR']

as shown in the provided example: OSSN currently does no logging of member IPs which you could pass to a call like that.

ng Moneya Replied 10 years ago

here is an exampleexample file

ng Moneya Replied 10 years ago

i mean the newsfeed activity item

German Michael Zülsdorff Replied 10 years ago

If you perhaps could send a screenshot? I got no idea what "status update" means. :((

ng Moneya Replied 10 years ago

hi,
i want to ask a few question..

what i need to do is actually showing user location below status update..
any idea on how to do That..
using js the above example Works with home page..

German Michael Zülsdorff Replied 10 years ago

What's going wrong, Moneya?

Arsalan told you already the code to be placed in the com file of your module. The rest is to find a good place (below the 'Welcome' on the frontpage for instance)
and a little jquery like

Ossn.RegisterStartupFunction(function(){

$(document).ready(function() {
var greeting = '<br><span style=\"font-size:10pt;\">Our special greetings go to everyone from ' + geoplugincity() + ', ' + geoplugincountryName() + '</span>';
$(".home-left-contents h1").append(greeting);
});
});

which goes into the Javascript subdirectory. (See HelloWorld module as an example to start with)