- Adres van je forum: http://ea.chosen5.nl
Event. modificaties op je forum:
Wanneer ontstond het probleem? Na Installatie
phpBB versie: 2.0.22
Heb je onlangs iets verandert aan je forum? Neen
Wat is het probleem?
..
Code: Selecteer alles
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Enduring Allegiance</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header">
</div>
<div id="menu">
<ul>
<li><a href="?p=news" accesskey="1" title="">News</a></li>
<li><a target=_blank href="/forums/" accesskey="2" title="">Forums</a></li>
<li><a href="?p=wss" accesskey="3" title="">WSS</a></li>
<li><a href="?p=dkp" accesskey="4" title="">DKP</a></li>
<li><a href="?p=contact" accesskey="5" title="">Contact</a></li>
</ul>
</div>
<div id="content">
<center>
<BR>
<?php
$parameter = 'p';
$standaardPagina = 'news.php';
$foutPagina = 'error.php';
$pagina = isset($_GET[$parameter]) ? $_GET[$parameter] . '.php' : $standaardPagina;
include file_exists($pagina) ? $pagina : $foutPagina;
?>
</center>
<div style="clear: both;"> </div>
</div>
<div id="footer">
<B><center>Copyright Enduring Allegiance 2007 - Design by Darkstylo</center></B>
</div>
</body>
</html>
Code: Selecteer alles
<?php
/***************************************************************************
* news_portal.php
* -------------------
* begin : Saturday, November 06, 2004
* copyright : (C) 2004 Oxpus
* email : webmaster@oxpus.de
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
/***************************************************************************
*
* Some code in this file I borrowed from the original portal.php by Smartor!
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = 'forums/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
// Read Portal Configuration from DB
define('NEWS_PAGE_TABLE', $table_prefix.'news_portal');
$CFG = array();
$sql = "SELECT * FROM " . NEWS_PAGE_TABLE;
if( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
$CFG[$row['news_page']] = $row['news_value'];
}
// Option censored words
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
// Start output of page
$template->set_filenames(array('body' => 'news_portal_body.tpl'));
$page_title = $lang['News_portal'];
include($phpbb_root_path . 'includes/test.'.$phpEx);
$template->assign_vars(array(
'L_BOARD_NAVIGATION' => $lang['Board_navigation'],
'L_SEARCH' => $lang['Search'],
'L_COMMENTS' => $lang['Comments'],
'L_VIEW_COMMENTS' => $lang['View_comments'],
'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
'L_POSTED' => $lang['Time'],
'L_FORUM' => $lang['Forum'],
'L_NEWS' => $lang[$page_title],
'WIDTH_LEFT_COLUMN' => $CFG['width_left_column'],
'WIDTH_MIDDLE_COLUMN' => $CFG['width_middle_column'],
'WIDTH_RIGHT_COLUMN' => $CFG['width_right_column'])
);
// Set function for news
function phpbb_fetch_posts($forum_id, $number_of_posts, $sorting_order)
{
global $db, $board_config;
$sql = 'SELECT
t.topic_id,
t.topic_time,
t.topic_title,
pt.post_text,
u.username,
u.user_id,
t.topic_replies,
pt.bbcode_uid,
t.forum_id,
t.topic_poster,
t.topic_first_post_id,
t.topic_status,
pt.post_id,
p.post_id,
p.enable_smilies
FROM
' . TOPICS_TABLE . ' AS t,
' . USERS_TABLE . ' AS u,
' . POSTS_TEXT_TABLE . ' AS pt,
' . POSTS_TABLE . ' AS p
WHERE
t.forum_id = ' . $forum_id . ' AND
t.topic_time <= ' . time() . ' AND
t.topic_poster = u.user_id AND
t.topic_first_post_id = pt.post_id AND
t.topic_first_post_id = p.post_id AND
t.topic_status <> 2
ORDER BY
t.topic_time '.$sorting_order;
if ($number_of_posts != 0)
{
$sql .= ' LIMIT ' . $number_of_posts;
}
if(!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not query news information', '', __LINE__, __FILE__, $sql);
}
$posts = array();
if ($row = $db->sql_fetchrow($result))
{
$i = 0;
do
{
$posts[$i]['bbcode_uid'] = $row['bbcode_uid'];
$posts[$i]['enable_smilies'] = $row['enable_smilies'];
$posts[$i]['post_text'] = $row['post_text'];
$posts[$i]['topic_id'] = $row['topic_id'];
$posts[$i]['topic_replies'] = $row['topic_replies'];
$posts[$i]['topic_time'] = create_date($board_config['default_dateformat'], $row['topic_time'], $board_config['board_timezone']);
$posts[$i]['topic_title'] = $row['topic_title'];
$posts[$i]['user_id'] = $row['user_id'];
$posts[$i]['username'] = $row['username'];
$posts[$i]['post_id'] = $row['post_id'];
stripslashes($posts[$i]['post_text']);
if ($posts[$i]['enable_smilies'] == 1)
{
$posts[$i]['post_text'] = smilies_pass($posts[$i]['post_text']);
}
$posts[$i]['post_text'] = bbencode_second_pass($posts[$i]['post_text'], $posts[$i]['bbcode_uid']);
$posts[$i]['post_text'] = make_clickable($posts[$i]['post_text']);
$posts[$i]['post_text'] = str_replace("\n", "\n<br />\n", $posts[$i]['post_text']);
$i++;
}
while ($row = $db->sql_fetchrow($result));
}
return $posts;
}
// End function block
// Fetch Posts from News Forums
$fetchposts_left = phpbb_fetch_posts($CFG['news_left'], $CFG['number_of_news_left'], $CFG['news_sort_left']);
for ($i = 0; $i < count($fetchposts_left); $i++)
{
if (count($orig_word))
{
$fetchposts_left[$i]['topic_title'] = preg_replace($orig_word, $replacement_word, $fetchposts_left[$i]['topic_title']);
$fetchposts_left[$i]['post_text'] = preg_replace($orig_word, $replacement_word, $fetchposts_left[$i]['post_text']);
}
$template->assign_block_vars('news_left_row', array(
'TITLE' => $fetchposts_left[$i]['topic_title'],
'POSTER' => $fetchposts_left[$i]['username'],
'TIME' => $fetchposts_left[$i]['topic_time'],
'TEXT' => $fetchposts_left[$i]['post_text'],
'REPLIES' => $fetchposts_left[$i]['topic_replies'],
'U_VIEW_COMMENTS' => append_sid($phpbb_root_path . 'viewtopic.' . $phpEx . '?t=' . $fetchposts_left[$i]['topic_id']),
'U_POST_COMMENT' => append_sid($phpbb_root_path . 'posting.' . $phpEx . '?mode=reply&t=' . $fetchposts_left[$i]['topic_id']),
'U_READ_FULL' => append_sid($phpbb_root_path . 'news_portal.' . $phpEx . '?article=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket)
);
}
$fetchposts_right = phpbb_fetch_posts($CFG['news_right'], $CFG['number_of_news_right'], $CFG['news_sort_right']);
for ($i = 0; $i < count($fetchposts_right); $i++)
{
if (count($orig_word))
{
$fetchposts_right[$i]['topic_title'] = preg_replace($orig_word, $replacement_word, $fetchposts_right[$i]['topic_title']);
$fetchposts_right[$i]['post_text'] = preg_replace($orig_word, $replacement_word, $fetchposts_right[$i]['post_text']);
}
$template->assign_block_vars('news_right_row', array(
'TITLE' => $fetchposts_right[$i]['topic_title'],
'POSTER' => $fetchposts_right[$i]['username'],
'TIME' => $fetchposts_right[$i]['topic_time'],
'TEXT' => $fetchposts_right[$i]['post_text'],
'REPLIES' => $fetchposts_right[$i]['topic_replies'],
'U_VIEW_COMMENTS' => append_sid($phpbb_root_path . 'viewtopic.' . $phpEx . '?t=' . $fetchposts_right[$i]['topic_id']),
'U_POST_COMMENT' => append_sid($phpbb_root_path . 'posting.' . $phpEx . '?mode=reply&t=' . $fetchposts_right[$i]['topic_id']),
'U_READ_FULL' => append_sid($phpbb_root_path . 'news_portal.' . $phpEx . '?article=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket)
);
}
$fetchposts_middle = phpbb_fetch_posts($CFG['news_middle'], $CFG['number_of_news_middle'], $CFG['news_sort_middle']);
for ($i = 0; $i < count($fetchposts_middle); $i++)
{
if (count($orig_word))
{
$fetchposts_middle[$i]['topic_title'] = preg_replace($orig_word, $replacement_word, $fetchposts_middle[$i]['topic_title']);
$fetchposts_middle[$i]['post_text'] = preg_replace($orig_word, $replacement_word, $fetchposts_middle[$i]['post_text']);
}
$template->assign_block_vars('news_middle_row', array(
'TITLE' => $fetchposts_middle[$i]['topic_title'],
'POSTER' => $fetchposts_middle[$i]['username'],
'TIME' => $fetchposts_middle[$i]['topic_time'],
'TEXT' => $fetchposts_middle[$i]['post_text'],
'REPLIES' => $fetchposts_middle[$i]['topic_replies'],
'U_VIEW_COMMENTS' => append_sid($phpbb_root_path . 'viewtopic.' . $phpEx . '?t=' . $fetchposts_middle[$i]['topic_id']),
'U_POST_COMMENT' => append_sid($phpbb_root_path . 'posting.' . $phpEx . '?mode=reply&t=' . $fetchposts_middle[$i]['topic_id']),
'U_READ_FULL' => append_sid($phpbb_root_path . 'news_portal.' . $phpEx . '?article=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket)
);
}
//
// Recent Topics
//
if ($CFG['recent_topics'])
{
$template->assign_block_vars('recent_topics_'.$CFG['pos_recent_topic'], array(
'L_RECENT_TOPICS' => $lang['Recent_topics'])
);
$sql = "SELECT * FROM ". FORUMS_TABLE . " ORDER BY forum_id";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_data[] = $row;
}
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);
$except_forum_id = '\'start\'';
for ($i = 0; $i < count($forum_data); $i++)
{
if ((!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_read']) or (!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']))
{
if ($except_forum_id == '\'start\'')
{
$except_forum_id = $forum_data[$i]['forum_id'];
}
else
{
$except_forum_id .= ',' . $forum_data[$i]['forum_id'];
}
}
}
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_username, p.post_time, u.user_id, u.username
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
WHERE t.forum_id NOT IN (" . $except_forum_id . ")
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
ORDER BY p.post_id DESC
LIMIT " . $CFG['number_recent_topics'];
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
$number_recent_topics = $db->sql_numrows($result);
$recent_topic_row = array();
while ($row = $db->sql_fetchrow($result))
{
$recent_topic_row[] = $row;
}
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
for ($i = 0; $i < $number_recent_topics; $i++)
{
$recent_topic = $recent_topic_row[$i]['topic_title'];
if ( count($orig_word) )
{
$recent_topic = preg_replace($orig_word, $replacement_word, $recent_topic);
}
$template->assign_block_vars('recent_topics_'.$CFG['pos_recent_topic'].'.recent_topic_row', array(
'AUTHOR' => $recent_topic_row[$i]['username'],
'U_TITLE' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#' .$recent_topic_row[$i]['post_id'],
'L_TITLE' => ( strlen($recent_topic) >= 31 ) ? substr($recent_topic, 0, 31).'...' : $recent_topic)
);
}
}
// END Recent Topics
//
// Recent Pics
//
if ($CFG['recent_pic'] && $userdata['user_id'] != ANONYMOUS)
{
$template->assign_block_vars('recent_pic_'.$CFG['pos_recent_pic'], array(
'L_RECENT_PIC' => $lang['Recent_Pic'])
);
$sql = "SELECT pic_id, pic_title, pic_username, pic_time FROM " . ALBUM_TABLE . "
WHERE pic_cat_id <> 0
AND pic_approval <> 0
ORDER BY pic_id DESC
LIMIT 1";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query album information', '', __LINE__, __FILE__, $sql);
}
$picrow = $db->sql_fetchrow($result);
$template->assign_block_vars('recent_pic_'.$CFG['pos_recent_pic'].'.recent_picrow', array(
'PIC_IMAGE' => append_sid('album_thumbnail.'. $phpEx . '?pic_id=' . $picrow['pic_id']),
'PIC_POSTER' => $picrow['pic_username'],
'U_PIC_LINK' => append_sid('album_page.' . $phpEx . '?pic_id=' . $picrow['pic_id']))
);
}
// END Recent Pics
// Generate the page
$template->pparse('body');
// include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>