
robert.access
Members-
Posts
52 -
Joined
-
Last visited
Never
Everything posted by robert.access
-
really don't know. It's a pre made script... can you be more explicit please
-
hi! please somebody help me to set this to display + 5 hours in this script: <span id="servertime"></span> this is called from here (how to modify to display five hours ahead? Thanks): <script type="text/javascript"> var currenttime = '<?=$current_time_display;?>'; var serverdate=new Date(currenttime); function padlength(what){ var output=(what.toString().length==1)? "0"+what : what; return output; } function displaytime(){ serverdate.setSeconds(serverdate.getSeconds()+1) var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds()); document.getElementById("servertime").innerHTML=timestring; } window.onload=function(){ setInterval("displaytime()", 1000); } var ie4 = false; if(document.all) { ie4 = true; } function getObject(id) { if (ie4) { return document.all[id]; } else { return document.getElementById(id); } } function toggle(link, divId) { var lText = link.innerHTML; var d = getObject(divId); if (lText == '+') { link.innerHTML = '–'; d.style.display = 'block'; } else { link.innerHTML = '+'; d.style.display = 'none'; } } </script>
-
it's not working how exacly to modify? $thetimex = date("F d, Y H:i:s", time() + (TIME_OFFSET * 3600));
-
thank you very much for the answer! I will try'it and let you know if working. "Where is 'TIME_OFFSET' defined?" - don't know???? With this script I have a countdown on page and if it finish will display CLOSED.... I will try now your code. thx again
-
hi I have the following script: <? session_start(); $thedates = $db->get_sql_field("SELECT end_time FROM " . DB_PREFIX . "auctions WHERE auction_id='" . $_REQUEST['id'] . "'", 'end_time'); $thedates = date("Y-m-d H:i:s",$thedates); $countdown_to = "$thedates"; // "YYYY-MM-DD HH:MM:SS" --- time is in 24 hour format $float = 'clear'; // clear - left - right $font = "Arial, 'Times New Romans'"; $font_color = "#000"; $font_size = '8pt'; $font_weight = 'bold'; $width = '250px'; $height = '10px'; $border_width = '1px'; $border_color = '#ccc'; $background = ''; $border_style = 'none'; $padding = '0'; $margin = '0'; $thetimex = date("F d, Y H:i:s", time() + (TIME_OFFSET * 3600)); $count_from = "$thetimex"; function datediff($interval, $datefrom, $dateto, $using_timestamps = false) { /* $interval can be: yyyy - Number of full years q - Number of full quarters m - Number of full months y - Difference between day numbers (eg 1st Jan 2004 is "1", the first day. 2nd Feb 2003 is "33". The datediff is "-32".) d - Number of full days w - Number of full weekdays ww - Number of full weeks h - Number of full hours n - Number of full minutes s - Number of full seconds (default) */ if (!$using_timestamps) { $datefrom = strtotime($datefrom, 0); $dateto = strtotime($dateto, 0); } $difference = $dateto - $datefrom; // Difference in seconds switch($interval) { case 'yyyy': // Number of full years $years_difference = floor($difference / 31536000); if (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom), date("j", $datefrom), date("Y", $datefrom)+$years_difference) > $dateto) { $years_difference--; } if (mktime(date("H", $dateto), date("i", $dateto), date("s", $dateto), date("n", $dateto), date("j", $dateto), date("Y", $dateto)-($years_difference+1)) > $datefrom) { $years_difference++; } $datediff = $years_difference; break; case "q": // Number of full quarters $quarters_difference = floor($difference / 8035200); while (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom)+($quarters_difference*3), date("j", $dateto), date("Y", $datefrom)) < $dateto) { $months_difference++; } $quarters_difference--; $datediff = $quarters_difference; break; case "m": // Number of full months $months_difference = floor($difference / 2678400); while (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom)+($months_difference), date("j", $dateto), date("Y", $datefrom)) < $dateto) { $months_difference++; } $months_difference--; $datediff = $months_difference; break; case 'y': // Difference between day numbers $datediff = date("z", $dateto) - date("z", $datefrom); break; case "d": // Number of full days $datediff = floor($difference / 86400); break; case "w": // Number of full weekdays $days_difference = floor($difference / 86400); $weeks_difference = floor($days_difference / 7); // Complete weeks $first_day = date("w", $datefrom); $days_remainder = floor($days_difference % 7); $odd_days = $first_day + $days_remainder; // Do we have a Saturday or Sunday in the remainder? if ($odd_days > 7) { // Sunday $days_remainder--; } if ($odd_days > 6) { // Saturday $days_remainder--; } $datediff = ($weeks_difference * 5) + $days_remainder; break; case "ww": // Number of full weeks $datediff = floor($difference / 604800); break; case "h": // Number of full hours $datediff = floor($difference / 3600); break; case "n": // Number of full minutes $datediff = floor($difference / 60); break; default: // Number of full seconds (default) $datediff = $difference; break; } return $datediff; } $diff = datediff("s", $count_from, $countdown_to); header('Content-Type: text/javascript'); ?> countdown = <?=$diff?>; function convert_to_time(secs) { secs = parseInt(secs); hh = secs / 3600; hh = parseInt(hh); mmt = secs - (hh * 3600); mm = mmt / 60; mm = parseInt(mm); ss = mmt - (mm * 60); if (hh > 23) { dd = hh / 24; dd = parseInt(dd); hh = hh - (dd * 24); } else { dd = 0; } if (ss < 10) { ss = "0"+ss; } if (mm < 10) { mm = "0"+mm; } if (hh < 10) { hh = "0"+hh; } if (dd == 0) { return (hh+" Hours, "+mm+" Minutes, "+ss+" Seconds"); } else { if (dd > 1) { return (dd+" Days, "+hh+" Hours, "+mm+" Minutes, "+ss+" Seconds"); } else { return (dd+" Day, "+hh+" Hours, "+mm+" Minutes, "+ss+" Seconds"); } } } function do_cd() { if (countdown <= 0) { document.write("<div id=\"cd\" style=\"float:<?=$float?>\; margin:<?=$margin?>\; padding:<?=$padding?>\; border: <?=$border_size?> <?=$border_style?> \<?=$border_color?>\; background:\<?=$background?>\; height:<?=height?>\; width:<?=$width?>\; font-family: <?=$font?>\; color: \<?=$font_color?>\;font-size:<?=$font_size?>\; font-weight:<?=$font_weight;?>\; text-align:center\;\">CLOSED</div>\n"); } else { document.getElementById('cd').innerHTML = convert_to_time(countdown); setTimeout('do_cd()', 1000); } countdown = countdown - 1; } document.write("<div id=\"cd\" style=\"float:<?=$float?>\; margin:<?=$margin?>\; padding:<?=$padding?>\; border: <?=$border_size?> <?=$border_style?> \<?=$border_color?>\; background:\<?=$background?>\; height:<?=height?>\; width:<?=$width?>\; font-family: <?=$font?>\; color: \<?=$font_color?>\;font-size:<?=$font_size?>\; font-weight:<?=$font_weight;?>\; text-align:left\;\"></div>\n"); do_cd(); <? exit(); ?> Everithing works fine but My server date it's set with +5 hours (time difference), because I use a server that is 5 hours difference from the site, and I need to set +5 hours in the above script. How can I do that??? Please help. Thank you!
-
I solved temporaly. I have separate them in two tables. If anyoane have another idea mabe within a div, please post it here. Thanks!
-
Hi! I have a strange problem with a code, like following: <table> <tr> <td colspan="2"><textarea id="description" name="description" style="width: 400px; height: 200px; overflow: hidden;"><?=$text_details['description'];?></textarea><?=$text_description_editor;?></td> </tr> </table> and the page its using ajax selection so when you select items, that are above of this code, <?=$text_description_editor;?> (witch is an html editor) it's floating on page, over the text and images (when the page go bigger). How an I make it to go down automatically and stay in table and not float around??? Thank you in advance! Here it's a pic that show the buttons image are not go down with background, and the position change when ajax make the page bigger.
-
text box alphanumeric caracters only
robert.access replied to robert.access's topic in PHP Coding Help
hi all ant thanks for help. sorry for long time that I dont read this post, but trying to find a solution. So, like mjdamato says, if can I use php it's more convenient. I know verry little about javascript and php. What I need it's <form action....><imput type="text" name="x"></form> so, in the form the user to not be able to copy paste, to not be able to enter !@#$%^&*()_+={}[];':",./<>? etc, just only alpha and numbers. And also, into another form I want to limit the numbers they enter like: <imput type=text maxlength="1"> so user can imput from 0 to 9 but how can I limit this to only 5 from 0 to 5?? Thank you for your help. An example on how to implement this it will verry verry usefull to figure out how to implement to my site. Thank you very much. -
text box alphanumeric caracters only
robert.access replied to robert.access's topic in PHP Coding Help
i have found this: <?php $strings = array('AbCd1zyZ9', 'foo!#$bar'); foreach ($strings as $testcase) { if (ctype_alnum($testcase)) { echo "The string $testcase consists of all letters or digits.\n"; } else { echo "The string $testcase does not consist of all letters or digits.\n"; } } ?> I asume that will be in the top of my php page, but what to put on imput form??? <input type="text" name="name" size="40" /> Can you please give me a small example??? Thanks! -
text box alphanumeric caracters only
robert.access replied to robert.access's topic in PHP Coding Help
thank you very much for quick answer. -
hi all! I have search on google on how to enter in a test box only caracters A-Z,a-z,0-9 using php, but all the solutions are not for me I need, if you can help me to allow a user to insert only those caracters and with no space at all, like in username field. Can you please help me with an example? Thanks!
-
by the way css rules are: .sprite-bl { background-position: 0 0; } .sprite-br { background-position: 0 -15px; } .sprite-ml { background-position: 0 -30px; } .sprite-mr { background-position: 0 -32px; } .sprite-ms { background-position: 0 -34px; } .sprite-tl { background-position: 0 -163px; } .sprite-tr { background-position: 0 -177px; } So it's possible to align sprite images???
-
Hi! I realy have a problem including a sprite image in my website to minimize the http request. Please help me with the following code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>CSS rounded-corner</title> <style type="text/css"> body { font:normal 76% georgia,helvetica,verdana,tahoma,arial,"sans serif"; } #container { background: url(table.png) no-repeat top left; } .dialog { width:980px; margin:0px auto; min-width:20em; color:#fff; } .dialog .hd .c, .dialog .ft .c { font-size:1px; /* ensure minimum height */ height:13px; } .dialog .ft .c { height:14px; } .dialog .hd { background:transparent no-repeat 0px 0px; } .dialog .hd .c { background:transparent url(tr.gif) no-repeat right 0px; } .dialog .bd { background:transparent url(ml.gif) repeat-y 0px 0px; } .dialog .bd .c { background:transparent url(mr.gif) repeat-y right 0px; } .dialog .bd .c .s { margin:0px 8px 0px 4px; background:#B8E1FF url(ms.jpg) repeat-x 0px 0px; padding:1em; } .dialog .ft { background:transparent url(bl.gif) no-repeat 0px 0px; } .dialog .ft .c { background:transparent url(br.gif) no-repeat right 0px; } /* content-specific */ .dialog h1 { /* header */ font-size:2em; margin:0px; padding:0px; margin-top:-0.6em; } .dialog p { margin:0.5em 0px 0px 0px; padding:0px; font:0.95em/1.5em arial,tahoma,"sans serif"; } </style> </head> <body> <div class="dialog"> <div class="hd" id="container" style="background-position: 0 -163px;"><div id="container" class="c" style="background-position: 0 -177px;"></div></div> <div class="bd" style="background-position: 0 -30px;"> <div class="c"> <div class="s"> <!-- content area --> <h1>xxxxxxx</h1> <!-- content area --> <hr color="#000000" /><br /> yyyyyyyyyyyyyyyy<br /> </div> </div> </div> <div class="ft" id="container" style="background-position: 0 0;"><div class="c"></div></div> </div> <p> </p> </body> </html> the image its I cannot align the corner to right. Please someone help me at least with one cornet (top) to figure out how it's work. and one middle margin to repeat Thank you very much!