vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   PHP question... (https://vborg.vbsupport.ru/showthread.php?t=67747)

Tailfeathers 07-29-2004 06:44 AM

PHP question...
 
How would I put a specific image at the top of each forum (one different one for each forum)?

I assume I'd go to the forum template and put the code where I want the banner to show...the code would be like, if frm 50, show this image, if frm30, show this page, etc...

I'd assume the php for this would be pretty easy, but I'm clueless. :p

Colin F 07-29-2004 07:34 AM

you can do that with template conditionals:
<if condition="forumid == 30">
//code for forum 30
</else><if condition="forumid == 31">
//code for forum 31
</if></if>

just do that for all the forums you have.

Dean C 07-29-2004 09:08 AM

Easier still create a new directory in your images /misc/ folder and name the images based on the forumid. E.g. 1.gif (for forumid1) etc...

Then in the templates put:

Code:

<img src="$stylevar[imgdir_misc]/forumicons/$forumid.gif" border="0" alt="" />
Remember that'll output as a broken image if one forumid hasn't got an image :)

Andreas 07-29-2004 09:15 AM

You can avoid the broken image if you put the following as .htaccess in your forumicons directory (only for Apache):

Code:

ErrorDocument 404 http://www.yoursite.tld/forums/clear.gif
:)

Dean C 07-29-2004 09:41 AM

Nice workaround ;)

Modin 07-29-2004 03:09 PM

nice tip Kirby :up:

Will be using that one :)

Tailfeathers 07-29-2004 05:27 PM

Thanks, everyone. :D


All times are GMT. The time now is 10:59 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01088 seconds
  • Memory Usage 1,713KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete