Unofficial modifications
nieoficjalne modyfikacje for?w phpBB by Przemo

Foreign support - Forums Sections Ignore ver. 1.0

kidzior - Pon 30 Kwi, 2007
Temat postu: Forums Sections Ignore ver. 1.0
Modification made by qbs
http://mody.lastinn.info/...m_v10-t350.html

Translated by kidzior http://www.niezal.org

Modification allows You to ignore forum sections.

Wiadomo?? ukryta / Hidden message
Aby zobaczy? wiadomo?? postaw piwo autorowi piwo.
SQL:
Kod
CREATE TABLE `phpbb_forums_ignore` (
`user_id` INT( 12 ) NOT NULL ,
`forum_id` INT( 6 ) NOT NULL
);


--- [ OPEN ] -------

includes/read_history.php

--- [ FIND ] -------

function user_unread_posts()

--- [ BEFORE, ADD ] -------

function ignored_forums()
{
global $db, $userdata, $table_prefix;
if ( !$userdata['session_logged_in'] ) return array();
$ignored_forums = array();
$sql = "SELECT forum_id
FROM " . $table_prefix . "forums_ignore
WHERE user_id = " . intval($userdata['user_id']);
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain ignored forums', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$ignored_forums[] = $row['forum_id'];
}
return $ignored_forums;
}

--- [ FIND ] -------

$userdata['unread_data'] = $no_auth_forums = $remove_from_forums = array();

--- [ AFTER, ADD ] -------

$ignored_forums = ignored_forums();

--- [ FIND ] -------

while( $row = $db->sql_fetchrow($result) )
{
if ( !in_array($row['forum_id'], $no_auth_forums) )
{
$userdata['unread_data'][$row['forum_id']][$row['topic_id']][] = $row['post_id'];
}

--- [ REPLACE ] -------

while( $row = $db->sql_fetchrow($result) )
{
if ( @in_array($row['forum_id'], $ignored_forums) )
{
$remove_from_forums[] = $row['forum_id'];
continue;
}
if ( !in_array($row['forum_id'], $no_auth_forums) )
{
$userdata['unread_data'][$row['forum_id']][$row['topic_id']][] = $row['post_id'];
}


##################################################################


--- [ OPEN ] -------

includes/page_header.php

--- [ FIND ] -------

'COOKIE_SECURE' => $board_config['cookie_secure'],

--- [ AFTER, ADD ] -------

'U_FORUMS_IGNORE' => ( $userdata['session_logged_in'] ) ? '<a href="' . append_sid("forums_ignore.$phpEx") . '" class="gensmall">' . $lang['forums_ignore'] . '</a>' : '',



--- [ OPEN ] -------

language/lang_polish/lang_main.php

--- [ FIND ] -------

//
// That's all Folks!
// -------------------------------------------------

--- [ BEFORE, ADD ] -------

$lang['forums_ignore'] = 'Sections Ignore';


##################################################################


--- [ OPEN ] -------

templates/subSilver/index_body.tpl

--- [ FIND ] -------

<a href="{U_MARK_READ}" class="gensmall">{L_MARK_FORUMS_READ}</a>

--- [ REPLACE ] -------

<a href="{U_MARK_READ}" class="gensmall">{L_MARK_FORUMS_READ}</a><br />
<b>{U_FORUMS_IGNORE}</b>


Powered by phpBB modified by Przemo © 2003 phpBB Group