Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Template Modifications

Reply
 
Thread Tools
Image on Forumbit (forumhome) Details »»
Image on Forumbit (forumhome)
Version: 1.00, by sabret00the sabret00the is offline
Developer Last Online: Apr 2010 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 05-09-2004 Last Update: Never Installs: 8
Template Edits
 
No support by the author.

this is for the forumhome, open your "forumhome_forumbit_level2_post" template and find ;
HTML Code:
		<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
add above that
HTML Code:
<if condition="$forum[parentid]==XX OR $forum[parentid]==XX"><img src="$stylevars[imgdir_misc]/[forumhome]/$forum[forumid].gif" alt="$forum[title]" border="0" vspace="2 px" hspace="2 px" align="left"/></if>
if you want it to appear for all forums, remove the conditional, you can also just change the conditional to suit your needs better, the XX's in the conditional are to be replaced by the parentid's of your desire [cyclops] the parentid is just the forumid of the catergory.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 01-22-2005, 07:47 PM
Dan's Avatar
Dan Dan is offline
 
Join Date: Dec 2002
Location: Titusville, Florida
Posts: 1,787
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm... this really doesn't seem to be working but my templtes are pretty modified So any help would be appreciated.
Reply With Quote
  #33  
Old 01-22-2005, 07:51 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you got your templates?

doubt i'll see this tonight as on my way out, but i'll see your reply tomorrow morning
Reply With Quote
  #34  
Old 01-22-2005, 09:48 PM
Mechanical Mind's Avatar
Mechanical Mind Mechanical Mind is offline
 
Join Date: Sep 2004
Location: USA
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here are my templates for this. These templates have been modified to add small images next to forum titles AND to vertically align the title and descriptions.

forumhome_forumbit_level1_post

Code:
<tbody>
	<tr align="center">
		<td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">
		
		<table cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
			<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
			<td>

<td>
				<if condition="in_array($forum['forumid'], array(20, 21, 22, 23, 34, 26, 41, 24, 25, 36, 27, 28, 29, 30, 31, 32, 39, 37))">
					<img src="images/forum_pics/$forum[forumid].gif" alt="" border="0" />
				</if>
			</td>

			<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
			<td>

			<div>
				<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
				<if condition="$show['browsers']"><span class="smallfont"><div style = color:#FF0000><phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase></div></span></if>
			</div>
			<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
			<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
			<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
			</td>
		</tr>
		</table>
		
		</td>
		<td class="alt1" colspan="2">$forum[threadcount]</td>
		<td class="alt2">$forum[replycount]</td>
		<if condition="$vboptions['showmoderatorcolumn']">
		<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
		</if>
	</tr>
</tbody>
<if condition="$childforumbits">
<tbody>
	$childforumbits
</tbody>
</if>
forumhome_forumbit_level2_post

Code:
<tr align="center">
	<td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
	<td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]">

	<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr>

                <if condition="in_array($forum['forumid'], array(20, 21, 22, 23, 34, 26, 41, 24, 25, 36, 27, 28, 29, 30, 31, 32, 39, 37))">
			<td>
			<img src="images/forum_pics/$forum[forumid].gif" align="left" style="margin-right: 9px" alt="" border="0" />
			</td>
		</if>

		<td width="100%" align="left" valign="middle">

		<div>
			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
			<if condition="$show['browsers']"><span class="smallfont"><div style = color:#FF0000><phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase></div></span></if>
		</div>
		<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
		<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
		<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>

		</td>
	</tr>
	</table>

	</td>
	<td class="alt1" colspan="2">$forum[threadcount]</td>
	<td class="alt2">$forum[replycount]</td>
	<if condition="$vboptions['showmoderatorcolumn']">
	<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
	</if>
</tr>
$childforumbits
This might help somebody else.

Take it easy.

mm
Reply With Quote
  #35  
Old 01-23-2005, 12:38 AM
Dan's Avatar
Dan Dan is offline
 
Join Date: Dec 2002
Location: Titusville, Florida
Posts: 1,787
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sabret00the
you got your templates?

doubt i'll see this tonight as on my way out, but i'll see your reply tomorrow morning
Here it is....

forumhome_forumbit_level2_post

Code:
<tr align="center">
	<td class="alt2"><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td>
	<td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]">
		<div>
			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
			<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
		</div>
		<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
		<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
		<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
	</td>
	<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
	<td class="alt1">$forum[threadcount]</td>
	<td class="alt2">$forum[replycount]</td>
	<if condition="$vboptions['showmoderatorcolumn']">
	<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
	</if>
</tr>
$childforumbits
Reply With Quote
  #36  
Old 02-21-2005, 10:50 PM
EDDIE! EDDIE! is offline
 
Join Date: Oct 2004
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how would I do this so it shows only on certain styles? I'm putting this code inside the Forum Description so I can show a logo in the Forum Bit of each forum.
Reply With Quote
  #37  
Old 03-08-2005, 02:45 AM
thinkpixels thinkpixels is offline
 
Join Date: Jul 2004
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Love this mod. I tried to install it on my board, and removed the conditional since I want a different image to show up for every forum (movie titles).

However I get red x's on titles that have no image uploaded to my image folder. Ideally I would love to have a default image to show if there is no corresponding image for that forum (ie. 59.jpg) Is there a way to get rid of the red x's? (they only show in IE) and write a conditional to show a default image if there is no image corresponding to that forum id? Thanks in advance.

Here is my code: forumhome_forumbit_level2_post
HTML Code:
<tr align="center">
	<td class="thumb"><img src="$stylevars[imgdir_misc]/images/misc/forumhome/$forum[forumid].jpg" class="picborder"></td>
			<!-- <img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" /></td> -->
	<!-- <td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]"> -->
        <!-- hover code -->
	<td class="alt1Active" align="$stylevar[left]" id="f$forum[forumid]" style="cursor:hand;" onmouseover="this.className='alt2Active';" onmouseout="this.className='alt1Active';" onclick="window.location.href='forumdisplay.php?$session[sessionurl]f=$forum[forumid]';">

		<div>
			<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><strong>$forum[title]</strong></a>
			<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
		</div>
		<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
		<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
		<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
	</td>
	<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
	<td class="alt1">$forum[threadcount]</td>
	<td class="alt2">$forum[replycount]</td>
	<if condition="$vboptions['showmoderatorcolumn']">
	<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
	</if>
</tr>
$childforumbits
Reply With Quote
  #38  
Old 03-08-2005, 09:48 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the only way i could think of is with hacking i.e. using the file_exists() function of php.

you could however use a conditonal to say
HTML Code:
<img src="$stylevars[imgdir_misc]/images/misc/forumhome/<if condition="in_array($forum['forumid'], array(XX, XX, XX, XX, XX, XX))">other_image.jpg<else />$forum[forumid].jpg</if>" class="picborder" alt="" />
Reply With Quote
  #39  
Old 03-08-2005, 06:27 PM
thinkpixels thinkpixels is offline
 
Join Date: Jul 2004
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks sabret00the. The only problem with an array is that I am constantly adding 2 or 3 new forums every month and I would really prefer this be maintanence free and not have to edit the template each time I create a new forum. So I would like the image to be the generic default, until I upload one onto the server.

Your mention of the file_exists() function sounds like a good one. I tried a few attempts at this and got a code explosion though... But I am no PHP guru. Any suggestions how to get the code below to function?

HTML Code:
if ( file_exists('$stylevars[imgdir_misc]/images/misc/forumhome/$forum[forumid].jpg') ) {
	<img src="$stylevars[imgdir_misc]/images/misc/forumhome/$forum[forumid].jpg" class="picborder"/>;
} else {
   <img src="$stylevars[imgdir_misc]/images/misc/forumhome/soon.gif" />;
}
or should it be like this?
HTML Code:
<img src="$stylevar[imgdir_misc]/images/misc/forumhome/<if (file_exists($forum[forumid].jpg'))>$forum[forumid].jpg<else />spacer.gif</if>" class="picborder" alt="" />
Thanks again
Reply With Quote
  #40  
Old 03-08-2005, 06:43 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

before i provide the code changes you need, could you do me a favour and ask over at vb.com if enabling the file_exists() function in templates is a security risk.
Reply With Quote
  #41  
Old 03-08-2005, 07:31 PM
thinkpixels thinkpixels is offline
 
Join Date: Jul 2004
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Waiting on a reply at vb.com, but I did find this on a quick search.
http://www.vbulletin.com/forum/showt...ists%28%29+php

If it is a risk is there another way to do this? Maybe just place the file if it is there and if not use the placeholder image and I could have a backgound image placed by css? Thanks again.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:20 AM.


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.04472 seconds
  • Memory Usage 2,337KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (6)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete