MyBB Community Forums

Full Version: How to add a new column at forumdisplay?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys,

Maybe someone could help me...
I want to add a new column in forumdisplay to display icons like mybb theme have.

For example, from this:
[Image: 35THr.png]

To this:
[Image: 0pAr9.png]

This is my forumdisplay_thread code:
<tr{$priority_class}>
	<td align="center" class="{$bgcolor}{$thread_type_class}" width="2%"><img src="{$theme['imgdir']}/{$folder}.gif" alt="{$folder_label}" title="{$folder_label}" /></td>
	<td align="center" class="{$bgcolor}{$thread_type_class}" width="2%">{$attachment_count}{$avatar_usuario}</td>
	<td class="{$bgcolor}{$thread_type_class}">
		<div>
			<span>{$mysupport_status}{$mysupport_bestanswer}{$mysupport_assigned}{$prefix} {$gotounread}{$thread['threadprefix']}{$icon} <a href="{$thread['threadlink']}" class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a>{$thread['multipage']}</span>
			<div class="author smalltext">&nbsp;&nbsp;{$thread['profilelink']}</div>
		</div>
	</td>
	<td align="center" class="{$bgcolor}{$thread_type_class}"><a href="javascript:MyBB.whoPosted({$thread['tid']});">{$thread['replies']}</a>{$unapproved_posts}</td>
	<td align="center" class="{$bgcolor}{$thread_type_class}">{$thread['views']}</td>
	{$rating}
	<td class="{$bgcolor}{$thread_type_class}" style="white-space: nowrap; text-align: right;">
		<span class="lastpost smalltext">{$avatar_usuario2}{$lastpostdate} {$lastposttime}<br />
		<a href="{$thread['lastpostlink']}">{$lang->lastpost}</a>: {$lastposterlink}</span>
	</td>
{$modbit}
</tr>

I tried to add this line:
<td align="center" class="{$bgcolor}{$thread_type_class}" width="2%">{$icon} </td>

After this:
<td align="center" class="{$bgcolor}{$thread_type_class}" width="2%"><img src="{$theme['imgdir']}/{$folder}.gif" alt="{$folder_label}" title="{$folder_label}" /></td>

But layout appears strange:
http://i.imgur.com/cEmQP.png

Can someone help me? Smile
Thank you!

Im almost there... I did this:

Go to Admin CP > Templates & Style > Templates > Your Template Set > Forum Display Templates > forumdisplay_thread.
FIND:
<td align="center" class="{$bgcolor}{$thread_type_class}" width="2%"><img src="{$theme['imgdir']}/{$folder}.gif" alt="{$folder_label}" title="{$folder_label}" /></td>

AFTER ADD:
<td align="center" class="{$bgcolor}{$thread_type_class}" width="2%">{$icon}</td>

Go to Admin CP > Templates & Style > Templates > Your Template Set > Forum Display Templates > forumdisplay_threadlist
FIND:
<td class="tcat" colspan="3" width="66%">

REPLACE WITH:
<td class="tcat" colspan="4" width="66%">

But is still not perfect:
http://i.imgur.com/x2oha.png

What I'm missing?

I think that I need to change this lines at :
<td class="thead" colspan="{$colspan}">
and
<td class="tfoot" align="right" colspan="{$colspan}">

increasing the colspan... but I dont understand why appears the variable {$colspan}, where can I increase the colspan value?
so it is fixed - $colspan is a variable , its value depends on the location - comes from originating file (eg. forumdisplay.php)

you may also like to change colspan value for <td class="trow_sep" colspan="{$colspan}"> in below templates ..
forumdisplay_announcements , forumdisplay_sticky_sep , forumdisplay_threads_sep

Hi, thank you for your reply Smile

Yes is fixed, I changed this:
<td class="thead" colspan="{$colspan}">
To this:
<td class="thead" colspan="9">

Is that ok?

ranjani Wrote:you may also like to change colspan value for <td class="trow_sep" colspan="{$colspan}"> in below templates ..
forumdisplay_announcements , forumdisplay_sticky_sep , forumdisplay_threads_sep

Ok, thank you, I will change that also Smile