Код: Выделить всё
##############################################################
## MOD Title: Refresh index.php
## MOD Author: [R: R@m$e$ :U] < Ramses@FromRU.com > (Ramses) http://www.phpbbguru.net
## MOD Description: Refresh index.php every x seconds (X - configure in admin)
## MOD Version: 1.1.0
##
## Installation Level: Easy
## Installation Time: ~3 Minutes
## Files To Edit:
## admin/admin_board.php,
## language/lang_english/lang_admin.php
## language/lang_russian/lang_admin.php
## templates/subSilver/admin/board_config_body.tpl
## index.php
## Included Files:
## db_update.php
##############################################################
## For Security Purposes, Please Check: http://www.phpbbguru.net/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum.
##############################################################
## Author Notes:
## Find bug? Write here - http://www.phpbbguru.net/community/viewtopic.php?t=1552
## plz =)
##
## Run SQL-commands in phpMyAdmin or execute root/db_update.php
##
##############################################################
## MOD History:
##
## 2005-02-13 - Version 1.1.0
## - Config in admin =)
##
## 2005-02-13 - Version 1.0.0
## - First version +)))
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES('refresh_index', 1);
INSERT INTO phpbb_config (config_name, config_value) VALUES('refresh_index_time', 300);
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
$board_email_form_yes = ( $new['board_email_form'] ) ? "checked=\"checked\"" : "";
$board_email_form_no = ( !$new['board_email_form'] ) ? "checked=\"checked\"" : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [start] Refresh index.php
$refresh_index_yes = ( $new['refresh_index'] ) ? "checked=\"checked\"" : "";
$refresh_index_no = ( !$new['refresh_index'] ) ? "checked=\"checked\"" : "";
// [end] Refresh index.php
#
#-----[ FIND ]------------------------------------------
#
"L_FLOOD_INTERVAL" => $lang['Flood_Interval'],
"L_FLOOD_INTERVAL_EXPLAIN" => $lang['Flood_Interval_explain'],
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Refresh index.php
"L_REFRESH_INDEX" => $lang['Refresh_index'],
"L_REFRESH_INDEX_EXPLAIN" => $lang['Refresh_index_explain'],
"L_REFRESH_INDEX_TIME" => $lang['Refresh_index_time'],
"L_REFRESH_INDEX_TIME_EXPLAIN" => $lang['Refresh_index_time_explain'],
// [end] Refresh index.php
#
#-----[ FIND ]------------------------------------------
#
"FLOOD_INTERVAL" => $new['flood_interval'],
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Refresh index.php
"REFRESH_INDEX_ENABLE" => $refresh_index_yes,
"REFRESH_INDEX_DISABLE" => $refresh_index_no,
"REFRESH_INDEX_TIME" => $new['refresh_index_time'],
// [end] Refresh index.php
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Refresh index.php
$lang['Refresh_index'] = 'Refresh index.php';
$lang['Refresh_index_explain'] = 'If enabled, index.php will be refresh';
$lang['Refresh_index_time'] = 'Time interval of refreshing index.php';
$lang['Refresh_index_time_explain'] = 'Time interval, after which index.php refreshing. [ seconds; default - 300 ]';
// [end] Refresh index.php
#
#-----[ OPEN ]------------------------------------------
#
language/lang_russian/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Refresh index.php
$lang['Refresh_index'] = 'Обновление index.php';
$lang['Refresh_index_explain'] = 'Если включено, то index.php будет обновлятся через определенный промежуток времени';
$lang['Refresh_index_time'] = 'Интервал обновления index.php';
$lang['Refresh_index_time_explain'] = 'Промежуток времени, через который будет обновлятся index.php. [ в секундах; по умолчанию 300 ]';
// [end] Refresh index.php
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_FLOOD_INTERVAL} <br /><span class="gensmall">{L_FLOOD_INTERVAL_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="flood_interval" value="{FLOOD_INTERVAL}" /></td>
</tr>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<tr>
<td class="row1">{L_REFRESH_INDEX}<br /><span class="gensmall">{L_REFRESH_INDEX_EXPLAIN}</span></td>
<td class="row2"><input type="radio" name="refresh_index" value="1" {REFRESH_INDEX_ENABLE} /> {L_ENABLED} <input type="radio" name="refresh_index" value="0" {REFRESH_INDEX_DISABLE} /> {L_DISABLED}</td>
</tr>
<tr>
<td class="row1">{L_REFRESH_INDEX_TIME} <br /><span class="gensmall">{L_REFRESH_INDEX_TIME_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="refresh_index_time" value="{REFRESH_INDEX_TIME}" /></td>
</tr>
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
//
// End session management
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [start] Refresh index.php
if ($board_config['refresh_index'])
{
header('Refresh: ' . $board_config['refresh_index_time'] . '; URL=' . $server_protocol . $server_name . $server_port . $script_name . $url);
}
// [end] Refresh index.php
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
db_update.php
Код: Выделить всё
<?
#########################################################
## SQL commands to phpBB2
## Author: Niels Chr. Rшd
## Nickname: Niels Chr. Denmark
## Email: ncr@db9.dk
##
## Ver 1.0.7
##
## phpBB2 database update script for mods
## this file is intended to use with phpBB2, when installing mods
## after so you may delete this file, but only admin can use so it really doesen't matter
## The script will look what prefix you are using, and use the existing DB defined by congig.php
## The execution of this script's included SQL is harmless, so you can run it as meny times you like
## note, though that the users last visit, will be set back to his/her last login,
## but that is a minor cosmetic isue, that will correct it self next time the use logs in
##
## the following example are from my mods, and you can add some self, for other mods if you like
## you will after execution get a list over those commands that are run with succes and those with warnings !
## delete the sample lines if you are using it only for other mods
##
#########################################################
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
###################################################################################################
##
## put the SQL commands below here, the SQL commands listed below are only exampels, substitude them with the one you need ##
##
###################################################################################################
$sql=array(
'INSERT INTO ' . CONFIG_TABLE . ' (config_name, config_value) VALUES("refresh_index", "1")',
'INSERT INTO ' . CONFIG_TABLE . ' (config_name, config_value) VALUES("refresh_index_time", "300")'
);
$mods = array (
'Refresh index.php','Refresh index.php',
);
############################################### Do not change anything below this line #######################################
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if ($userdata['user_level']!=ADMIN)
message_die(GENERAL_ERROR, "You are not Authorised to do this");
$n=0;
$message="<b>This list is a result of the SQL queries needed for mod</b><br/><br/>";
while($sql[$n])
{
$message .= ($mods[$n-1] != $mods[$n]) ? '<p><b><font size=3>'.$mods[$n].'</font></b><br/>' : '';
if(!$result = $db->sql_query($sql[$n]))
$message .= '<b><font color=#FF0000>[Already added]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
else $message .='<b><font color=#0000fF>[Added/Updated]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
$n++;
}
message_die(GENERAL_MESSAGE, $message);
?>