vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=134)
-   -   Image on Forumbit (forumhome) (https://vborg.vbsupport.ru/showthread.php?t=89121)

Dan 01-22-2005 07:47 PM

Hmm... this really doesn't seem to be working but my templtes are pretty modified ;) So any help would be appreciated.

sabret00the 01-22-2005 07:51 PM

you got your templates?

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

Mechanical Mind 01-22-2005 09:48 PM

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

Dan 01-23-2005 12:38 AM

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


EDDIE! 02-21-2005 10:50 PM

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.

thinkpixels 03-08-2005 02:45 AM

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


sabret00the 03-08-2005 09:48 AM

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="" />

thinkpixels 03-08-2005 06:27 PM

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... :eek: 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

sabret00the 03-08-2005 06:43 PM

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.

thinkpixels 03-08-2005 07:31 PM

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.


All times are GMT. The time now is 03:55 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.01155 seconds
  • Memory Usage 1,804KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete