Welcome to Geeklog, Anonymous Tuesday, April 23 2024 @ 10:33 pm EDT

Geeklog Forums

Forum name hack wanted


mikez0r

Anonymous
I was wondering if there was a way for the forums to display the realname instead of the username in all the different places. I would take the time to figure out and find this myself but i'm already over my head in work.

The reason behind this is everyone that uses the site knows the names of the people who have access to accounts (general users don't get to login) and they don't really know these people by username as these can be really far off from actual name. Any help would be awsome.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512
curious what your users would say about that... it sort of defeats the purpose of a username altogether doesn't it.
you could always just ask your users to change their username to their realname. you would find out real quick if your idea is good for them or not.
 Quote

mikez0r

Anonymous
Well, i'm actually kinda using the site in a weird way. I'm the RA for a floor in the building and I was approached to make a cheap/quick/easy (not to insult geeklog) website. Now, the residents don't get accounts, they can only post as guests and see news from everyone else. Only other RA's get accounts and none of them would notice a difference if it showed their real names rather than login names. Changing their login names to match their real names also wouldn't work well since one is seperated by a space and the other doesn't allow spaces.

Everyone here knows what their RA's real names are but no one here really could tell who Admin is without me posting my name on every post. Granted I could put it in my signature but i'm looking to hack this and not just find the easiest way around it.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by mikez0r: Changing their login names to match their real names also wouldn't work well since one is seperated by a space and the other doesn't allow spaces.

Spaces work just fine in the username (despite that warning in the Admin's user editor), but they are restricted to only 16 characters ...

bye, Dirk
 Quote

mikez0r

Anonymous
I still rather not tell everyone that their username has to be changed if I can just modify a little php and viola. I really was just hoping for someone to say "Here use this snippet of code".
 Quote

mikez0r

Anonymous
It really suprises me that no one has done this or knows how to do this. Any way I can get ahold of the author of the forums plugin? He may know.
 Quote

Status: Banned

machinari

Forum User
Full Member
Registered: 03/22/04
Posts: 1512

blaine over at portalparts.com is one of the developers. I'm sure if you post there someone will guide you to the right snippet. Your issue does sound familiar though... did you search this forum very much or the portalparts forum?
 Quote

mikez0r

Anonymous
I did search this one but i was too stupid or lazy (multiple choice question) to find out the author/authors website. Thanks for pointing me in the right direction.
 Quote

Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
Mikez0r,

Have you figured this out yet? I'm just starting to look into the forum code to see what I can do, but I figured that I'd check here before diving in. I'll be able to figure it out, but I was hoping that someone would have a shortcut.

I'm doing this on my family's site, one that isn't open to the public, so usernames are used just for logging in. I have all instances where the username is displayed, changed to first (fullname in the users table) and last name (added field in users table). But I have yet to do the forums, which I'm starting on this week.

If you haven't figured it out yet, I'll post where to change the code here to help anyone else wanting to do this as well.
 Quote

Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
Ok, pretty simple, but there is a catch. When a user creates a topic, their username is entered into the name field in the forum_topic table. If you have a lot of posts in your forum, you may not want to go in and change every one, but changing the username to their full name is all you need to do for the old posts. (At least as far as I can tell anyway, I really haven't spent a lot of time testing.)

As for new posts, edit createtopic.php with the following:

Around line 419 (on my version anyway) you'll find this:
Text Formatted Code
 if ($method == "edit") {
            if ($modedit == $LANG_GF01['YES']) {
                $username = $username;
            } elseif ($useredit == $LANG_GF01['YES']) {
                $username = $_USER['username'];
            }
        } else {
            $username = $_USER['username'];


 

Change $_USER['username'] to $_USER['fullname']

Then in line 623 (again on my version), where this code is:
Text Formatted Code
$postername = DB_getItem($_TABLES['users'],"username", "uid=$userid");


 

Either add fullname, or change username to fullname. I added it in mine, so I haven't tested it without username, though I would assume that it will work.

Good luck
 Quote

All times are EDT. The time is now 10:33 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