The pattern that has to follow are these:
Up to the root of the forum file: db_update.php
Create file: db_update.php:
<?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_ERROR, "You are not Authorised to do this");
}
$sql_array = array();
$sql_array[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('sotw_desc', 'A little text to describe this SOTW');";
$sql_array[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('sotw_image', 'images/sotw/default.jpg');";
$delete_me = false;
$error = false;
$error_one = false;
for ( $i = 0; $i < count($sql_array); $i++ )
{
if ( trim($sql_array[$i]) != '' )
{
if ( !$db->sql_query($sql_array[$i]) )
{
$error = true;
$error_sql[] = $sql_array[$i];
$error_msg[] = $db->sql_error();
}
else
{
$error_one = true;
}
}
}
if ( $error && !$error_one )
{
$msg = 'The queries failed.';
}
else if ( $error )
{
$msg = 'Some queries failed.';
}
else
{
$delete = false;
if ( $delete_me )
{
$delete = @unlink(__FILE__);
}
$msg = 'The Mod was installed successful. ' . ( $delete ? 'This file was deleted successful.' : 'Don't forget to delete this file.' );
}
if ( $error )
{
$msg .= '<br/><br/>Error list:';
for ( $i = 0; $i < count($error_sql); $i++ )
{
$msg .= '<br />SQL Error: ' . $error_msg[$i]['code'] . ' ' . $error_msg[$i]['message'] . '<br />SQL Query: ' . $error_sql[$i] . '<br />';
}
}
message_die( ( $error ) ? GENERAL_ERROR : GENERAL_MESSAGE, $msg);
?>
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_ERROR, "You are not Authorised to do this");
}
$sql_array = array();
$sql_array[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('sotw_desc', 'A little text to describe this SOTW');";
$sql_array[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('sotw_image', 'images/sotw/default.jpg');";
$delete_me = false;
$error = false;
$error_one = false;
for ( $i = 0; $i < count($sql_array); $i++ )
{
if ( trim($sql_array[$i]) != '' )
{
if ( !$db->sql_query($sql_array[$i]) )
{
$error = true;
$error_sql[] = $sql_array[$i];
$error_msg[] = $db->sql_error();
}
else
{
$error_one = true;
}
}
}
if ( $error && !$error_one )
{
$msg = 'The queries failed.';
}
else if ( $error )
{
$msg = 'Some queries failed.';
}
else
{
$delete = false;
if ( $delete_me )
{
$delete = @unlink(__FILE__);
}
$msg = 'The Mod was installed successful. ' . ( $delete ? 'This file was deleted successful.' : 'Don't forget to delete this file.' );
}
if ( $error )
{
$msg .= '<br/><br/>Error list:';
for ( $i = 0; $i < count($error_sql); $i++ )
{
$msg .= '<br />SQL Error: ' . $error_msg[$i]['code'] . ' ' . $error_msg[$i]['message'] . '<br />SQL Query: ' . $error_sql[$i] . '<br />';
}
}
message_die( ( $error ) ? GENERAL_ERROR : GENERAL_MESSAGE, $msg);
?>
Create in /images/ directory called sotw, and get there this image. (Or you want to display as a signature of the week)
And now to modify a few files.
Open:
forum.php
Search:
After Add:
'L_SOTW' => $lang['sotw_title'],
'SOTW_IMG' => $board_config['sotw_image'],
'SOTW_DESC' => $board_config['sotw_desc'],
'SOTW_IMG' => $board_config['sotw_image'],
'SOTW_DESC' => $board_config['sotw_desc'],
Open:
adm/admin_board.php
Search:
$new['sitename'] = str_replace('"', '"', strip_tags($new['sitename']));
After Add:
$new['sotw_desc'] = str_replace('"', '"', strip_tags($new['sotw_desc']));
Search:
After Add:
'L_SOTW_DESC' => $lang['sotw_desc'],
'L_SOTW_DESC_EXPLAIN' => $lang['sotw_desc_explain'],
'L_SOTW_IMG' => $lang['sotw_img'],
'L_SOTW_IMG_EXPLAIN' => $lang['sotw_img_explain'],
'L_SOTW_DESC_EXPLAIN' => $lang['sotw_desc_explain'],
'L_SOTW_IMG' => $lang['sotw_img'],
'L_SOTW_IMG_EXPLAIN' => $lang['sotw_img_explain'],
Search:
After Add:
'SOTW_SETTING_DESC' => $new['sotw_desc'],
'SOTW_SETTING' => $new['sotw_image'],
'SOTW_SETTING' => $new['sotw_image'],
Open:
language/lang_xxxxxxx/lang_admin.php
Search:
//
// That's all Folks!
// -------------------------------------------------
// That's all Folks!
// -------------------------------------------------
Before Add:
$lang['sotw_desc'] = 'SOTW description';
$lang['sotw_desc_explain'] = 'Small description to describe this week's SOTW';
$lang['sotw_img'] = 'Path to SOTW image';
$lang['sotw_img_explain'] = 'Path to the image can either be relative to the forum directory or an absolute path linking offsite.';
$lang['sotw_desc_explain'] = 'Small description to describe this week's SOTW';
$lang['sotw_img'] = 'Path to SOTW image';
$lang['sotw_img_explain'] = 'Path to the image can either be relative to the forum directory or an absolute path linking offsite.';
Open:
language/lang_xxxxxxx/lang_main.php
Search:
Before Add:
Open:
templates/mg_themes/index_body.tpl
Search:
<div class="center-block" style="text-align:center;margin:30px;">
<table class="forumlinenb" style="padding:2px;" width="100%" cellspacing="0" cellpadding="2">
<tr>
<table class="forumlinenb" style="padding:2px;" width="100%" cellspacing="0" cellpadding="2">
<tr>
Before Add:
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><span class="cattitle">{L_SOTW}</a></span></td>
</tr>
<tr>
<td class="row1" align="left"><span class="gensmall">{SOTW_DESC}</span></td>
</tr>
<tr>
<td class="row1" align="left"><img src="{SOTW_IMG}" alt="{L_SOTW}" /></td>
</tr>
</table>
<tr>
<td class="catHead" height="28"><span class="cattitle">{L_SOTW}</a></span></td>
</tr>
<tr>
<td class="row1" align="left"><span class="gensmall">{SOTW_DESC}</span></td>
</tr>
<tr>
<td class="row1" align="left"><img src="{SOTW_IMG}" alt="{L_SOTW}" /></td>
</tr>
</table>
Open:
templates/common/ACP/board_config_body.tpl
Search:
<tr>
<td class="row1">{L_DEFAULT_STYLE}</td>
<td class="row2">{STYLE_SELECT}</td>
</tr>
<td class="row1">{L_DEFAULT_STYLE}</td>
<td class="row2">{STYLE_SELECT}</td>
</tr>
Before Add:
<tr>
<td class="row1">{L_SOTW_DESC}<br /><span class="gensmall">{L_SOTW_DESC_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="40" maxlength="255" name="sotw_desc" value="{SOTW_SETTING_DESC}" /></td>
</tr>
<tr>
<td class="row1">{L_SOTW_IMG}<br /><span class="gensmall">{L_SOTW_IMG_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="40" maxlength="255" name="sotw_image" value="{SOTW_SETTING}" /></td>
</tr>
<td class="row1">{L_SOTW_DESC}<br /><span class="gensmall">{L_SOTW_DESC_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="40" maxlength="255" name="sotw_desc" value="{SOTW_SETTING_DESC}" /></td>
</tr>
<tr>
<td class="row1">{L_SOTW_IMG}<br /><span class="gensmall">{L_SOTW_IMG_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="40" maxlength="255" name="sotw_image" value="{SOTW_SETTING}" /></td>
</tr>
That's all folks!
I hope you serve.
Bye
Creator of the mod -> DooBDee
Adapted to Icy Phoenix by -> Salcedaka