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 02-23-2010, 03:02 PM
1GTurn 1GTurn is offline
 
Join Date: Oct 2009
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default CCS.PHP getting slammed....

I posted this under the general section which I think was wrong. Sorry I'm retarded. Anyways below is my issues. I can provide any details needed to help resolve this issue.

Don't know if this is a bug or something I might have wrong. Currently the ccs.php file located under the root directory is getting hit over 20,000 times every 24hours. We only have about 100 users and have had no more than 33 people on line at one time. Seems an awful lot for not that many users. Anything I should check for or can provide that might solve this issue. I'm running 4.0.2.

Let me know if anymore information is needed in order to help figure this out.

Don't know if this helps but under Style & Language Settings the "Store CSS Stylesheets as Files" is currently no.

Thank you

PHP Code:
<?php

/*======================================================================*\

|| #################################################################### ||

||

|| # ---------------------------------------------------------------- # ||

|| # Copyright ?2000-2010 vBulletin Solutions Inc. All Rights Reserved. ||

|| # This file may not be redistributed in whole or significant part. # ||

|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||

|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||

|| #################################################################### ||

\*======================================================================*/



// ####################### SET PHP ENVIRONMENT ###########################

error_reporting(E_ALL & ~E_NOTICE);



// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT''css');

define('CSRF_PROTECTION'true);

define('NOPMPOPUP'1);

define('NOCOOKIES'1);

define('NONOTICES'1);

define('NOHEADER'1);

define('NOSHUTDOWNFUNC'1);

define('LOCATION_BYPASS'1);



define('NOCHECKSTATE'1);

define('SKIP_SESSIONCREATE'1);



// Immediately send back the 304 Not Modified header if this css is cached, don't load global.php

if ((!empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) OR !empty($_SERVER['HTTP_IF_NONE_MATCH'])))

{

    
$sapi_name php_sapi_name();

    if (
$sapi_name == 'cgi' OR $sapi_name == 'cgi-fcgi')

    {

        
header('Status: 304 Not Modified');

    }

    else

    {

        
header('HTTP/1.1 304 Not Modified');

    }

    
// remove the content-type and X-Powered headers to emulate a 304 Not Modified response as close as possible

    
header('Content-Type:');

    
header('X-Powered-By:');

    exit;

}



// ################### PRE-CACHE TEMPLATES AND DATA ######################

// get special phrase groups

$phrasegroups = array();



// get special data templates from the datastore

$specialtemplates = array();



// pre-cache templates used by all actions  - build

preg_match_all('#([a-z0-9_\-]+\.css)#i'$_REQUEST['sheet'], $matches);

if (
$matches[1])

{

    foreach (
$matches[1] AS $cssfile)

    {

        
$globaltemplates[] = $cssfile;

    }

}

else

{

    
$globaltemplates = array();

}



// pre-cache templates used by specific actions

$actiontemplates = array();



// ######################### REQUIRE BACK-END ############################

require_once('./global.php');



// #######################################################################

// ######################## START MAIN SCRIPT ############################

// #######################################################################



header('Content-Type: text/css');



(
$hook vBulletinHook::fetch_hook('css_start')) ? eval($hook) : false;



if (empty(
$matches[1]))

{

    echo 
"/* Unable to find css sheet */";

}

else

{

    
//        Note that the css publishing mechanism relies on the fact that

    //        there isn't any user specific data passed to the css templates.



    
$templates '';

    
$count 0;

    foreach (
$matches[1] AS $template)

    {

        if (
$count 0)

        {

            
$templates .= "\r\n\r\n";

        }

        
$templater vB_Template::create($template);

        
$template $templater->render(true);

        if (
$count 0)

        {

            
$template preg_replace("#@charset .*#i"""$template);

        }

        
$templates .= $template;

        
$count++;

    }



    
// TODO - Remove this

    //temporary -- allows me to fix the stylevars without destroying everybody else's work.

    // commented-out by chris: 01/14/2010

    //$templates = str_replace('pxpx', 'px', $templates);



    
header('Cache-control: max-age=31536000, private');

    
header('Expires: ' gmdate("D, d M Y H:i:s"TIMENOW 31536000) . ' GMT');

    
header('Last-Modified: ' gmdate('D, d M Y H:i:s'$style['dateline']) . ' GMT');



    echo 
$templates;

}



/*======================================================================*\

|| ####################################################################

|| # Downloaded: 16:41, Fri Feb 19th 2010

|| # CVS: $RCSfile$ - $Revision: 30573 $

|| ####################################################################

\*======================================================================*/
Here is the CCS.php file in question if it helps.
Reply With Quote
  #2  
Old 02-23-2010, 03:29 PM
cad2go cad2go is offline
 
Join Date: Feb 2009
Posts: 181
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Don't know if this helps but under Style & Language Settings the "Store CSS Stylesheets as Files" is currently no.
Set that to yes.
Reply With Quote
  #3  
Old 02-23-2010, 03:31 PM
1GTurn 1GTurn is offline
 
Join Date: Oct 2009
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will that mess anything currently up in running? Do I need to add anything?
Reply With Quote
  #4  
Old 02-23-2010, 03:34 PM
cad2go cad2go is offline
 
Join Date: Feb 2009
Posts: 181
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you may have to make the css directories writable where ever they are. but that's about it.
Reply With Quote
  #5  
Old 02-23-2010, 04:14 PM
1GTurn 1GTurn is offline
 
Join Date: Oct 2009
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So I made that change but its still doing it.

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

I tried to run this..
https://vborg.vbsupport.ru/showthread.php?t=229608

and got this warning when I did the compress CCS.

Quote:
Warning: Invalid argument supplied for foreach() in [path]/includes/adminfunctions_template.php on line 913
Reply With Quote
  #6  
Old 02-27-2010, 12:56 PM
ChopSuey ChopSuey is offline
 
Join Date: Jun 2009
Location: Alaska
Posts: 2,140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is a problem with that mod, disabling that and installing this works fine with vB4.

https://vborg.vbsupport.ru/showthread.php?t=107615
Reply With Quote
  #7  
Old 02-27-2010, 02:03 PM
compwhizii compwhizii is offline
 
Join Date: Aug 2009
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Since no one told you what that is I guess I'll tell you.

Css.php is what serves all of the CSS for the page (Thus why it's named css.php ).
Reply With Quote
  #8  
Old 02-07-2016, 06:53 PM
Wmteknik Wmteknik is offline
 
Join Date: Dec 2015
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you
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 10:11 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.06869 seconds
  • Memory Usage 2,259KB
  • 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
  • (2)bbcode_quote
  • (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