Verfasst: 28.02.2007 01:09
Na dann mal viel Erfolg mit dem Cache. 

Code: Alles auswählen
<?php
//---------------------------------------------
// Generated : 2007-02-28 19:18:53 (GMT)
//---------------------------------------------
if ( !defined('IN_PHPBB') )
{
die('Hack attempt');
}
$row = unserialize('a:1:{i:247;a:20:
s:7:"post_id";s:3:"247";s:8:"topic_id";s:2:"82";s:8:"forum_id";s:1:"1";s:
9:"poster_id";i:2;s:9:"post_time";s:10:"1139961971";s:9:"poster_ip";s:8:"
543f0e59";s:13:"post_username";s:0:"";s:13:"enable_bbcode";s:1:"1";s:1
1:"enable_html";s:1:"0";s:14:"enable_smilies";s:1:"1";s:10:"enable_sig";s
:1:"0";s:14:"post_edit_time";s:1:"0";s:15:"post_edit_count";s:1:"0";s:9:"p
ost_icon";s:1:"0";s:15:"post_attachment";s:1:"0";s:12:"post_subject";s:4:
"test";s:14:"post_sub_title";s:0:"";s:9:"post_text";s:4:"test";s:10:"bbcode
_uid";s:10:"01bcbcde00";s:11:"post_unread";b:0;}}');
$user_ids = unserialize('a:1:{i:2;b:1;}');
?>
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if ( $userdata['user_level'] != ADMIN )
{
message_die(GENERAL_MESSAGE, $lang['Not_admin']);
}
$delete_per_loop = 1000;
$last_id = ( isset($HTTP_GET_VARS['last_id']) ) ? $HTTP_GET_VARS['last_id'] : '';
$count_files = count(glob($phpbb_root_path . 'cache/topics/*.php'));
$i = 0;
foreach ( glob($phpbb_root_path . 'cache/topics/*.php') as $fn )
{
if ( $i == $delete_per_loop )
{
break;
}
unlink($fn);
$i++;
}
if ( $count_files == 0 )
{
exit('Done...');
}
else
{
echo("\n\n<script language=\"JavaScript\" type=\"text/javascript\">window.setTimeout('location.href=\"" . $phpbb_root_path . "delete_cache.php\";',4000);</script>\n");
echo("<p><a href=\"" . $phpbb_root_path . "delete_cache.php\">Manuell weiter...</p>\n");
}
?>
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if ( $userdata['user_level'] != ADMIN )
{
message_die(GENERAL_MESSAGE, $lang['Not_admin']);
}
// Settings
$delete_per_loop = 1000;
$dir = 'cache/topics/';
$delete_folders = false;
// Delete cache
$i = 0;
function delete_cache($dir, &$i, $force=false)
{
global $delete_per_loop, $delete_folders;
if ( is_dir($dir) )
{
if ( substr($dir, -1) != '/' )
{
$dir .= '/';
}
$handle = opendir($dir);
while ( ($fn = readdir($handle)) !== false )
{
if ( $i == $delete_per_loop )
{
return false;
}
if ( $fn != '.' && $fn != '..' )
{
$path = $dir . $fn;
if ( is_dir($path) )
{
delete_cache($path, $i, true);
}
else
{
unlink($path);
}
}
$i++;
}
closedir($handle);
if ( $delete_folders && $force )
{
rmdir($dir);
}
return true;
}
else
{
return false;
}
}
if ( delete_cache($dir, $i) )
{
exit('Done...');
}
else
{
echo("\n\n<script language=\"JavaScript\" type=\"text/javascript\">window.setTimeout('location.href=\"" . $phpbb_root_path . "delete_cache.php\";',4000);</script>\n");
echo("<p><a href=\"" . $phpbb_root_path . "delete_cache.php\">Manuell weiter...</p>\n");
}
?>
Code: Alles auswählen
function topic_cached()
{
global $config;
$this->cache_folder = (string)$this->topic_id;
$this->cache_folder = intval($this->cache_folder{0}) . '/' . intval($this->cache_folder{1}) . '/';
if ( @file_exists($config->url('cache/topics/' . $this->cache_folder . intval($this->topic_id) . '_' . intval($this->parms['start']))) )
{
$this->cached = true;
return true;
}
else
{
$this->cached = false;
return false;
}
}
Code: Alles auswählen
// output to file
if ( !file_exists('cache/topics/' . $this->cache_folder) )
{
@mkdir('cache/topics/' . intval($this->cache_folder{0}), 0777);
@chmod('cache/topics/' . intval($this->cache_folder{0}), 0777);
@mkdir('cache/topics/' . intval($this->cache_folder{0}) . '/' . intval($this->cache_folder{2}), 0777);
@chmod('cache/topics/' . intval($this->cache_folder{0}) . '/' . intval($this->cache_folder{2}), 0777);
}