Modification of PK's MovieDB [UPDATE 2009-06-04]

If you made a template for printing or HTML export, you can offer it to the others here. You can also ask here for help about these templates
Eddie
Posts: 40
Joined: 2005-07-29 07:04:08

Post by Eddie »

The picture shows the import by hand. The autoimport expects the SQL file in the folder "antexport" and then just call the webpage.
This should import the SQL into the database and create the missing database field.
Elusyn
Posts: 2
Joined: 2009-11-03 17:19:15

Post by Elusyn »

thanks for your answer eddie, gonna work on it =)
and yes my votes dont have decimals..
Mstrik
Posts: 9
Joined: 2009-11-11 10:02:22

Post by Mstrik »

Eddie wrote:The picture shows the import by hand. The autoimport expects the SQL file in the folder "antexport" and then just call the webpage.
This should import the SQL into the database and create the missing database field.
Thanks, will try it the week.
qtx
Posts: 8
Joined: 2009-02-07 10:19:56

Post by qtx »

What's the equivalent to the $$DATE & $$TIME command?
(I need it to let people know when the last time was I updated the movielist)

Also, anyone figured out what is causing Pinonono's problem (previous page)?
(the "Random Movie" piece of code being all fuzzy etc)
I have the same problem =]
Eddie
Posts: 40
Joined: 2005-07-29 07:04:08

Post by Eddie »

Elusyn wrote:thanks for your answer eddie, gonna work on it =)
and yes my votes dont have decimals..
Here is the solution if you got decimals but only want to show integers in the panel:
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();
and change it to this:

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();
That adds a new database field.
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);
		}
and change it to this:

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);
		
		}
This fills the database field. Now only one thing is left to be done. Create a panel using the new field "RATE" instead of "RATING".
margaan
Posts: 2
Joined: 2009-11-21 10:37:04

Post by margaan »

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:

Image

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";
I have no phpadmin pass set. Its a local DB.

Now when i go to ://localhost/moviedb, I see the background colour and only:

Code: Select all

get_html(); ?>  
Any ideas what Ive been doing wrong?

Thanks!
Eddie
Posts: 40
Joined: 2005-07-29 07:04:08

Post by Eddie »

is PHP working for your local apache?
To check, create a file called test.php only containing this

Code: Select all

<php

phpinfo();

?>
and call it (http://localhost/test.php)
margaan
Posts: 2
Joined: 2009-11-21 10:37:04

Post by margaan »

yap, works fine... when I do that...

UPDATE: Used my older XAMPP version... works now... weird...
Thanks!
the_observer
Posts: 62
Joined: 2009-11-12 05:53:14

Post by the_observer »

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

Is there somewhere to grab it.

Thank you 4 your time reading this.

Regards,

The_Observer.
Eddie
Posts: 40
Joined: 2005-07-29 07:04:08

Post by Eddie »

Haven't checked the original link, just upped it here:
moviedb_alex1.rar - 0.39MB
the_observer
Posts: 62
Joined: 2009-11-12 05:53:14

Post by the_observer »

Eddie wrote:Haven't checked the original link, just upped it here:
moviedb_alex1.rar - 0.39MB
Thank for the link but this is alex1's modification on PK's MovieDB package.

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 :
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.
and that is why i need 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
Eddie
Posts: 40
Joined: 2005-07-29 07:04:08

Post by Eddie »

Ok, my fault. should have read better :)
the_observer
Posts: 62
Joined: 2009-11-12 05:53:14

Post by the_observer »

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.
Eddie
Posts: 40
Joined: 2005-07-29 07:04:08

Post by Eddie »

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.
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?
And the rating field contains your personal rating?
the_observer
Posts: 62
Joined: 2009-11-12 05:53:14

Post by the_observer »

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.
Eddie
Posts: 40
Joined: 2005-07-29 07:04:08

Post by Eddie »

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 :)
the_observer
Posts: 62
Joined: 2009-11-12 05:53:14

Post by the_observer »

Unfortunately

i cannot do any of the two ways without some guidance :(

Regards,
The_Observer.
Eddie
Posts: 40
Joined: 2005-07-29 07:04:08

Post by Eddie »

:)
Then tell me what you want and I guide you.
the_observer
Posts: 62
Joined: 2009-11-12 05:53:14

Post by the_observer »

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.
bish0p
Posts: 4
Joined: 2009-12-07 17:07:18

Post by bish0p »

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:

Image

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";
I have no phpadmin pass set. Its a local DB.

Now when i go to ://localhost/moviedb, I see the background colour and only:

Code: Select all

get_html(); ?>  
Any ideas what Ive been doing wrong?

Thanks!
I get the exact same thing in the latest WAMP on Windows XP.

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.
Any idea what is wrong? I setup a test on a Linux server and it worked right away, but I prefer to use WAMP.

Thanks.
Post Reply