Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 04:37 pm EDT

Geeklog Forums

Two Questions:


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!
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany

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');):

Text Formatted Code
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

 Quote

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!
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

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.
 Quote

Anonymous

Anonymous
Being ridiculously horrible w/ PHP, could you perhaps show me an example code? Thanks
 Quote

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.
 Quote

All times are EDT. The time is now 04:37 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content