[Mod] Signature Of The Week »  Show posts from    to     

Icy Phoenix


Old Customizations - [Mod] Signature Of The Week



salcedaka [ Sun 16 Nov, 2008 12:12 ]
Post subject: [Mod] Signature Of The Week
Hello, looking for the network since I found this wonderful change that serves a lot of forums for graphic design.
The pattern that has to follow are these:

Up to the root of the forum file: db_update.php
Create file: db_update.php:
Code: [Hide] [Select]
<?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);
?>


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:
Code: [Hide] [Select]
'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'],


After Add:
Code: [Hide] [Select]
'L_SOTW' => $lang['sotw_title'],
'SOTW_IMG' => $board_config['sotw_image'],
'SOTW_DESC' => $board_config['sotw_desc'],


Open:

adm/admin_board.php

Search:
Code: [Hide] [Select]
$new['sitename'] = str_replace('"', '&quot;', strip_tags($new['sitename']));


After Add:
Code: [Hide] [Select]
$new['sotw_desc'] = str_replace('"', '&quot;', strip_tags($new['sotw_desc']));


Search:
Code: [Hide] [Select]
'L_SITE_DESCRIPTION' => $lang['Site_desc'],


After Add:
Code: [Hide] [Select]
'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'],


Search:
Code: [Hide] [Select]
'SITE_DESCRIPTION' => $new['site_desc'],


After Add:
Code: [Hide] [Select]
'SOTW_SETTING_DESC' => $new['sotw_desc'],
'SOTW_SETTING' => $new['sotw_image'],


Open:

language/lang_xxxxxxx/lang_admin.php

Search:
Code: [Hide] [Select]
//
// That's all Folks!
// -------------------------------------------------


Before Add:
Code: [Hide] [Select]
$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.';


Open:

language/lang_xxxxxxx/lang_main.php

Search:
Code: [Hide] [Select]
//$lang[''] = '';


Before Add:
Code: [Hide] [Select]
$lang['sotw_title'] = 'Signature Of The Week';


Open:

templates/mg_themes/index_body.tpl

Search:
Code: [Hide] [Select]
<div class="center-block" style="text-align:center;margin:30px;">
<table class="forumlinenb" style="padding:2px;" width="100%" cellspacing="0" cellpadding="2">
<tr>


Before Add:
Code: [Hide] [Select]
<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>


Open:

templates/common/acp/board_config_body.tpl

Search:
Code: [Hide] [Select]
<tr>
<td class="row1">{L_DEFAULT_STYLE}</td>
<td class="row2">{STYLE_SELECT}</td>
</tr>


Before Add:
Code: [Hide] [Select]
<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


Chaotic [ Mon 17 Nov, 2008 00:58 ]
Post subject: Re: [Mod] Signature Of The Week
Nice work. Do you happen to have a board using this MOD so we can see it in action?

Moving to Icy Phoenix Customizations.




Powered by Icy Phoenix