UID for guests
#1
We'll I need some specific functionality for my site. Basically I need to generate a random UID for guests and display it in the postbit. I know this can be done with the IP somehow.

currently Guests are displayed like so.

Guest
Unregistered

What I would like is to change the default name of Guest, and generate a UID like so

Random Person
685243

I have a thread starter plugin, but all guest have a default UID of 0, so it wont work as every guest will be recognized as "threadstarter"

I know i can use a template conditional and make it work for user, but am having a problem with doing so for guests
Reply
#2
Would this unique ID have to stay the same for the post after posting? If so, you'd need to store it in the database.
Reply
#3
http://community.mybb.com/thread-153979-...pid1104220 - but as Euan says, you'd need to store the value for thread starter at least to compare it with other.

Or you could just get the IP address of the first post and compare other IPs to that, guest UID is not needed (unless you want it for anything else besides thread starter plugin).
// in a showthread_start hook
if($thread['uid'] == 0)
{
    //query the first post IP, store it in a global var and then compare to it in a postbit hook
}
Reply
#4
(03-04-2015, 07:52 AM)Euan T Wrote: Would this unique ID have to stay the same for the post after posting? If so, you'd need to store it in the database.

YES IT WOULD

(03-04-2015, 09:08 AM)Destroy666 Wrote: http://community.mybb.com/thread-153979-...pid1104220 - but as Euan says, you'd need to store the value for thread starter at least to compare it with other.

Or you could just get the IP address of the first post and compare other IPs to that,  guest UID is not needed (unless you want it for anything else besides thread starter plugin).

// in a showthread_start hook
if($thread['uid'] == 0)
{
    //query the first post IP, store it in a global var and then compare to it in a postbit hook
}

UID must remain constant across multiple posts for guest. Basically i need guest to be able to post any be distinguishable as the OP if they post again later

(03-04-2015, 01:25 PM)moobooshtz Wrote:
(03-04-2015, 07:52 AM)Euan T Wrote: Would this unique ID have to stay the same for the post after posting? If so, you'd need to store it in the database.

YES IT WOULD

I tried that bit of code before doesn't work


(03-04-2015, 09:08 AM)Destroy666 Wrote: http://community.mybb.com/thread-153979-...pid1104220 - but as Euan says, you'd need to store the value for thread starter at least to compare it with other.

Or you could just get the IP address of the first post and compare other IPs to that,  guest UID is not needed (unless you want it for anything else besides thread starter plugin).


// in a showthread_start hook
if($thread['uid'] == 0)
{
    //query the first post IP, store it in a global var and then compare to it in a postbit hook
}

UID must remain constant across multiple posts for guest. Basically i need guest to be able to post any be distinguishable as the OP if they post again later
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)