Want Occupation on the viewtopic page

This forum is now closed. Please ask all styles-related questions in the phpBB 3.0 Styles Support & Discussion Forum.
Locked
dnrcea
Registered User
Posts: 51
Joined: Thu Jun 10, 2004 2:25 pm

Want Occupation on the viewtopic page

Post by dnrcea »

I want occupation to show on the viewtopic page. IE: I want username, joined, posts, location, occupation, How would I add it?
dnrcea
Registered User
Posts: 51
Joined: Thu Jun 10, 2004 2:25 pm

Post by dnrcea »

Any suggestions? I want Occupation to appear where Rank does on the topics page.
User avatar
Arty
Former Team Member
Posts: 16654
Joined: Wed Mar 06, 2002 2:36 pm
Name: Vjacheslav Trushkin
Contact:

Post by Arty »

I didn't test it, but i think this should work. Open viewtopic.php, find this:

Code: Select all

$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid
	FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
	WHERE p.topic_id = $topic_id
		$limit_posts_time
		AND pt.post_id = p.post_id
		AND u.user_id = p.poster_id
	ORDER BY p.post_time $post_time_order
	LIMIT $start, ".$board_config['posts_per_page'];
and in that code on first line find this:

Code: Select all

u.user_from,
and add after it:

Code: Select all

user_occ,
then find this:

Code: Select all

$poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $postrow[$i]['user_from'] : '';
and add after it:

Code: Select all

$poster_occ = ( $postrow[$i]['user_occ'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Occupation'] . ': ' . $postrow[$i]['user_occ'] : '';
then find this:

Code: Select all

'POSTER_FROM' => $poster_from,
and add after it:

Code: Select all

'POSTER_OCC' => $poster_occ,
then open templates/subSilver/viewtopic_body.tpl, find this:

Code: Select all

{postrow.POSTER_FROM}
and add after it:

Code: Select all

<br />{postrow.POSTER_OCC}
Vjacheslav Trushkin / Arty.
Free phpBB 3.1 styles | New project: Iconify - modern SVG framework
dnrcea
Registered User
Posts: 51
Joined: Thu Jun 10, 2004 2:25 pm

Post by dnrcea »

Thank you....that worked.
rreptile
Registered User
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Post by rreptile »

Yes, this is perfect. Thank you, CyberAlien.
Locked

Return to “[2.0.x] Styles Development & Discussion”

cron