Forum Replies Created

Page 40 of 50
  • Curtis Thompson

    June 23, 2005 at 4:06 pm in reply to: Can’t trash a file in Tiger

    hello…

    have you tried going command-line on it yet?

    https://docs.info.apple.com/article.html?artnum=106272

    sitruc

  • Curtis Thompson

    June 23, 2005 at 6:03 am in reply to: radio site

    hello…

    no problem – be sure to post the site url when you get it done!

    sitruc

  • Curtis Thompson

    June 23, 2005 at 3:30 am in reply to: radio site

    hello…

    this is much messier than it needs to be due to the rather lax formatting of the time values (like no am/pm for the first time, which requires a lot more logic to figure out what it should be) – but that said, this should be a functioning example:

    https://sitruc.com/cow/radio_schedule/

    the schedule.csv is a full schedule, the schedule.php is the script and the other one is the schedule.php code in a plain txt file…

    tested it with a few varieties of things and it seemed to work ok – again, it would be _immensely_ easier if the times were more structured (i.e. “11am – 1pm”), but this should compensate for the current times. but also note that if you change the format of the file, it might break this script – because of the free-flow nature of the times and day rows, this looks for very specific patterns to properly extract data (it’s the only way it can work, really)…

    sitruc

  • Curtis Thompson

    June 23, 2005 at 2:24 am in reply to: radio site

    hello…

    it’s hard to answer all these w/o the context of your actual file…

    i’ve seen your csv example from the other post – i think it will just be easier for me to write you an example rather than try to help you with your existing stuff when i’m so removed…

    give me 30 minutes or so…

    sitruc

  • Curtis Thompson

    June 23, 2005 at 1:06 am in reply to: radio site

    hello…

    you need to do a basic open file script and put the contents into an array:

    https://us4.php.net/manual/en/function.file.php

    then you need to analyze the time column and compare the time in that to now – this is typically done by comparing timestamps (seconds or sometimes milliseconds since jan 1, 1970). you can do that with the current time via this:

    https://us4.php.net/manual/en/function.time.php

    and then if your csv file has a typically-formatted date, you can use strtotime to convert it to a time value:

    https://us4.php.net/manual/en/function.strtotime.php

    if not, you’ll need to parse it manually with substr to get out the bits to make a time value:

    https://us4.php.net/manual/en/function.substr.php

    then using the basic example from the file call listed first above, you can iterate through the lines of the csv file and test each time value against your current time value – if it matches, you note the content value and break the loop (important to help performance) and then show the content via something like you had posted in your first example a few posts ago…

    make sense?

    sitruc

  • Curtis Thompson

    June 23, 2005 at 12:53 am in reply to: radio site

    hello…

    this guy supposedly has written an xls file reader for php (by default php doesn’t do this):

    https://www.paggard.com/projects/xls.reader/xls_reader_help.html

    but it is oop programming so without scripting experience it might be a little overwhelming…but actually his code looks rather straightforward.

    if the xls file doesn’t change often, then it would be much easier to export it as tab-delimited data or as a csv file and then php can read that easily…there, you just load the file via a file call and loop through the contents until you find the match.

    alternately, you could transfer the content to a database and read it that way.

    so yes – i do know how to do it and there are many ways _to_ do it, but all involve at least a bit of scripting knowledge. without seeing your xls file or knowing if you have the option of converting it to csv or the likes or putting it in a db, i cannot offer a specific solution to fit your needs. if you can do the csv or db route, it is no more than 20 lines or so of code. if it’s for a home page on a high-traffic site, you might want to consider the db route as it will be faster in the long run…

    sitruc

  • Curtis Thompson

    June 23, 2005 at 12:22 am in reply to: radio site

    hello…

    sorry – still missing info…when you say it won’t work, what do you mean? like the wrong data shows up? no data? script won’t compile?

    i don’t think it’s going to work with this:

    $query = “SELECT `B,13` FROM `timetable.xls` WHERE `id`=’$time'”;
    $result = mysql_query($query);
    $result = mysql_fetch_array($result);

    i’ve never seen a sql select running on an xls file like that and mysql_query will only typically run against a mysql db…

    sitruc

  • Curtis Thompson

    June 22, 2005 at 11:14 pm in reply to: radio site

    hello…

    short answer: yes. there are a ton of ways to do that – unfortunatley, you didn’t get into your personal scripting experience or other related bits that could be helpful in answering your question… :-/

    you can get into having this info in a database, although something as simple as a tab-delimited text file with one show per row might do as well – then use any basic scripting language (perl, php, asp, etc.) to read the file and show the appropriate content based on the current date and time…

    and if the schedule really doesn’t change that much, you could consider just storing it in a javascript array and just using that to figure out what to show. the database/tab file is easier for non-techies to edit, but it might end up being overkill if the schedule is pretty consistent…

    sitruc

  • Curtis Thompson

    June 22, 2005 at 3:24 pm in reply to: Tiger / I can no longer use Windows Sharing

    hey good deal! i just ran across that answer on the net as i saw your solved post – makes no sense at all… :-/

    sitruc

  • Curtis Thompson

    June 22, 2005 at 1:38 am in reply to: Ethernet to USB converter
Page 40 of 50

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy