sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not query Intro + Portal configuration !
RUN intro_portal_mod_db_install.php AND DELETE IT AFTER THAT AND CHECK THE FILES TO EDIT !!!
Fehler beim Abfragen der Intro + Portal Konfiguration !
FÜHRE DIE intro_portal_mod_db_install.php AUS UND LÖSCHE SIE DANACH UND ÜBERPRÜFE DIE ZU EDITIERENDEN DATEIEN !!!
HTH AWSW', '', __LINE__, __FILE__, $sql);
}
// DATABASE CHANGES MADE ? END
// LOAD THE APPROPRIATE INTROPORTAL LANGUAGE FILE START
if( isset($HTTP_GET_VARS['mode']) )
{
switch( $HTTP_GET_VARS['mode'] )
{
default:
$lang_file = 'lang_introportal';
$l_title = $lang['introportal'];
break;
}
}
else
{
$lang_file = 'lang_introportal';
$l_title = $lang['introportal'];
}
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx);
// LOAD THE APPROPRIATE INTROPORTAL LANGUAGE FILE END
// OUTPUT PAGE HEADER START
define('SHOW_ONLINE', true);
$page_title = $lang['IntroPortalMOD1'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
// OUTPUT PAGE HEADER END
// IS THE MOD DISABLED START
if( $introportalmod_config['introportalmod_disable'] == "1" || $introportalmod_config['intro_disable'] == "1" )
{
message_die(GENERAL_MESSAGE, $introportalmod_config['intro_disable_msg'] , 'Information');
}
// IS THE MOD DISABLED END
// CHECK FOR ANONYMOUS USER START
if ($userdata['user_id'] != '-1')
{
$name_link = $userdata['username'];
}
else
{
$name_link = $lang['Guest'];
}
// CHECK FOR ANONYMOUS USER END
// TEMPLATE VARS START
$template->assign_vars(array(
'FORUM_ID' => $forum_id,
'FORUM_NAME' => $forum_row['forum_name'],
'MODERATORS' => $forum_moderators,
'POST_IMG' => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'],
'FOLDER_IMG' => $images['folder'],
'FOLDER_NEW_IMG' => $images['folder_new'],
'FOLDER_HOT_IMG' => $images['folder_hot'],
'FOLDER_HOT_NEW_IMG' => $images['folder_hot_new'],
'FOLDER_LOCKED_IMG' => $images['folder_locked'],
'FOLDER_LOCKED_NEW_IMG' => $images['folder_locked_new'],
'FOLDER_STICKY_IMG' => $images['folder_sticky'],
'FOLDER_STICKY_NEW_IMG' => $images['folder_sticky_new'],
'FOLDER_ANNOUNCE_IMG' => $images['folder_announce'],
'FOLDER_ANNOUNCE_NEW_IMG' => $images['folder_announce_new'],
'IntroPortaltext1' => $lang['IntroPortaltext1'],
'IntroPortaltext2' => $lang['IntroPortaltext2'],
'IntroPortaltext3' => $lang['IntroPortaltext3'],
'IntroPortaltext4' => $lang['IntroPortaltext4'],
'IntroPortaltext5' => $lang['IntroPortaltext5'],
'IntroPortaltext6' => $lang['IntroPortaltext6'],
'IntroPortaltext7' => $lang['IntroPortaltext7'],
'IntroPortaltext8' => $lang['IntroPortaltext8'],
'IntroPortaltext9' => $lang['IntroPortaltext9'],
'IntroPortaltext10' => $lang['IntroPortaltext10'],
'IntroPortaltext11' => $lang['IntroPortaltext11'],
'IntroPortaltext12' => $lang['IntroPortaltext12'],
'IntroPortaltext13' => $lang['IntroPortaltext13'],
'IntroPortaltext14' => $lang['IntroPortaltext14'],
'IntroPortaltext15' => $lang['IntroPortaltext15'],
'IntroPortaltext16' => $lang['IntroPortaltext16'],
'IntroPortaltext17' => $lang['IntroPortaltext17'],
'IntroPortaltext18' => $lang['IntroPortaltext18'],
'IntroPortaltext19' => $lang['IntroPortaltext19'],
'IntroPortaltext20' => $lang['IntroPortaltext20'],
'IntroPortaltext21' => $lang['IntroPortaltext21'],
'IntroPortaltext22' => $lang['IntroPortaltext22'],
'IntroPortaltext23' => $lang['IntroPortaltext23'],
'IntroPortaltext24' => $lang['IntroPortaltext24'],
'IntroPortaltext25' => $lang['IntroPortaltext25'],
'IntroPortaltext26' => $lang['IntroPortaltext26'],
'INTRO_PORTAL_VERSION' => $introportalmod_config['modversion'],
'L_EMAIL' => $lang['Email'],
'L_FORUM' => $lang['Forum'],
'L_PM' => $lang['Private_Message'],
'L_WEBSITE' => $lang['Website'],
'L_SEND_PASSWORD' => $lang['Forgotten_password'],
'U_SEND_PASSWORD' => append_sid("profile.$phpEx?mode=sendpassword"),
'L_TOPICS' => $lang['Topics'],
'L_REPLIES' => $lang['Replies'],
'L_VIEWS' => $lang['Views'],
'L_POSTS' => $lang['Posts'],
'L_LASTPOST' => $lang['Last_Post'],
'L_MODERATOR' => $l_moderators,
'L_MARK_TOPICS_READ' => $lang['Mark_all_topics'],
'L_POST_NEW_TOPIC' => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'],
'L_NO_NEW_POSTS' => $lang['No_new_posts'],
'L_NEW_POSTS' => $lang['New_posts'],
'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
'L_NO_NEW_POSTS_HOT' => $lang['No_new_posts_hot'],
'L_NEW_POSTS_HOT' => $lang['New_posts_hot'],
'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
'L_STICKY' => $lang['Post_Sticky'],
'L_POSTED' => $lang['Posted'],
'L_JOINED' => $lang['Joined'],
'L_AUTHOR' => $lang['Author'],
'U_NAME_LINK' => $name_link,
'U_SEND_PASSWORD' => append_sid("profile.$phpEx?mode=sendpassword"),
'AVATAR_IMG' => $avatar_img,
'S_AUTH_LIST' => $s_auth_can,
'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id"),
'U_MARK_READ' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&mark=topics"))
);
// TEMPLATE VARS END
// LAST TOPICS START
if( $introportalmod_config['introlasttopics_active'] == "1" )
{
$length = $introportalmod_config['lasttopics_length_intro'];
$limit = $introportalmod_config['introlasttopics_limit'];
$sql = "SELECT post_id FROM " . POSTS_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql);
}
$recent_ids = array();
while( $row = $db->sql_fetchrow($result) )
{
$recent_ids[] = $row['post_id'];
}
$db->sql_freeresult($result);
$recent_forum = ( isset($HTTP_POST_VARS['forum']) ) ? intval($HTTP_POST_VARS['forum']) : -1;
if ( $recent_forum == -1 )
{
$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
$ignore_forum_sql = '';
while( list($key, $value) = each($is_auth_ary) )
{
if ( !$value['auth_read'] )
{
$ignore_forum_sql .= ( ( $ignore_forum_sql != '' ) ? ', ' : '' ) . $key;
}
}
if ( $ignore_forum_sql != '' )
{
$auth_sql .= ( $auth_sql != '' ) ? " AND f.forum_id NOT IN ($ignore_forum_sql) " : "f.forum_id NOT IN ($ignore_forum_sql) ";
}
}
if ( $recent_author == '' && $auth_sql == '' )
{
$sql = "SELECT topic_id FROM " . POSTS_TABLE . "
WHERE post_id IN (" . implode(", ", $recent_ids) . ")
$where_sql GROUP BY topic_id";
}
else
{
$from_sql = POSTS_TABLE . " p";
if ( $auth_sql != '' )
{
$from_sql .= ", " . FORUMS_TABLE . " f";
$where_sql .= " AND f.forum_id = p.forum_id AND $auth_sql";
}
$sql = "SELECT p.topic_id FROM $from_sql
WHERE p.post_id IN (" . implode(", ", $recent_ids) . ")
$where_sql GROUP BY p.topic_id";
}
if ( !($result = $db->sql_query($sql)) )
{
// message_die(GENERAL_ERROR, 'Could not obtain topic ids', '', __LINE__, __FILE__, $sql);
}
$recent_ids = array();
while( $row = $db->sql_fetchrow($result) )
{
$recent_ids[] = $row['topic_id'];
}
$db->sql_freeresult($result);
$auth_results = implode(', ', $recent_ids);
$sql = "SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
FROM ". TOPICS_TABLE ." t, ". FORUMS_TABLE ." f, ". USERS_TABLE ." u, ". POSTS_TABLE ." p, ". POSTS_TABLE ." p2, ". USERS_TABLE ." u2
WHERE t.topic_id IN ($auth_results)
AND t.topic_poster = u.user_id
AND f.forum_id = t.forum_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND u2.user_id = p2.poster_id
ORDER BY t.topic_last_post_id DESC LIMIT $limit";
if ( !$result = $db->sql_query($sql) )
{
// message_die(GENERAL_ERROR, 'Could not obtain main information', '', __LINE__, __FILE__, $sql);
}
$line = array();
while( $row = $db->sql_fetchrow($result) )
{
$line[] = $row;
}
$db->sql_freeresult($result);
$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();
for($i = 0; $i < count($line); $i++)
{
$forum_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $line[$i]['forum_id']);
$forum_id = $line[$i]['forum_id'];
$topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $line[$i]['topic_id']);
$topic_id = $line[$i]['topic_id'];
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
$word_censor = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $line[$i]['topic_title']) : $line[$i]['topic_title'];
$topic_title = ( strlen($line[$i]['topic_title']) < $length ) ? $word_censor : substr(stripslashes($word_censor), 0, $length) . "...";
$topic_type = ( $line[$i]['topic_type'] == POST_GLOBAL_ANNOUNCE ) ? $lang['Topic_global_announcement'] .' ': '';
$topic_type .= ( $line[$i]['topic_type'] == POST_ANNOUNCE ) ? $lang['Topic_Announcement'] .' ': '';
$topic_type .= ( $line[$i]['topic_type'] == POST_STICKY ) ? $lang['Topic_Sticky'] .' ': '';
$topic_type .= ( $line[$i]['topic_vote'] ) ? $lang['Topic_Poll'] .' ': '';
$views = $line[$i]['topic_views'];
$replies = $line[$i]['topic_replies'];
if ( ( $replies + 1 ) > $board_config['posts_per_page'] )
{
$total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] );
$goto_page = ' [ ';
$times = 1;
for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
{
$goto_page .= '' . $times . '';
if ( $times == 1 && $total_pages > 4 )
{
$goto_page .= ' ... ';
$times = $total_pages - 3;
$j += ( $total_pages - 4 ) * $board_config['posts_per_page'];
}
else if ( $times < $total_pages )
{
$goto_page .= ', ';
}
$times++;
}
$goto_page .= ' ] ';
}
else
{
$goto_page = '';
}
if ( $line[$i]['topic_status'] == TOPIC_LOCKED )
{
$folder = $images['folder_locked'];
$folder_new = $images['folder_locked_new'];
}
else if( $line[$i]['topic_type'] == POST_GLOBAL_ANNOUNCE )
{
$folder = $images['folder_global_announce'];
$folder_new = $images['folder_global_announce_new'];
}
else if ( $line[$i]['topic_type'] == POST_ANNOUNCE )
{
$folder = $images['folder_announce'];
$folder_new = $images['folder_announce_new'];
}
else if ( $line[$i]['topic_type'] == POST_STICKY )
{
$folder = $images['folder_sticky'];
$folder_new = $images['folder_sticky_new'];
}
else
{
if ( $replies >= $board_config['hot_threshold'] )
{
$folder = $images['folder_hot'];
$folder_new = $images['folder_hot_new'];
}
else
{
$folder = $images['folder'];
$folder_new = $images['folder_new'];
}
}
if ( $userdata['session_logged_in'] )
{
if ( $line[$i]['post_time'] > $userdata['user_lastvisit'] )
{
if ( !empty($tracking_topics) || !empty($tracking_forums) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
{
$unread_topics = true;
if ( !empty($tracking_topics[$topic_id]) )
{
if ( $tracking_topics[$topic_id] > $line[$i]['post_time'] )
{
$unread_topics = false;
}
}
if ( !empty($tracking_forums[$forum_id]) )
{
if ( $tracking_forums[$forum_id] > $line[$i]['post_time'] )
{
$unread_topics = false;
}
}
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
{
if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $line[$i]['post_time'] )
{
$unread_topics = false;
}
}
if ( $unread_topics )
{
$folder_image = $folder_new;
$folder_alt = $lang['New_posts'];
$newest_img = '
';
}
else
{
$folder_alt = ( $line[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
$folder_image = $folder;
$folder_alt = $folder_alt;
$newest_img = '';
}
}
else if ( $line[$i]['post_time'] > $userdata['user_lastvisit'] )
{
$folder_image = $folder_new;
$folder_alt = $lang['New_posts'];
$newest_img = '
';
}
else
{
$folder_image = $folder;
$folder_alt = ( $line[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
$newest_img = '';
}
}
else
{
$folder_image = $folder;
$folder_alt = ( $line[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
$newest_img = '';
}
}
else
{
$folder_image = $folder;
$folder_alt = ( $line[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];
$newest_img = '';
}
$first_time = create_date($board_config['default_dateformat'], $line[$i]['topic_time'], $board_config['board_timezone']);
$first_author = ( $line[$i]['user_id'] != ANONYMOUS ) ? ''.$line[$i]['username'].'' : ( ($line[$i]['post_username'] != '' ) ? $line[$i]['post_username'] : $lang['Guest'] );
$last_time = create_date($board_config['default_dateformat'], $line[$i]['post_time'], $board_config['board_timezone']);
$last_author = ( $line[$i]['id2'] == ANONYMOUS ) ? ( ($line[$i]['post_username2'] != '' ) ? $line[$i]['post_username2'] . ' ' : $lang['Guest'] . ' ' ) : '' . $line[$i]['user2'] . '';
$last_url = '
';
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars('recent', array(
'TOPIC_TITLE' => $topic_title,
'TOPIC_TYPE' => $topic_type,
'VIEWS' => $views,
'REPLIES' => $replies,
'GOTO_PAGE' => $goto_page,
'TOPIC_FOLDER_IMG' => $folder_image,
'NEWEST_IMG' => $newest_img,
'FIRST_TIME' => $first_time,
'FIRST_AUTHOR' => $first_author,
'LAST_TIME' => $last_time,
'LAST_AUTHOR' => $last_author,
'LAST_URL' => $last_url,
'ROW_CLASS' => $row_class,
'L_BY' => $lang['by'],
'L_STARTED' => $lang['Started'],
'L_REPLIES' => $lang['Replies'],
'L_VIEWS' => $lang['Views'],
'FORUM_NAME' => $line[$i]['forum_name'],
'U_VIEW_FORUM' => $forum_url,
'FORUM_ID' => $forum_id,
'U_VIEW_TOPIC' => $topic_url,
'TOPIC_ID' => $topic_id
));
}
$template->assign_vars(array(
'L_RECENT_TITLE' => $lang['Title']
));
$template->assign_block_vars('switch_lasttopics_active', array());
}
// LAST TOPICS END
$template->set_filenames(array(
'body' => 'intro_body.tpl')
);
// MAIN PART AND FOOTER START
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
// MAIN PART AND FOOTER END
?>