Seite 1 von 1

Probleme beim Einbau vom -advanced countdown mod-

Verfasst: 06.04.2007 20:53
von 19cyprinus88
Hallo zusammen,

ich habe ein Problem, sobald ich diesen schritt einbaue, funktioniert leider nichts mehr.

Code: Alles auswählen

#
#-----[ FIND ]------------------------------------------
#
//
// Parse and show the overall header.
//
$template->set_filenames(array(
	'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);

#
#-----[ AFTER, ADD ]------------------------------------------
#
// Advanded Countdown Mod START
if ( defined('ON_INDEX') || defined('ON_PORTAL') )
{
	include_once($phpbb_root_path.'includes/bbcode.'.$phpEx);
	$sql = "SELECT * FROM " . COUNTDOWN_TABLE;
	if( !($result = $db->sql_query($sql)) )
	{
	      message_die(GENERAL_ERROR, 'Could not get countdown settings', '', __LINE__, __FILE__, $sql);
	}

	while ( $row = $db->sql_fetchrow($result))
	{
		$img_left = $row['img_left'];
		$img_right = $row['img_right'];
		$title = $row['title'];
		$description = $row['description'];
		$event_text = stripslashes($row['event_text']);
		$event_stop = $row['event_stop'];
		$enable_index = $row['enable_index'];
		$enable_portal = $row['enable_portal'];
		$full_display = $row['full_display'];
	}

	$b_day = create_date('d', $event_stop, $board_config['board_timezone']);
	$b_month = create_date('n', $event_stop, $board_config['board_timezone']);
	$b_year = create_date('Y', $event_stop, $board_config['board_timezone']);
	$b_hour = create_date('H', $event_stop, $board_config['board_timezone']);
	$b_minute = create_date('i', $event_stop, $board_config['board_timezone']);
	$b_second = create_date('s', $event_stop, $board_config['board_timezone']);

	switch ($b_month)
	{
		case 1:$b_month = 'January';break;
		case 2:$b_month = 'February';break;
		case 3:$b_month = 'March';break;
		case 4:$b_month = 'April';break;
		case 5:$b_month = 'May';break;
		case 6:$b_month = 'June';break;
		case 7:$b_month = 'July';break;
		case 8:$b_month = 'August';break;
		case 9:$b_month = 'September';break;
		case 10:$b_month = 'October';break;
		case 11:$b_month = 'November';break;
		case 12:$b_month = 'December';break;
	}

	$stop = $b_month.' '.$b_day.', '.$b_year.' '.$b_hour.':'.$b_minute.':'.$b_second;

	$user_lang = ( $userdata['user_lang'] ) ? $userdata['user_lang'] : $board_config['default_lang'];
	include_once($phpbb_root_path . 'language/lang_' . $user_lang . '/lang_countdown.php');

	$template->assign_vars(array(
		'L_DAYS' => $lang['C_days'],
		'IMG_LEFT' => ( $img_left ) ? '<img src="'.$img_left.'" border="0" />' : '',
		'IMG_RIGHT' => ( $img_right ) ? '<img src="'.$img_right.'" border="0" />' : '',
		'TITLE' => make_clickable(stripslashes($title)),
		'DESC' => make_clickable(stripslashes($description)))
	);
}

$countdown_on = 0;

if ( defined('ON_INDEX') && $enable_index == 1 )
{
	$template->assign_block_vars('switch_countdown_on', array());
	$countdown_on = 1;
}

if ( defined('ON_PORTAL') && $enable_portal == 1 )
{
	$template->assign_block_vars('switch_countdown_on', array());
	$countdown_on = 1;
}

if ( $countdown_on == 1 )
{
	$countdown = "<script language='JavaScript' type='text/javascript'>
<!--
var eventdate = new Date('".$stop."');
function toSt(n)
{
	s=''
	if(n<10) s+='0'
	return s+n.toString();
}

function countdown()
{
	d=new Date();
	count=Math.floor((eventdate.getTime()-d.getTime())/1000);

	if(count<=0)
	{
		var time_event = document.getElementById('time_event');
		var event_time = document.getElementById('event_time');
		time_event.style.display = 'none';
		event_time.style.display = '';
		return;
	}

	secs_count = toSt(count%60);
	count=Math.floor(count/60);
	mins_count = toSt(count%60);
	count=Math.floor(count/60);
	hours_count = toSt(count%24);
	count=Math.floor(count/24);
	days_count = count;

	document.countdown.days.value = days_count;
	document.countdown.hours.value = hours_count;
	document.countdown.mins.value = mins_count;
	document.countdown.secs.value = secs_count;

	window.setTimeout('countdown()',500);

}
//-->
</script>";

	$template->assign_vars(array(
		'EVENT_TEXT' => $event_text,
		'COUNTDOWN' => $countdown,
		'COUNTDOWN_ON' => 'onLoad="javascript:countdown();"'));
}

if ( $full_display == 0 )
{
	$template->assign_vars(array(
		'FULL_DISPLAY' => 'none'));
}
else
{
	$template->assign_vars(array(
		'FULL_DISPLAY' => ''));
}
// Advanded Countdown Mod END


Dann kommt folgendes:
Allgemeiner Fehler

Could not get countdown settings

DEBUG MODE

SQL Error : 1146 Table 'usr_web4_1.COUNTDOWN_TABLE' doesn't exist

SELECT * FROM COUNTDOWN_TABLE

Line : 153
File : page_header.php

Verfasst: 06.04.2007 20:57
von uwe310
Hast du install ausgeführt (sql Befehle e.c.t) übersehen ?
Mfg
Uwe

Verfasst: 06.04.2007 21:46
von 19cyprinus88
nein alles gemacht

Verfasst: 06.04.2007 22:13
von Mahony
Hallo
Ich habe dir das mal repariert. Du hattest die includes/constants.php nicht bearbeitet. :oops:

P.S. Bitte etwas sorgsamer arbeiten, dann kommen solche Fehler auch nicht mehr vor. :P





Grüße: Mahony

Verfasst: 07.04.2007 18:39
von 19cyprinus88
O.k. Danke! Ich werde mir demnächst evtl. etwas mehr zeit nehmen. Dies sollte nur mal so schnell eingebaut werden. :oops:

Ich habe nun versucht dies zu Aktivieren, nur leider wird die verbleibende Zeit nicht angezeigt. :(


[ externes Bild ]

Verfasst: 07.04.2007 20:04
von redbull254
Hallo,
hast Du denn auch im ACP die Zeit richtig eingestellt?

Verfasst: 07.04.2007 21:15
von Mahony
Hallo

Da fehlte noch der zu ersetzende Teil in der overall_header.tpl

Ich habe dir das mal eben eingefügt.




Grüße: Mahony

Verfasst: 07.04.2007 21:20
von 19cyprinus88
WOW nun geht es. Danke mahony, du bist ein gott :D

Verfasst: 07.04.2007 21:28
von Dr.Death
Nicht direkt ;-)

Mahony liest nur die Anleitungen genau :wink:

Verfasst: 07.04.2007 22:44
von 19cyprinus88
Dachte mit dem Satz
Hallo
Ich habe dir das mal repariert. Du hattest die includes/constants.php nicht bearbeitet.

das der Mod vollständig eingebaut wurde. :oops: :wink: