[ES] Campos personalizados

If you need help on how to use the program
Post Reply
pacoon
Posts: 3
Joined: 2012-05-06 03:05:35

[ES] Campos personalizados

Post by pacoon »

Hola a todos,

Me he descargado este estupendo programa y lo he estado trasteando un poco. He creado unos campos: Guión, Música, Fotografía y Premios; y ahora quiero llenarlos automáticamente con algún script.

Por ejemplo, al conectarme a FilmAffinity, estos mismos campos salen en el apartado de comentarios y yo lo que quiero es dirigirlos a los campos que yo he creado.

He estado buscando por el foro, pero lo poco que he encontrado no me sirve.

¿Cómo podría resolver esto? ¿Saben de algún tutorial que ya esté creado? (No importa si no está en español).

Muchas gracias.

I'm sorry. My english is very bad.
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post by soulsnake »

Hi,

You have to change the script FilmAffinity to use your custom fields.

E.g. You can replace line 270 in script editor

Code: Select all

   // Script writer
   LineNr := FindLine('<th>GUIÓN</th>', Page, LineNr);
   if LineNr <> -1 then
   begin
      Line := Page.GetString(LineNr + 1);
      Item := TextBetween(Line, '<td>', '</td>');
      Comments := Comments + 'Guión: ' + Item + #13#10 + #13#10;
   end;

   // Composer
   LineNr := FindLine(' <th>MÚSICA</th>', Page, LineNr);
   if LineNr <> -1 then
   begin
      Line := Page.GetString(LineNr + 1);
      Item := TextBetween(Line, '<td>', '</td>');
      Comments := Comments + 'Música: ' + Item + #13#10 + #13#10;
   end;

   // Photography
   LineNr := FindLine('<th>FOTOGRAFÍA</th>', Page, LineNr);
   if LineNr <> -1 then
   begin
      Line := Page.GetString(LineNr + 1);
      Item := TextBetween(Line, '<td>', '</td>');
      Comments := Comments + 'Fotografía: ' + Item + #13#10 + #13#10;
   end;
by

Code: Select all

   // Script writer
   LineNr := FindLine('<th>GUIÓN</th>', Page, LineNr);
   if LineNr <> -1 then
   begin
      Line := Page.GetString(LineNr + 1);
      Item := TextBetween(Line, '<td>', '</td>');
      //Comments := Comments + 'Guión: ' + Item + #13#10 + #13#10;
      SetCustomField('YourCustomFieldTagWithThisQuotes', Item);
   end;

   // Composer
   LineNr := FindLine(' <th>MÚSICA</th>', Page, LineNr);
   if LineNr <> -1 then
   begin
      Line := Page.GetString(LineNr + 1);
      Item := TextBetween(Line, '<td>', '</td>');
      //Comments := Comments + 'Música: ' + Item + #13#10 + #13#10;
      SetCustomField('YourCustomFieldTagWithThisQuotes', Item);
   end;

   // Photography
   LineNr := FindLine('<th>FOTOGRAFÍA</th>', Page, LineNr);
   if LineNr <> -1 then
   begin
      Line := Page.GetString(LineNr + 1);
      Item := TextBetween(Line, '<td>', '</td>');
      //Comments := Comments + 'Fotografía: ' + Item + #13#10 + #13#10;
      SetCustomField('YourCustomFieldTagWithThisQuotes', Item);
   end;
and replace

Code: Select all

   // Awards
   LineNr := FindLine('<th>PREMIOS</th>', Page, LineNr);
   if LineNr <> -1 then
   begin
      LineNr   := LineNr + 1;
      Line     := Page.GetString(LineNr);
      Comments := Comments + 'Premios: ' + #13#10;
      while Pos('<a href="/es/awards.php', Line) > 0 do
      begin
        Item := DeleteTags(Line);
        Comments := Comments + '  - ' + Trim(Item) + #13#10;
        LineNr   := LineNr + 1;
        Line     := Page.GetString(LineNr);
      end;
      Comments := Comments + #13#10;
   end;
by

Code: Select all

   // Awards
   LineNr := FindLine('<th>PREMIOS</th>', Page, LineNr);
   if LineNr <> -1 then
   begin
      LineNr   := LineNr + 1;
      Line     := Page.GetString(LineNr);
      //Comments := Comments + 'Premios: ' + #13#10;
      SetCustomField('YourCustomFieldTagWithThisQuotes', '');
      while Pos('<a href="/es/awards.php', Line) > 0 do
      begin
        Item := DeleteTags(Line);
        //Comments := Comments + '  - ' + Trim(Item) + #13#10;
        SetCustomField('YourCustomFieldTagWithThisQuotes', GetCustomField('YourCustomFieldTagWithThisQuotes') + '  - ' + Trim(Item) + #13#10);
        LineNr   := LineNr + 1;
        Line     := Page.GetString(LineNr);
      end;
      //Comments := Comments + #13#10;
   end;
And finally, replace YourCustomFieldTagWithThisQuotes with the tag you choose when you create the custom field ;).

Soulsnake.
pacoon
Posts: 3
Joined: 2012-05-06 03:05:35

Post by pacoon »

Yes, its work. Thank you so much.

I have other question.

I want to use this fields with Ant Movie Catalog Viewer.

Code: Select all

<p><b>Género<br></b>$CATEGORY</p>
<p><b>Duración<br></b>$LENGTH Minutes</p>
<p><b>Director<br></b>$DIRECTOR</p>
<p><b>Reparto<br></b>$ACTORS</p>
<p><b>Productora<br></b>$PRODUCER</p>
<p><b>Sinopsis<br></b>$DESCRIPTION</p>
<p><b>Comentarios<br></b>$COMMENTS</p>
What is the code?
<p><b>guión<br></b>$$GUION</p>??

Thank you, soulsnake
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post by soulsnake »

I want to use this fields with Ant Movie Catalog Viewer.
You can not show custom fields in Ant Movie Catalog Viewer for now.
Someone should update this program...

Soulsnake.
pacoon
Posts: 3
Joined: 2012-05-06 03:05:35

Post by pacoon »

OK

Thank you very much
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post by soulsnake »

You can not show custom fields in Ant Movie Catalog Viewer for now.
Someone should update this program...
Well, I have started to modify this program to add full custom fields support.
Also, I will try to correct some bugs I found ;).

Soulsnake.
soulsnake
Posts: 756
Joined: 2011-03-14 15:42:20
Location: France

Post by soulsnake »

Hi,

I update Ant Viewer to add full custom fields support and fix some bugs ;).
See: viewtopic.php?p=34437

Soulsnake.
Post Reply