PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.

#1 2008-01-22 09:49:45

EN
Member
Registered: 2008-01-16
Posts: 15

Group Legend.

For example: Posts: 23
                    Group: Member

I'm trying to find the exact code for showing what user belongs to which usergroups in the post.php, and viewtopic.php. If anyone could tell me what to modify or add-in, would be greatly appreciated

Offline

 

#2 2008-01-22 13:50:22

Mark
Moderator
From: North West England
Registered: 2005-06-06
Posts: 1165

Re: Group Legend.

you mean like the request you posted here.. http://www.punres.net/viewtopic.php?id=4385
ill do that in a few mins


Cant find something you want? try searching
Also try the wiki

Offline

 

#3 2008-01-22 17:49:21

Mark
Moderator
From: North West England
Registered: 2005-06-06
Posts: 1165

Re: Group Legend.

Open viewtopic.php
locate:

Code:

$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

change to

Code:

$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_title, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

locate line 235:

Code:

$user_info[] = '<dd>'.$lang_common['Posts'].': '.$cur_post['num_posts'];

after add:

Code:

$user_info[] = '<dd>Group: '.$cur_post['g_title'];

thats it.
think its what you want.

that will give you somethin like this in viewtopic.php

Code:

Flying Flamingo
Administrator
Registered: 2008-01-07
Posts: 3
Group: Administrators
IP: 127.0.0.1
E-mail

ONLINE

Cant find something you want? try searching
Also try the wiki

Offline

 

#4 2008-01-23 04:13:33

EN
Member
Registered: 2008-01-16
Posts: 15

Re: Group Legend.

Thank you so much smile Props to Mark

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.