vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   [SOLVED] Add css code in additional.css Template by plugin (https://vborg.vbsupport.ru/showthread.php?t=323827)

omardealo 11-07-2016 10:43 AM

[SOLVED] Add css code in additional.css Template by plugin
 
i want add css code in additional.css Template , but my code dose not work

hook : parse_templates
code :
Code:

$csscode = '.threadlisthead span.threadinfo {
    width: 48%;
}
.threadbit .threadinfo {
    width: 48%;
}'; 
$vbulletin->templatecache['additional.css'] .= '$csscode';


MarkFL 11-07-2016 11:29 AM

What I would do instead is at that same plugin hook, use the code:

PHP Code:

if (THIS_SCRIPT === 'forumdisplay')
{
    
$template_hook['headinclude_css'] .= '<style>.threadlisthead span.threadinfo, .threadbit .threadinfo {width: 48%;}</style>';



omardealo 11-07-2016 11:54 AM

Quote:

Originally Posted by MarkFL (Post 2577916)
What I would do instead is at that same plugin hook, use the code:

PHP Code:

if (THIS_SCRIPT === 'forumdisplay')
{
    
$template_hook['headinclude_css'] .= '<style>.threadlisthead span.threadinfo, .threadbit .threadinfo {width: 48%;}</style>';



what is name of hook u use it ??

MarkFL 11-07-2016 11:57 AM

The same hook you were already using: parse_templates

omardealo 11-07-2016 11:59 AM

Quote:

Originally Posted by MarkFL (Post 2577918)
The same hook you were already using: parse_templates

okay thanks bro , but it is not work :erm:

MarkFL 11-07-2016 12:02 PM

You may need to add "!important" to your selector's CSS declaration. :)

omardealo 11-07-2016 12:05 PM

Quote:

Originally Posted by MarkFL (Post 2577920)
You may need to add "!important" to your selector's CSS declaration. :)

I do not understand Can you explain
thanks :up:

MarkFL 11-07-2016 12:08 PM

Change the plugin code to:

PHP Code:

if (THIS_SCRIPT === 'forumdisplay')
{
    
$template_hook['headinclude_css'] .= '<style>.threadlisthead span.threadinfo, .threadbit .threadinfo {width: 48% !important;}</style>';


This way it will override any other normal selectors pertaining to those elements.

omardealo 11-07-2016 12:16 PM

Quote:

Originally Posted by MarkFL (Post 2577922)
Change the plugin code to:

PHP Code:

if (THIS_SCRIPT === 'forumdisplay')
{
    
$template_hook['headinclude_css'] .= '<style>.threadlisthead span.threadinfo, .threadbit .threadinfo {width: 48% !important;}</style>';


This way it will override any other normal selectors pertaining to those elements.

Okay bro it is works good now
thanks alot :up::up:


All times are GMT. The time now is 09:58 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.00990 seconds
  • Memory Usage 1,736KB
  • 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
  • (1)bbcode_code_printable
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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