Counter Hack |
Sigi
Mitglied
Dabei seit: 16.01.04
Beiträge: 37
Herkunft: Wachtendonk (Niederrhein) Forenversion: 2.3.3
|
|
Hi Leute!
Die Frage den Counter zu einer bestimmten Uhrzeit zu beenden, habe ich mal in ein Javascript-Forum gestellt. Dort wurde mir empfohlen, daß Javascript aus der counter.tpl in ein Dynmic countdown Script II auszutauschen. Meine Veranstaltung hat am 10. Juni 2006 um 12 Uhr begonnen. Der Name der Veranstaltung lautete "TENGO-HANDBALL.de All Star Spiele ". Nach beginn der Veranstaltung erschien dann der Text "Die TENGO-HANDBALL.de All Star Spiele 2006 laufen seit 12 Uhr!". Hier mal der veränderte Text der counter.tpl. Bei mir lief es einwandfrei.
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
|
<table cellpadding="4" cellspacing="1" border="0" style="width:90%" class="tableinborder">
<tr>
<td class="tabletitle" align="center"><span class="smallfont">
<script type="text/javascript">
//Dynamic countdown Script II- © Dynamic Drive (www.dynamicdrive.com)
//Support for hour minutes and seconds added by Chuck Winrich (winrich@babson.edu) on 12-12-2001
//For full source code, 100's more DHTML scripts, visit http://www.dynamicdrive.com
function setcountdown(theyear,themonth,theday,thehour,themin,thesec){
yr=theyear;mo=themonth;da=theday;hr=thehour;min=themin;sec=thesec
}
//////////CONFIGURE THE COUNTDOWN SCRIPT HERE//////////////////
//STEP 1: Configure the countdown-to date, in the format year, month, day, hour(0=midnight,23=11pm), minutes, seconds:
setcountdown(2006,6,10,12,00,00) //Jahr, Monat, Tag, Stunden, Minuten, Sekunden
//STEP 2: Change the two text below to reflect the occasion, and message to display on that occasion, respectively
var occasion="ersten Spiel der TENGO-HANDBALL.de All Star Spiele 2006"
var message_on_occasion="Auf, auf das Spiel hat begonnen!"
//STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countdown area
var countdownwidth='675px'
var countdownheight='35px'
var countdownbgcolor='#9BAAC1'
var opentags='<font face="Verdana"><small><font color="000000">'
var closetags='</small></font>'
//////////DO NOT EDIT PAST THIS LINE//////////////////
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var crosscount=''
function start_countdown(){
if (document.layers)
document.countdownnsmain.visibility="show"
else if (document.all||document.getElementById)
crosscount=document.getElementById&&!document.all?document.getElementById("countdownie") : countdownie
countdown()
}
if (document.all||document.getElementById)
document.write('<span id="countdownie" style="width:'+countdownwidth+'; background-color:'+countdownbgcolor+'"></span>')
window.onload=start_countdown
function countdown(){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr+" "+hr+":"+min+":"+sec
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
//if on day of occasion
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+message_on_occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+message_on_occasion+closetags
return
}
//if passed day of occasion
else if (dday<=-1){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+" Die TENGO-HANDBALL.de All Star Spiele 2006 laufen seit 12 Uhr! "+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+" Die TENGO-HANDBALL.de All Star Spiele 2006 laufen seit 12 Uhr! "+closetags
return
}
//else, if not yet
else{
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+dday+ " Tage, "+dhour+" Stunden, "+dmin+" Minuten und "+dsec+" Sekunden bis zum "+occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+dday+ " Tage, "+dhour+" Stunden, "+dmin+" Minuten und "+dsec+" Sekunden bis zum "+occasion+closetags
}
setTimeout("countdown()",1000)
}
</script>
<ilayer id="countdownnsmain" width=&{countdownwidth}; height=&{countdownheight}; bgColor=&{countdownbgcolor}; visibility=hide><layer id="countdownnssub" width=&{countdownwidth}; height=&{countdownheight}; left=0 top=0></layer></ilayer>
</span>
</td>
</tr>
</table> |
|
|
|
10.07.06 10:31 |
E-Mail
WWW
Finden
Als Freund hinzufügen
|
|
Sigi
Mitglied
Dabei seit: 16.01.04
Beiträge: 37
Herkunft: Wachtendonk (Niederrhein) Forenversion: 2.3.3
|
|
Zitat: |
Original von spider30
Nur wäre es noch sinnvoll die Textfarbe auch automatisch der Textfarbe des Styles anzupassen.Weil bei schwarzen Hintergrund sieht man schwarz schwer und bei mehreren Styles ist es nicht möglich eine Farbe für alle Styles zu finden. |
Ist dafür nicht die Zeile:
code: |
1:
|
var opentags='<font face="Verdana"><small><font color="000000">' |
|
zuständig. Wenn Du da aus 00000 als Beispiel ein FFFFFF machst, wird die Schrift doch weiß. Nee andere Variante fällt mir nicht ein.
Gruß, Sigi
|
|
12.07.06 23:31 |
E-Mail
WWW
Finden
Als Freund hinzufügen
|
|
spider30
Mitglied
Dabei seit: 31.03.05
Beiträge: 136
Herkunft: Zöbing Forenversion: 2.3
|
|
Na toll!Das ist mir klar, aber dann hast du Styles die nen weißen Hintergrund haben und dann siehst es erst wieder net.Ich hab 7-8 Styles in den verschiedensten Farben installiert und da kann ich net eine Farbe für alle passend aussuchen.
__________________ Besuche uns doch mal unter www.zoebinger.com/forum
|
|
13.07.06 18:33 |
E-Mail
WWW
Finden
Als Freund hinzufügen
|
|
Gexor
Mitglied
Dabei seit: 07.02.05
Beiträge: 244
Fähigkeiten: WBB2 Profi; WBB Lite 1 Profi Forenversion: 2.3
|
|
wenn ich bei solchen sachen immer lese © bei usw und darf nur dort angeboten werden...
dieses ding scriptet dir ein script anfänger,mann mann immer © da und © dort
das iss doch ein simpler counter den du dir 100mio ums sonnst ohne © im netz saugen kannst
|
|
05.09.06 11:21 |
E-Mail
WWW
Finden
Als Freund hinzufügen
|
|
Sigi
Mitglied
Dabei seit: 16.01.04
Beiträge: 37
Herkunft: Wachtendonk (Niederrhein) Forenversion: 2.3.3
|
|
@Gexor: Ich wollte hier nur helfen. Bin kein Java-Script Experte. Bei mir hat es geklappt, bei denen die es jetzt mit dem Script probiert haben auch. Sicherlich gibt es da ganz andere Varianten und Lösungen. Nur, wenn keiner oder wie Du, jemand sich dazu so spät äußert, muß man doch erfinderisch sein, oder?
Also, wenn Du da ein andere bessere Lösung hast , rein damit
|
|
05.09.06 11:36 |
E-Mail
WWW
Finden
Als Freund hinzufügen
|
|
spider30
Mitglied
Dabei seit: 31.03.05
Beiträge: 136
Herkunft: Zöbing Forenversion: 2.3
|
|
Könnte villeicht mal wer den Hack so coden, daß man die Eingaben übers ACP machen kann?Also den Text und das Datum mit der Uhrzeit und diese Daten dann als Variable in das Template einbinden?
Habe ca. 10 Styles und müsste das sonst bei jeden abändern ein jedes mal.
__________________ Besuche uns doch mal unter www.zoebinger.com/forum
|
|
29.10.06 19:20 |
E-Mail
WWW
Finden
Als Freund hinzufügen
|
|
Markus1
Mitglied
Dabei seit: 30.11.05
Beiträge: 71
Forenversion: 2.3
|
|
Hallo!
bei mir tacuht ein fehler auf
www.the-com.de
oben!
__________________ Mit freundlichen Grüßen,mark-labs
Du suchst einen Ort, wo Du über alles reden kannst?
==>
www.the-com.de
|
|
02.11.06 11:47 |
E-Mail
WWW
Finden
Als Freund hinzufügen
|
|
Agi
TEAM - PHP Freak
Dabei seit: 22.11.04
Beiträge: 2.628
Fähigkeiten: WBB3 Profi Forenversion: 3.1
|
|
Zitat: |
Original von Markus1
Hallo!
bei mir tacuht ein fehler auf
www.the-com.de
oben! |
Wenn du das "Occasion already passed!" meinst, das bedeutet, dass der Countdown, den du eingestellt hast, bereits abgelaufen ist
__________________
|
|
02.11.06 12:36 |
Finden
Als Freund hinzufügen
|
|
TommyBoss
Mitglied
Dabei seit: 09.12.06
Beiträge: 7
Forenversion: 2.3
|
|
Hallo,
vielen Dank für das Tutorial.
Ich bräuchte aber eine Zentrierung für folgendes. Ansonsten sieht es nach dem Code eben wie auf diesem Bild aus:
[IMG]http://img300.imageshack.us/img300/841/12ad2.png[/IMG]
code: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
|
<table cellpadding="4" cellspacing="1" border="0" style="width:20%" class="tableinborder">
<tr>
<td class="tabletitle" align="center"><span class="smallfont">
<script language="JavaScript1.2">
function setcountdown(theyear,themonth,theday) {
yr=theyear;mo=themonth;da=theday
}
setcountdown(2007,02,01)
var occasion="| SAW III RELEASE"
var message_on_occasion="<b>SAWIII OUT NOW</b>"
var countdownwidth='570px'
var countdownheight='22px'
var countdownbgcolor=''
var opentags=''
var closetags=''
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var crosscount=''
function start_countdown(){
if (document.layers)
document.countdownnsmain.visibility="show"
else if (document.all||document.getElementById)
crosscount=document.getElementById&&!document.all?document.getElementById("countdownie") : countdownie
countdown()
}
if (document.all||document.getElementById)
document.write('<span id="countdownie" style="width:'+countdownwidth+'; background-color:'+countdownbgcolor+'"></span>')
window.onload=start_countdown
function countdown(){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
//if on day of occasion
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+message_on_occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+message_on_occasion+closetags
return
}
//if passed day of occasion
else if (dday<=-1){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+"Occasion already passed! "+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+"Occasion already passed! "+closetags
return
}
//else, if not yet
else{
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+dday+ " Tage, "+dhour+" Stunden, "+dmin+" Minuten und "+dsec+" Sekunden "+occasion+closetags
}
setTimeout("countdown()",1000)
}
</script>
</span>
</td>
</tr>
</table>
|
|
|
|
10.12.06 21:35 |
E-Mail
WWW
Finden
Als Freund hinzufügen
|
|
spider30
Mitglied
Dabei seit: 31.03.05
Beiträge: 136
Herkunft: Zöbing Forenversion: 2.3
|
|
Kann man den Hack nicht irgend wie erweitern, daß man ihn per ACP an und ausschalten kann?
Ist sonst mühsam ihn jedes mal in jedes Style ein und auszubauen.Funzt ja bei andern Hacks auch (siehe X-quiz, Guthaben , WIW usw.)
__________________ Besuche uns doch mal unter www.zoebinger.com/forum
|
|
13.12.06 11:42 |
E-Mail
WWW
Finden
Als Freund hinzufügen
|
|
leonie34
Mitglied
Dabei seit: 17.12.06
Beiträge: 168
Herkunft: Köln Forenversion: 2.3
|
|
Super HAck danke funzt einwandfrei
Hab mal ne Frage,kann man in den Counter auch ein kleines Bild einfügen?
Ich weis nicht wo und was da genau eingegeben wird.
Wollte rechts und links von der Zeit ein Minibild rein haben...
LG
Leonie
__________________
|
|
25.02.07 22:21 |
E-Mail
WWW
Finden
Als Freund hinzufügen
|
|
crazyelephant
Mitglied
Dabei seit: 17.11.07
Beiträge: 41
Fähigkeiten: WBB2 Anfänger Forenversion: 2.3
|
|
Ich hab' mal das orginale Template so geändert daß nun die eingebene Zeit mit berechnet wird.
Das eine Beispiel scheint mir von dynamicdrive.com kopiert worden zu sein...
php: |
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
|
<table cellpadding="4" cellspacing="1" border="0" style="width:98%" class="tableinborder">
<tr>
<td class="tabletitle" align="center"><span class="smallfont">
<script language="JavaScript1.2">
function setcountdown(theyear,themonth,theday,thehour,themin,thesec)
{yr=theyear;mo=themonth;da=theday;hr=thehour;min=themin;sec=thesec}
<!--EINSTELLEN DATUM-->
setcountdown(2008,04,06,13,30,00)//Jahr, Monat, Tag, Stunden, Minuten, Sekunden
<!--EINSTELLEN DES GP-->
var occasion="GP von Bahrein in Manama"
var message_on_occasion="<b>das Rennen hat begonnen !</b>"
var countdownwidth='570px'
var countdownheight='22px'
var countdownbgcolor=''
var opentags=''
var closetags=''
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
var crosscount=''
function start_countdown(){
if (document.layers)
document.countdownnsmain.visibility="show"
else if (document.all||document.getElementById)
crosscount=document.getElementById&&!document.all?document.getElementById("countdownie") : countdownie
countdown()
}
if (document.all||document.getElementById)
document.write('<span id="countdownie" style="width:'+countdownwidth+'; background-color:'+countdownbgcolor+'"></span>')
window.onload=start_countdown
function countdown(){
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[mo-1]+" "+da+", "+yr+" "+hr+":"+min+":"+sec
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
//if on day of occasion
if(dday<=0&&dhour<=0&&dmin<=0&&dsec<=1&&todayd==da){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+message_on_occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+message_on_occasion+closetags
return
}
//if passed day of occasion
else if (dday<=-1){
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+"Occasion already passed! "+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+"Occasion already passed! "+closetags
return
}
//else, if not yet
else{
if (document.layers){
document.countdownnsmain.document.countdownnssub.document.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+occasion+closetags)
document.countdownnsmain.document.countdownnssub.document.close()
}
else if (document.all||document.getElementById)
crosscount.innerHTML=opentags+dday+ " Tage, "+dhour+" Stunden, "+dmin+" Minuten und "+dsec+" Sekunden bis zum "+occasion+closetags
}
setTimeout("countdown()",1000)
}
</script>
</span>
</td>
</tr>
</table> |
|
__________________ Gruss crazyelephant
Dieser Beitrag wurde 1 mal editiert, zum letzten Mal von crazyelephant: 23.03.08 10:03.
|
|
23.03.08 10:02 |
E-Mail
Finden
Als Freund hinzufügen
|
|
Frett-Award
Mitglied
Dabei seit: 07.05.06
Beiträge: 15
Herkunft: Frankfurt Forenversion: 2.3; Lite 1.0
|
|
Hi
mal ne frage wie oder besser wo muss man es eintragen wenn man es auf der index und im portal haben möchte ??? wäre für eine schnelle antwort dankbar
Lg Frett-Award
|
|
06.04.08 18:30 |
E-Mail
Finden
Als Freund hinzufügen
|
|
|