WordPress.org

Ready to get started?Download WordPress

Forums

Set all publish dates to an offset value & have a movable TODAY? (4 posts)

  1. stitchmedia
    Member
    Posted 11 months ago #

    Here's my proposed hack:

    We are setting up WP for a television series and we need events to happen on a FICTIONAL timeline - ie Character A posts two days after Ep 1 airs, Character B responds to Character A six hours later, etc.

    WP is great for doing this in ABSOLUTE time (ie what day in reality did this post happen?) It's also great for displaying date/time relative to today (ie posted 8 days ago). What we need to do is to be able to shift time according to a broadcast schedule.

    I would like to be able to enter each post with an 'offset' that will publish posts whenever a specific amount of time has elapsed from a 'start time' (ie the first episode broadcast). That way, when the show re-broadcasts six months later, it's an easy set-up to just change the 'start time' for the new broadcast and know that all the posts will go dormant until their offset time elapses before publishing.

    Happy to clarify - not sure if this makes sense. Praying there's a plugin for this but we've got a coder to tinker too. Just looking for advice/ideas/tips.

  2. bcworkz
    Member
    Posted 11 months ago #

    Is it really a true fictional time line, or do you simply want to reset day zero to a new value once in a while? Is the time of next week's episode really a week away, or is it supposed to be only 24 hours (or whatever non-linear time frame) later?

    If a week passed is a week passed, you could setup all the future events as required by the broadcast schedule. When re-broadcast time comes about, you could reset the whole thing with a couple SQL queries. One changes all the post_status fields to "future" then another adds a specific number of days to every timestamp that represents the days between the original broadcast and the re-broadcast.

    This all could be run by clicking a special reset button in the admin settings. The result would be nothing is yet published after the reset. Each post will be published in turn as the timeline advances through the new schedule.

    If it is a true fictional timeline, the posts will need to be divorced from the system clock somehow. This will take much more brain power, but I could give it some thought if need be.

  3. stitchmedia
    Member
    Posted 11 months ago #

    Good question bcworks - the timeline matches 'real time' (ie a week in the story is a week in reality).

    So is it just as simple as updating the entire list of posts via SQL? That won't create any conflicts with images that might be in month folders? I'd prefer it if I could run this as an admin script with a custom page/button, because I may have to hand off the project at some point.

  4. bcworkz
    Member
    Posted 11 months ago #

    Ah, the months folders. Another good question. I don't think WP will care. The attachment URL data linking to the image will remain the same, we're only changing the dates for the attachment post type, nothing regarding the actual images. This does mean if someone were to look at the HTML source during the re-broadcast season, they would see the date folders do not match up with the post dates. Nothing should appear unusual in the normal HTML view.

    So yes, I do believe it is that simple. You will not be surprised that I've never done this, so I may be wrong. You'd obviously want to do some testing on a small subset of data before turning such a query loose on the entire DB. It should be apparent in this phase if there are any unforeseen issues with this scheme.

    Once you're sure this is a viable approach, it's pretty simple to add a settings section where one could enter the episode 1 re-broadcast date and upon submit, the entire DB would be reset for the new date scheme. Even so, it would be a really good idea if someone did a full DB backup before running the reset script.

Reply

You must log in to post.

About this Topic