Код: Выделить всё
##############################################################
## MOD Title: Category link at navigation bar
## MOD Author: Xpert < xpert@phpbbguru.net > http://www.phpbbguru.net
## MOD Description: This mod can places category link at navigation bar
## on viewforum & viewtopic pages.
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit (4): viewtopic.php
## viewforum.php
## templates/subSilver/viewtopic_body.tpl
## templates/subSilver/viewforum_body.tpl
##
## Included Files (0): (n/a)
##############################################################
## 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. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbbguru.net/mods/
##############################################################
## Author Notes:
##
## You will get 2 matching strings at every template file - on at the top
## and one at the bottom at the page. Process them both.
##
##############################################################
## MOD History:
##
## 2004-07-25 - Version 1.2.0
## - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
viewforum.php
#
#-----[ FIND ]------------------------------------------
#
//
// End of auth check
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Getting current category info
//
$sql = "SELECT f.forum_id, f.cat_id, c.cat_id, c.cat_title
FROM " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
WHERE f.forum_id = $forum_id
AND c.cat_id = f.cat_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain category information", '', __LINE__, __FILE__, $sql);
}
$cat_data = $db->sql_fetchrow($result);
$cat_id = intval($cat_data['cat_id']);
$cat_title = $cat_data['cat_title'];
#
#-----[ FIND ]------------------------------------------
#
'FORUM_NAME' => $forum_name,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'CAT_TITLE' => $cat_title,
#
#-----[ FIND ]------------------------------------------
#
'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id"),
#
#-----[ AFTER, ADD ]------------------------------------------
#
'U_VIEW_CAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"),
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
//
// Is user watching this thread?
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// Getting current category info
//
$sql = "SELECT f.forum_id, f.cat_id, c.cat_id, c.cat_title
FROM " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
WHERE f.forum_id = $forum_id
AND c.cat_id = f.cat_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain category information", '', __LINE__, __FILE__, $sql);
}
$cat_data = $db->sql_fetchrow($result);
$cat_id = intval($cat_data['cat_id']);
$cat_title = $cat_data['cat_title'];
#
#-----[ FIND ]------------------------------------------
#
$view_next_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=next");
#
#-----[ AFTER, ADD ]------------------------------------------
#
$view_cat_url = append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id");
#
#-----[ FIND ]------------------------------------------
#
'FORUM_NAME' => $forum_name,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'CAT_TITLE' => $cat_title,
#
#-----[ FIND ]------------------------------------------
#
'U_VIEW_OLDER_TOPIC' => $view_prev_topic_url,
#
#-----[ BEFORE, ADD ]------------------------------------------
#
'U_VIEW_CAT' => $view_cat_url,
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------
#
-> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
-> <a class="nav" href="{U_VIEW_CAT}">{CAT_TITLE}</a>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
-> <a href="{U_VIEW_CAT}" class="nav">{CAT_TITLE}</a>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM