Seite 1 von 2

Advanced Countdown überall sichtbar machen?

Verfasst: 06.07.2005 21:35
von WebElch
Hallo,

Ich hab den Mod, wie in der Anleitung beschrieben, installiert. Die SQL-Datenbanken sind auch korrekt installiert worden. Sobald ich aber den Countdown eingestellt habe, sehe ich auf meiner Index nur:
Verbleibende Tage: - : :
Da ist nichts mit Countdown. Kann mir da jemand helfen???

`!

Verfasst: 07.07.2005 16:39
von kidrob
hmm...kenne den mod zwar nich richtig-aber:

hast du alles richtig in der index_body eingestellt/bzw eingefügt?

Verfasst: 07.07.2005 17:15
von WebElch
Sorry, hab das Problem gelöst. Hab in der Anleitung übersehen vor

Code: Alles auswählen

</head>
<body bgcolor="{T_BODY_BGCOLOR}" text="{T_BODY_TEXT}" link="{T_BODY_LINK}" vlink="{T_BODY_VLINK}" {COUNTDOWN_ON}/>
noch

Code: Alles auswählen

{COUNTDOWN}
mit einzufügen. Kann man aber auch in der Anleitung recht leicht übersehen, muss ich zugeben.

Verfasst: 08.07.2005 11:29
von WebElch
Ich hab noch eine weitere Frage zu deisem MOD, will jetzt aber nicht extra einen neuen Thread anfangen.

Wie kann man den Countdown MOD überall anzeigen lassen? Bis jetzt erscheint er nur beim Aufruf der index.php. Auf den anderen Seiten ist er nie da, obwohl er in der overall_header.tpl doch drin steht. Muss noch was anderes beachten?

!

Verfasst: 08.07.2005 15:47
von kidrob
bin mir nicht ganz sicher aber:

schau einfach nochmal in der anleitung nach und

-> mach das, was du bei der index.php und der index_body machen musstest auch bei den dateien wo er noch drin sein soll!!!

zb wenns ins portal soll in die portal.php und portal_body!!

hoffe habe geholfen! gruß

Verfasst: 08.07.2005 16:18
von oxpus
Du musst nur in der includes/page_header.php die Zeile

Code: Alles auswählen

if ( defined('ON_INDEX') || defined('ON_PORTAL') )
entfernen und der Countdown wird überall angezeigt.

Verfasst: 10.07.2005 21:30
von WebElch
Hab ich gemacht. Bleibt ohne Effekt.

Verfasst: 13.07.2005 13:04
von WebElch
Gibt jemand der mit noch helfen kann? :(

Verfasst: 13.07.2005 17:38
von oxpus
Ersetze in der page_header.php mal den Block

Code: Alles auswählen

// 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'];
	}

	$event_stop -= $userdata['user_timezone'] * 3600;
	$event_stop += (date('I')) ? 3600 : 0;

	$b_day = date('d', $event_stop);
	$b_month = date('n', $event_stop);
	$b_year = date('Y', $event_stop);
	$b_hour = date('H', $event_stop);
	$b_minute = date('i', $event_stop);
	$b_second = date('s', $event_stop);

	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
mit diesem hier:

Code: Alles auswählen

// Advanded Countdown Mod START
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'];
}

$event_stop -= $userdata['user_timezone'] * 3600;
$event_stop += (date('I')) ? 3600 : 0;

$b_day = date('d', $event_stop);
$b_month = date('n', $event_stop);
$b_year = date('Y', $event_stop);
$b_hour = date('H', $event_stop);
$b_minute = date('i', $event_stop);
$b_second = date('s', $event_stop);

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;

$template->assign_block_vars('switch_countdown_on', array());

$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

Verfasst: 14.07.2005 07:49
von WebElch
Vielen Dank!

Das hat funktioniert!
:grin: