Results 1 to 5 of 5

Thread: Auto-deleting code

  1. #1
    Join Date
    Apr 2010
    Location
    New York
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation Auto-deleting code

    http://alldesignedforyou.com/whiskey/calendar/

    Is there a code for a page like this? so that when the concert date passes, it deletes the concert information from the page?

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Depending on how it is all setup, it's very simple: only select (or keep) dates after/including today's date. if ($date>=$todaysdate) { continue.... }

    This could be done in PHP or another serverside language while getting info from the database or other storage location, or while sorting the data, or after all of this using Javascript to only display the dates you want.

    The only hard part is figuring out where in the script to add it and then finding the exact syntax and an easy way to check that it is "valid".

    If you want more help, you'll need to post some code. If you want someone to create an entire calendar for you, you may want to ask for paid help. If you are just wondering if anyone has seen this, then someone may post a link for you, but it's also easy enough to add this to any existing calendar script as long as you are willing to take the time to find the sorting/finding operation and modify it a bit.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Apr 2010
    Location
    New York
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    The site's built in wordpress, currently all of the content on that page is place in individually, like the first concert's code is

    HTML Code:
    [caption id="attachment_104" align="alignright" width="203" caption="Courtlyn Carr"]<img class="size-full wp-image-104   " title="courtlyn-carr" src="http://alldesignedforyou.com/whiskey/wp-content/uploads/2010/03/courtlyn-carr.png" alt="Courtlyn Carr" width="203" height="134" />[/caption]
    <h3>Friday - March 19 2010</h3>
    <a href="http://courtlyncarr.com/" target="_blank">Courtlyn Carr</a>
    <em>Country
    </em>
    
    A contemporary songwriter, Courtlyn Carr knew long ago that her heart  and soul had—and have—an insatiable hunger for writing and performing  her own music.  As a powerful vocalist and multi-instrumentalist, Carr  pours her energy into creating music that displays the emotion and  honesty inherent in a Nashville star.
    
    <a href="http://www.missiontix.com/page/searchResults/?venue=The%20Whiskey" target="_blank"><strong>Get Your Tickets Now!</strong></a>
    After the client approves this website, someone else will be adding in new concert dates, so the easier the method, the better.

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    There's nothing you can do if it is just entered manually. You need a programming language (like PHP or Javascript) that has access to that information as DATA, not as text.

    It's theoretically possible to parse the page and search through the text (very complex) to eventually figure out which text sections (such as a <div>) contain outdated concert info, BUT this is not possible within the way that wordpress is setup since it parses the text, rather than giving you a way to parse it.


    So, you either need to just update everything manually (which will over time get very tiring) or switch to a dynamic system where a programming language does the work for you. Integrating this with wordpress might be somewhat difficult, though it should be possible.

    Personally I would use a database and PHP, but you could also just use a Javascript setup where you have a list of events and Javascript generates them on the page, but do be warned that in that case the end user would need Javascript enabled in order to see any of it at all-- if not, they'd see no concerts.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. The Following User Says Thank You to djr33 For This Useful Post:

    adfy (04-02-2010)

  6. #5
    Join Date
    Apr 2010
    Location
    New York
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    hmm that sucks but alright, could you help me out with this other topic?: http://www.dynamicdrive.com/forums/s...ad.php?t=53693

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •