MyBB Community Forums

Full Version: Insert image between category
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
You don't need a plugin for this, just add this to the bottom of the forumbit_depth1_cat template:
<img src="images/catimages/{$forum['fid']}.png" alt="{$forum['fid']}" />

Create a ./images/catimages folder and upload images with the category ID number as the filename.
(2011-03-27, 06:48 PM)AJS Wrote: [ -> ]You don't need a plugin for this, just add this to the bottom of the forumbit_depth1_cat template:
<img src="images/catimages/{$forum['fid']}.png" alt="{$forum['fid']}" />

Create a ./images/catimages folder and upload images with the category ID number as the filename.

Done that, and it works, but the images apear one under another after i placed the code...:
<img src="images/catimages/73.png" alt="{$forum['fid73']}" /><br>
<img src="images/catimages/12.png" alt="{$forum['fid12']}" />
to make the second picture... why ?


(2011-03-27, 04:26 PM)Stely Wrote: [ -> ]Ai rezolvat?
Nu inca... :-(

Don't change the code. Simply paste this once at the bottom:
<img src="images/catimages/{$forum['fid']}.png" alt="{$forum['fid']}" />
(2011-03-28, 11:53 PM)Clarkie Wrote: [ -> ]Don't change the code. Simply paste this once at the bottom:
<img src="images/catimages/{$forum['fid']}.png" alt="{$forum['fid']}" />

Ok, but i need 1 specific image to a category....

For example... smile.png to category 1, heart.png to category 2... and so on....

How can i do that ?

(2011-03-30, 12:12 PM)uzurpatoru Wrote: [ -> ]
(2011-03-28, 11:53 PM)Clarkie Wrote: [ -> ]Don't change the code. Simply paste this once at the bottom:
<img src="images/catimages/{$forum['fid']}.png" alt="{$forum['fid']}" />

Ok, but i need 1 specific image to a category....

For example... smile.png to category 1, heart.png to category 2... and so on....

How can i do that ?

It will do it automatically. You just need to change the file name of the image to the cat number so if you wanted smile.png to category 1 you would rename that file to 1.png then the same with the heart for category 2 it would be 2.png.

But make sure in the forumbit_depth1_cat template you keep the code as
<img src="images/catimages/{$forum['fid']}.png" alt="{$forum['fid']}" />
Replace above <img> tag with this;
<img src="images/catimages/catimg{$forum['fid']}.png" alt="{$forum['fid']}" />

Now Rename your images like;
catimg1.png for smile.png
catimg2.png for heart.png

and so on..
well if catergory 1 has 65 as the id
then istead of calling the fle smile png call it 65.png
(2011-03-30, 12:27 PM)Yaldaram Wrote: [ -> ]Replace above <img> tag with this;
<img src="images/catimages/catimg{$forum['fid']}.png" alt="{$forum['fid']}" />

Now Rename your images like;
catimg1.png for smile.png
catimg2.png for heart.png

and so on..

lol why confuse the poor bloke even more? But yea that would do exactly the same.
But i should paste the code more times if i have more images (for the next categories) ? for example...
<img src="images/catimages/{$forum['fid12']}.png" alt="{$forum['fid12']}" />
<img src="images/catimages/{$forum['fid74']}.png" alt="{$forum['fid74']}" />
<img src="images/catimages/{$forum['fid35']}.png" alt="{$forum['fid35']}" />

And another thing, this code is not working, it is like this now:
[Image: fidk.jpg]
... and no images between categories ! (i need the right code)

Why ?

Please post one example like this (in code):
Code for 67.png to fid67
Code for 13.png to fid13

This means one picture for first category and second for second...
Pages: 1 2 3 4