Feature Request: Remote Database and/or Movie List Export (2 Viewers)

Status
Not open for further replies.

joz

Portal Pro
March 17, 2008
1,353
306
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.
 

LRFalk01

Portal Pro
August 27, 2007
257
92
38
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
 

joz

Portal Pro
March 17, 2008
1,353
306
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.
 

nibby

Portal Member
January 30, 2007
8
0
Home Country
Denmark Denmark
nice I finally figured it out, thanks!! haha. Not sure what my problem was, I started fresh and no problems, so must have been a typo or something.

Great tool!

Acutally one thing. The IMDB links don't show up.... I'm using the generic XSL you made, viewable here:
Index of /movies
mymovies.xml
mymovies.xsl

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...

if anyone's interested I'm working on something myself, this thread gave me the idea and the basic start (never worked with php + sqlite combi before).
It's still a work in progress but I'm getting there. All set up nicely php codewise now. Still not really sure how to style it all though. Liking the jquery fancy stuff going on (click the table rows and dvd covers) :)
Catalog: Movingpictures

I choose to do it with php for a couple of reasons;
1) I am familair with it
2) It's realtime
3) It has the potential to serve all kinds of data not just movingpictures
4) Powerfull queries and the use of apache aliases makes it show whatever

Currently setup in an MVC structure, if someone's interested I can post the code. I think it will only be running on php 5.
First I was copying images to my webroot but after a while I figured apache aliases would be easier (never done it, was a breeze).

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).
 

joz

Portal Pro
March 17, 2008
1,353
306
Home Country
Netherlands Netherlands
And the previous requests are still very valid i think

Maybe very valid but not what I had in mind. There's gonna be a whole seperate search bit.
 

shackrock

Portal Pro
December 27, 2008
291
12
Raleigh, NC
Home Country
United States of America United States of America
Yep here's what I have working now...
Link to the table: The Dark Knight
First my XSL file (movies.xsl)
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  	<head>
		<script type="text/javascript" src="javascript/mootools1.2.1.js"></script>
		<script type="text/javascript" src="javascript/movies.js"></script>
		<script type="text/javascript" src="javascript/sorttable.js"></script>
		<link rel="stylesheet" href="css/main.css" type="text/css" media="screen" charset="utf-8" />
		<title>HTPC Movies</title>

  	</head>
  <body>
  <center>
    <table class="sortable" border="1">
      <tr>
        <th>Title</th>
        <th>Year</th>
	<th>Genres</th>
	<th>Score</th>
	<th>Rating</th>
	<th>Runtime</th>
	<th>IMDB</th>
      </tr>
      <xsl:for-each select="ROOT/MOVIES/MOVIE">
      <tr>
        <td class="movieTitle">
        	<xsl:attribute name="id">
			    <xsl:value-of select="ID" />
			</xsl:attribute> 
			<xsl:value-of select="SORTBY"/>
		</td>
        <td class="movieYear"><xsl:value-of select="YEAR"/></td>
		<td class="movieGenres"><xsl:value-of select="GENRES"/></td>
		<td class="movieScore"><xsl:value-of select="SCORE"/></td>
		<td class="movieRating"><xsl:value-of select="CERTIFICATION"/></td>
		<td class="movieLength"><xsl:value-of select="RUNTIME"/></td>
		<td class="movieImdb"><xsl:value-of select="IMDBID"/></td>
      </tr>
      </xsl:for-each>
    </table>
	</center>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

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:
<?php

header ("Location: http://www.thesoundaswordmakes.com/movies/movies.xml");

?>

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.
 

nibby

Portal Member
January 30, 2007
8
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? :)
 

LRFalk01

Portal Pro
August 27, 2007
257
92
38
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
 

nibby

Portal Member
January 30, 2007
8
0
Home Country
Denmark Denmark
Then what pulls info from the movingpictures.db3 file?
 
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom