MyBB Community Forums

Full Version: Can anybody help me with this User ID problem I have.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What I want is the user id to appear as it does in this forum. You can see it under the user name.

What it does is change the unique user IP address into a unique user ID number both for guests and members.

You can see it here: http://lunaticoutpost.com/Topic-Welcome-...est-member

BTW the UID Plugin is not the thing, it does not work for guest posts.

Thank you Smile
Actually that wouldn't be too hard. I've wanted this for a bit aswell, i'll try when i'm not in class.
(2011-09-14, 03:25 PM)Aristotle Wrote: [ -> ]Actually that wouldn't be too hard. I've wanted this for a bit aswell, i'll try when i'm not in class.

Thanks dude, don't forget me Smile Angel
*Edit*

Didn't read all of the original post, at least here is a way to display the user id
-------------------------------

I think this should work for you,

Horizontal Layout

Post Bit Templates --> postbit

Find
<td class="smalltext post_author_info" width="165">
{$post['user_details']}
</td>

Replace with
<td class="smalltext post_author_info" width="165">
{$post['user_details']}<br />
User ID: {$post['uid']}
</td>

Classic Layout

Find
<span class="smalltext">
{$post['usertitle']}<br />
{$post['userstars']}
{$post['groupimage']}
{$post['useravatar']}<br />
{$post['user_details']}
</span>

Replace with
<span class="smalltext">
{$post['usertitle']}<br />
{$post['userstars']}
{$post['groupimage']}
{$post['useravatar']}<br />
{$post['user_details']}<br />
User ID: {$post['uid']}
</span>
(2011-09-14, 03:37 PM)jdzine Wrote: [ -> ]*Edit*

Didn't read all of the original post, at least here is a way to display the user id
-------------------------------

I think this should work for you,

Horizontal Layout

Post Bit Templates --> postbit

Find
<td class="smalltext post_author_info" width="165">
{$post['user_details']}
</td>

Replace with
<td class="smalltext post_author_info" width="165">
{$post['user_details']}<br />
User ID: {$post['uid']}
</td>

Classic Layout

Find
<span class="smalltext">
{$post['usertitle']}<br />
{$post['userstars']}
{$post['groupimage']}
{$post['useravatar']}<br />
{$post['user_details']}
</span>

Replace with
<span class="smalltext">
{$post['usertitle']}<br />
{$post['userstars']}
{$post['groupimage']}
{$post['useravatar']}<br />
{$post['user_details']}<br />
User ID: {$post['uid']}
</span>

Will this generate a random uid instead of showing a users ip address. basically what the uid does in the example in the forum I linked in the thread post generates a unique user id for the users ip address, even if the user is a guest.

Thus if a user posts as a guest or as a member the uid stays the same. The uid number has to be unique to stop users replying to posts and bumping themselves to make their post look good.

Thank you for taking the time to share the code jdzine Smile
You could do it with ip2long(get_ip());
(2011-09-16, 11:41 AM)Malcolm. Wrote: [ -> ]You could do it with ip2long(get_ip());

YAY thanks dude Smile

Me is rather stupid and has had brain fry trying to twiddle with the forum codes... now everything else is starting to baffle me slightly.

May I be prudent and ask you Malcolm how I do this please?
Best option would be to create a plugin. Do a query to select the longipaddress column from the last post in the current thread, and then match it against ip2long(get_ip()).



(2011-09-16, 11:54 AM)Malcolm. Wrote: [ -> ]Best option would be to create a plugin. Do a query to select the longipaddress column from the last post in the current thread, and then match it against ip2long(get_ip()).

Hmmm I'm lost on Plugins Malcolm lol. I simply do not get the time in the day with work and kids to make one.

I have been told off for spending time on my website and forum so to speak - ahhh if I get time I suppose I will have to try your methods.

Thank you Smile
Bumping thread as it has got lost down the list.