Moin Jungs
Will in meinem ez-Portal nen Counter reinbringen. Habe mich für diesen endschieden:
http://www.lerneniminternet.de/htm/tip_countdown-php.html
Problem ist, der macht gar nix....ich hab den mal ganz einfach so eingesetzt wie er da Beschrieben ist, also einfach nur kopiert NIX geändert. Das ez Portal funktioniert ansonsten auch, nur da wo der Counter eigentlich stehen soll steht nur das:
[Blockierte Grafik: http://img116.imageshack.us/img116/421/fuckingforumuv4.th.jpg]
Hier der Code aus der portal.php:
ZitatAlles anzeigen<?php
/***************************************************************************
* portal.php
* -------------------
* begin : Tuesday, August 13, 2002
* copyright : (C) 2002 Smartor
* email : smartor_xp@hotmail.com
*
* $Id: portal.php,v 2.1.7 2003/01/30, 17:05:58 Smartor Exp $
*
***************************************************************************//***************************************************************************
*
* 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 index.php, Welcome
* Avatar MOD and others...
*
***************************************************************************///
// Set configuration for ezPortal
//// Welcome Text: note that we are in PHP file, so use \' instead of ' and use \\ instead of \ (HTML enabled)
$CFG['welcome_text'] = '<center><h4>Willkommen bei computexx.de.am</h>
<?
// Silvester countdown
// stichtag 1.1.2007 als Unixtime erzeugen
$newDate = mktime(0,0,0, 1, 1, 2007);
// aktuelle Zeit im Unixformat erzeugen
$actDate = time();
// Differenz berechnen (in Sekunden)
$diffDate = ($newDate-$actDate);// Anzahl Tage = Sekunden /24/60/60
// floor() liefert nur den Anteil vor dem Komma
$days = floor($diffDate / 24 / 60 / 60 );
// den verbleibenden Rest berechnen = Stunden
$diffDate = $diffDate - ($days*24*60*60);
// den Stundenanteil herausrechnen
$hours = floor($diffDate / 60 / 60);
$diffDate = ($diffDate - ($hours*60*60));
// den Minutenanteil
$minutes = floor($diffDate/60);
$diffDate = $diffDate - ($minutes*60);
// die verbleibenden Sekunden
$seconds = floor($diffDate);// und das ganze dann Anzeigen:
echo "Noch: $days Tage, $hours Stunden, $minutes Minuten und $seconds Sekunden
";
?></center>';// Number of news on portal
$CFG['number_of_news'] = '3';// Length of news
$CFG['news_length'] = '200';// News Forum ID: separate by comma for multi-forums, eg. '1,2,5'
$CFG['news_forum'] = '5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,26,27,28';// Poll Forum ID: separate by comma for multi-forums, eg. '3,8,14'
$CFG['poll_forum'] = '25';//
// END configuration
// --------------------------------------------------------define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'fetchposts.'.$phpEx);//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
////
// If you don't use these stats on your index you may want to consider
// removing them
//
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$total_topics = get_db_stat('topiccount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];if( $total_posts == 0 )
{
$l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
$l_total_post_s = $lang['Posted_article_total'];
}
else
{
$l_total_post_s = $lang['Posted_articles_total'];
}if( $total_users == 0 )
{
$l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
$l_total_user_s = $lang['Registered_user_total'];
}
else
{
$l_total_user_s = $lang['Registered_users_total'];
}if( $userdata['session_logged_in'] )
{
$sql = "SELECT COUNT(post_id) as total
FROM " . POSTS_TABLE . "
WHERE post_time >= " . $userdata['user_lastvisit'];
$result = $db->sql_query($sql);
if( $result )
{
$row = $db->sql_fetchrow($result);
$lang['Search_new'] = $lang['Search_new'] . "(" . $row['total'] . ")";
}
}//
// Start output of page
//
define('SHOW_ONLINE', true);
$page_title = $lang['Home'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);$template->set_filenames(array(
'body' => 'portal_body.tpl')
);//
// Avatar On Index MOD
//
$avatar_img = '';
if ( $userdata['user_avatar_type'] && $userdata['user_allowavatar'] )
{
switch( $userdata['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$avatar_img = ( $board_config['allow_avatar_upload'] ) ? '' : '';
break;
case USER_AVATAR_REMOTE:
$avatar_img = ( $board_config['allow_avatar_remote'] ) ? '' : '';
break;
case USER_AVATAR_GALLERY:
$avatar_img = ( $board_config['allow_avatar_local'] ) ? '' : '';
break;
}
}
// Check For Anonymous User
if ($userdata['user_id'] != '-1')
{
$name_link = '[url='' . append_sid(']' . $userdata['username'] . '[/url]';
}
else
{
$name_link = $lang['Guest'];
}
//
// END: Avatar On Index MOD
//
$template->assign_vars(array(
'WELCOME_TEXT' => $CFG['welcome_text'],
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'TOTAL_TOPICS' => sprintf($lang['total_topics'], $total_topics),
'NEWEST_USER' => sprintf($lang['Newest_user'], '[url='' . append_sid(']', $newest_user, '[/url]'),
'L_FORUM' => $lang['Forum'],
'L_BOARD_NAVIGATION' => $lang['Board_navigation'],
'L_STATISTICS' => $lang['Statistics'],
'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
'L_POSTED' => $lang['Posted'],
'L_COMMENTS' => $lang['Comments'],
'L_VIEW_COMMENTS' => $lang['View_comments'],
'L_POST_COMMENT' => $lang['Post_your_comment'],
'L_SEND_PASSWORD' => $lang['Forgotten_password'],
'U_SEND_PASSWORD' => append_sid("profile.$phpEx?mode=sendpassword"),
'L_REGISTER_NEW_ACCOUNT' => sprintf($lang['Register_new_account'], '[url='' . append_sid(']', '[/url]'),
'L_REMEMBER_ME' => $lang['Remember_me'],
'L_VIEW_COMPLETE_LIST' => $lang['View_complete_list'],
'L_POLL' => $lang['Poll'],
'L_VOTE_BUTTON' => $lang['Vote'],// Welcome Avatar
'L_NAME_WELCOME' => $lang['Welcome'],
'U_NAME_LINK' => $name_link,
'AVATAR_IMG' => $avatar_img)
);//
// Fetch Posts from Announcements Forum
//
if(!isset($HTTP_GET_VARS['article']))
{
$template->assign_block_vars('welcome_text', array());$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], $CFG['news_length']);
for ($i = 0; $i < count($fetchposts); $i++)
{
if( $fetchposts[$i]['striped'] == 1 )
{
$open_bracket = '[ ';
$close_bracket = ' ]';
$read_full = $lang['Read_Full'];
}
else
{
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}$template->assign_block_vars('fetchpost_row', array(
'TITLE' => $fetchposts[$i]['topic_title'],
'POSTER' => $fetchposts[$i]['username'],
'TIME' => $fetchposts[$i]['topic_time'],
'TEXT' => $fetchposts[$i]['post_text'],
'REPLIES' => $fetchposts[$i]['topic_replies'],
'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&t=' . $fetchposts[$i]['topic_id']),
'U_READ_FULL' => append_sid('portal.' . $phpEx . '?article=' . $i),
'L_READ_FULL' => $read_full,
'OPEN' => $open_bracket,
'CLOSE' => $close_bracket)
);
}
}
else
{
$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], 0);$i = intval($HTTP_GET_VARS['article']);
$template->assign_block_vars('fetchpost_row', array(
'TITLE' => $fetchposts[$i]['topic_title'],
'POSTER' => $fetchposts[$i]['username'],
'TIME' => $fetchposts[$i]['topic_time'],
'TEXT' => $fetchposts[$i]['post_text'],
'REPLIES' => $fetchposts[$i]['topic_replies'],
'U_VIEW_COMMENTS' => append_sid('viewtopic.' . $phpEx . '?t=' . $fetchposts[$i]['topic_id']),
'U_POST_COMMENT' => append_sid('posting.' . $phpEx . '?mode=reply&t=' . $fetchposts[$i]['topic_id'])
)
);
}
//
// END: Fetch Announcements
////
// Fetch Poll
//
$fetchpoll = phpbb_fetch_poll($CFG['poll_forum']);if (!empty($fetchpoll))
{
$template->assign_vars(array(
'S_POLL_QUESTION' => $fetchpoll['vote_text'],
'S_POLL_ACTION' => append_sid('posting.'.$phpEx.'?'.POST_TOPIC_URL.'='.$fetchpoll['topic_id']),
'S_TOPIC_ID' => $fetchpoll['topic_id'],
'L_SUBMIT_VOTE' => $lang['Submit_vote'],
'L_LOGIN_TO_VOTE' => $lang['Login_to_vote']
)
);for ($i = 0; $i < count($fetchpoll['options']); $i++)
{
$template->assign_block_vars('poll_option_row', array(
'OPTION_ID' => $fetchpoll['options'][$i]['vote_option_id'],
'OPTION_TEXT' => $fetchpoll['options'][$i]['vote_option_text'],
'VOTE_RESULT' => $fetchpoll['options'][$i]['vote_result'],
)
);
}
}
else
{
$template->assign_vars(array(
'S_POLL_QUESTION' => $lang['No_poll'],
'DISABLED' => 'disabled="disabled"'
)
);
}//
// Heise Newsticker Add-on
//
$content = implode ("", file ("http://www.heise.de/newsticker/heise.rdf"));
preg_match_all("|<item>(.*)</item>|Uism",$content, $items, PREG_PATTERN_ORDER);
for ($i=0;$i<count($items[1]);$i++)
{
preg_match_all("|<title>(.*)</title>(.*)<link>(.*)</link>|Uism",$items[1][$i], $regs, PREG_PATTERN_ORDER);
$template->assign_block_vars('newsticker',array(
'heise_Ticker' => "[url=''.utf8_decode($regs[3][0])."']".utf8_decode($regs[1][0])."[/url] • "));
}//
// Generate the page
//
$template->pparse('body');include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>