PK's MovieDB Release.V3.0 (Dynamic PHP View)
Ok. I figure out my problem.
It seems as Fedora Core 4 PHP doesn't include GD lib when installed threw yum. My solution was to:
1. Remove PHP and all dependencies
i.e "yum remove php"
2. Then install php-gd (witch will include php as a dependency)
i.e "yum install php-gd"
3. Re-installed mySQL
i.e "yum install php-mysql
Then I rebooted the webserver and vola! I've got pictures!
It seems as Fedora Core 4 PHP doesn't include GD lib when installed threw yum. My solution was to:
1. Remove PHP and all dependencies
i.e "yum remove php"
2. Then install php-gd (witch will include php as a dependency)
i.e "yum install php-gd"
3. Re-installed mySQL
i.e "yum install php-mysql
Then I rebooted the webserver and vola! I've got pictures!
Last edited by fredriksk on 2007-03-21 10:30:44, edited 1 time in total.
Ok now when I got the covers working. I have started to tweak the template a bit.
This is what I would like to do:
I would like to add a row called status ("in collection" / "loaned by: fredrik") like this:
year: 2005
date added: 2007-02-13
Video Format: DVD
Category: Drama, comedy
Status: loaned by: fredrik
Is this possible?
When a user browses thre collection and find a movie he/she likes it's no point asking for it it's not avaliable. And it get tedious to go back and forth between the movielist and loaned movies list.
This is what I would like to do:
I would like to add a row called status ("in collection" / "loaned by: fredrik") like this:
year: 2005
date added: 2007-02-13
Video Format: DVD
Category: Drama, comedy
Status: loaned by: fredrik
Is this possible?
When a user browses thre collection and find a movie he/she likes it's no point asking for it it's not avaliable. And it get tedious to go back and forth between the movielist and loaned movies list.
Hello. Yeah I'm glad I got it working to. This is a great template system for a great product. I use Ant movie database to keep track of my movies and what friend that has borrowed what movie. I can browse threw my catalouge using a plugin to media portal and all my friends can do the same threw this great template system. This is a complete solution!
Now. I'm using the built in system in Ant to keep track on witch movies that is lent out to a friend. The field is called "Borrower" in ant 3.5.0.2. Hope thats the info you need.
another thing I have discovered is that ACTORS etc isn't comma separated in my db export from Ant. It's separated by a pipe (or vertical bar if you like) like this:
---- 8< -----
Roller: Amanda Peet|Ashton Kutcher|Taryn Manning|Aimee Garcia|Lee Garlington|Birdie M Hale|Tyrone Giordano|Melissa van der Schyff|Theresa Spruill
--------------
So, when I click on a name I'll do a search on all actors in that movie. How do I change this?
Now. I'm using the built in system in Ant to keep track on witch movies that is lent out to a friend. The field is called "Borrower" in ant 3.5.0.2. Hope thats the info you need.
another thing I have discovered is that ACTORS etc isn't comma separated in my db export from Ant. It's separated by a pipe (or vertical bar if you like) like this:
---- 8< -----
Roller: Amanda Peet|Ashton Kutcher|Taryn Manning|Aimee Garcia|Lee Garlington|Birdie M Hale|Tyrone Giordano|Melissa van der Schyff|Theresa Spruill
--------------
So, when I click on a name I'll do a search on all actors in that movie. How do I change this?
-
- Posts: 58
- Joined: 2006-12-08 18:19:18
- Location: The Land Down Under
@fredriksk
Am I correct in thinking that the Actors are stored in your AMC catalog using the pipe "|" character as the delimiter?
If so, there are a few ways you could choose from to address the issue:
(1) Run the following script over all your movies in AMC. It will replace all the pipe characters with a comma and a space (in the actors field), i.e. "Amanda Peet|Ashton Kutcher|Taryn Manning" becomes "Amanda Peet, Ashton Kutcher, Taryn Manning"
(2) After exporting your catalog to an sql file, open it in a plain text editor like notepad and perform a find/replace to find all "|" and replace with ", " (without the quotes). Note this will only work if the pipe delimiter doesn't appear elsewhere in the exported data where you don't want it changed
(3) After importing into your MySQL database, run an SQL query to perform the same replace within the Actors field in the database table.
I'm presuming the pipe delimiter is being inserted when you are grabbing info from the web for your movies. You may want to check to see if there is an option in the script you are using to instead use a comma delimited at the point of grabbing the Actor data - saves having to manipulate it after the fact.
Hope this helps.
Cheers.......Thermal
Thermal's Movie db / TV Series db
Am I correct in thinking that the Actors are stored in your AMC catalog using the pipe "|" character as the delimiter?
If so, there are a few ways you could choose from to address the issue:
(1) Run the following script over all your movies in AMC. It will replace all the pipe characters with a comma and a space (in the actors field), i.e. "Amanda Peet|Ashton Kutcher|Taryn Manning" becomes "Amanda Peet, Ashton Kutcher, Taryn Manning"
Code: Select all
(***************************************************
Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/
[Infos]
Authors=Thermal Ions
Title=Change Delimiter
Description=Changes the Delimiter in Actors field from | to a comma.
Site=
Language=EN
Version=1.0
Requires=3.5.0
Comments=Hope it helps, fredriksk.
License=Edit to your hearts content.
GetInfo=0
[Options]
***************************************************)
program ChangeDelimiter;
var
olddelim: string;
newdelim: string;
actorin: string;
actorout: string;
begin
olddelim := '|';
newdelim := ', ';
actorin := Getfield(fieldActors);
actorout := StringReplace(actorin, olddelim, newdelim);
Setfield(fieldActors, actorout);
end.
(3) After importing into your MySQL database, run an SQL query to perform the same replace within the Actors field in the database table.
I'm presuming the pipe delimiter is being inserted when you are grabbing info from the web for your movies. You may want to check to see if there is an option in the script you are using to instead use a comma delimited at the point of grabbing the Actor data - saves having to manipulate it after the fact.
Hope this helps.
Cheers.......Thermal
Thermal's Movie db / TV Series db
Last edited by Thermal Ions on 2007-03-28 11:54:38, edited 1 time in total.
Ok. Thanks for the advice. After much thinking back and forth I did a middleway.
In the script, where you import from SQL file I do a search and replace on | -> ", ". I understand this may not be optimal if the sql -query contains a | sign. But I think that that is not a real issue. I can't find a | -sign anywhere in my moviedesciption or else ware. And if there is one this only creates a minor type -o in that movie.
So here is what I did (if anyone whants to try the same)
1. Find the file mdb3.php
locate the lines that says:
It's the function called
_auto_import_ant_export()
and it should be anywhere near line 843
Change the while statement to:
In the script, where you import from SQL file I do a search and replace on | -> ", ". I understand this may not be optimal if the sql -query contains a | sign. But I think that that is not a real issue. I can't find a | -sign anywhere in my moviedesciption or else ware. And if there is one this only creates a minor type -o in that movie.
So here is what I did (if anyone whants to try the same)
1. Find the file mdb3.php
locate the lines that says:
Code: Select all
while (!feof($fp) and ($count < 10)) {
$query = $this->_getline($fp);
if (trim($query) != "") {
$this->db->query($query);
}
}
It's the function called
_auto_import_ant_export()
and it should be anywhere near line 843
Change the while statement to:
Code: Select all
while (!feof($fp) and ($count < 10)) {
$query = $this->_getline($fp);
if (trim($query) != "") {
$query = str_replace("|", ", ", $query);
$this->db->query($query);
}
}
-
- Posts: 58
- Joined: 2004-11-18 12:48:40
spanish.inc
Code: Select all
<?
/** ===============================================================================================
* SPANISH Language file for MovieDB by PK-Designs.com
* @author: Murnau_Vs_Buñuel (cine-clasico.com)
*=============================================================================================== */
# Misc. words that people will find useful
$this->lang['APPNAME'] = "MDB3"; # Name of this application
$this->lang['ALL_MOVIES'] = "Todas las películas"; # All Movies
$this->lang['MORE'] = "más"; # More (when needed for cuting description)
$this->lang['UNKNOWN'] = "nulo"; # Unknown (Not Available)
$this->lang['ROLE'] = "Personaje"; # Actor / Actress Role
$this->lang['MINUTES'] = "min."; # When displaying the length
$this->lang['FIRST'] = "Primera"; # When linking to the First Page
$this->lang['LAST'] = "Última"; # When linking to the Last page
# TITLES - Title refrences for the cooresponding database field
$this->lang['NUM'] = "Nº";
$this->lang['CHECKED'] = "Chequear";
$this->lang['MEDIA'] = "Soporte";
$this->lang['MEDIATYPE'] = "Tipo de soporte";
$this->lang['SOURCE'] = "Fuente";
$this->lang['DATEADD'] = "Fecha";
$this->lang['BORROWER'] = "Prestatario";
$this->lang['RATING'] = "Puntuación";
$this->lang['ORIGINALTITLE'] = "Título";
$this->lang['TRANSLATEDTITLE'] = "Título traducido";
$this->lang['FORMATTEDTITLE'] = "Título formateado";
$this->lang['DIRECTOR'] = "Director";
$this->lang['PRODUCER'] = "Productor";
$this->lang['COUNTRY'] = "País";
$this->lang['CATEGORY'] = "Categoría";
$this->lang['YEAR'] = "Año";
$this->lang['LENGTH'] = "Duración";
$this->lang['ACTORS'] = "Reparto";
$this->lang['URL'] = "Enlace";
$this->lang['DESCRIPTION'] = "Descripción";
$this->lang['COMMENTS'] = "Comentarios";
$this->lang['VIDEOFORMAT'] = "Formato Video";
$this->lang['VIDEOBITRATE'] = "Bitrate Video";
$this->lang['AUDIOFORMAT'] = "Formato Audio";
$this->lang['AUDIOBITRATE'] = "Bitrate Audio";
$this->lang['RESOLUTION'] = "Resolución";
$this->lang['FRAMERATE'] = "Framerate";
$this->lang['LANGUAGES'] = "Idiomas";
$this->lang['SUBTITLES'] = "Subtítulos";
$this->lang['FILESIZE'] = "Tamaño del archivo";
$this->lang['DISKS'] = "Dicos";
$this->lang['PICTURENAME'] = "Imagen";
# PLURALS - A few dbfields need plurar definitions (Example: Other Contries)
$this->lang['_OTHER'] = "Otros";
$this->lang['MEDIATYPES'] = "Tipos de soporte";
$this->lang['SOURCES'] = "Fuentes";
$this->lang['BORROWERS'] = "Prestatarios";
$this->lang['COUNTRYS'] = "Paises";
$this->lang['CATEGORYS'] = "Categorias";
$this->lang['YEARS'] = "Años";
$this->lang['VIDEOFORMATS'] = "Formatos de Video";
$this->lang['AUDIOFORMATS'] = "Formats de Audio";
# PANELS - These words are used for the panels
$this->lang['JUMPTO'] = "Ir a";
$this->lang['SEARCH'] = "Buscar";
$this->lang['CLEARSEARCH'] = "Resetear buscador";
$this->lang['SUBMIT'] = "Aceptar";
$this->lang['CLEAR'] = "Resetear";
$this->lang['VIEW'] = "Ver";
$this->lang['_ALL'] = "Todo";
$this->lang['_BLANK'] = "Desconocido";
$this->lang['_OTHER'] = "Otro";
# PAGES - Useful words for the page displays
$this->lang['PAGE'] = "Página";
$this->lang['NUMPERPAGE'] = "Núm/Pág";
$this->lang['PREVIOUS'] = "Anterior";
$this->lang['NEXT'] = "Siguiente";
$this->lang['GOTOPAGE'] = "Ir a la página";
$this->lang['SHOWING'] = "Mostrando";
$this->lang['OF'] = "de";
# SORT OPTIONS - (already defined RATING, YEAR, LENGTH)
$this->lang['SORT'] = "Mostrar por";
$this->lang['TITLE'] = "Título";
$this->lang['MOST_RECENT'] = "Más Reciente";
Last edited by Murnau_Vs_Buñuel on 2007-04-04 21:03:16, edited 1 time in total.
-
- Posts: 2
- Joined: 2007-04-04 15:45:09
French.inc
Code: Select all
<?
/** ===============================================================================================
* FRENCH Language file for MovieDB by PK-Designs.com
* @author: Boubidibou
*=============================================================================================== */
# Misc. words that people will find useful
$this->lang['APPNAME'] = "MDB3"; # Name of this application
$this->lang['ALL_MOVIES'] = "Tous les films"; # All Movies
$this->lang['MORE'] = "plus"; # More (when needed for cuting description)
$this->lang['UNKNOWN'] = "inconnu"; # Unknown (Not Available)
$this->lang['ROLE'] = "Role"; # Actor / Actress Role
$this->lang['MINUTES'] = "min."; # When displaying the length
$this->lang['FIRST'] = "Début"; # When linking to the First Page
$this->lang['LAST'] = "Fin"; # When linking to the Last page
# TITLES - Title refrences for the cooresponding database field
$this->lang['NUM'] = "Index";
$this->lang['CHECKED'] = "Coché";
$this->lang['MEDIA'] = "Support";
$this->lang['MEDIATYPE'] = "Type Support";
$this->lang['SOURCE'] = "Source";
$this->lang['DATEADD'] = "Date Ajout";
$this->lang['BORROWER'] = "Prêté à";
$this->lang['RATING'] = "Note";
$this->lang['ORIGINALTITLE'] = "Títre";
$this->lang['TRANSLATEDTITLE'] = "Títre Traduit";
$this->lang['FORMATTEDTITLE'] = "Títre formaté";
$this->lang['DIRECTOR'] = "Réalisateur";
$this->lang['PRODUCER'] = "Producteur";
$this->lang['COUNTRY'] = "Pays";
$this->lang['CATEGORY'] = "Catégoríe";
$this->lang['YEAR'] = "Année";
$this->lang['LENGTH'] = "Durée";
$this->lang['ACTORS'] = "Acteurs";
$this->lang['URL'] = "Page Web";
$this->lang['DESCRIPTION'] = "Synopsis";
$this->lang['COMMENTS'] = "Comentaires";
$this->lang['VIDEOFORMAT'] = "Format Video";
$this->lang['VIDEOBITRATE'] = "Bitrate Video";
$this->lang['AUDIOFORMAT'] = "Format Audio";
$this->lang['AUDIOBITRATE'] = "Bitrate Audio";
$this->lang['RESOLUTION'] = "Resolution";
$this->lang['FRAMERATE'] = "Framerate";
$this->lang['LANGUAGES'] = "Langues";
$this->lang['SUBTITLES'] = "SousTitres";
$this->lang['FILESIZE'] = "Taille Fichier";
$this->lang['DISKS'] = "Disques";
$this->lang['PICTURENAME'] = "Image";
# PLURALS - A few dbfields need plurar definitions (Example: Other Contries)
$this->lang['_OTHER'] = "Autres";
$this->lang['MEDIATYPES'] = "Type de support";
$this->lang['SOURCES'] = "Sources";
$this->lang['BORROWERS'] = "Prêté à";
$this->lang['COUNTRYS'] = "Pays";
$this->lang['CATEGORYS'] = "Categories";
$this->lang['YEARS'] = "Année";
$this->lang['VIDEOFORMATS'] = "Format Video";
$this->lang['AUDIOFORMATS'] = "Format Audio";
# PANELS - These words are used for the panels
$this->lang['JUMPTO'] = "Aller à";
$this->lang['SEARCH'] = "Chercher";
$this->lang['CLEARSEARCH'] = "Effacer Recherche";
$this->lang['SUBMIT'] = "Envoyer";
$this->lang['CLEAR'] = "Vider";
$this->lang['VIEW'] = "Voir";
$this->lang['_ALL'] = "Tous";
$this->lang['_BLANK'] = "Inconnu";
$this->lang['_OTHER'] = "Autre";
# PAGES - Useful words for the page displays
$this->lang['PAGE'] = "Page";
$this->lang['NUMPERPAGE'] = "Num/Pag";
$this->lang['PREVIOUS'] = "Précédent";
$this->lang['NEXT'] = "Suivant";
$this->lang['GOTOPAGE'] = "Nouvelle Page";
$this->lang['SHOWING'] = "Montrer";
$this->lang['OF'] = "de";
# SORT OPTIONS - (already defined RATING, YEAR, LENGTH)
$this->lang['SORT'] = "Trier par";
$this->lang['TITLE'] = "Títre";
$this->lang['MOST_RECENT'] = "Plus Récent";
-
- Posts: 58
- Joined: 2004-11-18 12:48:40
future request:
1) Is possible a script or other system to random logos?
2) is possible a system Feeds (RSS or/and Atom)? Solved thanks to kaznor here
3) Select box or flags images to select the differents languages file *.inc Features to the next version
4) Select box to select the differents templates
How install any kaznor´s addons in the default template?
1) how can i put a image border? similar to this moviedb: http://kazgor.awardspace.com/index.php with this image Solved by Thermal Ions here
2)
3) how can i print the alphabet Box in the "default" template:
thanks
1) Is possible a script or other system to random logos?
2) is possible a system Feeds (RSS or/and Atom)? Solved thanks to kaznor here
3) Select box or flags images to select the differents languages file *.inc Features to the next version
4) Select box to select the differents templates
How install any kaznor´s addons in the default template?
1) how can i put a image border? similar to this moviedb: http://kazgor.awardspace.com/index.php with this image Solved by Thermal Ions here
2)
how can i do this in template default?kazgor wrote: Click on a film, i've added the IMDB Trivia
3) how can i print the alphabet Box in the "default" template:
thanks
Last edited by Murnau_Vs_Buñuel on 2007-04-07 12:14:44, edited 15 times in total.
-
- Posts: 58
- Joined: 2006-12-08 18:19:18
- Location: The Land Down Under
Image border can be changed by adjusting the "\templates\default\style.css" file
Try changing it to something like
To stop the border colour changing when you mouse over it, change the #446476 to #000000 also.
Not quite sure what you are wanting to randomise? The movie cover or the graphic at top left of page ?
I don't know anything about Feeds so can't help there.
Cheers.......Thermal
Thermal's Movie db / TV Series db
Code: Select all
/*----------------------------------------------------------------------------------
/* MovieDB Movie List
/*---------------------------------------------------------------------------------- */
#mdb .movies A.cover IMG { width: 75px; height: 110px; margin: 0; padding: 0px; text-decoration: none; }
#mdb .movies A.cover { display: block; padding: 0px; border: 4px solid #88806B; margin-right: 10px; }
#mdb .movies A.cover:hover { border: 4px solid #446476; }
Code: Select all
/*----------------------------------------------------------------------------------
/* MovieDB Movie List
/*---------------------------------------------------------------------------------- */
#mdb .movies A.cover IMG { width: 75px; height: 110px; margin: 0; padding: 0px; text-decoration: none; }
#mdb .movies A.cover { display: block; padding: 0px; border: 1px solid #000000; margin-right: 10px; }
#mdb .movies A.cover:hover { border: 1px solid #446476; }
Not quite sure what you are wanting to randomise? The movie cover or the graphic at top left of page ?
I don't know anything about Feeds so can't help there.
Cheers.......Thermal
Thermal's Movie db / TV Series db
-
- Posts: 58
- Joined: 2004-11-18 12:48:40
sorry thermal ions, I would say how i can using an image to border or background. Same that in this site http://kazgor.awardspace.com/index.php with this image:Thermal Ions wrote:Image border can be changed by adjusting the "\templates\default\style.css" file
i have update my request and question post
Pd: sorry for my bad english i am spanish and this is my moviedb: http://www.cine-clasico.com/mvsb/
-
- Posts: 58
- Joined: 2006-12-08 18:19:18
- Location: The Land Down Under
I've done a bit of playing around and unfortunately can't get the "movie strip" border you want by just using css. It is acheivable by resorting to using a table as was done in PK's version 2 template (as used by http://kazgor.awardspace.com/index.php).
In index.php, replace:
with
For the above, I've just put the film.png file in the same directory as index.php.
I've for the moment made this change on http://thermal-ions.110mb.com/ so you can see it working.
Unfortunately your other questions are outside my skillset as they likely need knowledge of php. I might have a go at adding the Trivia bit if Kazgor isn't around though.
Don't worry about apologising for your English - at least you've got a second language
In index.php, replace:
Code: Select all
<body style='margin: 0 0 0 0; background-color: #B0A06F;'>
<div style='width: 85%; margin: 0 auto; padding: 1px 10px; border: 4px solid #555; border-width: 0 4px 0 4px; background-color: #D8CBAA;'>
<? print $moviedb->get_html(); ?>
</div>
</body>
Code: Select all
<body style='margin: 0 0 0 0; background-color: #B0A06F;'>
<center>
<table cellspacing='0' valign='top' bgcolor='#B0A06F' height='100%' width='85%'>
<tr>
<td valign='top' width='10' height='100%' background='film.png'> </td>
<td height='100%' valign='top' align='left'>
<div style='margin: 0 auto; padding: 1px 10px; border: 4px solid #555; border-width: 0 0 0 0; background-color: #D8CBAA;'>
<? print $moviedb->get_html(); ?>
</div>
</td>
<td valign='top' width='10' height='100%' background='film.png'> </td>
</tr>
</table>
</center>
</body>
I've for the moment made this change on http://thermal-ions.110mb.com/ so you can see it working.
Unfortunately your other questions are outside my skillset as they likely need knowledge of php. I might have a go at adding the Trivia bit if Kazgor isn't around though.
Don't worry about apologising for your English - at least you've got a second language
-
- Posts: 58
- Joined: 2004-11-18 12:48:40
a lot of thanks Thermal Ions, very friendly
other question, i am any stupid because i dont udestand this steps:
other question, i am any stupid because i dont udestand this steps:
can somebody say me step by step what i should do with others words, i what row after or befores should i add that code? (instructions like to mod phpbb?)kazgor wrote:hi Thermal, looks like thats not been coded yet.
anyway here how you can do it, probably not the best way to do it, just the best way i can think of it from what i can see the code doing.
Edit mbd_panel.inc and in the function recount_categories() near the bottom change it so its looks like.
now add the following new function a few lines down.Code: Select all
# Finish Up.. Save the Categories if ($this->mdb->config['options']['empty_categories'] == FALSE) { $categories = $this->empty_categories($categories); } $this->categories = $categories;
that should do the trick, you can switch it on/off via empty_categoties flag... False means hide the zero cats, true=show... well thats how i read the comments to be.Code: Select all
function empty_categories($categories) { foreach ($categories as $value => $count ) { if (($value != "_ALL") and ($count == 0) ) { unset($categories[$value]); } } return $categories; }
hi all..
Thermal.. ta for popping in here and helping out.. you been doing a good job
Also nice job in replicating the FILM Strip side bars.. doing it in a table was the easiest way i could think of doing it.
It can be done in CSS but i need to experiement on exactly how, 2ways i've seen it done.
1. use a 600pixel width image with filmstrip logo on the left & right side of the image with the middle filled in with the colour u want. now do a Y repeat to make the image scroll down the page.
2. use a 3 column css layout... column 1 on 3 would be where the filmstrip image goes with column 2 being the main movie. I'll have to see if i can get an example to try out.
Doing the IMDB trivia wasnt so easy, i needed to first actived the Comment field (see ealier posts on howto) now i only use the field for trivia so i did not have to worry about stripping it out from the normal IMDB user comments.
Now Trivia when imported into ANTP all start with - (hyphen) so i wrote some php code to change these into <LI> tags so you get the nice bullet effect u see in my page.
Here the code to look at, you wouldnt be able to use it though as there are other bits you need to update before it can be activated and viewed, just thought you might want to see what was involved.
its abit messy.. never got round to cleaning it up.
for the final part ie about Zero Categories mod. the easiest way i can explain it is to do the following.
edit MDB_PANEL.INC find function recount_categories() and replace it that function with this version.
With V3 working differently to V2 i dont think you can do that ALPHABET box, besides V3 as better filters now that you narrow you film selection quick that just Jumping to film Y.
I've been waiting for PK to release version 3.0.4 as that as a few fixes and changes that would mean i have to re-add all my changes to it again but i may just release my MOD once at somepoint.
Thermal.. ta for popping in here and helping out.. you been doing a good job
Also nice job in replicating the FILM Strip side bars.. doing it in a table was the easiest way i could think of doing it.
It can be done in CSS but i need to experiement on exactly how, 2ways i've seen it done.
1. use a 600pixel width image with filmstrip logo on the left & right side of the image with the middle filled in with the colour u want. now do a Y repeat to make the image scroll down the page.
2. use a 3 column css layout... column 1 on 3 would be where the filmstrip image goes with column 2 being the main movie. I'll have to see if i can get an example to try out.
Doing the IMDB trivia wasnt so easy, i needed to first actived the Comment field (see ealier posts on howto) now i only use the field for trivia so i did not have to worry about stripping it out from the normal IMDB user comments.
Now Trivia when imported into ANTP all start with - (hyphen) so i wrote some php code to change these into <LI> tags so you get the nice bullet effect u see in my page.
Here the code to look at, you wouldnt be able to use it though as there are other bits you need to update before it can be activated and viewed, just thought you might want to see what was involved.
Code: Select all
function _callback_comments($args=NULL) {
# Set Default Arguments & Description
$maxchars = (($args == NULL) ? 400 : $args[0]);
$comm = $this->data['COMMENTS'];
$comm = substr($comm, 0, $maxchars);
# Check we want to include the "..." signifying (more)
$trivia_start = strpos($comm, "IMDB TRIVIA");
$trivia_end = strpos($comm, "|-", $trivia_start);
if ($trivia_start !== false) {
$comm_front = "<div class='imdbtrivia'>";
$comm_front .= substr($comm, $trivia_start, $trivia_end - 2);
$comm_front .= "</div>";
$comm_front .= substr($comm, $trivia_end-2, $maxchars);
$comm = $comm_front;
}
$firstdash = strpos($comm, "|-");
if ($firstdash !== false) { $comm=substr($comm, 0, ($firstdash)-2)."<ul><li>".substr($comm, ($firstdash)+2, $maxchars); }
if (strlen($comm) < strlen($this->data['COMMENTS'])) {
$comm = substr($comm, 0, strrpos($comm, " "));
$comm .= "...";
}
# Add the return lines
$comm = trim(str_replace("|- ", "</li><li>", $comm))."</li></ul>";
$comm = trim(str_replace("|", "<br/>\n", $comm));
return $comm;
}
for the final part ie about Zero Categories mod. the easiest way i can explain it is to do the following.
edit MDB_PANEL.INC find function recount_categories() and replace it that function with this version.
Code: Select all
function recount_categories() {
# Sort what we have & Reset all counts to 0.
$categories = $this->sort_categories($this->categories);
foreach ($categories as $key => $val) {
$categories[$key] = 0;
}
# Recount all values, this time we know the _OTHER fields :)
$query = "SELECT ".$this->dbfield.",count(*) FROM ".$this->mdb->mysql_table;
$query .= $this->mdb->sqlwhere($this->dbfield);
$query .= " GROUP BY ".$this->dbfield;
$query .= " ORDER BY ".$this->dbfield;
$dbres = $this->mdb->db->query($query);
# Loop throught the MySQL Resource rows..
while ($row = $dbres->fetch_assoc()) {
$values = array($row[$this->dbfield]);
$count = $row['count(*)'];
$categories["_ALL"] += $row['count(*)'];
# Split the values, if its comma seperated
if (in_array($this->dbfield, $this->mdb->config['options']['comma_seperated'])) {
$values = explode(",", $values[0]);
}
# Count all the subvalues..
foreach($values as $value) {
# Get the correct Value
$value = trim($value);
if (in_array($value, $this->_BLANKvalues) and (sizeof($values) == 1)) {
$value = "_OTHER";
}
# Add the Value to the Categories
if (isset($categories[$value])) {
$categories[$value] += $count;
} else {
$categories["_OTHER"] += $count;
}
}
}
# Finish Up.. Save the Categories
if ($this->mdb->config['options']['empty_categories'] == FALSE) {
$categories = $this->blank_categories($categories);
}
$this->categories = $categories;
}
/** -------------------------------------------------------------------------------------------
* Remove any categories that are blank
* -----------------------------------------------------------------------------------------*/
function blank_categories($categories) {
foreach ($categories as $value => $count ) {
if (($value != "_ALL") and ($count == 0) ) {
unset($categories[$value]);
}
}
return $categories;
}
With V3 working differently to V2 i dont think you can do that ALPHABET box, besides V3 as better filters now that you narrow you film selection quick that just Jumping to film Y.
I've been waiting for PK to release version 3.0.4 as that as a few fixes and changes that would mean i have to re-add all my changes to it again but i may just release my MOD once at somepoint.
Last edited by kazgor on 2007-04-06 23:32:47, edited 1 time in total.
Create a RSS feed with http://www.feed43.com
first have a read of there tutorial @ http://www.feed43.com/step-by-step.html
ok..
now for do the following
STEP 1:
enter your moviedb link. eg
http://brunesmedia.110mb.com/moviedb3/index.php (you should see a RSS feed on mysite if you want to see what it will look like first)
STEP 2:
for Global Search Pattern enter {%}
in Item (repeatable) Search Pattern enter the following search string.
click on EXTRACT button
looks a right mess but it basically is grabbing 4 items in the next box you should therefore see
STEP 3.
RSS feed properties fill in the page titles and details.
in RSS item properties
enter {%3} for Item Title Template
enter {%2} for Item Link Template
enter <br>{%1} <br><br>{%4} for Item Content Template
click on PREVIEW button
u will now get a link for your feed, you can rename it so it as a sensible name.
u may want to create a free account so that u can edit the feed and make changes.
first have a read of there tutorial @ http://www.feed43.com/step-by-step.html
ok..
now for do the following
STEP 1:
enter your moviedb link. eg
http://brunesmedia.110mb.com/moviedb3/index.php (you should see a RSS feed on mysite if you want to see what it will look like first)
STEP 2:
for Global Search Pattern enter {%}
in Item (repeatable) Search Pattern enter the following search string.
Code: Select all
<a class='cover'{*}>{%}</a>{*}<div class='title'>{*}href='{%}'>{%}</a></div>{*}<div class='description'>{%}</div>
looks a right mess but it basically is grabbing 4 items in the next box you should therefore see
Code: Select all
{%1} = <img src='http://brunesmedia.110mb.com/moviedb3/templates/kazgor/images etc etc
{%2} = http://brunesmedia.110mb.com/moviedb3/index.php?num=145
{%3} = A Scanner Darkly
{%4} = "What Does A Scanner See?"<br/> <br/> The L.A. of a not-too-distant future suffers a surge of drug abuse involving a new ultra-addictive and eventually brain-damaging substance simply named "D". Bob Arctor is an undercover narc leading a double life, dutifully reporting to his superiors while effectively having abandoned whatever normal existence he had for a "D" user/dealer career. But this schizophrenic...
RSS feed properties fill in the page titles and details.
in RSS item properties
enter {%3} for Item Title Template
enter {%2} for Item Link Template
enter <br>{%1} <br><br>{%4} for Item Content Template
click on PREVIEW button
u will now get a link for your feed, you can rename it so it as a sensible name.
u may want to create a free account so that u can edit the feed and make changes.
-
- Posts: 58
- Joined: 2006-12-08 18:19:18
- Location: The Land Down Under
Thanks Kazgor. It's been fun actually, and given me some impetus to play around and learn a few things while helping out.kazgor wrote:Thermal.. ta for popping in here and helping out.. you been doing a good job
I tried something kind of similar but different, with one <div> filled with the film.png graphic, which was then overlaid by another <div> 20 pixels narrower - leaving 10 pixels visible down both the left and right side. Problem was that I don't use a fixed width for my template, rather I use a percentage of the window width. This unfortunately meant the film.png wasn't neatly aligned on the right hand side, rather it was half cut off.kazgor wrote:1. use a 600pixel width image with filmstrip logo on the left & right side of the image with the middle filled in with the colour u want. now do a Y repeat to make the image scroll down the page.
(This site being the basis of the attempt)
Wish you hadn't posted that last paragraph - only joking. I'm now almost through working on an implementation, only thing is that I do have more than just the Trivia in the comments field so am needing to do some trimming as I'm getting full comments field content (trivia, awards and mpaa) all displaying presently.kazgor wrote:Doing the IMDB trivia wasnt so easy, i needed to first actived the Comment field (see ealier posts on howto) now i only use the field for trivia so i did not have to worry about stripping it out from the normal IMDB user comments.
Now Trivia when imported into ANTP all start with - (hyphen) so i wrote some php code to change these into <LI> tags so you get the nice bullet effect u see in my page.
Here the code to look at, you wouldnt be able to use it though as there are other bits you need to update before it can be activated and viewed, just thought you might want to see what was involved.
Which brings me to my question. I noted the below code in mdb_movie.inc which parses out the awards information from the description field. I've adjusted it so it parses from the comments field instead. My problem is how to output this award information. I tried adding $MOVIE[awards], $AWARDS[], (and some other variations) to the details.tpl file immediately below where the movie description is output, but as you can imagine it doesn't work - just displays the text $MOVIE[awards], $AWARDS[], etc.
Therefore how do I reference this parsed awards info to output it, or is there other intermediary code that's missing?
Code: Select all
/** -------------------------------------------------------------------------------------------
* Checks the DESCRIPTION field for an AWARDS section. If one is found, $this->awards will
* be filled and that section will be cut from the description.
* @access private
* ------------------------------------------------------------------------------------------*/
function _parse_awards() {
$desc = $this->data['DESCRIPTION'];
$awardpos = strpos($desc, "AWARDS FOR ");
if ($awardpos !== FALSE) {
$this->awards = substr($desc, $awardpos);
$this->data['DESCRIPTION'] = trim(substr($desc, 0, $awardpos-1));
By all means if it's significantly involved - just tell me to sod off
Cheers.......Thermal
Thermal's Movie db / TV Series db
-
- Posts: 58
- Joined: 2004-11-18 12:48:40
i know this Random Quotes script.
In a new php file named "quotes.php" write this code:
2) upload the quotes.php file in the same root index.php
3)Open index.php and search this:
write after, in the next line this:
you can watch this script in my site www.cine-clasico.com/mvsb/index.php
any better form? how can i put this script in the panel?
In a new php file named "quotes.php" write this code:
Code: Select all
<SCRIPT>
function randomquote(){
text_array = new Array(
"I have no further use for America. I wouldn't go back there if Jesus Christ was President. (Charles Chaplin)",
"A tramp, a gentleman, a poet, a dreamer, a lonely fellow, always hopeful of romance and adventure. (Charles Chaplin)",
"In reference to the murder scene in 'Dial M for murder': As you have seen on the screen; the best way to do it is with a scissor. (Alfred Hitchcock).",
"I have prepared one of my own timecapsules. I have placed some rather large samples of dynamite, gunpowder, and nitroglycerin. My time capsule is set to go off in the year 3000. It will show them what we are really like.(Alfred Hitchcock)."
);
var numero = Math.random();
numero = numero * text_array.length;
numero = numero * .5;
numero = Math.round(numero);
document.write(
'<font face="verdana" size="2" color="blue"><b>' +
text_array[numero]) +
'</b></font>'
}
</SCRIPT>
<font face="verdana" size="2">Random Quote:</font><br>
<SCRIPT>
randomquote();
</SCRIPT>
3)Open index.php and search this:
Code: Select all
<? print $moviedb->get_html(); ?>
Code: Select all
<? include("quotes.php") ?>
any better form? how can i put this script in the panel?
@Thermal.
Not at all.. ask as many question u like, gives me an excuse to play with the code and learn something new.
If you're enabling all those info into the comments field then i'm guessing they will get put in a certain order.. ie comments, MPAA, Awards, Trivia or any combination.
Now i was thinking an easier hack would be to update the IMDB script to put at the end of each section a *** END AWARDS *** and *** END TRIVIA *** etc that makes it much easier to chop out each section from the Comments field.
Otherwise you will have to build up logic that say chop from here to Awards, if no awards then upto Trivia etc.. can be done but you are governed by what order the IMDB script presents the info. to be honest i dont think it thats hard really, just need a few mins to map out the possible combinations.
Now i need to look at it but for now i dont think the $this->awards is being passed onto the template so hence its really not much use.. think MJ started with the idea but never got round to fully implimenting it. I think from what u said you had the right idea i'll have to give it a try myself and see if there something more.
Ok.. First things first.. did you get just bogstandard Comments printing in your template.. I explained how to actived the Comments field in the DETAILED view in the PKmoviedb2 post..
viewtopic.php?p=22425#22425
This explains how to do it.. and i'm bettering it where we have to integrate the $this->awards into.
I'll Race Ya
Not at all.. ask as many question u like, gives me an excuse to play with the code and learn something new.
If you're enabling all those info into the comments field then i'm guessing they will get put in a certain order.. ie comments, MPAA, Awards, Trivia or any combination.
Now i was thinking an easier hack would be to update the IMDB script to put at the end of each section a *** END AWARDS *** and *** END TRIVIA *** etc that makes it much easier to chop out each section from the Comments field.
Otherwise you will have to build up logic that say chop from here to Awards, if no awards then upto Trivia etc.. can be done but you are governed by what order the IMDB script presents the info. to be honest i dont think it thats hard really, just need a few mins to map out the possible combinations.
Now i need to look at it but for now i dont think the $this->awards is being passed onto the template so hence its really not much use.. think MJ started with the idea but never got round to fully implimenting it. I think from what u said you had the right idea i'll have to give it a try myself and see if there something more.
Ok.. First things first.. did you get just bogstandard Comments printing in your template.. I explained how to actived the Comments field in the DETAILED view in the PKmoviedb2 post..
viewtopic.php?p=22425#22425
This explains how to do it.. and i'm bettering it where we have to integrate the $this->awards into.
I'll Race Ya
-
- Posts: 58
- Joined: 2006-12-08 18:19:18
- Location: The Land Down Under
Yes, I've got the comments field working, even with your nice little bullets instead of dashes. I forgot about your post back in the version 2 thread, and actually worked out what needed to be changed / added myself after being unable to find it in this thread.
I progressed a little further by trimming comments to just contain the trivia, while placing the remainder of the original comments field into the $this->awards (variable? - don't know the right terminology for this php stuff).
So yes, I'm currently stuck (totally lost actually) at passing the $this->awards to the template for display.
My IMDB import does put the different contents in a set order, but your idea of inserting a section ending is better as not all the various contents exist for all the movies.
I don't think I'll race you though - particularly as I started also writing a script today to grab movie classification information from the database of the Australian Office of Film and Literature Classification. (Eventually) No more relying on MPAA ratings or imprecise Australian ratings from IMDB. That's been quite a learnign exercise too - but that's OT here.
P.S. Got fed up with the ongoing problems with Box9 on 110mb.com today, and temporarily pulled my movie db site. Will reregister in a few days and should get on a box that actually lets me into my mysql database.
Better go get some sleep - work again tomorrow
Cheers................Thermal
I progressed a little further by trimming comments to just contain the trivia, while placing the remainder of the original comments field into the $this->awards (variable? - don't know the right terminology for this php stuff).
So yes, I'm currently stuck (totally lost actually) at passing the $this->awards to the template for display.
My IMDB import does put the different contents in a set order, but your idea of inserting a section ending is better as not all the various contents exist for all the movies.
I don't think I'll race you though - particularly as I started also writing a script today to grab movie classification information from the database of the Australian Office of Film and Literature Classification. (Eventually) No more relying on MPAA ratings or imprecise Australian ratings from IMDB. That's been quite a learnign exercise too - but that's OT here.
P.S. Got fed up with the ongoing problems with Box9 on 110mb.com today, and temporarily pulled my movie db site. Will reregister in a few days and should get on a box that actually lets me into my mysql database.
Better go get some sleep - work again tomorrow
Cheers................Thermal
-
- Posts: 58
- Joined: 2004-11-18 12:48:40
i have actived the comments field in the detailed view too. Thanks kazgor, very good.kazgor wrote: actived the Comments field in the detailed view in the PKmoviedb2 post..
viewtopic.php?p=22425#22425
i have other intreseting question or request :
do you know the "social bookmark"? Del.icio.us (the more important), digg, BlinkList, ... a lot of more
these bookmarks can be important to who are seeing the pages of your moviedb and they can add each page to their favorite social bookmarks at the time the moviedb are been promote.
i know thease easy codes, but i don´t know the better way to put this in the template (i am not coder):
Code: Select all
<a href="" onclick="window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)); return false;" class="gensmall" title="Bookmark this page to Delicious"><img src="images/icons_tag/delicious.16px.gif" alt="Bookmark this page to Delicious" name="Delicious" id="Delicious" border="0" /></a>
Code: Select all
<a href="" onclick="window.open('http://digg.com/submit?phase=2&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)); return false;" class="gensmall" title="Bookmark this page to Digg"><img src="images/icons_tag/digg.png" alt="Bookmark this page to Digg" name="Digg" id="Digg" border="0" /></a>
Code: Select all
<a href="" onclick="window.open('http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)); return false;" class="gensmall" title="Bookmark this page to Blinklist"><img src="images/icons_tag/blinklist.png" alt="Bookmark this page to Blinklist" name="Blinklist" id="Blinklist" border="0" /></a>
will be nice that each page of detailed view have the title (<title>"original or translate title"</title>) of the movies, then this will work better.
you can watch this social bookmarks in my detailed moviedb: http://www.cine-clasico.com/mvsb/index.php?num=617
i know thease codes thanks to this phpBB mod