Problem z licznikiem czasu do danej daty
Wyniki 1 do 8 z 8

Temat: Problem z licznikiem czasu do danej daty

  1. #1
    Przeglądacz
    Dołączył
    23-01-2011
    Wpisy
    69
    Punkty
    10

    Domyślny Problem z licznikiem czasu do danej daty

    Witam!!

    wczoraj wieczorem znalazłem skrypcik, przerobiłem go i wstawiłem na joomle po przez edycję kodu html szablonu. Wszystko fajnie się wstawiło, w to miejsce w które chcialem, tylko wyszło mi trochę za "wysokie" >>> www.ssszorly.pl >> umieszczone na logu

    Próbowałem zmieniać rozmiar w kodzie, tak jak to wcześniej robiłem przy edycji tego zegarka, ale nic się nie zmienia....

    Wstawiam wam kod
    Kod:
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
    <title>Nowa strona 1</title>
    
    <!-- head sekundy -->
    <script type="text/javascript">
    
    /***********************************************
    * Dynamic Countdown script- Š Dynamic Drive (http://www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit http://www.dynamicdrive.com/ for this script and 100s more.
    ***********************************************/
    
    function cdtime(container, targetdate){
    if (!document.getElementById || !document.getElementById(container)) return
    this.container=document.getElementById(container)
    this.currentTime=new Date()
    this.targetdate=new Date(targetdate)
    this.timesup=false
    this.updateTime()
    }
    
    cdtime.prototype.updateTime=function(){
    var thisobj=this
    this.currentTime.setSeconds(this.currentTime.getSeconds()+1)
    setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second
    }
    
    cdtime.prototype.displaycountdown=function(baseunit, functionref){
    this.baseunit=baseunit
    this.formatresults=functionref
    this.showresults()
    }
    
    cdtime.prototype.showresults=function(){
    var thisobj=this
    
    
    var timediff=(this.targetdate-this.currentTime)/1000 //difference btw target date and current date, in seconds
    if (timediff<0){ //if time is up
    this.timesup=true
    this.container.innerHTML=this.formatresults()
    return
    }
    var oneMinute=60 //minute unit in seconds
    var oneHour=60*60 //hour unit in seconds
    var oneDay=60*60*24 //day unit in seconds
    var dayfield=Math.floor(timediff/oneDay)
    var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour)
    var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute)
    var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute))
    if (this.baseunit=="hours"){ //if base unit is hours, set "hourfield" to be topmost level
    hourfield=dayfield*24+hourfield
    dayfield="n/a"
    }
    else if (this.baseunit=="minutes"){ //if base unit is minutes, set "minutefield" to be topmost level
    minutefield=dayfield*24*60+hourfield*60+minutefield
    dayfield=hourfield="n/a"
    }
    else if (this.baseunit=="seconds"){ //if base unit is seconds, set "secondfield" to be topmost level
    var secondfield=timediff
    dayfield=hourfield=minutefield="n/a"
    }
    this.container.innerHTML=this.formatresults(dayfield, hourfield, minutefield, secondfield)
    setTimeout(function(){thisobj.showresults()}, 1000) //update results every second
    }
    
    /////CUSTOM FORMAT OUTPUT FUNCTIONS BELOW//////////////////////////////
    
    //Create your own custom format function to pass into cdtime.displaycountdown()
    //Use arguments[0] to access "Days" left
    //Use arguments[1] to access "Hours" left
    //Use arguments[2] to access "Minutes" left
    //Use arguments[3] to access "Seconds" left
    
    //The values of these arguments may change depending on the "baseunit" parameter of cdtime.displaycountdown()
    //For example, if "baseunit" is set to "hours", arguments[0] becomes meaningless and contains "n/a"
    //For example, if "baseunit" is set to "minutes", arguments[0] and arguments[1] become meaningless etc
    
    
    function formatresults(){
    if (this.timesup==false){//if target date/time not yet met
    var displaystring="<p style=\"font-size: 10px; font-family: tahoma; color: #000000;\">Za "+arguments[0]+" dni "+arguments[1]+" godzin "+arguments[2]+" minut "+arguments[3]+" sekund mecz Orzeł Łódź vs ROW Rybnik"
    }
    else{ //else if target date/time met
    var displaystring="<p style=\"font-size: 10px; font-family: tahoma; color: #000000;\">było: mecz Orzeł Łódź vs ROW Rybnik"
    }
    return displaystring
    }
    
    function formatresults2(){
    if (this.timesup==false){ //if target date/time not yet met
    var displaystring="<p style=\"font-size: 10px; font-family: tahoma; color: #000000;\">Za "+arguments[0]+" dni "+arguments[1]+" godzin "+arguments[2]+" minut "+arguments[3]+" sekund mecz Orzeł Łódź vs ROW Rybnik"
    }
    else{ //else if target date/time met
    var displaystring="<p style=\"font-size: 10px; font-family: tahoma; color: #000000;\">mecz Orzeł Łódź vs ROW Rybnik" //Don't display any text
    }
    return displaystring
    }
    
    </script>
    <!-- /head -->
    </head>
    
    <body>
    
    <center>
    <!--start kodu-->
    <table border="1" cellspacing="1" style="border-collapse: collapse; font-family: Verdana; font-size: 10 px; bordercolor: #000000; width: 250; height: 150;" bgcolor="transparent">
    <tr><td align="center" style="background-image:url()">
    
    <div style="position: relative; top: 2; left:0;">
    <img src="http://img88.imageshack.us/img88/6479/logoyq.png" border="0" alt="ile czasu do..."/></a>
    <div id="countdowncontainer"></div>
    <script type="text/javascript">
    
    var futuredate=new cdtime("countdowncontainer", "4 3, 2011 00:00:00")
    futuredate.displaycountdown("days", formatresults)
    
    var currentyear=new Date().getFullYear()
    //dynamically get this Christmas' year value. If Christmas already passed, then year=current year+1
    var thischristmasyear=(new Date().getMonth()>=11 && new Date().getDate()>25)? currentyear+1 : currentyear
    var christmas=new cdtime("countdowncontainer2", "December 25, "+thischristmasyear+" 0:0:00")
    christmas.displaycountdown("days", formatresults2)
    </script>
    <noscript><a href="http://dodatki.blogowicz.info/wlepki,dla,webmastera/darmowe,komponenty/licznik,ile,czasu,do/">ile czasu po</a>
    <a href="http://dodatki.blogowicz.info/">kalendarze</a></noscript>
    </div></td></tr></table>
    <!--/koniec kodu-->
    </center>
    </body>
    Wysokość zmieniam w tym kodzie:
    <table border="1" cellspacing="1" style="border-collapse: collapse; font-family: Verdana; font-size: 10 px; bordercolor: #000000; width: 250; height: 150;" bgcolor="transparent">

    Ale nic mi się nie zmienia...

    Dodam że logo strony zostanie zmienione pod ten dodatek ;)

    Z góry ThX za pomoc

  2. Pani Reklamowa
    Pani Reklamowa jest aktywna
    Avatar Panny Google

    Dołączył
    19-08-2010
    Skąd
    Internet
    Postów
    milion
    Pochwał
    setki
  3. #2
    Senior Bazyl awatar
    Dołączył
    02-08-2008
    Skąd
    Skierniewice
    Wpisy
    7 693
    Punkty
    574

    Domyślny

    Cześć,

    Daj górny margines dla div id="countdowncontainer"

  4. #3
    Wiarus Robster awatar
    Dołączył
    30-01-2010
    Skąd
    Częstochowa
    Wpisy
    2 136
    Punkty
    135

    Domyślny

    A grafikę próbowałeś zmniejszyć? Jak chcesz tabelę zmniejszyć jak masz grafikę o stałym rozmiarze? Sama zmiana wysokości tabeli nie zrobi resize obrazka, co najwyżej pojawi się scroll jeśli taki w css włączysz. Zmniejsz grafikę i napisz co wyszło.
    Nic co jest warte posiadania nie przychodzi łatwo.
    http://robertmatuszewski.pl

  5. #4
    Przeglądacz
    Dołączył
    23-01-2011
    Wpisy
    69
    Punkty
    10

    Domyślny

    Wolał bym grafikę zostawić w takim rozmiarze w jakim jest ;) ale zaraz sprawdzę ze zmniejszoną grafiką


    Edit: Pomogło Wystarczyło usunąć trochę przeźroczystego tła ;) Wielkie dzięki. Punkcik reputacji poleciał
    Ostanio edytowane przez seboo107 : 23-01-2011 13:41

  6. #5
    Senior Bazyl awatar
    Dołączył
    02-08-2008
    Skąd
    Skierniewice
    Wpisy
    7 693
    Punkty
    574

    Domyślny

    Ja Cię zrozumiałem inaczej...
    Teraz licznik zlewa się z tłem.
    Pisałem o marginesie, by opuścić go na niebieski pasek pod obrazkami.

  7. #6
    Przeglądacz
    Dołączył
    23-01-2011
    Wpisy
    69
    Punkty
    10

    Domyślny

    Pisałem już w pierwszym poście że logo strony zostanie zmienione pod ten dodatek ;)

  8. #7
    Senior Bazyl awatar
    Dołączył
    02-08-2008
    Skąd
    Skierniewice
    Wpisy
    7 693
    Punkty
    574

    Domyślny

    Znaczy, jak zawsze: diabeł tkwi w szczegółach...
    @Robster ma młodsze oczy

  9. #8
    Wiarus Robster awatar
    Dołączył
    30-01-2010
    Skąd
    Częstochowa
    Wpisy
    2 136
    Punkty
    135

    Domyślny

    Hej @bazyl. Z tymi oczami/oczyma* to różnie bywa Najczęściej to ja czytam jakieś pierdoły ^^

    Dzięki @seboo107 za reputkę, ostatnio mało osób o niej pamięta, nawet o zwykłe dziękuje trudno


    *nieprawidłowe skreślić
    Nic co jest warte posiadania nie przychodzi łatwo.
    http://robertmatuszewski.pl

Podobne tematy

  1. Fromat daty/czasu pod tytułem artykułu
    przez gizzzmo na forum Szablony, wygląd, formatowanie
    Odpowiedzi: 3
    Ostatni post/autor: 02-01-2011, 23:07
  2. Ja usunąć godzinę z daty / terminu / czasu utworzenia newsa?
    przez moje na forum Administracja - ogólne
    Odpowiedzi: 6
    Ostatni post/autor: 17-08-2009, 18:17
  3. problem z licznikiem odwiedzin
    przez wienzi na forum Rozszerzenia - problemy z obsługą, zarządzaniem
    Odpowiedzi: 8
    Ostatni post/autor: 22-04-2009, 15:26
  4. problem z licznikiem w Jomli 1.08
    przez panorama na forum Administracja składnikami
    Odpowiedzi: 1
    Ostatni post/autor: 08-06-2006, 23:41
  5. Problem z licznikiem w IE
    przez sipio na forum Administracja Joomla!
    Odpowiedzi: 0
    Ostatni post/autor: 13-04-2006, 01:08

Reguły pisania

  • Nie możesz zakładać nowych tematów
  • Nie możesz dodawać wypowiedzi
  • Nie możesz dodawać załączników
  • Nie możesz poprawiać swoich postów
  •