Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-27-2010, 02:51 PM
GreenT's Avatar
GreenT GreenT is offline
 
Join Date: Dec 2005
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Include another default CSS template via plug-in

Hi,

I would like to include the album.css styles on FORUMDISPLAY pages. Is there a way to achieve this via a plug-in?

I'm aware that I could inject the stylesheet into the header, but I would like it to be compatible with both embedded and outsourced (filesystem) CSS.

Thanks!

Marcus
Reply With Quote
  #2  
Old 01-27-2010, 08:08 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any method atm will almost certainly change in 4.0.2, so best to wait.
Reply With Quote
  #3  
Old 01-27-2010, 08:14 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is an article in the vb4 articles forum that you may want to read. But, as Paul said, things may change a bit... I know there is a template_hook available right now but exactly how it is to be used may change.
Reply With Quote
  #4  
Old 01-28-2010, 05:01 AM
GreenT's Avatar
GreenT GreenT is offline
 
Join Date: Dec 2005
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, thanks then... I'll wait.
Reply With Quote
  #5  
Old 03-14-2010, 05:56 PM
MrNase MrNase is offline
 
Join Date: May 2003
Location: Germany
Posts: 670
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any news on this?

I would like to use one CSS template from 'showthread' in 'newthread' - how is the script told what CSS template to use on what page?
Reply With Quote
  #6  
Old 03-14-2010, 11:23 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Several ways to do it. One way..

hook location - parse_templates
PHP Code:
if (THIS_SCRIPT == 'xxxx') {
        if (
$vbulletin->options['storecssasfile'])
        {
            
$vbcsspath 'clientscript/vbulletin_css/style' str_pad($style['styleid'], 5'0'STR_PAD_LEFT) . $vbulletin->stylevars['textdirection']['string'][0] . '/';
        }
        else
        {
            
// textdirection var added to prevent cache if admin modified language text_direction. See bug #32640
            
$vbcsspath 'css.php?styleid=' $style['styleid'] . '&langid=' LANGUAGEID '&d=' $style['dateline'] . '&td=' $vbulletin->stylevars['textdirection']['string'] . '&sheet=';
                }
$template_hook['headinclude_bottom_css'] .= '<link rel="stylesheet" type="text/css" href="'.$vbcsspath.'yyyy.css" />'

Change xxxx and yyyy as needed.
Reply With Quote
  #7  
Old 03-15-2010, 08:40 PM
MrNase MrNase is offline
 
Join Date: May 2003
Location: Germany
Posts: 670
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your answer.

Depending on what page I am, vBulletin knows what CSS templates to include - what controls this behaviour?

I was hoping the only thing I need to do is add something to an array (like what you do when you want to add a custom template to the cache) and it just works. I mean.. there must be something that is responsible for the default CSS templates.

Don't get me wrong, there is basically nothing wrong with your solution but it has one flaw: It links to another CSS file - the stock installation composes many different files into one and that's what I am trying to achive. (less files - more speed).
Reply With Quote
  #8  
Old 03-17-2010, 02:26 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you know you are not going to be storing css in the file system, then you can use the template_hook custom_css_list (in headerinclude template) to add to the list of templates.
Reply With Quote
Reply


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 01:13 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.04029 seconds
  • Memory Usage 2,231KB
  • 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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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