Jump to content

ChrisFlynn

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by ChrisFlynn

  1. This interests me - I'll have a google. Thanks for the suggestion! (Incidently, it's with regards to this page > http://keaneshaped.co.uk/disco - feel free to snoop at the code)
  2. I found this code to preload images - it works in IE6 and Opera, but not Firefox. Predictably, JSLint hates it. var myimages = new Array(); function preloading() { for (x=0; x<preloading.arguments.length; x++) { myimages[x] = new Image(); myimages[x].src = preloading.arguments[x]; } } preloading("images/tn_thumb1over.jpg", "images/tn_thumb2over.jpg"); preloading("images/tn_thumb2over.jpg", "images/tn_thumb4over.jpg", "images/tn_thumb5over.jpg"); // etc for a total of about 30 rollover images I don't care about keeping this code (which I borrowed from the net anyway). Is there any magic code which anyone can recommend, which I should re-code my page to? Finding 'good' Javascript is pretty impossible, so it'd be great to know what is considered 'best practice'. Here's my criteria: * works for all 3 browsers (IE, FF, Opera - ideally all others too) * doesn't use array indexes by number (I add new images occasionally, and don't want to mess around with changing the array index) * is perhaps even is valid(!)
  3. Running http://validator.w3.org/checklink on http://keaneshaped.co.uk/faq (warning, it's 100kb of HTML with many links, so takes around 240 seconds on default). All my fragment links get the response: These fragment links works fine on IE6, FF2 and Opera 9, and validate with XHTML 1.0 Transitional. So, any idea why it's not link-validating? I'm a stickler for 'getting it right' and it's just going to annoy me otherwise Here is an example: (space added in </a > so it displays correctly on the forum) What's wrong with that? Any clues would be greatfully accepted!
  4. Let me rephrase one last time(!) - any idea where I should be asking alternatively? It's not Apache-specific, and Apache forums seem to be concerning the setup more than the latter analysis. Anyone?
  5. To ask a shorter question... Any apps where I can import log files, and then tell it just to parse for file X, and generate a day by day count e.g. File X 20080601 - 14 20080602 - 7 20080603 - 4 20080604 - 0 20080605 - 2
  6. Hi everyone, Slightly off-topic, but I know this is a great forum I've just recently started a podcast, and am trying to get some useful stats on the mp3 downloads (don't care about xml views, so feedburner is not use to me ). On my hosting package I have got three stats applications. However: Webalizer hits episode 1 - 914 episode 2 - 451 Analog requests episode 1 - 914 episode 2 - 451 *AwStats views* episode 1- 696 episode 2- 239 My questions: 1) Why the difference between AwStats and the others? Is AwStats filtering out duplicate users or something? 2) What's the best way for me to count file downloads? (So I can see how many people are hearing my podcast). Ideally, I want to see the number of completed *.mp3 downloads for each file by day. I have access to my raw logs so what are the best simple apps? (Windows desktop or PHP) I don't care about referrers, times, agents etc... something like this would be great: 20080424: Ep1.mp3 = 40, Ep2.mp3 = 23 20080425: Ep1.mp3 = 23, Ep2.mp3 = 50 ... 2a) I only want to count complete downloads. If I get: 70.107.132.22 - - [17/Apr/2008:03:23:19 +0100] "GET /Ep1.mp3 HTTP/1.1" 200 44628 "-" "iTunes/7.6.2 (Windows; N)" but I know my file is actually 3143523 bytes, I want to discount anything else (such as 44628). Is this possible using any apps, or even worthwhile? How does a resume work - is that 2 log entries, or just one? Any recommendations? I know it's not an exact science, but it'd be good to get close...
  7. I definitely agree. It also makes you more open - I was an avid IE fan (mainly because I think FF sucks), but Opera is pretty damn good... But back to the topic - where are the standards clearly defined? It seems a strange problem given that I've expressed it in CSS as I'd explain it in natural language, yet only IE can see it. So how do I work to the standard?
  8. I have a different (but related) issue now... I've got a 'middlepane' div. Within that is 'maincontainer' - which houses the content. I want 'advert' within the middlepane, on the far right. I also want the 'maincontainer' to be center of 'middlepane' (but text left aligned), but 'maincontainer' should never overlap with 'advert'. <html> <head> <style type="text/css"> div.middlepane { width: 100%; margin-left: auto; margin-right: auto; text-align: center; } div.maincontainer { padding: 5px; width: 75%; margin-left: auto; margin-right: auto; background: #EEEEEE; border: 1px solid black; } div.advert { float: right; width: 160px; } </style> </head> <body> <div class="middlepane"> <div class="advert"> <img src="images/mockad.gif" width="160" height="600" alt="advert" /> </div> <div class="maincontainer"> <p>This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content.</p> <p>This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content.</p> <p>This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content.</p> <p>This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content.</p> <p>This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content.</p> <p>This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content. This is some content.</p> </div> <div style="clear:both"></div> </div> </body> </html> IE understand what I mean. Firefox and Opera don't display what I mean.
  9. Dual core machines have 2 cores in one chip. So is the quoted speed (e.g. "1.8Ghz dual core") per core or per chip? Am I getting two flows of execution at 1.8Ghz each, or is effectively two 0.9Ghz cores amounting to a theoretical addition? I currently have a 3.5 year old 2.6Ghz Celeron machine, so am pretty surprised to see that new machines now don't have speeds a lot of Ghz faster (RIP Moore's Law). What's a very approximate equivalent in dual-core terms of my 2.6Ghz Celeron, and does anyone have any recommendations? Is quad significantly better than dual? Are certain models better? Or is it all about the RAM these days? The way I work is usually to have lots of things going on (I'm currently doing WAMP, ripping a CD, uploading, checking my email, have 5 browsers open - that's just light usage), and am not interested in gaming or graphics, if that helps...
  10. Perfect - thankyou I don't quite understand the rationale for this though - if I find anything good explanation pages I'll post them for other readers.
  11. IE 6 = ok. Opera 9.26 = ok. Firefox 2.0.0.12 = 'fails'.
  12. <html> <head> <style type="text/css"> div.superbox { border: 1px solid #000000; width: 80%; margin-left: auto; margin-right: auto; } div.subbox1 { float: left; } div.subbox2 { float: right; width: 30% } </style> </head> <body> <div class="superbox"> <div class="subbox1"> Content1 </div> <div class="subbox2"> Content2 <div>Another another</div> <div>And another</div> </div> </div> </body> </html> Within IE the content all displays within the superbox. On Firefox, it seems to 'fall out'. Any reason/workaround?
  13. If I change my 'Date' column to select from ref_date, then the Sales column won't be counting transactions though? I definitely see the logic that I want every date from ref_date in my left join, but don't see how I can then achieve the sales count without a subquery... Agreed - will update ASAP. Thanks for the tip. Agreed - much better than dateformat for this. Yes, I think I'm drifting a bit from my ultimate goal. I want to list the number of sales for each days between the first date there is a sale up to today (including days where there are no sales), ideally formatted DD/MM/YYYY. And I do like keeping it all to SQL if possible. Here's the latest: SELECT ref_date.Date AS 'Date', count( * ) AS 'Sales' FROM ref_date LEFT JOIN Transaction ON ( ref_date.Date = DATE(Transaction.Date) AND Transaction.productID= '1' ) GROUP BY Transaction.Date 2008-01-31 41 2008-02-12 1 2008-02-14 1 2008-02-14 1 2008-02-14 1
  14. Thanks for your input. OK - great. I see. I've only done inner joins before which is why I'm struggling (I know it's basic!) To clarify: Transaction.Date is: datetime NOT NULL (e.g. 2008-02-14 22:41:28) ref_date.Date is: date NOT NULL (e.g. 2008-02-01) Hence the date_format madness, as I want to group by date, and throw away the H:M:S. Ideally I want it in DD/MM/YYYY format, but whatever I can get working at the moment is good enough(!) This outputs the following: NULL 41 2008-02-12 1 2008-02-14 1 2008-02-14 1 2008-02-14 1 Also, doing: SELECT Transaction.Date AS 'Date', count( * ) AS 'Sales' FROM ref_date LEFT JOIN Transaction ON ref_date.Date = Transaction.Date AND Transaction.productID = '1' GROUP BY Transaction.Date Gives: Date Sales NULL 43 I appreciate I haven't made it totally clear from the start, but I appreciate everyone's help!
  15. I've also tried this, but get the somewhat cryptic: 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 0 01/01/1970 1 01/01/1970 1 01/01/1970 1 01/01/1970 1 I'm starting to wonder if it's something to do with the date format of my tables?
  16. I think I like the pure SQL approach best. I've now filled up the table; however I'm still only getting: Date Sales 2008-02-12 1 2008-02-14 3 Transaction.Date is DATETIME, ref_date is DATE, so I've done a little bit of (ugly) formatting... SELECT date_format( Transaction.Date, '%Y-%m-%d' ) AS 'Date', count( * ) AS 'Sales' FROM ref_date LEFT JOIN Transaction ON ref_date.Date = date_format( Transaction.Date, '%Y-%m-%d' ) WHERE Transaction.productID = '1' GROUP BY date_format( Transaction.Date, '%Y-%m-%d' ) ORDER BY date_format( Transaction.Date, '%Y-%m-%d' )
  17. I got it in the end! # if ($1.php exists) { $1.php } else { search.php?search=$1 } RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^([a-zA-Z]+)$ /$1.php [NC,L] RewriteRule ^([a-zA-Z]+)$ /search.php?search=$1 [NC,L] I'm sure that wasn't worth x hours... oh well
  18. I know for a fact MS Server can easily do this (effectively redirect a 404 to /anexceptionfile.php?id=$1); I'm quite surprised it's not simple. Which part of RTFM?
  19. Thanks for the answer - this definitely makes sense! What's the best way to create this 'dates' reference table, and fill it up? I'd normally use Excel's Autocomplete, but I can't get it to format right... Is there a nice SQL way of filling things up? ['01/01/2007'..'31/12/2010'] Chris
  20. Basically (I've cut the crap): CREATE TABLE `transaction` ( `Email` varchar(255) NOT NULL, `Date` datetime NOT NULL, `TransactionID` varchar(255) NOT NULL, `ProductID` smallint(5) unsigned NOT NULL, PRIMARY KEY (`TransactionID`) ) Each row represents a successful transaction.
  21. I hope I don't sound grumpy, as I know you guys do this for free! However, is there anything I could make more clear? Let me know if there's any confusion; I really appreciate any help!
  22. MySQL - 5.0.45 select date_format(Date, '%d/%m/%Y') as 'Date', count(*) as 'Sales' from Transaction where productID='5' group by date_format(Date, '%d/%m/%Y') order by date_format(Date, '%d/%m/%Y') Result: Date Sales 12/02/2008 1 14/02/2008 3 I want to have every day displayed; from the first one that exists (min Date) up to today. E.g. Date Sales 12/02/2008 1 13/02/2008 0 14/02/2008 3 15/02/2008 0 I'm guessing I need some kind of join, but I can't figure it out - what's the most elegant way of doing it?
  23. I guess this is an ordering issue, but no amount of changing the position of [L] seems to work... I'm trying to get the following behaviour on these two conditions: 1) User visits: http://domain.com/foo They see that in their address bar. The page loaded is http://domain.com/page.php?value=foo (To be pedantic, spaces and underscores should be replaced with hyphens in the address bar too - is this possible with [R]? I can parse the value on page.php so that's not an issue... Value should accept hyphens, numbers, letters etc) 2) I also have some 'real' pages which do actually exist (e.g. faq.php, index.php). User visits: http://domain.com/faq (no extension) They see that in their address bar. The page loaded is http://domain.com/faq.php I'm currently achieving the latter with: RewriteRule ^([a-z]+)$ /$1.php, but this isn't working alongside the first RewriteRule ^([A-Za-z0-9-]+)/$ page.php?value=$1 [L] Is there a dynamic way of getting both working, without hard-coding all my 'real' pages in?
  24. My profound apologies if this has been covered recently - if someone can post a link or even just some good search words that would be brilliant. OK, I have folders full of MP3s. I've adapted a script to dynamically these folders, and serve them to users - this works. However, now my hosting have now cut me off as their tmp files are getting full and they have to clean them. I'm guessing what is happening is people are pressing 'cancel' during the download and my script is being terminated since the interaction with the user is termitated? I added a try/catch but this didn't work (I'm more familiar with Java, so don't know if it works in the same context). Could anyone see any solutions? (I have limited disc space, so need to create ZIPs 'on the fly'). <?PHP $filename_no_ext=$_GET['download']; if (!is_dir($filename_no_ext)) { echo 'Folder not found'; die(); } header("Content-Type: archive/zip"); header("Content-Disposition: attachment; filename=$filename_no_ext".".zip"); $tmp_zip = tempnam ("tmp", "tempname") . ".zip"; `zip -r $tmp_zip $filename_no_ext`; $filesize = filesize($tmp_zip); header("Content-Length: $filesize"); try { $fp = fopen("$tmp_zip","r"); echo fpassthru($fp); } catch (Exception $e) { `rm $tmp_zip `; } // clean up the tmp zip file `rm $tmp_zip `; ?> Any obvious solutions of how to fix this?
×
×
  • 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.