SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Might I attempt this?

    Hi,
    I have a old client who wants me to make a cahnge to and exisiting website and I think PHP would be the way to go. Thing is I am new to this back end kinda stuff but I have no deadline so I wanted to give this a shot myself.
    Here is what I need to do
    Bascially the site has three video's on the page but on the server they have about 50 videos. I basically want to have the three videaos swap out every wednesday with the next three "in line" . I do have a little programming background but this would be my first attempt at a web based /php project. Is this to much for me to start? I am familiar with the sysntax and some functions of PHP already and have done simple things like forms etc.
    Here what I have in my list of how t do this. Any advice would be greatly appreciated. Am I on the correct path with this list?

    Purpose = Auto update 3 tables of content every wednesday.



    1- create some type of container in the 3 tables
    2- run a script each day in that at 12:01 am that uses the date() to find out if today is a wednesday or not.
    3- if today IS wednesday proceed with script and swap out first copntainer with the next file in and ordered list of content on server(does this have to be a database file? or can it just be files on the server and run them in order example- content_01, content_02, etc)
    4- move to next container in html file and run the same script.

  2. #2
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    still working on this. basically now I am looking ofr other sites that do something similar and trying to see how they did it.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2009
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It sounds like you just want to make a queue.

    try looking up tutorials on how to make a queue in php and modify it to your needs.
    Check out my web design blog.
    http://www.bolducpress.com

  4. #4
    SitePoint Evangelist Waffles's Avatar
    Join Date
    Nov 2005
    Posts
    435
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    consider researching cron jobs for the automatic running of said script,

    you could either have a database that contains records of every movie (easier to expand), ie:

    Code:
    movie_id   |    movie_name   | movie_path
    1               test.wmv       movies/movie_01.wmv
    ..
    ..
    keep a count in say a .txt file use this in an SQL query for the OFFSET parameter..so if you were on the 2nd week, the value in the txt file would be 6:

    Code:
    SELECT *
        FROM tblMovies
        LIMIT 3 OFFSET *VALUE FROM TEXT FILE*
    then just add 3 to the text file so next week it gets 3 movies starting from the 9th record in the table etc.

    PHP Code:
    //if its wednesday
    // get value from txtFile/whatever, its a 1 as we just started

    $q mysql_query('SELECT * FROM tblMovies LIMIT 3 OFFSET ' $txtFileValue ''); //return movies 001 002 003
    while($r=mysql_fetch_array($q)) {
        echo 
    $r['movie_name'];
        echo 
    '<html code to embed movie>';


  5. #5
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    both of your responses have throttled me off to getting rolling and learning more. thank you.


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
  •