Jump to content

dsonesuk

Members
  • Posts

    11,220
  • Joined

  • Last visited

  • Days Won

    117

Everything posted by dsonesuk

  1. dsonesuk

    date range

    Because, $monday= setdate, if this day is on Sunday, goes FORWARD 1 day, now you are in Monday, therefore 'this Monday' would target that Monday (next weeks Monday), whereas 'last Monday' brings you back the 'Monday' of the current week you are working to. Hope that makes sense! unless you mean? why not$startDate = $monday->modify("tomorrow");$startDate = $startDate->modify("last Monday");$startDate = $startDate->format('Ymd');$endDate = $sunday->modify("yesterday");$endDate = $endDate->modify("next Sunday");$endDate = $endDate->format('Ymd');instead$startDate = $monday->modify("tomorrow")->modify("last Monday")->format('Ymd');$endDate = $sunday->modify("yesterday")->modify("next Sunday")->format('Ymd');lot shorter
  2. dsonesuk

    date range

    $newdate = '30-04-2012';//$newdate = '02-05-2012';$now = new DateTime($newdate);$week = $now->format('l') === 'Sunday' ? 'previous' : 'this';$monday = clone $now;$monday->modify('Monday ' . $week . ' week'); /*$now->format('j');$sunday1=clone $now;$sunday1->modify('+7 days'); not required here */$sunday = clone $now;$sunday->modify('Sunday ' . $week . ' week');for ($day = clone $monday; $day <= $sunday; $day->modify('+1 day')) {echo $day->format('Y-m-d').'<br />';}
  3. dsonesuk

    date range

    That works as well, but i gather $sunday1 is to do with another part of code somewhere else?
  4. dsonesuk

    date range

    $now could be tuesday date, wednes.....etc therefore so will $monday, $sunday you have to define the actual monday and sunday values to get the range to loop through <?php$now = new DateTime;//$now->modify("+1 day");//$now->modify("+2 days");//$now->modify("+3 days");//$now->modify("+4 days");//$now->modify("+5 days");//$now->modify("+6 days");//$now->modify("+7 days"); $monday = clone $now;$monday->modify("+1 day")->modify("last Monday"); $sunday = clone $now;$sunday->modify("-1 day")->modify("next Sunday"); for ($day = clone $monday; $day <= $sunday; $day->modify('+1 day')) {echo $day->format('Y-m-d').'<br />';}?> the +1 and -1 days are used if on Monday, the last monday would the Monday week before, by going forward 1 day and selecting last Monday it becomes current last Monday, and then do reverse for Sunday.
  5. dsonesuk

    date range

    You don't need to loop through current weekdays, just identify if current day falls between start - end dates, and apply id to tr element <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><style type="text/css">.mytable td.weekdays {background-color:#FFFF99;}.mytable td.weekend {background-color: #FFCC99;}.mytable #current_week td.weekdays, .mytable #current_week td.weekend {background-color:#FF0033;}</style></head><body><?php$current = new DateTime;$monday = new DateTime;$sunday = new DateTime;$current = $current->format('Ymd'); // change from today to//$current = $current->modify("-1 week")->format('Ymd'); // last week$startDate = $monday->modify("tomorrow")->modify("last Monday")->format('Ymd');$endDate = $sunday->modify("yesterday")->modify("next Sunday")->format('Ymd');echo 'Monday = '.$startDate.'<br />';echo 'Sunday = '.$endDate.'<br />';echo 'current = '.$current.'<br />';?><table class="mytable"><tr><td class="weekdays">23</td><td class="weekdays">24</td><td class="weekdays">25</td><td class="weekdays">26</td><td class="weekdays">27</td><td class="weekend">28</td><td class="weekend">29</td></tr><?phpif($current >= $startDate && $current <= $endDate){echo '<tr id="current_week">';}else{echo '<tr>';}?><td class="weekdays">30</td><td class="weekdays">1</td><td class="weekdays">2</td><td class="weekdays">3</td><td class="weekdays">4</td><td class="weekend">5</td><td class="weekend">6</td></tr></table></body></html>
  6. ?? What do you mean transfer/import 3d model? from 3d application like 'truespace', 'Swift3D', long time since i used these, but they just created a 3d model and you save it as a flash movie, might have changed since then, to use slider rotate etc.OR scan 3d model of plane for example, which sounds expensive, honestly don't know.
  7. ??? iconbar or iconslist, anyway changed it to iconbar for this, in this situation it would be easier to us jquery to hide the counter when icon hovered over $(document).ready(function(){$("#iconbar").hover(function(){$("#unread_container").hide()},function(){$("#unread_container").show();});}); The other way would be apply position: relative; to li elements then remove the image from anchor link element, and place it beside it so anchor element it is now empty, you then make the anchor links the same size as images, and use position: absolute to place these above the respective image, AND the counter by using a higher z-index,
  8. Give the container position: relative;, with icon background-image, with counter inside overlapping icon, create anchor and make it display: block; position: absolute; top:0; left: 0; right:0; bottom:0;, this will overlap both icon image and counter, but you may have to adjust z-index; to fully overlap.
  9. Right!, because different browser show different borders, and IF you are allowed too, I suggest using cellspacing="1" with a background colour (black for instance) to show between spacing, the problem with this is you have to use, for instance a white background colour for each cell, but the results are consistent in all browsers, but you still end up with double border on bottom and left of five row table.
  10. The only way I can see this being done without the use of css, and with text appearing in blank left hand side of 5 cell rows, is by using two tables, one without borders on left, obviously the other with borders on right. You will!, end up with double borders showing in some browser, you may be able to use 'frame' attribute to help remove non required borders from showing in these browsers. IT is very much harder to achieve a design like this, that will look identical in all browsers, without the use of css.
  11. You don't require two tables, you just need to use border-collapse: and apply/remove borders to cells to achieve the same end result.
  12. Usually you don't lose quality shrinking, its usually the other way round, when you enlarge a small pixel image to a larger size it ends up pixelated and colour blurs from on pixel to the next. All you need to do is get the proportion correct, when he's finished, use high res for scanner while scanning the images, the file size will be huge, but then you just reduce it in size and res to go into you website to the quality you are happy with.
  13. 150px = 3.96875cm is exactly right, what you could do is draw these boxes in a graphics program, print it out and compare.
  14. It searches the whole domain and its sub pages, so you just need the domain name, you type in you keyword, it searches for listing in search engines if found it will show rank IF lower than ranking 200, and then list the url where it was found as inhttp://www.DomainName.com/dsonesuk.html so stop moaning.
  15. A free rank checker, which i use is seobook.com rank checker, you have to register, you enter your domain, then keyword/s and then click start, it then searches through the major search engine google.com, google.co.uk, bing, yahoo etc and list your ranking in each.
  16. page names should use hyphens /news-of-keyword.html AND NOT underscore news_of_keyword.html, google is able to separate hyphenated words so it will search by 'news', 'of', 'keyword' compared with search just 'news_of_keyword' which will return near zero results. The same also goes for image filenames my-keyword-01.jpg and my-keyword-02.jpg, you can also use the keyword in <h2> and <h3> as well but don't over do it.
  17. Works fine on mine, as soon as i reduce the height of table_inner div so the data content is greater than that element height, so can scroll the data content, and the header is fixed!
  18. Must be my PC and browsers then? getting a lot of that here recently, guess I'm a lucky chappy, cause the headers fixed on mine.
  19. ??? I think you will they are fixed, IF the content data exceeds the height set for .table_inner
  20. The only way I could get this to work cross browser was this method <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><script type="text/javascript">/*<![CDATA[*//*---->*//*--*//*]]>*/</script><style type="text/css">.table_wrapper {width:1024px; overflow-x:auto;}.table_inner{height:500px; overflow-y:auto; width:2021px;padding-bottom:60px;} .tloc { width: 110px; } .tsite{ width: 110px; } .tbusunit { width: 180px; } .titem { width: 200px; } .taction { width: 200px; } .tspecial { width: 130px; } .tFM { width: 50px; } .tcompliant { width: 90px; } .tdatecomp { width: 120px; } .tdatereview { width: 120px; } .tfreq { width: 100px; } .tremedial { width: 100px; } .tcnw { width: 120px; } .tcomments { width: 160px; } .tinforce { width: 180px; } .tlastchange { width: 180px; } .tnotes { width: 180px; }</style><!--[if lte IE 7]> <style> .table_wrapper{overflow-y:hidden;} </style><![endif]--><!--[if IE 8]> <style> .table_inner table{ padding-bottom:60px;} </style><![endif]--></head><body><div class="table_wrapper"><table width="2004" border="1" cellspacing="0" cellpadding="0"> <tr> <td class="tloc">first head</td> <td class="tsite">head</td> <td class="tbusunit">head</td> <td class="titem">head</td> <td class="taction">head</td> <td class="tspecial">head</td> <td class="tFM"> </td> <td class="tcompliant">head</td> <td class="tdatereview">head</td> <td class="tfreq">head</td> <td class="tremedial">head</td> <td class="tcnw ">head</td> <td class="tcomments">head</td> <td class="tinforce">head</td> <td class="tlastchange">head</td> <td class="tnotes">last head</td> </tr> </table> <div class="table_inner"> <table width="2004" border="1" cellspacing="0" cellpadding="0"> <tr bgcolor="#CCFFCC"> <td class="tloc">first rec</td> <td class="tsite"> </td> <td class="tbusunit"> </td> <td class="titem"> </td> <td class="taction"> </td> <td class="tspecial"> </td> <td class="tFM"> </td> <td class="tcompliant"> </td> <td class="tdatereview"> </td> <td class="tfreq"> </td> <td class="tremedial"> </td> <td class="tcnw "> </td> <td class="tcomments"> </td> <td class="tinforce"> </td> <td class="tlastchange"> </td> <td class="tnotes">last rec</td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr></table></div></div></body></html> With the usual conditional fixes for crappy IE. Note: not tested in IE9.
  21. Or just use normal js of jquery formula window.onload = function(){var tdChild = document.getElementsByTagName("td");for(var i=0; i<tdChild.length; i++){ if(tdChild[i].getAttribute("itemprop")=="productID") { alert(tdChild[i].innerHTML); }}}
  22. if you want to find that custom attribute, you might want to consider jquerys each() and attr() <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" ></script><script type="text/javascript">/*<![CDATA[*//*---->*/$(document).ready(function(){$("td").each(function(){ if($(this).attr("itemprop")=="productID") { alert($(this).html()) } });});/*--*//*]]>*/</script>
  23. dsonesuk

    Centering Images

    Geees, i thought we had finally got rid of this posting with no body, and then DAMN! got me doing it now. Please terminate this posting.
  24. Oh my Gosh you are right! the background colours, solid borders, not to mention dashed borders, and there's totally the wrong number of images, wrong background(well there's no background actually) all would make this code unusable. if only there was a way to remove these, and restrict the number of images to be resized and reposition? looks like a job for Mr Picky! enter YOU.
  25. try this<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>auto iframe height adjust</title><style></style><script type="text/javascript"><!--//function sizeFrame(frameId) { var F = document.getElementById(frameId); if(F.contentDocument) { F.height = F.contentDocument.documentElement.scrollHeight+30; //FF 3.0.11, Opera 9.63, and Chrome } else { F.height = F.contentWindow.document.body.scrollHeight+30; //IE6, IE7 and Chrome } }// window.onload=sizeFrame; //--></script></head><body><iframe width="100%" id="myFrame" src="aliens.htm" scrolling="no" frameborder="0" onload="sizeFrame('myFrame')">An iframe capable browser isrequired to view this web site.</iframe></body></html>
×
×
  • Create New...