Jump to content
GIGN Forum

Dienasb Ilde


ElviiC
 Share

Recommended Posts

kads lūdzu varētu , pateikt ka uz ucoz uztaisit dienas bildi , itka taisiju pec sim paamcibam , bet tur ir teitks tani direktorija kurs fails iemests bildes , bet ka lai izdara to ucoza , j otur filemanagera jaliek , un tad tur bildes salikt var , un ka lai ieliek no turienes , kads nevar pateikt kodu , nu tadu kur ir ka ielikt tieshi no ucoza tas bildes , un lai pashas automatiski katru dienu mainas :P Lūdzu palidzat

Link to comment
Share on other sites

LASI PAMACIBAS !!

Link to comment
Share on other sites

Tākā ucoz, cik nu esmu dzirdējis, neatbalsta php, jāveido ar js, aiziešu pameklēt, kkur man bija gatavs kods, ko senāk izmantoju vienā lapā, ja atradīšu editošu topic un pievienošu file...

<html>
<head>
<script>

//returns the current date in YYYYMMDD format
function getCurrentDateString(){

   //make a new date object set at the current date
   var currentDate = new Date();

   //get the four position year and
   //make it a string
   var currentYear = currentDate.getFullYear() + "";

   //get the zero-indexed month and add 1
   //for the real month and make it a strintg
   var currentMonth = (currentDate.getMonth() + 1) + "";

   //add a zero at the beginning if only one
   //digit month
   if (currentMonth.length == 1) {
     currentMonth = "0" + currentMonth;
   }

   //get the current day of the month and
   //make it a string
   var currentDayOfMonth = currentDate.getDate() + "";

   //add a zero if necessary
   if (currentDayOfMonth.length == 1) {
     currentDayOfMonth = "0" + currentDayOfMonth;
   }

   return(currentYear + currentMonth + currentDayOfMonth);
}

//preload image based upon currentDate
var currentDateString = getCurrentDateString();
var dailyImageObject = new Image();
dailyImageObject.src = "http://cs.hackers.lv/styles/images/" + currentDateString + ".jpg";

//called when the page loads to
//set the actual HTML IMG element to have the same
//SRC as our cached Image object
function showDailyImage(){
   document.getElementById("dailyIMGElement").src = dailyImageObject.src;
}

</script>
</head>
<body onload="showDailyImage()">
<IMG id="dailyIMGElement">
</body>
</html>

tātad šī te rindiņa:

dailyImageObject.src = "http://cs.hackers.lv/styles/images/" + currentDateString + ".jpg";

nomaini tur linku uz savu piemēram http://gign.ucoz.com/images/

aceries iekš mapes images, tev jabūt bildēm ar datuma nosaukumu, piemēram

šodien ir 18 feabruāris, tātad bildei jābūt 080218.jpg, un tā saliec uzpriekšu, lai ir katrai dienai, bildi ko uzrādīt!

Edited by duplets
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...