Cached Generation mod - Uptade 1.2.2 -> 1.4.3
Tarih: 18.08.2006, 10:31
Cached Generation mod güncellendi... dosya içinden güncelleme dosyası çıkmadı
ben de oturup kendi güncelleme dosyamı yazdım
ben de oturup kendi güncelleme dosyamı yazdım
- Kod: Tümünü seç
#######################################################################
##MOD Title: Cached Generation Uptade 1.2.2 -> 1.4.3
##MOD Author: Doobdee < n/a > ( n/a ) http://www.doobdee.net
##MOD Author: CyberAlien < n/a > ( n/a ) http://www.phpbbstyles.com
##Update Fıle: yakusha < n/a > ( n/a ) http://www.phpbbturkiye.com
##MOD Description: This caches SQL queries, adds SQL queries counter and page generation time
##MOD Version: 1.0.1 - beta
##Installation Level: ()
##Installation Time: 20 Minutes
##Files To Edit: ()
#
#######################################################################
# This not mod. This only o update file for Cached Generation
# from 1.2.2 -> 1.4.3
#
# 1.0.1 - beta / 18 Agust 2006
# -- beta relaese
#
# 1.0.0 - Alfa / 17 Agust 2006
# -- initial relaese
# -- 40.000 man's dead this they in golcuk / turkey
###################################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT topic_id
FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];
if (!($result = $db->sql_query($sql)))
{
$db->clear_cache('posts_');
#
#-----[ REPLACE ]------------------------------------------
#
$sql = "SELECT topic_id
FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];
if (!($result = $db->sql_query($sql)))
{
// only --> $db->clear_cache('posts_'); <-- deleted
#
#-----[ FIND ]------------------------------------------
#
AND u.user_id = tw.user_id";
if (!($result = $db->sql_query($sql)))
{
#
#-----[ AFTER, ADD ]------------------------------------------
#
$db->clear_cache('posts_');
#-----[ FIND ]------------------------------------------
#
#
#-----[ OPEN ]------------------------------------------
#
//includes/user_cp.php
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
$message = $message . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
#
#-----[ AFTER, ADD ]------------------------------------------
#
$db->clear_cache();
#-----[ OPEN ]------------------------------------------
#
#
db/mysql.php
#
#-----[ FIND ]------------------------------------------
#
if($this->caching)
{
if($this->row[$query_id] === false)
{
$this->write_cache();
}
$this->cache[] = $this->row[$query_id];
}
#
#-----[ REPLACE ]------------------------------------------
#
if($this->caching)
{
$this->cache[] = $this->row[$query_id];
if($this->row[$query_id] === false || mysql_affected_rows($this->db_connect_id) == 1)
{
$this->write_cache();
}
}
#
#-----[ FIND ]------------------------------------------
#
function write_cache()
{
if(!$this->caching)
{
return;
}
global $phpbb_root_path;
$f = fopen($phpbb_root_path . 'cache/sql_' . $this->caching . '.php', 'w');
$data = var_export($this->cache, true);
@fputs($f, '<?php $set = ' . $data . '; ?>');
@fclose($f);
@chmod($phpbb_root_path . 'cache/sql_' . $this->caching . '.php', 0777);
$this->caching = false;
$this->cached = false;
$this->cache = array();
}
#
#-----[ REPLACE ]------------------------------------------
#
function write_cache()
{
if(!$this->caching)
{
return;
}
global $phpbb_root_path;
$f = fopen($phpbb_root_path . 'cache/sql_' . $this->caching . '.php', 'w');
$data = var_export($this->cache, true);
@flock($f,LOCK_EX);
@fputs($f, '<?php $set = ' . $data . '; ?>');
@fclose($f);
@flock($f,LOCK_UN);
$set = array();
include($phpbb_root_path . 'cache/sql_' . $this->caching . '.php');
if (!$set)
{
@unlink($phpbb_root_path . 'cache/sql_' . $this->caching . '.php');
}
@chmod($phpbb_root_path . 'cache/sql_' . $this->caching . '.php', 0777);
$this->caching = false;
$this->cached = false;
$this->cache = array();
}
#
#-----[ OPEN ]------------------------------------------
#
#
db/mysql4.php
#
#-----[ FIND ]------------------------------------------
#
if($this->caching)
{
if($this->row[$query_id] === false)
{
$this->write_cache();
}
$this->cache[] = $this->row[$query_id];
}
#
#-----[ REPLACE ]------------------------------------------
#
if($this->caching)
{
$this->cache[] = $this->row[$query_id];
if($this->row[$query_id] === false || mysql_affected_rows($this->db_connect_id) == 1)
{
$this->write_cache();
}
}
#
#-----[ FIND ]------------------------------------------
#
function write_cache()
{
if(!$this->caching)
{
return;
}
global $phpbb_root_path;
$f = fopen($phpbb_root_path . 'cache/sql_' . $this->caching . '.php', 'w');
$data = var_export($this->cache, true);
@fputs($f, '<?php $set = ' . $data . '; ?>');
@fclose($f);
@chmod($phpbb_root_path . 'cache/sql_' . $this->caching . '.php', 0777);
$this->caching = false;
$this->cached = false;
$this->cache = array();
}
#
#-----[ REPLACE ]------------------------------------------
#
function write_cache()
{
if(!$this->caching)
{
return;
}
global $phpbb_root_path;
$f = fopen($phpbb_root_path . 'cache/sql_' . $this->caching . '.php', 'w');
$data = var_export($this->cache, true);
@flock($f,LOCK_EX);
@fputs($f, '<?php $set = ' . $data . '; ?>');
@fclose($f);
@flock($f,LOCK_UN);
$set = array();
include($phpbb_root_path . 'cache/sql_' . $this->caching . '.php');
if (!$set)
{
@unlink($phpbb_root_path . 'cache/sql_' . $this->caching . '.php');
}
@chmod($phpbb_root_path . 'cache/sql_' . $this->caching . '.php', 0777);
$this->caching = false;
$this->cached = false;
$this->cache = array();
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
#EoM