Welcome to Geeklog, Anonymous Wednesday, May 08 2024 @ 06:17 pm EDT

Geeklog Forums

COnvert UID to Username and vise versa


Anonymous

Anonymous
Is there a function to convert a uid to username and vise versa? this would be really helpful but for some reason the mysql code i used wont work... $dbarray = DB_query("SELECT username FROM 'gl_users' WHERE uid=7"Wink; $username = DB_fetcharray($dbarray); return $username; the uid i was using was just a test and it does exist.. the query even works in phpmyadmin!! whats wrong with it? why does it return nothing to me?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Well, the SQL query looks okay but the rest of your code doesn't. DB_fetchArray() returns an array (as the name suggests ...) containing all the fields you SELECTed. So you should be doing something like $A = DB_fetchArray($dbarray); return $A['username']; Or you could use DB_getItem(): return DB_getItem($_TABLES['users'], 'username', "uid = 7"Wink; bye, Dirk
 Quote

Anonymous

Anonymous
yeah cheers. i got it all sorted out on the IRC. mr vinny and erm.. sorry i forgot the other ones name gave me a nice load of help for anyone who cares info i am writing a PM plugin. not a silly one liner like chatterblock (which is nice but to short!) but a nice long stroy style pm. i'll let everyone know when its done if anyone is interested..
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
> not a silly one liner like chatterblock Chatterblock was not initially designed as a PM tool but as an alternative to Shoutblock and had many features never seen before in a Geeklog addon. I added the PM feature, logging, independant auto-refresh to name a few, but I agree its not a instant messenger tool. I really did not think anyone would be sending PM's greater then 255 characters. Having said that .. removing the restriction is simple. 1) Change the field type of the msgtxt field in the cb_chatterlog table to "longtext" - is currently varchar(255). 2) Remove the maxlength="255" restriction on the input field. This is approx line 95 in cb_main.php Blaine
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Anonymous

Anonymous
you misunderstand.... i think chatter block is great as a shoutbox replacement. but i dont like the one line pm's so i am writing a new plugin to allow long pm's that will look much like forums posts. when i said silly i didnt mean it in a 'what a stupid idea' way but more in a 'its a nice idea but they are just a bit small' way.... you will see what my pm plugin is like when i finish it! maybe even find ways to improve it or even (and this might be doubtful) include it with the forum plugin... i hope i am not doing it just for myself and that others will be able to find a use for it!!
 Quote

Anonymous

Anonymous
I'm looking forward to your PM plugin, and I agree with what you mean about the Chatterbox. Hopefully with your PM plugin you can set it up where you can send attachments, a option to have a pop-up message telling you that you have a PM, and other features that you see with other PM systems used in Message Board systems like phpBB or Invision Board.
 Quote

Anonymous

Anonymous
attachments willhave to come later.... im not that good with php and will have to work it out Wink but its definatly an idea. there will be pop up alerts when you have a new message and you will have an inbox and outbox and sent box so you can see your messages, the messages you have sent and if the other person has read any message. any other ideas are welcome and i do of course hope that people will be able to expand it how they want!!
 Quote

Anonymous

Anonymous
Another idea is to have an address book. To keep UID/Usernames saved to make it easier to contact those you would like to message in the future. Also, like you said, integration with the Geeklog forum would be great. As there is so much more that the Geeklog forum needs that can compare it to phpBB, but hopefully it will get there...as Geeklog forum is very integrated with Geeklog, but just doesnt have enough features for me at the moment.
 Quote

Anonymous

Anonymous
well maybe i will add a buddy list for v2 or whatever the next one will be... for v1 i am just gonna have a standard PM device...
 Quote

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