• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved My script in countdown

Swansoft

New Member
Joined
Apr 13, 2013
Messages
49
Reaction score
0
Yoo so ive got a countdown script and well when i add it in to layout like this.


THIS IS MY SCRIPT
1y332q.png



now this is what i get on my website.... Latestnews - QunteOT

14vlkdi.png



REPS+


This is the script..
PHP:
  <table class="center countdown">
                    <tr>
                        <td><div id="days"></td>
                        <td><div id="hours"></td>
                        <td><div id="minutes"></td>
                        <td><div id="seconds"></td>
                    </tr>
                    <tr>
                        <td>days</td>
                        <td>hours</td>
                        <td>minutes</td>
                        <td>seconds</td>
                    </tr>
                </table>
<script type="text/javascript">getStartTime('Apr 20 2013 23:28:20', 'Apr 26 2013 18:00:00',0);</script>
 
I told you yesterday that you need the JavaScript code as well in order to make it work.
 
S o l v e d

First make a .js CALLED countdown.js file in the same folder as layout and basic ect. Pase in there this..

countdown.js code
PHP:
function getStartTime(cet_now,cet_to,ticks)
{
	now = new Date(cet_now);
							
	//ENTER BELOW THE DATE YOU WISH TO COUNTDOWN TO
	later = new Date(cet_to);
			
	ticks = ticks + 1
			
	diff = (later - now - ticks*1000)
			
	days = diff / 1000 / 60 / 60 / 24;
	daysRound = Math.floor(days);
					
	hours = diff / 1000 / 60 / 60;
	hoursRound = Math.floor(hours);
					
	hours2 = diff / 1000 / 60 / 60 - (24 * daysRound);
	hoursRound2 = Math.floor(hours2);
				
	minutes = diff / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound2);
	minutesRound = Math.floor(minutes);
			
	seconds = diff / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound2) - (60 * minutesRound);
	secondsRound = Math.round(seconds);
					
	if(hoursRound < 0 || minutesRound < 0 || secondsRound < 0)
	{
        document.getElementById('days').innerHTML = "0";
		document.getElementById('hours').innerHTML = "0";
		document.getElementById('minutes').innerHTML = "0";
		document.getElementById('seconds').innerHTML = "0";
	}
	else
	{
        document.getElementById('days').innerHTML = daysRound;
		document.getElementById('hours').innerHTML = hoursRound2;
		document.getElementById('minutes').innerHTML = minutesRound;
		document.getElementById('seconds').innerHTML = secondsRound;
		newtime = window.setTimeout("getStartTime('"+cet_now+"','"+cet_to+"', "+ticks+");", 1000);
	}
}


Then goto layout find this
<script type="text/javascript" src="<?PHP echo $layout_name; ?>/initialize.js"></script>

and paste this underneath
<script type="text/javascript" src="<?PHP echo $layout_name; ?>/countdown.js"></script>

STILL IN LAYOUT

find this

<div id="<?PHP echo $subtopic; ?>" class="Box">

Above it paste this
<?PHP echo $news_content; ?>

OK NOW TO LATEST NEWS


under the very first
PHP:
<?PHP

Paste this

PHP:
 $news_content .= '<div id="featuredarticle" class="Box">
   <div class="Corner-tl" style="background-image: url('.$layout_name.'/images/content/corner-tl.gif);"></div>
   <div class="Corner-tr" style="background-image: url('.$layout_name.'/images/content/corner-tr.gif);"></div>
   <div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div>
   <div class="BorderTitleText" style="background-image: url('.$layout_name.'/images/content/title-background-green.gif);"></div>
   <div class="Border_2">
       <div class="Border_3">
           <div class="BoxContent" style="background-image: url("'.$layout_name.'/images/content/scroll.gif");">
                   <tr>';
               
                    $news_content .= '<div class="stats-box"><h1><font size="5"><font face="martell" color="red"><B><center>Qunteot.net starting 25.5.2013 18:00 CEST (GMT + 1:00)  </center></BOLD></font>
					<font size="4"><h1>Qunteot.net starts in:</h1></font>

                <table class="center countdown">
                   
				     <tr>
                        <td><div id="days"></td>
                        <td><div id="hours"></td>
                        <td><div id="minutes"></td>
                        <td><div id="seconds"></td>
                    </tr>
                    <tr>
                        <td>days</td>
                        <td>hours</td>
                        <td>minutes</td>
                        <td>seconds</td>
                    </tr>
                </table>
				

               <script type="text/javascript">getStartTime("Apr 22 2013 20:15:00", "May 25 2013 19:00:00",0);</script><br/></div>';

YOU NEED TO EDIT THE VERY BOTTOM OF THE SCRIPT FROM START TIME TO END TIME

ALL REPS GOTO NINJA
 
Last edited:
latestnews.php

Under
PHP:
<?php
if(!defined('INITIALIZED'))
    exit;
paste this
PHP:
$news_content .= '<div id="featuredarticle" class="Box"><div class="Corner-tl" style="background-image: url('.$layout_name.'/images/content/corner-tl.gif);"></div><div class="Corner-tr" style="background-image: url('.$layout_name.'/images/content/corner-tr.gif);"></div><div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div><div class="BorderTitleText" style="background-image: url('.$layout_name.'/images/content/title-background-green.gif);"></div><img class="Title" src="headline.php?txt=Countdown" alt="Contentbox headline" /><div class="Border_2"><div class="Border_3"><div class="BoxContent" style="background-image: url("'.$layout_name.'/images/content/scroll.gif");"><table border="0" cellspacing="3" cellpadding="4" width="100%"><tr><td style="width: 20%; text-align: center;">
    <script language="JavaScript">
        TargetDate = "1/1/2014 00:00 AM";
        CountActive = true;
        CountStepper = -1;
        LeadingZero = false;
        DisplayFormat = "<h2>%%D%% days, %%H%% hours, %%M%% minutes and %%S%% seconds!</h2>";
        FinishMessage = "<center></center>";
    </script>
    <script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js"></script></td></tr></table></div></div></div><div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div><div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div><div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div></div>';
 
Last edited:
latestnews.php

Under
PHP:
<?php
if(!defined('INITIALIZED'))
    exit;
paste this
PHP:
$news_content .= '<div id="countdown" class="Box"><div class="Corner-tl" style="background-image: url('.$layout_name.'/images/content/corner-tl.gif);"></div><div class="Corner-tr" style="background-image: url('.$layout_name.'/images/content/corner-tr.gif);"></div><div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div><div class="BorderTitleText" style="background-image: url('.$layout_name.'/images/content/title-background-green.gif);"></div><img class="Title" src="headline.php?txt=Countdown" alt="Contentbox headline" /><div class="Border_2"><div class="Border_3"><div class="BoxContent" style="background-image: url("'.$layout_name.'/images/content/scroll.gif");"><table border="0" cellspacing="3" cellpadding="4" width="100%"><tr><td style="width: 20%; text-align: center;">
    <script language="JavaScript">
        TargetDate = "1/1/2014 00:00 AM";
        CountActive = true;
        CountStepper = -1;
        LeadingZero = false;
        DisplayFormat = "<h2>%%D%% days, %%H%% hours, %%M%% minutes and %%S%% seconds!</h2>";
        FinishMessage = "<center></center>";
    </script>
    <script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js"></script></td></tr></table></div></div></div><div class="Border_1" style="background-image: url('.$layout_name.'/images/content/border-1.gif);"></div><div class="CornerWrapper-b"><div class="Corner-bl" style="background-image: url('.$layout_name.'/images/content/corner-bl.gif);"></div></div><div class="CornerWrapper-b"><div class="Corner-br" style="background-image: url('.$layout_name.'/images/content/corner-br.gif);"></div></div></div>';

This time nothing at all shows up, atleast the page doesn't go blank. :D
 
Did you paste this
PHP:
<?PHP echo $news_content; ?>
above
PHP:
<div id="<?PHP echo $subtopic; ?>" class="Box">
in layout.php?
 
Did you paste this
PHP:
<?PHP echo $news_content; ?>
above
PHP:
<div id="<?PHP echo $subtopic; ?>" class="Box">
in layout.php?

My bad, i didn't. It works now, the height is really high though, like.. 3x as high as it should be and the image in the top left of the thingy is broken. Any idea how to adjust the height? chaning the precentage of height didn't work.
 
Back
Top