Adding Occupation to Memberlist

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
StrikeMike2k
Registered User
Posts: 49
Joined: Wed Sep 21, 2005 8:47 am
Location: New York
Contact:

Adding Occupation to Memberlist

Post by StrikeMike2k »

I have this code in memberlist.php

Code: Select all

		$username = $row['username'];
		$user_id = $row['user_id'];

		$from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' ';
		$joined = create_date($lang['DATE_FORMAT'], $row['user_regdate'], $board_config['board_timezone']);
		$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
and was going to add in there:

Code: Select all

	$occu = ( !empty($row['user_occ']) ) ? $row['user_occ'] : ' ';
And at the bottom in the VARS:

Code: Select all

			'FROM' => $from,
			'OCCU' => $occu,
			'JOINED' => $joined,
in the memberlist_body.tpl I have it all set to read the occupation with:

Code: Select all

<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gensmall">{memberrow.OCCU}</span></td>
Can anyone tell me what I did wrong? Or what i need to add.

Thank you in advance! :P
~Mikey
StrikeMike2k
Registered User
Posts: 49
Joined: Wed Sep 21, 2005 8:47 am
Location: New York
Contact:

Post by StrikeMike2k »

NEVERMIND, I Figured it out...

I had to add in line:

Code: Select all

$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type,
I had to add " user_occ " to the end of that!
Thanks anyways! :-p
~Mikey
rreptile
Registered User
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Post by rreptile »

How handy that someone else did all the work first! Thanks, StrikeMike2k.

I also added 'Occupation' to the table headers. I tried both

<th class="thTop" nowrap="nowrap">{L_OCC}

AND

<th class="thTop" nowrap="nowrap">{L_OCCUPATION}</th>

but nothing showed. So I just did the following in memberlist_body.tpl:

Code: Select all

<th class="thTop" nowrap="nowrap">{L_FROM}</th>
<th class="thTop" nowrap="nowrap">Occupation</th>
<th class="thTop" nowrap="nowrap">{L_JOINED}</th>
and further down, changed the colspan from 8 to 9 so the table was balanced:

Code: Select all

<td class="catBottom" colspan="9" height="28">&nbsp;</td>
Locked

Return to “2.0.x Support Forum”