Posted on: 11/17/02 04:48pm
By: Anonymous (Anonymous)
First, I would like anonymous comments, etc, to show the IP address, as opposed to the "Anonymous" tag that is shows. Where can I change that?
ie. instead of a comment from "Anonymous" it would be from "144.118.280.90" or whatever
And Second,
When I load my site first, the cookies work, but you have to hit the "Home" link again for it to show you logged in. Is there anyway to change this too? When cookies are enabled, to automatically redirect to the page where it shows you logged in?
Thanks!
Two Questions:
Posted on: 11/18/02 06:40am
By: Dirk
The second problem you're having is the "www vs. non-www" problem that has been discussed here a couple of times already.
To redirect people to the correct URL, you could try the following code (put it in index.php just after the require_once('lib-common.php');
):
preg_match ("/\/\/([^\/]*)/", $_CONF['site_url'], $server);
if ($HTTP_SERVER_VARS['HTTP_HOST'] != $server[1]) {
// this may be a case of a www. vs. non-www. URL ...
if (!empty ($QUERY_STRING)) {
$query = '?' . $QUERY_STRING;
} else {
$query = '';
}
echo COM_refresh ($_CONF['site_url'] . '/index.php' . $query);
exit;
}
I haven't tested this extensively yet, but it seems to work okay on one of my sites so far ...
bye, Dirk
Two Questions:
Posted on: 11/18/02 10:38pm
By: Anonymous (Anonymous)
I figured out why it wasn't forwarding right, something w/ my autoforwarding index.html, I fixed it.
Any idea on how to get the IP vs. Anon thing. That was the main thing I was shooting for.
Thanks so much for your help!
Two Questions:
Posted on: 11/19/02 01:01am
By: Dirk
Geeklog doesn't store the poster's IP address, so you would need to add a field for holding that information to the gl_comments table. Then, when a comment is saved (in comments.php), store the IP address. When the comment is displayed (most of that code is in lib-common.php) from an anonymous visitor, you could display the IP address instead of the name.
Doesn't sound too complicated ...
bye, Dirk
Two Questions:
Posted on: 11/19/02 03:18am
By: Anonymous (Anonymous)
Why would you want to display a visitor's IP address?? That's an invasion of privacy and would actually deter people from using your site or that particular feature. Some people have static IP addresses and displaying them is like publishing their home address for the whole world. If you don't want anonymous posters, then mark the block which forces them to register first. Privacy is still very important to many people.
Two Questions:
Posted on: 11/19/02 12:13pm
By: Anonymous (Anonymous)
Being ridiculously horrible w/ PHP, could you perhaps show me an example code? Thanks
Two Questions:
Posted on: 11/19/02 12:15pm
By: Anonymous (Anonymous)
I understand that, my site is mostly populated by friends/family. I'm not trying take away privacy, but prevent harassment from other places.