Grow your CSS skills. Land your dream job.

Band Website customization

  • # September 5, 2009 at 9:38 pm

    I purchased the Band Website Template and have come a long way in learning how to incorporate php into a website. This has been a great help for me, thanks. However, I’m trying to customize the site behavior and am having a little trouble. The "shows" page, which connects to the database for the show information, deletes the current show on its date. I would like the show dates to remain on the page until I delete them manually (or for at least a day or 2 after the show). I believe this deleting action is called in a php script, but I’m not sure where it’s coming from. Perhaps the "update.php" file, or the "action.php" file? I’m new to php and would like to figure this out myself, but I’m getting a little frustrated. Any advise on what to look for? Thanks, Lon

    # September 6, 2009 at 6:04 am

    well no one else can help either if you don’t provide more information such as link, code, etc.

    if your looking for help we need more info.

    e.g. giving us the site page will let us see what is happeingin, giving us code snippetrs will let us see where it might be getting called from, then when we find that out we might as to see what the code is in that file to seee why it is not working the way you want it…..

    # September 8, 2009 at 4:49 pm

    Sorry, my bad… but this is still on my local box and I was trying to figure it out before I went live. I’m a newbie to php and mysql (but eager to learn) but I think I’ve narrowed it down a bit.

    The Show Schedule seems to be built from this bit of code from build-table.php

    /* build output */
    $query = ‘SELECT show_id, date_starts, stime, venue, url, city, state,
    DATE_FORMAT(date_starts,’%b %e’) as ds
    FROM shows
    WHERE date_starts >= NOW()
    ORDER BY date_starts ASC';
    $result = mysql_query($query,$DATABASE_LINK) or die(mysql_error().': ‘.$query);
    if(mysql_num_rows($result))
    {

    I think the line: WHERE date_starts >= NOW() is what is preventing the past dates from showing but I’m not sure how to modify it.
    I hope that is more helpful, thanks again, Lon

    # September 9, 2009 at 2:26 am

    have you tried searching google for this???

    you will find lots of useful hints about the time/date functions

    not sure if this works

    Code:
    $now = time();
    $plus7 = 7*24*60*60; // 7 days
    $now = $now + $plus7;

    echo ‘Current Date + 7: ‘.date(‘Y-m-d’, $now);

    # September 9, 2009 at 9:19 am

    Thanks ikthius for your help with this. Yes, I’ve searched quite a bit (I always do before posting) but apparently for the wrong terms. I falsely assumed that NOW() was the function and wondered why I couldn’t find any mention of it on the php.net site (I told you I was a newbie!). Now to search for more info on time/date functions…thanks again for setting me on the right path!

    # September 9, 2009 at 12:15 pm

    I pulled that from the net, and never tested…..

    any language you look at when it comes to time, more often than not you will have something like now() today() etc, but they are just functions that call upon time(), date() etc.

    you really want to look into the date function

    I probably would do:
    $sevenDay = 60*60*24*7;
    $nextweek = $today()+ $sevenDays;

    although again not tested, but that is how I would go about the formula

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".