/    Sign up×
Community /Pin to ProfileBookmark

Timer & Events

I’ll leave this question open, but I assume it’ll be done with Javascript and PHP backend scripts.

What I want to do is have a script that does the following

  • 1. Allows only one instance to run (i.e not via multiple tabs, or via device and desktop

  • 2. Has a timer of some sort to perform an event every 5minutes, one that doesn’t reset every time you refresh your browser.

  • 3. Want to NOT start the next interval until instructed, for example, when my the interval has ended, something is done (modal opens for example), nothing more can happen until it’s started again by clicking a button as an example.

  • 4. If the page is refreshed during this dwell time between intervals the modal just opens.
  • Long term progress will be stored in a database so when a user logs back in, it needs to start again from where they left off.

    Any kind of help on this would be great.

    Even points on how to professionally do steps 1 and 2 or do I need something advanced like Java?

    to post a comment
    Full-stack DeveloperJavaScript

    1 Comments(s)

    Copy linkTweet thisAlerts:
    @alexstormAug 11.2019 — Hi, I see there is no response for a while. My first reaction is that this functionality needs to be better worked through with a developer present. There are many ways you can go.

    Here are some quick notes on each.

  • 1. I think a back-end function watching for an extra call from the same ip, gets instead a warning page. Sorry, no additional tabs allowed.

  • 2. Javascript can create a timer that pops-up an alert first that the user has to click. I prefer to do that in jQuery, just because that is easier for me. jQuery adds weight to the page and should only really be used, if you are planning to make good use of the library, with a lot of animated controls, timers, one choice checking against other status and then serving to the user different results and that type of thing. If you don't really have a lot of that on the page, then it's cleaner to do the delay and alert in pure Javascript.

  • 3. Same answer as 2.

  • 4. Same answer as 2.


  • User starting where they left off really means getting the user to become a member, then store back-end data about the user to fill up a dbase of states and other details you need to get added to the user login dbase info on the server. So, when the user logs in again, the dbase pulls the state and data to bring back the page and info the user needs to continue. Before you make such a back-end, you really need to map out everything in a flowchart, so a well designed back-end can be created. There is no short cut to this, because the alternative of just doing a little at a time, would mean you recreate the wheel each time and you may have to do a major overhaul of the back end, each time you add something. This puts up your cost x 10, 20 or higher.

    I think that issue maybe why no one has bothered to answer. You need a lot more details and planning. From a more complete flowchart, you can get an estimate and that should be your goal, in my opinion. Then you can see if it's worth doing.

    I've worked on social media sites with more than 200K pages, eCommerce for world travel and hotels and others. Some features can quickly get into 5 figure cost or more, and they sound like they should be easy.

    Anyway, hope that helps.
    ×

    Success!

    Help @kiwis spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 3.28,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,

    tipper: Anonymous,
    tipped: article
    amount: 10 SATS,
    )...