Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Design and Graphics Discussions
  #1  
Old 11-22-2008, 12:44 PM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need help with this

Hii,

I used HTML in Forum title field to display a image. (I must use it in title and not in description). Say I used this code:-

HTML Code:
<img src="images/forumlogos/8.gif" align="left" border="0" alt="" hspace="5" />Forum title

It works just perfect and I am able to achieve what i want. BUT one thing I don't like is that the image is even displaying in the category strip (in the tcat) while viewing that forum, which is stretching it and making it look very bad.

SO, how do I block the HTML part to show in the tcat? and allow only the text i.e. Forum title. There's got to be some way to do it.

Thank you
Reply With Quote
  #2  
Old 11-22-2008, 01:01 PM
ReCom ReCom is offline
 
Join Date: Mar 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How about using plugin to inject the img tag into the output instead of inserting the tag in forum title? Or even customize the specific forum listing template. That way the image will appear exactly where you want it to be instead of wherever the forum title is displayed (one can never know all the places the forum title is displayed -- archives, RSS, thread subscription emails? *shivers*) ...
Reply With Quote
  #3  
Old 11-22-2008, 01:25 PM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your reply recom!

But I need more info please. Give me some idea of how the plugin code would look like and what hooks to use, i am new to this!

Thanks
Reply With Quote
  #4  
Old 11-22-2008, 01:46 PM
ReCom ReCom is offline
 
Join Date: Mar 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add a plugin with hook location: forumbit_display

The code:
Code:
$forum['title'] = '<img src="images/forumlogos/'.$forum['forumid'].'.gif" onerror="this.style.display=\'none\';" /> '.$forum['title'];
Save the plugin.

Then upload the forum logos into your images/forumlogos directory, with each logo named after the forumid (e.g. if the forumid is 18 then the logo is named 18.gif)

Set the plugin as active.

(the img tag I included above is special since it automatically handles situations where the logo files are missing by hiding itself)
Reply With Quote
  #5  
Old 11-22-2008, 02:35 PM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks, but I could achieve exactly the same thing editing forumhome_forumbit_level2_post template. But plugin thing saved my edit

I'm getting xhtml validation errors with onerror attribute. And the img tag still exists for all forums where logo files are missing. How do I stop injecting img tag on forums that does not have logo file?

Thanks

--------------- Added [DATE]1227379492[/DATE] at [TIME]1227379492[/TIME] ---------------

alright, I checked for existence of file this way.

PHP Code:
$filename 'images/forumlogos/'$forum[forumid].'.gif';

if (
file_exists($filename)) {
$forum['title'] = '<img src="images/forumlogos/'.$forum['forumid'].'.gif" /> '.$forum['title'];

Thanks
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:44 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03641 seconds
  • Memory Usage 2,200KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete