Feature Request: Remote Database and/or Movie List Export | Page 12

Discussion in 'Moving Pictures' started by shackrock, January 13, 2009.

Thread Status:
Not open for further replies.
  1. joz

    joz Portal Pro

    Joined:
    March 17, 2008
    Messages:
    1,353
    Likes Received:
    153
    Occupation:
    J2ME / PHP programmer
    Ratings:
    +154 / 0
    Home Country:
    Netherlands Netherlands
    yeah, sorry guys.
    I put an HTAccess password on it yesterday because I'm currently developing stuff that's able to manipulate databases (for example setting watched flag from the net, or my rating for that matter), which is still fragile and open for hack attacks, so that's why.
    I'm currently looking for a good webdesigner, take a look here;
    https://forum.team-mediaportal.com/skins-50/looking-good-webdesign-54487/
    In that thread I put a couple screenshots. I can also give you a guest account login if you PM me.


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. LRFalk01

    LRFalk01 Portal Pro

    Joined:
    August 27, 2007
    Messages:
    257
    Likes Received:
    92
    Ratings:
    +92 / 0
    Home Country:
    United States of America United States of America
    How are you guarding against injection attacks? I was having a problem with that when trying to do PDO with sqlite.

    -LRFalk01
     
  4. joz

    joz Portal Pro

    Joined:
    March 17, 2008
    Messages:
    1,353
    Likes Received:
    153
    Occupation:
    J2ME / PHP programmer
    Ratings:
    +154 / 0
    Home Country:
    Netherlands Netherlands
    well there's a sqlite_escape_string for SQLite PDO in PHP which should be able to do the trick.
    Haven't fully tested everything yet for vulnarabilities, so I'm not 100% sure this will save me from certain doom but I'm pretty confident :)

    I'll try out some injection tonight on a test db and see what happens. I set it up MVC, all queries should be savely handled now, escaping all user input.

    The issue that's on my mind currently is concurrency problems with MP and the website.
    If MP runs, the website will not be able to open SQLite DB because MP will lock it (like a file lock). The other way around; when the website serves a page it locks it too and MP can't get in.
    I'm thinking to have a copy of the database for the website, although that will not allow me to change data within the DB from the web. Not sure yet.

    -----------EDIT----------
    Read up a little on sqlite, it seems like concurrency won't be a huge deal, maybe slow, but no biggy. At least that's what I figured from this page.
    It also seems like PDO is actually not the way to go, I think I'm rewriting to sqlite3().
    Is gonna save about 30% overhead.

    ---------EDIT2---------
    Just tested what I currently have and all is well, I think. LRFalk01 go have a a hack at it if you like, always regularly backup db's anyways and I just removed the password.
    I just need to finish up design wise to maybe make a release. Although I'm not even sure anyone would use it because of the requirements :)
    btw I will try to keep the load, bandwith (an even cpu) wise as low as possible. It's kinda hard though. It's eating a lot currently, which I don't mind but others might. It can be kinda slow, only 100KB/s upload on this server. There's also still some image optimization needed to be done.
     
  5. nibby

    nibby Portal Member

    Joined:
    January 30, 2007
    Messages:
    8
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Denmark Denmark
    Heya, could you put your _index.php file up in .txt so i can see the final code? Or .zip entire site so i can DL and play with it?

    Having trouble with the code from the first post aswell...

    This looks good - any chance of some code?

    And the previous requests are still very valid i think:

    * Show the IMDB Rating on the main table (sortable).
    * Show the ID number or a Date Added field on the main table (sortable).
    * Year on the main table (sortable).
     
  6. joz

    joz Portal Pro

    Joined:
    March 17, 2008
    Messages:
    1,353
    Likes Received:
    153
    Occupation:
    J2ME / PHP programmer
    Ratings:
    +154 / 0
    Home Country:
    Netherlands Netherlands
    Maybe very valid but not what I had in mind. There's gonna be a whole seperate search bit.
     
  7. shackrock

    shackrock Portal Pro

    Joined:
    December 27, 2008
    Messages:
    291
    Likes Received:
    5
    Gender:
    Male
    Occupation:
    Electrical Engineer
    Location:
    Raleigh, NC
    Ratings:
    +14 / 1
    Home Country:
    United States of America United States of America
    Show System Specs
    Yep here's what I have working now...
    Link to the table: The Dark Knight
    First my XSL file (movies.xsl)
    Code (Text):
    1.  
    2. <?xml version="1.0" encoding="ISO-8859-1"?>
    3. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    4. <xsl:template match="/">
    5.   <html>
    6.     <head>
    7.         <script type="text/javascript" src="javascript/mootools1.2.1.js"></script>
    8.         <script type="text/javascript" src="javascript/movies.js"></script>
    9.         <script type="text/javascript" src="javascript/sorttable.js"></script>
    10.         <link rel="stylesheet" href="css/main.css" type="text/css" media="screen" charset="utf-8" />
    11.         <title>HTPC Movies</title>
    12.  
    13.     </head>
    14.   <body>
    15.   <center>
    16.     <table class="sortable" border="1">
    17.       <tr>
    18.         <th>Title</th>
    19.         <th>Year</th>
    20.     <th>Genres</th>
    21.     <th>Score</th>
    22.     <th>Rating</th>
    23.     <th>Runtime</th>
    24.     <th>IMDB</th>
    25.       </tr>
    26.       <xsl:for-each select="ROOT/MOVIES/MOVIE">
    27.       <tr>
    28.         <td class="movieTitle">
    29.             <xsl:attribute name="id">
    30.                 <xsl:value-of select="ID" />
    31.             </xsl:attribute>
    32.             <xsl:value-of select="SORTBY"/>
    33.         </td>
    34.         <td class="movieYear"><xsl:value-of select="YEAR"/></td>
    35.         <td class="movieGenres"><xsl:value-of select="GENRES"/></td>
    36.         <td class="movieScore"><xsl:value-of select="SCORE"/></td>
    37.         <td class="movieRating"><xsl:value-of select="CERTIFICATION"/></td>
    38.         <td class="movieLength"><xsl:value-of select="RUNTIME"/></td>
    39.         <td class="movieImdb"><xsl:value-of select="IMDBID"/></td>
    40.       </tr>
    41.       </xsl:for-each>
    42.     </table>
    43.     </center>
    44.   </body>
    45.   </html>
    46. </xsl:template>
    47. </xsl:stylesheet>
    48.  
    Now, what first comes up is the list of movies, starting with the oldest added (so the bottom shows the newest added to the database).
    The XSL is straight from LRF's code, with a little modification, but hardly. I added a javascript sort thing to the table (also his suggestion, though!).


    It uploads anytime MP is running, thanks to LRF's script. To link the XSL to the XML file, I had to make sure to check his checkbox in his MP plugin at the bottom, and enter "movies.xsl" without the quotes in the box. Then, just make sure the XML and XSL file are both in the same directory and you shouldn't have a problem.

    Finally, I added this little script that redirects from the index.html directly to the movies.xml file:
    Code (Text):
    1.  
    2. <?php
    3.  
    4. header ("Location: http://www.thesoundaswordmakes.com/movies/movies.xml");
    5.  
    6. ?>
    7.  
    Hope that helps!

    p.s. I recently reformatted and reinstalled windows, so the movie list there has some mistakes, that's some odd bug in moving pictures I think, for some reason it didn't download all the information correctly/fully. But normally this should all work out beautifully.
     
  8. nibby

    nibby Portal Member

    Joined:
    January 30, 2007
    Messages:
    8
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Denmark Denmark
    Hi shackrock,

    Thank you but thats not what i needed. Those files i can DL but your webserver does not allow "raw" download of .php files. It will parse it when i download and so i only get .html and not the .php code.

    So could you put your _index.php file up in .txt so i can see the final code? Or .zip entire site so i can DL and play with it? :)
     
  9. LRFalk01

    LRFalk01 Portal Pro

    Joined:
    August 27, 2007
    Messages:
    257
    Likes Received:
    92
    Ratings:
    +92 / 0
    Home Country:
    United States of America United States of America
    nibby,

    His php code is just a redirect to an xml file. The xml file has a xsl stylesheet that makes it look the way you are seeing it.

    -LRFalk01
     
  10. nibby

    nibby Portal Member

    Joined:
    January 30, 2007
    Messages:
    8
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Denmark Denmark
    Then what pulls info from the movingpictures.db3 file?
     
  11. LRFalk01

    LRFalk01 Portal Pro

    Joined:
    August 27, 2007
    Messages:
    257
    Likes Received:
    92
    Ratings:
    +92 / 0
    Home Country:
    United States of America United States of America
Loading...
Thread Status:
Not open for further replies.

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!