MyBB Community Forums

Full Version: add a image to each forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I try to modify forumbit_depth2_forum
<img src="$theme[imgdir]/$folder.gif" alt="" />
and index.php
if($forum['lastpost'] > $lastvisit && $forum['lastpost'] > $forumread && $forum['lastpost'] != 0)
					{
						$folder = "on";
						$altonoff = $lang->new_posts;
					}
					else
					{
						$folder = "off";
						$altonoff = $lang->no_new_posts;
					}
but i'm stucked
Any suggestions
Thanks
Why don't you just add the img code to the Forum Title...
Quote:Why don't you just add the img code to the Forum Title...

forum description, because forum title appears in different places including the browser's page title, most of these places can't/are not parsed.

regards
My mistake, cheers for pointing that out zaher!
You can add a image code but it won't work
if u use
<img src="$theme[imgdir]/$folder.gif" alt="" />

it wont work, you need to specify an image name, not $folder

regards
I solved the problem not in a very elegant way but it works.
I added to mybb_forums a field named avatar(varchar 20).
In myBB_forums I add in avatar field for forum1 image1.gif,forum2 image2.gif ,forum3 image3.gif and so on.
In your folder images put image1.gif,image2.gif,image3.gif(you must be careful to suit the path to the images with <img src="$theme[imgdir]...../$forum[avatar]>)

AdminCP ->Templates -> Modify/Delete -> Default Templates -> Expand -> Forum Bit Templates -> Expand -> forumbit_depth2_forum

I replaced the whole content with
<tr>
<td class="$bgcolor" align="center" valign="middle"><img src="$theme[imgdir]/$folder.gif" alt="" /></td>
<td class="$bgcolor" valign="top" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8%">
<img src="$theme[imgdir]/$forum[avatar]">
</td>
<td align="left"><strong><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a></strong><br /><div class="smalltext">$forum[description]$modlist$subforums</div>
</td>
</tr>
</table>
</td>

<td class="$bgcolor" valign="top" align="center" nowrap="nowrap">$threads</td>
<td class="$bgcolor" valign="top" align="center" nowrap="nowrap">$posts</td>
<td class="$bgcolor" valign="top" align="right" nowrap="nowrap">$lastpost</td>
</tr>
That is a pretty long-winded way of doing something simple...

You just edit a forum in the Admin CP, and put some html img tags in the description...
It's your standpoint and maybe it's correct but you will have a small problem with the view.
You have 3 rows(that you cannot manage very well)
title
<img> and description
Modereted by
The height will grow