Log in

View Full Version : Image Based on Forum Id


Seifer
08-14-2002, 04:13 AM
$forumimageid=$DB_site->query("SELECT forumid FROM forum");

if ($forumimageid == "2") {
$forumimage = "<img src=\"http://www.plasmicgaming.com/forum/images/2.gif\">";
} if ($forumimageid == "3") {
$forumimage = "<img src=\"http://www.plasmicgaming.com/forum/images/3.gif\">";
}

I know little about PHP, so I'm just going by what I've learned from looking at forumdisplay and some hacks, but this doesn't work. I place the forumimage variable in "navbar", so it shows up next to the navigation links, but all I got is blank space. What exactly am I doing wrong :angry: ?

Edit: This is in forumdisplay.php above // draw nav bar

Dark_Wizard
08-15-2002, 06:55 PM
<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=39779" target="_blank">https://vborg.vbsupport.ru/showt...threadid=39779</a>

DrkFusion
08-15-2002, 09:30 PM
imm...this is pretty easy


<img src="{imagesfolder]/$forum[id].gif">
in iamges folder, make the iamges and name it 1, 2 3 etc
Atleast I think this is what you want.

Also put this in the navbar template somewhere.

Seifer
08-15-2002, 09:45 PM
*dies*

I tried EVERY variable =P...I was like $forum[forumid] $forumid...$forum[id] doesn't work either =P

And that hack isn't what I'm looking for.

DrkFusion
08-15-2002, 11:13 PM
Well...try
$forum[name]...or something by the way I was guessing at the id lol.

Anyways, from wwhat I understand of ur post, something similar to my method in a template would work.

Seifer
08-16-2002, 12:25 AM
Yeah, I tried everything in the templates and nothing works. I just want to know why my php thing up there doesn't work...

DrkFusion
08-16-2002, 01:06 AM
Well explain to us what you want in full detail

Seifer
08-16-2002, 01:16 AM
Like, above all the forums, next to the navbar, I want an image to be displayed based on the forum ID. The image will be like, some kind of banner welcoming you to this forum. This is like, when you're looking at a forum (like, you're looking at General Hacking) but before you go into a thread.

DrkFusion
08-16-2002, 01:19 AM
Uhh...the word like threw me off.

If this was inspired by some other site, mind getting us a screenshot?

Seifer
08-16-2002, 03:53 AM
lol, I just got back from a friend gathering when I posted that...when we're together everyone starts saying "Like"...sorry. I try to control my teen grammar, but you know, it sometimes gets the best of me ;).

And thanks for trying to help, I got it to work though =D. :banana:

DrkFusion
08-16-2002, 03:55 AM
Can I see :)

Seifer
08-16-2002, 05:25 AM
I'm using it in a new style set I'm making...if you really care I'll PM you when the style is released at my forums or something...

Or do you mean the PHP code?

Seifer
08-17-2002, 04:31 AM
Grrr...first, I found the variable is $id, but that works in a thread id. So if I went in a thread with ID 4, but i was in forum 2, it would load the picture for the 4th forum. Then, I found I should put my code up at the top there in functions, but that is just giving me a variable. I get 2.gif in EVERY forum. Can't SOMEONE tell me what's wrong with that code that's not making it work?