Modification of PK's MovieDB [UPDATE 2009-06-04]
Here is the solution if you got decimals but only want to show integers in the panel:Elusyn wrote:thanks for your answer eddie, gonna work on it =)
and yes my votes dont have decimals..
in the file mdb3.php search for this (in the function _auto_import_ant_export):
Code: Select all
# Check if the colum "PERIOD" does exist
if (!$this->db->column_exists($this->mysql_table, "PERIOD"))
{
# Create the DB column "PERIOD" if necessary
$this->db->create_column($this->mysql_table, "PERIOD", "VARCHAR(15)");
}
# Process all movies and fill the column "PERIOD"
$this->_processPeriodForMovies();
Code: Select all
# Check if the colum "PERIOD" does exist
if (!$this->db->column_exists($this->mysql_table, "PERIOD"))
{
# Create the DB column "PERIOD" if necessary
$this->db->create_column($this->mysql_table, "PERIOD", "VARCHAR(15)");
}
# Check if the colum "RATE" does exist
if (!$this->db->column_exists($this->mysql_table, "RATE"))
{
# Create the DB column "RATE" if necessary
$this->db->create_column($this->mysql_table, "RATE", "VARCHAR(5)");
}
# Process all movies and fill the column "PERIOD"
$this->_processPeriodForMovies();
Than search in the function _processPeriodForMovies for this:
Code: Select all
$lsSQL = "UPDATE ".$this->mysql_table." SET PERIOD='$period' WHERE NUM=".$row[NUM];
$updateresult = $this->db->query($lsSQL);
}
Code: Select all
$lsSQL = "UPDATE ".$this->mysql_table." SET PERIOD='$period' WHERE NUM=".$row[NUM];
$updateresult = $this->db->query($lsSQL);
}
$query = "SELECT NUM, RATING FROM ".$this->mysql_table;
$result = $this->db->query($query);
while ($row = $result->fetch_assoc())
{
$rate = intval($row['RATING']);
$lsSQL = "UPDATE ".$this->mysql_table." SET RATE='$rate' WHERE NUM=".$row[NUM];
$updateresult = $this->db->query($lsSQL);
}
Hi
I downlaoded the files here and the latest xampp.
Then I put the files in the htdocs directory --> C: XAMPP HTDOCS MOVIEDB
I exported my DB from ANT with the options:
In PHPMYadmin I created a DB called 'moviedb' and Imported the SQL File --> entries were created (table 'moviedb' and movie details).
My config looks this:
I have no phpadmin pass set. Its a local DB.
Now when i go to /localhost/moviedb, I see the background colour and only:
Any ideas what Ive been doing wrong?
Thanks!
I downlaoded the files here and the latest xampp.
Then I put the files in the htdocs directory --> C: XAMPP HTDOCS MOVIEDB
I exported my DB from ANT with the options:
In PHPMYadmin I created a DB called 'moviedb' and Imported the SQL File --> entries were created (table 'moviedb' and movie details).
My config looks this:
Code: Select all
$this->config['mysql']['server'] = "localhost";
$this->config['mysql']['username'] = "root";
$this->config['mysql']['password'] = "";
$this->config['mysql']['database'] = "moviedb";
$this->config['mysql']['table'] = "moviedb";
Now when i go to /localhost/moviedb, I see the background colour and only:
Code: Select all
get_html(); ?>
Thanks!
is PHP working for your local apache?
To check, create a file called test.php only containing this
and call it (http://localhost/test.php)
To check, create a file called test.php only containing this
Code: Select all
<php
phpinfo();
?>
-
- Posts: 62
- Joined: 2009-11-12 05:53:14
I am afraid i can not find PK's package in order to find the read me file to perform the install.It seems the link is dead.If you don't know how to install it, go away! grin
Just kidding, it's easy to install, just read the readme from PK's package.
Is there somewhere to grab it.
Thank you 4 your time reading this.
Regards,
The_Observer.
Haven't checked the original link, just upped it here:
moviedb_alex1.rar - 0.39MB
moviedb_alex1.rar - 0.39MB
-
- Posts: 62
- Joined: 2009-11-12 05:53:14
Thank for the link but this is alex1's modification on PK's MovieDB package.Eddie wrote:Haven't checked the original link, just upped it here:
moviedb_alex1.rar - 0.39MB
What i really need is a link to PK's MovieDB package so i can read the readme file from there in order to install alex1's modification .
As i posted in my previous post just above alex1 says :
and that is why i need PK's package.If you don't know how to install it, go away! grin
Just kidding, it's easy to install, just read the readme from PK's package.
Thank you 4 reading this.
Regards,
The_Observer.
Edit: Ok i have found it.In case someone else is searching it ,you can download it from here
-
- Posts: 62
- Joined: 2009-11-12 05:53:14
Hi all.
I have a probably not so easy question but i have faith/hope in your help.
The deal is that i needed to have my ratings in ant movie db so i substituted the ratings field with the media label field so i could keep the number of votes except of the imdb rating .
So the media label field has become for example :
User Rating 7,9 out of 10 (with 113,151 votes)
In rating field i put my rating.
Now my question is ,since the template uses the rating field ,how can i modify it to use/sort with the media label field.
Is this possible ?
Can it be done?
Thank you 4 your time reading this.
Regards ,
The_Observer.
I have a probably not so easy question but i have faith/hope in your help.
The deal is that i needed to have my ratings in ant movie db so i substituted the ratings field with the media label field so i could keep the number of votes except of the imdb rating .
So the media label field has become for example :
User Rating 7,9 out of 10 (with 113,151 votes)
In rating field i put my rating.
Now my question is ,since the template uses the rating field ,how can i modify it to use/sort with the media label field.
Is this possible ?
Can it be done?
Thank you 4 your time reading this.
Regards ,
The_Observer.
So your media label contains the full string "User Rating x,x out of xx (with yyyy votes)" and not just the number of votes?the_observer wrote:The deal is that i needed to have my ratings in ant movie db so i substituted the ratings field with the media label field so i could keep the number of votes except of the imdb rating .
So the media label field has become for example :
User Rating 7,9 out of 10 (with 113,151 votes)
In rating field i put my rating.
Now my question is ,since the template uses the rating field ,how can i modify it to use/sort with the media label field.
And the rating field contains your personal rating?
-
- Posts: 62
- Joined: 2009-11-12 05:53:14
That is correct mate.
to be exact is :
User Rating: x,x out of 10 (with yyy votes)
Though i dont know how many digits yyy is but it should be an integer.
With my ignorant mind i see two ways to do it.
Either
1. i should make another column in the db and populate it with x,x and yyy from label (x,x would also be enough) and then display it to the position of rating instead of rating.
Or
2.When the template is constructed should suck x,x (and yyy) from label field and display it instead of rating.
To tell you the truth i didnt expect someone to respond because to me this task to do alone is difficult since i am no coder so i thank you very much for your response
Regards,
The_Observer.
P.S. Also i dont know which of the two would impact less in time and in possible future template releases or if there is a better way to be done.
to be exact is :
User Rating: x,x out of 10 (with yyy votes)
Though i dont know how many digits yyy is but it should be an integer.
With my ignorant mind i see two ways to do it.
Either
1. i should make another column in the db and populate it with x,x and yyy from label (x,x would also be enough) and then display it to the position of rating instead of rating.
Or
2.When the template is constructed should suck x,x (and yyy) from label field and display it instead of rating.
To tell you the truth i didnt expect someone to respond because to me this task to do alone is difficult since i am no coder so i thank you very much for your response
Regards,
The_Observer.
P.S. Also i dont know which of the two would impact less in time and in possible future template releases or if there is a better way to be done.
Both ways aren't that hard to implement.
For method1 you need two more db fields which are populated while importing (just like period).
The advantage is you are more free in the way you place the fields in the template, like # of votes in a different line or something like that.
For method2 you just change the dbfield that is outputted in the template from rating to medialabel. It's easier to do but you have to use the string as it is in the dbfield (or do some manipulation).
You get more flexibility in the output with method1, and method2 is easier to do.
Now it's up to you
For method1 you need two more db fields which are populated while importing (just like period).
The advantage is you are more free in the way you place the fields in the template, like # of votes in a different line or something like that.
For method2 you just change the dbfield that is outputted in the template from rating to medialabel. It's easier to do but you have to use the string as it is in the dbfield (or do some manipulation).
You get more flexibility in the output with method1, and method2 is easier to do.
Now it's up to you
-
- Posts: 62
- Joined: 2009-11-12 05:53:14
-
- Posts: 62
- Joined: 2009-11-12 05:53:14
I guess i have firstly to try to understand the structure of the whole thing .
how and where the skin reads from the db and fills things up in the screen e.t.c.
Usually i use the documentation but i cant find any exept from the config file so at the time this seems difficult.
But i thought of a third (more newbie) way to do it
I will save the db with another file name and re import the rating from imdb with the script using the url.So i will be able to use this copy of the db to show the correct rating in the template.
The drawback is that when i enter a new movie i will have to do in both instances of the db.
When/if i will have done some progress of understanding things better and have more specific questions ,cause from your last answer is obvious i will have to ask specific questions ,i will do ask them and lets hope that someone will be around...
Thanks.
Regards,
The_Observer.
how and where the skin reads from the db and fills things up in the screen e.t.c.
Usually i use the documentation but i cant find any exept from the config file so at the time this seems difficult.
But i thought of a third (more newbie) way to do it
I will save the db with another file name and re import the rating from imdb with the script using the url.So i will be able to use this copy of the db to show the correct rating in the template.
The drawback is that when i enter a new movie i will have to do in both instances of the db.
When/if i will have done some progress of understanding things better and have more specific questions ,cause from your last answer is obvious i will have to ask specific questions ,i will do ask them and lets hope that someone will be around...
Thanks.
Regards,
The_Observer.
I get the exact same thing in the latest WAMP on Windows XP.margaan wrote:Hi
I downlaoded the files here and the latest xampp.
Then I put the files in the htdocs directory --> C: XAMPP HTDOCS MOVIEDB
I exported my DB from ANT with the options:
In PHPMYadmin I created a DB called 'moviedb' and Imported the SQL File --> entries were created (table 'moviedb' and movie details).
My config looks this:
I have no phpadmin pass set. Its a local DB.Code: Select all
$this->config['mysql']['server'] = "localhost"; $this->config['mysql']['username'] = "root"; $this->config['mysql']['password'] = ""; $this->config['mysql']['database'] = "moviedb"; $this->config['mysql']['table'] = "moviedb";
Now when i go to /localhost/moviedb, I see the background colour and only:
Any ideas what Ive been doing wrong?Code: Select all
get_html(); ?>
Thanks!
Some more information:
Found this in Apache's error log:
[Mon Dec 07 11:50:28 2009] [error] [client 127.0.0.1] (20024)The given path is misformatted or contained invalid characters: Cannot map GET /%3C?%20print%20$moviedb->get_stylesheet()%20?> HTTP/1.1 to file, referer: http://localhost/
And if you use Internet Explorer rather than Firefox, you get this message in addition to the
Code: Select all
get_html(); ?>
Code: Select all
Floatbox does not support quirks mode. Page needs to have a valid doctype declaration.
Thanks.