Wanneer je een forum hebt gemaakt welke als link fungeert wordt dit forum overal weergegeven, zoals gewoonlijk. Als je bijvoorbeeld op je forum index op het forum klikt word je doorgelinkt naar het betreffende web adres.
Onderaan viewtopic.php en viewforum.php staat een dropdown box, waarmee je naar ieder ander beschikbaar forum kan gaan. Wanneer je in deze dropdown klikt op een forum welke is ingeschakeld als forumlink kom je in een forum waar staat dat er geen berichten zijn. ik heb hier een kleine fix voor geschreven dat je alsnog doorgeschakeld wordt.
Code: Selecteer alles
##############################################################
## MOD Title: Forum Title as Web Link extension
## MOD Author: Flance < mail@jordibetting.nl > (Jordi Betting)
## MOD Description: A required extension of the 'Forum title as Web Link'-mod
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 1 Minutes
## Files To Edit: viewforum.php
## Included Files: N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
## 2005-10-08 - Version 1.0.0
## - first release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ FIND ]------------------------------------------
#
//
// Check if the user has actually sent a forum ID with his/her request
// If not give them a nice error page.
//
if ( !empty($forum_id) )
{
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}
}
else
{
message_die(GENERAL_MESSAGE, 'Forum_not_exist');
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Check if the forum id is a link
//
$sql = "SELECT forum_id
FROM " . FORUMS_TABLE . "
WHERE title_is_link = 1";
if ( !($link_result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forum link information', '', __LINE__, __FILE__, $sql);
}
$forum_links = array();
while($link_id = $db->sql_fetchrow($link_result)) {
$forum_links[] = $link_id[0];
}
if(in_array($forum_id, $forum_links)) {
ob_end_clean();
header('location: '.append_sid('index.php?f='.$forum_id.'&forum_link=1'));
print('<META HTTP-EQUIV=Refresh CONTENT="0; URL='. append_sid('index.php?f='.$forum_id.'&forum_link=1').'">');
exit;
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM