Jump to content

jlodwick

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Everything posted by jlodwick

  1. I think I can do the following for the first for loop if the timer is less than 0 but I'm not sure what to do for the second for loop if the timer is greater than 0. for(i=input2; i='link1'; i++)
  2. I tried the loop below for the first timer which is what I thought would work but it didn't work. It didn't even show the timer on the first product. Any ideas? <script type="text/javascript"> //###################################################################################### // Author: ricocheting.com // Version: v2.0 // Date: 2011-03-31 // Description: displays the amount of time until the "dateFuture" entered below. // NOTE: the month entered must be one less than current month. ie; 0=January, 11=December // NOTE: the hour is in 24 hour format. 0=12am, 15=3pm etc // format: dateFuture1 = new Date(year,month-1,day,hour,min,sec) // example: dateFuture1 = new Date(2012,4,24,23,59,59) = April 26, 2003 - 2:15:00 pm dateFuture1 = new Date(2012,4,24,23,59,59); // TESTING: comment out the line below to print out the "dateFuture" for testing purposes //document.write(dateFuture +"<br />"); //################################### //nothing beyond this point //first product function GetCount(ddate,iid){ dateNow = new Date(); //grab current date amount = ddate.getTime() - dateNow.getTime(); //calc milliseconds between dates delete dateNow; // if time is already past for(i=document.getElementById('link1'); i='link1'; i++){ if(amount < 0) { document.getElementById(iid).innerHTML="Sorry this deal is expired"; var input = document.getElementById('link1'); var input2 = document.createElement('input'); with (input2){ type = 'hidden'; } input.parentNode.replaceChild(input2,input); break; } } // else date is still good for(j='countbox1'; j='countbox1'; j++){ else(amount > 0) { days=0;hours=0;mins=0;secs=0;out=""; amount = Math.floor(amount/1000);//kill the "milliseconds" so just secs days=Math.floor(amount/86400);//days amount=amount%86400; hours=Math.floor(amount/3600);//hours amount=amount%3600; mins=Math.floor(amount/60);//minutes amount=amount%60; secs=Math.floor(amount);//seconds if(days != 0){out += days +" "+((days==1)?"day":"days")+", ";} if(hours != 0){out += hours +" "+((hours==1)?"hour":"hours")+", ";} out += mins +" "+((mins==1)?"min":"mins")+", "; out += secs +" "+((secs==1)?"sec":"secs")+", "; out = out.substr(0,out.length-2); document.getElementById(iid).innerHTML=out; setTimeout(function(){GetCount(ddate,iid)}, 1000); break; } } } window.onload=function(){ GetCount(dateFuture1, 'countbox1'); //you can add additional countdowns here (just make sure you create dateFuture2 and countbox2 etc for each) } </script>
  3. Sorry for the confusion what I was trying to say is there is a second timer that uses flash and XML and is the purple pretty timer but it doesn't remove the "add to cart" so that's why I need the first timer. I don't understand how to apply your script to my current script for my first timer. Below are my scripts broken out: #timer { color: red; font-size:11px; font-style:italic; } <script type="text/javascript"> //###################################################################################### // Author: ricocheting.com // Version: v2.0 // Date: 2011-03-31 // Description: displays the amount of time until the "dateFuture" entered below. // NOTE: the month entered must be one less than current month. ie; 0=January, 11=December // NOTE: the hour is in 24 hour format. 0=12am, 15=3pm etc // format: dateFuture1 = new Date(year,month-1,day,hour,min,sec) // example: dateFuture1 = new Date(2012,4,24,23,59,59) = April 26, 2003 - 2:15:00 pm dateFuture1 = new Date(2012,4,24,23,59,59); // TESTING: comment out the line below to print out the "dateFuture" for testing purposes //document.write(dateFuture +"<br />"); //################################### //nothing beyond this point //first product function GetCount(ddate,iid){ dateNow = new Date(); //grab current date amount = ddate.getTime() - dateNow.getTime(); //calc milliseconds between dates delete dateNow; // if time is already past if(amount < 0) { document.getElementById(iid).innerHTML="Sorry this deal is expired"; var input = document.getElementById('link1'); var input2 = document.createElement('input'); with (input2){ type = 'hidden'; } input.parentNode.replaceChild(input2,input); } // else date is still good else{ days=0;hours=0;mins=0;secs=0;out=""; amount = Math.floor(amount/1000);//kill the "milliseconds" so just secs days=Math.floor(amount/86400);//days amount=amount%86400; hours=Math.floor(amount/3600);//hours amount=amount%3600; mins=Math.floor(amount/60);//minutes amount=amount%60; secs=Math.floor(amount);//seconds if(days != 0){out += days +" "+((days==1)?"day":"days")+", ";} if(hours != 0){out += hours +" "+((hours==1)?"hour":"hours")+", ";} out += mins +" "+((mins==1)?"min":"mins")+", "; out += secs +" "+((secs==1)?"sec":"secs")+", "; out = out.substr(0,out.length-2); document.getElementById(iid).innerHTML=out; setTimeout(function(){GetCount(ddate,iid)}, 1000); } } window.onload=function(){ GetCount(dateFuture1, 'countbox1'); //you can add additional countdowns here (just make sure you create dateFuture2 and countbox2 etc for each) } </script> //applying the countdown timer: <div id='timer'> <div id="countbox1"></div> </div> //id of "link1" below is referenced in the javascript and changes the type to hidden if amount variable (countdown timer) is less than 0. <input class="add" id="link1" type="image" src="http://www.spaenvydeals.com/Deals/shopsite-images/en-US/buttons/defaults/Add_To_Cart.gif"> <script type="text/javascript" src="http://www.spaenvydeals.com/Deals/swfobject.js"></script> <script type="text/javascript"> var flashvars = { config_file: "http://www.spaenvydeals.com/Deals/fd-denver-co-date-changer.xml?nocache=010920091407" }; var params = { bgcolor: "FFFFFF", menu: "false", quality: "high", scale: "scale" }; var attributes = { id: "swf_content", name: "swf_content" }; swfobject.embedSWF("http://www.spaenvydeals.com/Deals/countdown_flip_1days.swf", "flashcontent", "388", "74", "8.0.0", false, flashvars, params, attributes); </script> //below is how I apply this timer <!--**********--> <div id="flashcontent"> <div id="altcontent"> <h3>Wrong version or no version of Flash detected</h3> <p>You might also have <strong>JavaScript</strong> disabled. If so, please enable scripting in your browser's preferences or internet options or download the latest <a href="http://www.microsoft.com/windows/internet-explorer/download-ie.aspx">Internet Explorer</a> or <a href="http://www.mozilla.com/firefox/">Firefox</a> browser.</p> <p>If you'd like to download the latest <strong>Flash</strong> plug-in, <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">click here</a>.</p> </div> </div> <!--**********-->
  4. First let me give you a link to the page I need to add the loops to then I'll explain: http://www.spaenvydeals.com/testing-timer-loop.html I have a countdown timer that I've modified to make an "add to cart" button change to hidden after the timer reaches 0 using "getElementByID". It works great but I would like to add a loop so this shows up for every product I add to the page. Every product on the page should have the same timer and all of them should expire at the same time but obviously they all have different "add to cart" buttons that all need to go hidden when the timer expires. I also have a fancy countdown timer that uses flash and all it does is says "Sorry Deal is Expired" with a pretty purple box around it when the timer reaches 0. I have both because I can't figure out how to get the pretty one to make the "add to cart" button hidden because it uses XML instead of javascript for the actions for the timer. Also I'm not sure if I would even trust it to remove the "add to cart" button if someone doesn't have flash on their PC. I don't really mind having both because I just make the first timer white and it doesn't show up. I'm more concerned with adding loops on these 2 countdown timers. As you can see on the testing page above I copied the first product but the timers don't show up on the second copied product because I currently don't have any loops. Please let me know if you have any questions. Thanks, Jeff
  5. I finally got a chance to test this and it works great! Thank you very much for your help with this!!! Jeff
  6. Thank you so much for your help with this. I didn't have a chance to test this today but I will test it tomorrow morning and let you know how it works.
  7. The code below is the javascript I can't change. This javascript is written with a CGI script which is really complex. I might be able to modify it but then I could mess up the shopping cart so I really don't want to try to change it. Any ideas? I've been trying to figure this out for a long time. Thanks! <script type="text/javascript" language="JavaScript"> <!-- var ss_screen = "Thank You"; var ss_sbid = "SSMSB1336493648.5134"; var ss_associate = "Jeff Lodwick"; var ss_ordernum = "1322"; var ss_paytype = "99"; var ss_taxstr = "Colorado Tax"; var ss_taxpercent = "6.75"; var ss_shippingstr = "Ground"; var ss_email = "j_lodwick@hotmail.com"; var ss_billname = "Jeff Lodwick"; var ss_address1 = "9551 Dolton Way"; var ss_address2 = ""; var ss_city = "Highlands Ranch"; var ss_state = "CO"; var ss_postalcode = "80126"; var ss_country = "United States"; var ss_company = ""; var ss_phone = "303-919-1366"; var ss_ordertotal = "0.00"; var ss_subtotal = "0.04"; var ss_taxtotal = "0.00"; var ss_shiptotal = "5.00"; var ss_name = new Array; var ss_sku = new Array; var ss_quantity = new Array; var ss_finite_options = new Array; var ss_price = new Array; var ss_weight = new Array; var ss_total_price = new Array; var ss_freeform_options = new Array; var ss_field1 = new Array; var ss_field2 = new Array; var ss_field3 = new Array; var ss_field4 = new Array; var ss_field5 = new Array; var ss_field6 = new Array; var ss_field7 = new Array; var ss_field8 = new Array; var ss_field9 = new Array; var ss_field10 = new Array; var ss_field11 = new Array; var ss_field12 = new Array; var ss_field13 = new Array; var ss_field14 = new Array; var ss_field15 = new Array; var ss_field16 = new Array; var ss_field17 = new Array; var ss_field18 = new Array; var ss_field19 = new Array; var ss_field20 = new Array; var ss_field21 = new Array; var ss_field22 = new Array; var ss_field23 = new Array; var ss_field24 = new Array; var ss_field25 = new Array; ss_name[0]="$.01 for massage at Jeff\'s Massage Company"; ss_sku[0]=""; ss_quantity[0]=1; ss_finite_options[0]=""; ss_freeform_options[0]=""; ss_weight[0]=0.000000; ss_price[0]="0.01"; ss_total_price[0]="0.01"; ss_field1[0]=""; ss_field2[0]=""; ss_field3[0]=""; ss_field4[0]=""; ss_field5[0]=""; ss_field6[0]=""; ss_field7[0]=""; ss_field8[0]=""; ss_field9[0]=""; ss_field10[0]=""; ss_field11[0]=""; ss_field12[0]=""; ss_field13[0]=""; ss_field14[0]=""; ss_field15[0]=""; ss_field16[0]=""; ss_field17[0]=""; ss_field18[0]=""; ss_field19[0]=""; ss_field20[0]=""; ss_field21[0]=""; ss_field22[0]=""; ss_field23[0]=""; ss_field24[0]=""; ss_field25[0]=""; ss_name[1]="test-shipping"; ss_sku[1]=""; ss_quantity[1]=1; ss_finite_options[1]=""; ss_freeform_options[1]=""; ss_weight[1]=1.000000; ss_price[1]="0.01"; ss_total_price[1]="0.01"; ss_field1[1]=""; ss_field2[1]=""; ss_field3[1]=""; ss_field4[1]=""; ss_field5[1]=""; ss_field6[1]=""; ss_field7[1]=""; ss_field8[1]=""; ss_field9[1]=""; ss_field10[1]=""; ss_field11[1]=""; ss_field12[1]=""; ss_field13[1]=""; ss_field14[1]=""; ss_field15[1]=""; ss_field16[1]=""; ss_field17[1]=""; ss_field18[1]=""; ss_field19[1]=""; ss_field20[1]=""; ss_field21[1]=""; ss_field22[1]=""; ss_field23[1]=""; ss_field24[1]=""; ss_field25[1]=""; ss_name[2]="$.01 for massage at Christy\'s Massage Company"; ss_sku[2]=""; ss_quantity[2]=2; ss_finite_options[2]=""; ss_freeform_options[2]=""; ss_weight[2]=0.000000; ss_price[2]="0.01"; ss_total_price[2]="0.01"; ss_field1[2]=""; ss_field2[2]=""; ss_field3[2]=""; ss_field4[2]=""; ss_field5[2]=""; ss_field6[2]=""; ss_field7[2]=""; ss_field8[2]=""; ss_field9[2]=""; ss_field10[2]=""; ss_field11[2]=""; ss_field12[2]=""; ss_field13[2]=""; ss_field14[2]=""; ss_field15[2]=""; ss_field16[2]=""; ss_field17[2]=""; ss_field18[2]=""; ss_field19[2]=""; ss_field20[2]=""; ss_field21[2]=""; ss_field22[2]=""; ss_field23[2]=""; ss_field24[2]=""; ss_field25[2]=""; var number_products=3; var number_coupons=0; // --> </script>
  8. Sorry for the late reply. Thanks for the reply. Unfortunately I'm using a third party shopping cart so I can't change the info at the top of the page. Is there a way I can do the loop without changing that info?
  9. Oh yeah and if ss_weight does not equal 0.000000 then it should not print a coupon.
  10. If the ss_quantity equals 1 it should print 1 coupon, if ss_quantity equals 2 it should print 2 coupons, etc.. The ss_quantity is a JS array.
  11. It might be easier to see it in action. If you view the page source you should be able to see what I'm trying to do. I have products that are shipped that I don't want to print out a coupon for which is why I have the last else statement. Here's a link of it in action: https://www.spaenvydeals.com/Deals/sc/testing11.html
  12. Below is my javascript. It's for printing out coupons. As you can see I'm manually specifying if ss_quantity equals 1 do the 8 document.write stuff which prints out the coupon and if ss_quantity equals 2 do the 8 document.write stuff times 2. In my real script I have this up to 10 but I want to do a loop for this so that if the quantity is 2 it loops through the coupon twice, if 3 it loops 3 times, etc. I think I need to do nested "for" loops but I'm pretty new to this stuff and would like some help. Thanks. <script type="text/javascript"> <!-- for (i = 0; i < number_products; i++) { if (ss_weight == 0.000000 && ss_quantity == 1) { document.write ("<div id=\"coupon1\"><img src=\"design/coupon.png\"></div><div id=\"coupon2\">"); document.write(ss_name); document.write("</div>"); document.write ("<div id=\"coupon3\">Order Number:"); document.write (ss_ordernum); document.write ("&nbsp&nbsp&nbsp&nbsp&nbspExpires: "); document.write(Date.today().add({months: 6}).toString("M-d-yyyy")); document.write ("</div><br><br><br><br><br><br><br>"); } else if (ss_weight == 0.000000 && ss_quantity == 2) { document.write ("<div id=\"coupon1\"><img src=\"design/coupon.png\"></div><div id=\"coupon2\">"); document.write(ss_name); document.write("</div>"); document.write ("<div id=\"coupon3\">Order Number:"); document.write (ss_ordernum); document.write ("&nbsp&nbsp&nbsp&nbsp&nbspExpires: "); document.write(Date.today().add({months: 6}).toString("M-d-yyyy")); document.write ("</div><br><br><br><br><br><br><br>"); document.write ("<div id=\"coupon1\"><img src=\"design/coupon.png\"></div><div id=\"coupon2\">"); document.write(ss_name); document.write("</div>"); document.write ("<div id=\"coupon3\">Order Number:"); document.write (ss_ordernum); document.write ("&nbsp&nbsp&nbsp&nbsp&nbspExpires: "); document.write(Date.today().add({months: 6}).toString("M-d-yyyy")); document.write ("</div><br><br><br><br><br><br><br>"); } else{ } } // --> </script>
  13. Nevermind I found my problem
  14. I have a securimage captcha that I'm trying to get working but even if I put the correct code in my form says the code is wrong. I've attached my code and below is my code in action. http://www.spaenvydeals.com/Deals/testing/subscribe.php 18163_.php
  15. Thanks for the understanding
  16. Wow I feel like such an idiot! You are right. It was the scrollbar, duh. Sorry for wasting your guys time with this and thank you so much for helping me with this!
  17. I've narrowed it down some more. If the text on the right side of the table is longer than the picture on the left side then the shift doesn't happen. Any ideas why this is happening?
  18. I've narrowed it down to if I remove the bullets from the about us page it makes the page shift.
  19. Ok this is strange. I must have changed something because now all those pages are the same and the page below is having this problem. If I change the text the problem happens. http://www.babyboomermd.com/development/about-Dr-Kotelko.html
  20. I'm having trouble with my page moving a couple centimeters whenever I add a table to my page. Below are 3 of my pages. The last one has a table and shifts the page to the right a couple centimeters when compared to the other pages. I've been trying to figure this out for a long time. Could someone here please help me with this? Thanks. http://www.babyboomermd.com/development/ http://www.babyboomermd.com/development/about-us.html http://www.babyboomermd.com/development/about-us1.html
  21. I didn't think the table returns were required if I didn't need them. I added what you said and it worked perfectly. Sorry if this was a newby question. Thanks for taking the time to help me with this!! This forum is awesome!!
  22. I have 2 pages that are copies of each other with the exception of one of them has a smaller image on the page and it moves the whole page over a couple centimeters. I have been working on this for a long time and I can't figure out why the size of the picture causes the whole page to shift. The 2 pages are below. By the way they are both using the same css sheets too. http://www.babyboomermd.com/development/about-us.html and http://www.babyboomermd.com/development/about-us1.html
  23. Nevermind. I was doing the echo command wrong. It's working now. Thanks again!
  24. Ok I got it working for one variable but I can't get it working for two. I've tried both of the following without success. first page: <?php session_start(); // this MUST be called prior to any output including whitespaces and line breaks! $_SESSION['firstname2 lastname2'] = $var_value; ?> second page: <?php session_start(); $var_value = $_SESSION['firstname2 lastname2']; echo "$var_value"; ?> and first page: <?php session_start(); // this MUST be called prior to any output including whitespaces and line breaks! $_SESSION['firstname2'] = $var_value1; $_SESSION['lastname2'] = $var_value2; ?> second page: <?php session_start(); $var_value1 = $_SESSION['firstname2']; $var_value2 = $_SESSION['lastname2']; echo "$var_value1" "$var_value2"; ?>
  25. I just realized I forgot to add session_start(); to my second page. It's working now. Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.