Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Aravot on May 18, 2005, 09:25:17 PM

Title: Adding image to a board
Post by: Aravot on May 18, 2005, 09:25:17 PM
How to add image to a board, example

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwebpages.charter.net%2Fosipof%2Fsmf%2Fboardimage.jpg&hash=f075713eb40da035f9dd5a12ef321af7b57eecbf)
Title: Re: Adding image to a board
Post by: Jerry on May 18, 2005, 09:57:28 PM
well... I think this has been asked before. But here ;):
find in BoardIndex.template.php:
<td align="left">
<b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
', $board['description'];

and replace with:
<td align="left">
<b><img src="', $settings['images_url'], '/boards/', $board['id'], '.gif' alt=" " border="0" /> <a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
', $board['description'];

this will put a image in front of every board, and looks for it at /theme/images/boards/BOARDID.gif
so if the board id was 1, it would be looking for 1.gif...
Title: Re: Adding image to a board
Post by: Aravot on May 19, 2005, 04:25:03 PM
Jerry, tried your suggestion, I get Template Parse Error!

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in BoardIndex.template.php
Title: Re: Adding image to a board
Post by: kegobeer on May 19, 2005, 04:52:56 PM
'.gif'
should be
'.gif"'
Title: Re: Adding image to a board
Post by: Aravot on May 19, 2005, 04:56:53 PM
Quote from: kegobeer on May 19, 2005, 04:52:56 PM
'.gif'
should be
'.gif"'

No change same error
Title: Re: Adding image to a board
Post by: Jerry on May 19, 2005, 07:24:29 PM
try changing the .gif' to .gif" :)
Title: Re: Adding image to a board
Post by: Aravot on May 19, 2005, 07:36:17 PM
Quote from: Jerry on May 19, 2005, 07:24:29 PM
try changing the .gif' to .gif" :)

That worked, thanks
Title: Re: Adding image to a board
Post by: [Unknown] on May 20, 2005, 02:59:31 AM
You can also use html in names and descriptions.

-[Unknown]
Title: Re: Adding image to a board
Post by: Barth on June 11, 2005, 01:53:44 AM
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.lag.in%2Fhelp%2F1.JPG&hash=3244a02e3a6e7a81177ea5f3a77f9b99795dea42)


Hello... could u help me with code... i get new theme  --->Here (http://www.alnabri.net/smf-stuff/SMFone_gray.gif)
And i dont know how to make it look like on the 1st example with the little pictures on the left side...
This is BoardIndex.template Here (http://i.lag.in/help/BoardIndex.template.txt)
Where should i change the code?




Thank's
Title: Re: Adding image to a board
Post by: dtm.exe on June 11, 2005, 02:03:12 AM
You can also do that with this mod.

http://www.simplemachines.org/community/index.php?topic=29991.0

-Dan The Man
Title: Re: Adding image to a board
Post by: Barth on June 11, 2005, 11:36:00 AM
Thank's i like that mod...
I Changes codes


found
<b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
', $board['description'];

replaced
<b><img src="', $settings['images_url'], '/boards/', $board['id'], '.gif" alt=" " border="0" /> <a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
', $board['description'];


Now it looks like this
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.lag.in%2Fhelp%2F2.JPG&hash=a24e67846d1cc07815aa3742e0eb5ef6c39f4907)
How can i put title on the midle?
Title: Re: Adding image to a board
Post by: [Unknown] on June 11, 2005, 05:18:11 PM
Use:

<img src="', $settings['images_url'], '/boards/', $board['id'], '.gif" alt="" align="middle" border="0" />

Or:

<img src="', $settings['images_url'], '/boards/', $board['id'], '.gif" alt="" align="top" border="0" />

-[Unknown]
Title: Re: Adding image to a board
Post by: Barth on June 12, 2005, 02:45:07 PM
Thanks.. 
Title: Re: Adding image to a board
Post by: winaje on December 27, 2006, 06:35:48 PM
Quote from: Jerry on May 18, 2005, 09:57:28 PM
well... I think this has been asked before. But here ;):
find in BoardIndex.template.php:
<td align="left">
<b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
', $board['description'];

and replace with:
<td align="left">
<b><img src="', $settings['images_url'], '/boards/', $board['id'], '.gif' alt=" " border="0" /> <a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
', $board['description'];

this will put a image in front of every board, and looks for it at /theme/images/boards/BOARDID.gif
so if the board id was 1, it would be looking for 1.gif...

Hi, does this work for 1.1.1?  And if not, how wouold I do the same thing in 1.1.1?

Thanks heaps.
Title: Re: Adding image to a board
Post by: Aravot on December 27, 2006, 06:58:03 PM
Try on a none production site

http://mods.simplemachines.org/index.php?mod=496

or

http://mods.simplemachines.org/index.php?mod=511
Title: Re: Adding image to a board
Post by: maxxx223 on November 01, 2008, 07:20:57 PM
hi,

how can i do this with different pic for each board ???
for 1.5

thx for help


Maxx
Title: Re: Adding image to a board
Post by: [SiNaN] on November 04, 2008, 07:28:38 AM
Try this mod:

http://custom.simplemachines.org/mods/index.php?mod=511
Title: Re: Adding image to a board
Post by: maxxx223 on November 04, 2008, 10:46:54 AM
thx for answer


i try it out


ty again