Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 13 Aug 2013, 04:37
PinkMilk PinkMilk is offline
 
Join Date: May 2010
Real name: Milk Pink
css @import to <link>

when storing style sheets to file vBulletin uses @import:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

this has a negative impact on web page performance, is it some how possible to change this to link?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


--- Update ---


I have found this in includes/adminfunctions_template.php which looks to be the code I need to edit:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

BUT

there is also this function that deletes the older css files:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

so would need to change the preg_match regex for it to work with <link>, bit of an ask but can somebody be kind enough to rewrite the function?

Last edited by PinkMilk; 13 Aug 2013 at 04:57.
Reply With Quote
  #2  
Old 13 Aug 2013, 06:08
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Real name: Zachery Woods
Uh, that is php code, not css code. I'm nearly positive vBulletin doesn't use an @import in the actual css rules. It uses a standard <link> tag, in the head.
__________________
Looking for ImpEx?
Reply With Quote
  #3  
Old 13 Aug 2013, 06:51
PinkMilk PinkMilk is offline
 
Join Date: May 2010
Real name: Milk Pink
Originally Posted by Zachery View Post
Uh, that is php code, not css code. I'm nearly positive vBulletin doesn't use an @import in the actual css rules. It uses a standard <link> tag, in the head.
Under the vbulletin options > Style & Language Settings there is an option:
"Store CSS Stylesheets as Files?", if you check yes instead of the full css loading in page (see this sites source for example) you get something like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

as you can see it uses @import, this is not the best option it is better to use <link> as explained in op.

The first php code snippet is what helps create this , each time you update your style a new css file is created and the function in op deletes the older stored css file.

Last edited by PinkMilk; 13 Aug 2013 at 06:57.
Reply With Quote
  #4  
Old 13 Aug 2013, 11:42
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Try replacing the preg line with:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.



Originally Posted by Zachery View Post
Uh, that is php code, not css code. I'm nearly positive vBulletin doesn't use an @import in the actual css rules. It uses a standard <link> tag, in the head.
I thought the same thing, but it turns out it is something that browsers recognize. http://stackoverflow.com/questions/1...why-use-import
Reply With Quote
  #5  
Old 13 Aug 2013, 16:36
PinkMilk PinkMilk is offline
 
Join Date: May 2010
Real name: Milk Pink
Originally Posted by kh99 View Post
Try replacing the preg line with:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I thought the same thing, but it turns out it is something that browsers recognize. http://stackoverflow.com/questions/1...why-use-import
Thanks but didn't work, I have the <link> format working great its just the deleting of the older stylesheet, guess I will have to just remember to clean that folder out from time to time.
Reply With Quote
  #6  
Old 13 Aug 2013, 16:54
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by PinkMilk View Post
Thanks but didn't work, I have the <link> format working great its just the deleting of the older stylesheet, guess I will have to just remember to clean that folder out from time to time.

Oh right - I got the pattern to match but forgot that it needs parens around the matched part to use in the unlink call. If you want to try again, you could try this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #7  
Old 13 Aug 2013, 17:12
PinkMilk PinkMilk is offline
 
Join Date: May 2010
Real name: Milk Pink
Also didn't work but I moved clientscript/vbulletin_css/ from unlink into preg match and is now.
Reply With Quote
  #8  
Old 13 Aug 2013, 17:13
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I was just wondering if your <link> tag had the path in the file name or not. I guess it does.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Administrative and Maintenance Tools Add "Add/Import Product" link in AdminCP menu. BBR-APBT vBulletin 3.8 Add-ons 14 28 Apr 2011 21:07
Administrative and Maintenance Tools Put [Add/Import Product] link in your admincp menu ericgtr vBulletin 3.6 Template Modifications 18 20 Apr 2010 15:57
Administrative and Maintenance Tools Put [Add/Import Product] link in your admincp menu ericgtr vBulletin 4.x Add-ons 11 12 Mar 2010 17:51
Administrative and Maintenance Tools add/import product link relocation o0Hubba0o vBulletin 3.6 Add-ons 7 09 Jun 2007 19:16



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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


New To Site? Need Help?

All times are GMT. The time now is 20:53.

Layout Options | Width: Wide Color: