[Phpslash-commit] CVS: phpslash-ft/public_html search.php3,1.51,1.52 config-dist.php3,1.12,1.13 conf
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2002-11-24 23:12:58
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory sc8-pr-cvs1:/tmp/cvs-serv15696/phpslash-ft/public_html Modified Files: search.php3 config-dist.php3 config.php3 Log Message: jpcache related Index: search.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/search.php3,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** search.php3 21 Nov 2002 18:59:07 -0000 1.51 --- search.php3 24 Nov 2002 23:12:55 -0000 1.52 *************** *** 10,14 **** $xsiteobject = pslgetText("Search Page"); #Defines The META TAG Page Type ! page_open(array("sess"=>"slashSess","auth"=>"slashAuth","perm"=>"slashPerm")); $maxsearchresults = $_PSL['search_maxresults']; --- 10,14 ---- $xsiteobject = pslgetText("Search Page"); #Defines The META TAG Page Type ! // page_open(array("sess"=>"slashSess","auth"=>"slashAuth","perm"=>"slashPerm")); $maxsearchresults = $_PSL['search_maxresults']; *************** *** 405,410 **** while ($db->next_record ()) { $templ->set_var (array ( ! 'STORY_URL' => $_PSL['rooturl'] . "/article.php3?story_id=" . $db->f('story_id'), 'STORY_TITLE' => $db->f('title'), 'AUTHOR_URL' => str_html($db->f('url')), --- 405,416 ---- while ($db->next_record ()) { + + $story_url = $_PSL['rooturl'] . "/article.php3?story_id=" . $db->f('story_id'); + if(!empty($_SERVER['QUERY_STRING'])) { + $story_url .= $_PSL['amp'] . $_SERVER['QUERY_STRING']; + } + $templ->set_var (array ( ! 'STORY_URL' => $story_url, 'STORY_TITLE' => $db->f('title'), 'AUTHOR_URL' => str_html($db->f('url')), *************** *** 477,483 **** )); ! // TODO register_globals? ! if( !empty($QUERY_STRING)) { ! $QUERY_STRING = "?".$QUERY_STRING; } --- 483,488 ---- )); ! if( !empty($_SERVER['QUERY_STRING'])) { ! $QUERY_STRING = "?".$_SERVER['QUERY_STRING']; } Index: config-dist.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/config-dist.php3,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** config-dist.php3 22 Nov 2002 18:01:16 -0000 1.12 --- config-dist.php3 24 Nov 2002 23:12:55 -0000 1.13 *************** *** 15,18 **** --- 15,50 ---- like this, but you need to be sure to close it like so: */ + /* After phpSlash is configured, the jpcache-config.php file and the + varkey below can be configured to further optimize the cache system. + This is not needed to enable the cache initially. + */ + // require "/path/to/jpcache.php"; + if(array_key_exists('JPCACHE_VERSION', $GLOBALS)) { + if ( (empty($HTTP_COOKIE_VARS['slashSess'])) AND + (empty($HTTP_COOKIE_VARS['user_info'])) AND + (empty($HTTP_COOKIE_VARS['skin'])) ) { + + $varkey = "-uid-nobody-lang-en-skin-basic"; + if( !empty($HTTP_COOKIE_VARS['TZ'])) { + $varkey .= "-TZ-". $HTTP_COOKIE_VARS['TZ']; + } else { + $varkey .= "-TZ-America-Chicago"; + } + foreach( $HTTP_GET_VARS as $key => $value) { + $varkey .= "-". $key ."-". $value; + } + if ((empty($HTTP_GET_VARS['section'])) AND + (empty($HTTP_GET_VARS['section_id']))){ + $varkey .= "-section_id-3"; + } + $key = str_replace("/","-", $HTTP_SERVER_VARS['PHP_SELF'].$varkey); + if($GLOBALS['JPCACHE_IGNORE_DOMAIN'] == 0) { + $key = str_replace(".","-", $HTTP_SERVER_VARS['HTTP_HOST'] .$key); + } + jpcache_start('',$key); + } + } + */ + $_PSL = array(); Index: config.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/config.php3,v retrieving revision 1.159 retrieving revision 1.160 diff -C2 -d -r1.159 -r1.160 *** config.php3 22 Nov 2002 18:01:14 -0000 1.159 --- config.php3 24 Nov 2002 23:12:55 -0000 1.160 *************** *** 14,17 **** --- 14,49 ---- /* This is a comment as well, it can span multiple lines like this, but you need to be sure to close it like so: */ + + /* After phpSlash is configured, the jpcache-config.php file and the + varkey below can be configured to further optimize the cache system. + This is not needed to enable the cache initially. + */ + // require "/path/to/jpcache.php"; + if(array_key_exists('JPCACHE_VERSION', $GLOBALS)) { + if ( (empty($HTTP_COOKIE_VARS['slashSess'])) AND + (empty($HTTP_COOKIE_VARS['user_info'])) AND + (empty($HTTP_COOKIE_VARS['skin'])) ) { + + $varkey = "-uid-nobody-lang-en-skin-basic"; + if( !empty($HTTP_COOKIE_VARS['TZ'])) { + $varkey .= "-TZ-". $HTTP_COOKIE_VARS['TZ']; + } else { + $varkey .= "-TZ-America-Chicago"; + } + foreach( $HTTP_GET_VARS as $key => $value) { + $varkey .= "-". $key ."-". $value; + } + if ((empty($HTTP_GET_VARS['section'])) AND + (empty($HTTP_GET_VARS['section_id']))){ + $varkey .= "-section_id-3"; + } + $key = str_replace("/","-", $HTTP_SERVER_VARS['PHP_SELF'].$varkey); + if($GLOBALS['JPCACHE_IGNORE_DOMAIN'] == 0) { + $key = str_replace(".","-", $HTTP_SERVER_VARS['HTTP_HOST'] .$key); + } + jpcache_start('',$key); + } + } + */ $_PSL['version'] = '0.6.5'; *************** *** 71,124 **** $_PSL['topicimagedir'] = $_PSL['basedir'] . "/images" . "/topics"; ! // jpcachedir -> the full directory path to the jpcache scripts. ! if(empty($_PSL['jpcachedir'])) { ! $_PSL['jpcachedir'] = $_PSL['classdir'] . "/jpcache"; ! } ! // jpcache configuration ! // $JPCACHE_TYPE = "file"; ! // $JPCACHE_TYPE = "mysql"; ! //$JPCACHE_TYPE = "dbm"; ! $JPCACHE_TYPE = "phplib"; ! // General jpcache configuration options. ! ! $JPCACHE_TIME = 900; // Default number of seconds to cache a page ! $JPCACHE_DEBUG = 0; // Turn debugging on/off ! $JPCACHE_IGNORE_DOMAIN= 1; // Ignore domain name in request(single site) ! $JPCACHE_ON = 1; // Turn caching on/off ! $JPCACHE_USE_GZIP = 0; // Whether or not to use GZIP ! $JPCACHE_POST = 1; // Should POST's be cached ! $JPCACHE_GC = 1; // Probability % of garbage collection ! $JPCACHE_GZIP_LEVEL = 9; // GZIPcompressionlevel to use (1=low,9=high) ! $JPCACHE_DELAY_START = 1; // Immediate or manual call to jpcache_start() ! $JPCACHE_HASHSCRIPTKEY = 0; // Hash SCRIPT-KEY or not ! // File based caching setting. ! $JPCACHE_DIR = "/tmp/jpcache"; // Directory where jpcache must store ! // generated files. Please use a dedicated ! // directory, and make it writable ! $JPCACHE_FILEPREFIX = "jpc-";// Prefix used in the filename. This enables ! // us to (more accuratly) recognize jpcache- ! // files. - // DB based caching settings. - $JPCACHE_DB_HOST = $_PSL['DB_Host']; // Database Server - $JPCACHE_DB_DATABASE = $_PSL['DB_Database']; // Database-name to use - $JPCACHE_DB_USERNAME = $_PSL['DB_User']; // Username - $JPCACHE_DB_PASSWORD = $_PSL['DB_Password']; // Password - $JPCACHE_DB_TABLE = "CACHEDATA"; // Table that holds the data - $JPCACHE_OPTIMIZE = 0; // If 'OPTIMIZE TABLE' after garbage - // collection is executed. Please check - // first if this works on your mySQL! ! // Standard jpcache functions ! require $_PSL['jpcachedir']. "/jpcache-main.php"; ! ! // Type specific implementations ! require $_PSL['jpcachedir'] ."/type/$JPCACHE_TYPE.php"; // end of jpcache configuration --- 103,185 ---- $_PSL['topicimagedir'] = $_PSL['basedir'] . "/images" . "/topics"; ! if(empty($GLOBALS['JPCACHE_VERSION'])) { ! // jpcachedir -> the full directory path to the jpcache scripts. ! if(empty($_PSL['jpcachedir'])) { ! $_PSL['jpcachedir'] = $_PSL['classdir'] . "/jpcache"; ! } ! // $JPCACHE_TYPE = "file"; ! // $JPCACHE_TYPE = "mysql"; ! // $JPCACHE_TYPE = "dbm"; ! $JPCACHE_TYPE = "phplib"; + /** + * General configuration options. + */ + $JPCACHE_TIME = 900; // Default number of seconds to cache a page + $JPCACHE_DEBUG = 0; // Turn debugging on/off + $JPCACHE_IGNORE_DOMAIN= 1; // Ignore domain name in request(single site) + $JPCACHE_ON = 1; // Turn caching on/off + $JPCACHE_USE_GZIP = 0; // Whether or not to use GZIP + $JPCACHE_POST = 1; // Should POST's be cached + $JPCACHE_GC = 1; // Probability % of garbage collection + $JPCACHE_GZIP_LEVEL = 9; // GZIPcompressionlevel to use (1=low,9=high) + $JPCACHE_DELAY_START = 1; // Immediate or manual call to jpcache_start() + $JPCACHE_HASHSCRIPTKEY = 0; // Hash SCRIPT-KEY or not ! /** ! * File based caching setting. ! */ ! $JPCACHE_DIR = "/tmp/jpcache"; // Directory where jpcache must store ! // generated files. Please use a dedicated ! // directory, and make it writable ! $JPCACHE_FILEPREFIX = "jpc-";// Prefix used in the filename. This enables ! // us to (more accuratly) recognize jpcache- ! // files. ! /** ! * DB based caching settings. ! */ ! $JPCACHE_DB_HOST = $_PSL['DB_Host']; // Database Server ! $JPCACHE_DB_DATABASE = $_PSL['DB_Database']; // Database-name to use ! $JPCACHE_DB_USERNAME = $_PSL['DB_User']; // Username ! $JPCACHE_DB_PASSWORD = ""; // Password ! $JPCACHE_DB_TABLE = "CACHEDATA"; // Table that holds the data ! $JPCACHE_OPTIMIZE = 0; // If 'OPTIMIZE TABLE' after garbage ! // collection is executed. Please check ! // first if this works on your mySQL! ! // Standard functions ! require $_PSL['jpcachedir']. "/jpcache-main.php"; ! ! // Type specific implementations ! require $_PSL['jpcachedir'] ."/type/$JPCACHE_TYPE.php"; ! if ( (empty($HTTP_COOKIE_VARS['slashSess'])) AND ! (empty($HTTP_COOKIE_VARS['user_info'])) AND ! (empty($HTTP_COOKIE_VARS['skin'])) ) { ! ! $varkey = "-uid-nobody-lang-". $_PSL['language']."-skin-". $_PSL['defaultskin']; ! if( !empty($HTTP_COOKIE_VARS['TZ'])) { ! $varkey .= "-TZ-". $HTTP_COOKIE_VARS['TZ']; ! } else { ! $varkey .= "-TZ-". $_PSL['timezone']['name']; ! } ! foreach( $HTTP_GET_VARS as $key => $value) { ! $varkey .= "-". $key ."-". $value; ! } ! if ((empty($HTTP_GET_VARS['section'])) AND ! (empty($HTTP_GET_VARS['section_id']))){ ! $varkey .= "-section_id-". $_PSL['home_section_id']; ! } ! $key = str_replace("/","-", $_PSL['phpself'].$varkey); ! if($GLOBALS['JPCACHE_IGNORE_DOMAIN'] == 0) { ! $key = str_replace(".","-", $HTTP_SERVER_VARS['HTTP_HOST'] .$key); ! } ! jpcache_start('',$key); ! } ! } // end of jpcache configuration *************** *** 322,340 **** } - if ( (empty($HTTP_COOKIE_VARS['slashSess'])) AND - (empty($HTTP_COOKIE_VARS['user_info'])) AND - (empty($HTTP_COOKIE_VARS['skin'])) ) { - - $varkey = "-uid-nobody-lang-". $_PSL['language']."-skin-". $_PSL['defaultskin']; - if( !empty($HTTP_COOKIE_VARS['TZ'])) { - $varkey .= "-TZ-". $HTTP_COOKIE_VARS['TZ']; - } - foreach( $ary as $key => $value) { - $varkey .= "-". $key ."-". $value; - } - $key = str_replace("/","-", $_PSL['phpself'].$varkey); - jpcache_start('',$key); - } - /* now that the functions are in, we can define the arg_separator */ --- 383,386 ---- *************** *** 728,732 **** 'perm' => 'slashPerm')); ! if ( !empty($HTTP_COOKIE_VARS)) { $varkey = "-uid-".$auth->auth['uid']."-lang-". $_PSL['language']."-skin-". $_PSL['skin']; if( !empty($HTTP_COOKIE_VARS['TZ'])) { --- 774,779 ---- 'perm' => 'slashPerm')); ! if (( array_key_exists('slashSess', $HTTP_COOKIE_VARS)) AND ! (array_key_exists('JPCACHE_TYPE', $GLOBALS)) ) { $varkey = "-uid-".$auth->auth['uid']."-lang-". $_PSL['language']."-skin-". $_PSL['skin']; if( !empty($HTTP_COOKIE_VARS['TZ'])) { *************** *** 737,743 **** } $key = str_replace("/","-", $_PSL['phpself'].$varkey); jpcache_start('',$key); } - /* ============= Things to deprecate ============= */ --- 784,792 ---- } $key = str_replace("/","-", $_PSL['phpself'].$varkey); + if($GLOBALS['JPCACHE_IGNORE_DOMAIN'] == 0) { + $key = str_replace(".","-", $HTTP_SERVER_VARS['HTTP_HOST'] .$key); + } jpcache_start('',$key); } /* ============= Things to deprecate ============= */ |