Is this as easy as it sounds, a few simple questions

Discussion in 'Programming' started by sonny123, May 18, 2009.

  1. #1
    the last time I did anything that could be regarded as programming or coding was on my 48k spectrum many moons ago so please go easy on the jargon.

    If I have playing card images, can they be stored in a directory and be randomly displayed so that every visitor to the home page in effect will see a different combination of 3 cards,

    Can the number of displays of each card be monitored?

    If a certain card is displayed (say the joker) is it possible for the appearance of the joker to then open a seperate browser/or new tab in same browser but for the newly opened page to remain in the background.

    could i use word press to do this
     
    sonny123, May 18, 2009 IP
  2. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #2
    A very simple script may be written to list all images in an array, shuffle / randomize it and pick last 3 enteries.
    As far displaying in aseparate viewport, YES it is possible.
     
    Vooler, May 21, 2009 IP
  3. plog

    plog Peon

    Messages:
    298
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Starting from scratch without any knowledge of HTML, CSS, JavaScript or a Server Side programming language, this is how I would learn to do this:

    First, build a generic html page that simply displays 3 static cards. Do this on your computer, no need to put this on the web. It will be faster to develope and easier to troubleshoot.

    Second, add JavaScript to make them randomly load.

    Third, add Javascript to make Jokers pop up in a new window.

    Fourth, play around with the Javascript and HTML so that you understand what is happening and get it to work just like you want.

    This will get you 90% of where you want to go. For the tracking what cards get displayed you are going to need to learn a server side language and set up a database (there are hacks and shortcuts around this, but to do it right you should learn a server side language and set up a database).

    Once you have it all set up you can integrate your code into WordPress. Either as a whole new page, or in the header file of your template.
     
    plog, May 22, 2009 IP
  4. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #4
    I would do this all server-side. That way if the user doesn't have javascript enabled it will still work correctly. The only part that cannot be done server-side is the opening of a window when the joker is displayed. But either way it is a fairly simple task.
     
    camjohnson95, May 22, 2009 IP