Author Topic: Previewing movie URLs in skin  (Read 12830 times)

0 Members and 1 Guest are viewing this topic.

Offline afrocuban

  • Moderator
  • *****
  • Posts: 468
    • View Profile
Previewing movie URLs in skin
« on: April 27, 2013, 01:14:53 pm »
Instead of:
http://www.imdb.com/title/tt1764234/ for "url" field,

is it possible for users to present link in PVD skin like this:

IMDb

without changing IMDb plugin, but only by creating some syntax in skin's xml?

Same question for Ivek for his Allmovie_new script (Allmovie.com.psf)
« Last Edit: April 27, 2013, 01:16:32 pm by afrocuban »

Offline afrocuban

  • Moderator
  • *****
  • Posts: 468
    • View Profile
Re: Previewing movie URLs in skin
« Reply #1 on: April 27, 2013, 02:18:07 pm »
For AllMovie_new script I found the way, defining custom field and the codes would be (for example):

Allmovie script:
Code: [Select]
//Get ~mfURL~ or ~URL~

endPos := Pos('"><span>overview</span></a>', HTML);
if endPos > 0 then begin
curPos := PrevPos('href="/movie', HTML, endPos);
AddFieldValue(mfURL, BASE_URL + Copy(HTML, curPos + 6, endPos - curPos - 6));
end else
AddFieldValue(mfURL, MovieURL);
AddCustomFieldValueByName('AllMovie.com', '<link url="' + MovieURL + '">AllMovie.com</link>');

Skin:
Code: [Select]
<row>
                <column space="0" halign="left" autosize="true" valign="top">
                  <label>
                    <font>
                      <color>$000000</color>
                      <bold/>
                    </font>
                    <caption>Other URLs: </caption>
                  </label>
                  <custom field="AllMovie.com" linkcolor1="$338900"/>
                </column>
              </row>

Still, the OP question stands if it's possible to import urls in "url" field in such way.
« Last Edit: April 27, 2013, 02:24:54 pm by afrocuban »

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2711
    • View Profile
Re: Previewing movie URLs in skin
« Reply #2 on: April 27, 2013, 03:05:12 pm »
For AllMovie_new script I found the way, defining custom field and the codes would be (for example):

Allmovie script:
Code: [Select]
//Get ~mfURL~ or ~URL~

endPos := Pos('"><span>overview</span></a>', HTML);
if endPos > 0 then begin
curPos := PrevPos('href="/movie', HTML, endPos);
AddFieldValue(mfURL, BASE_URL + Copy(HTML, curPos + 6, endPos - curPos - 6));
end else
AddFieldValue(mfURL, MovieURL);
AddCustomFieldValueByName('AllMovie.com', '<link url="' + MovieURL + '">AllMovie.com</link>');

Skin:
Code: [Select]
<row>
                <column space="0" halign="left" autosize="true" valign="top">
                  <label>
                    <font>
                      <color>$000000</color>
                      <bold/>
                    </font>
                    <caption>Other URLs: </caption>
                  </label>
                  <custom field="AllMovie.com" linkcolor1="$338900"/>
                </column>
              </row>

Still, the OP question stands if it's possible to import urls in "url" field in such way.

Yes, it is possible if you use Imdb Movie Script for rating ... and the url do the same way as is done in Allmovie_new script.

Example for Imdb:
Code: [Select]
//Get ~mfURL~ or ~IMDb Url~
endPos := Pos('" /><meta property="og:url"', HTML);
if endPos > 0 then begin
curPos := PrevPos('"canonical" href="', HTML, endPos);
AddFieldValue(mfURL, Copy(HTML, curPos + 18, endPos - curPos - 18));
end else
AddFieldValue(mfURL, MovieURL);
AddCustomFieldValueByName('IMDb.com', '<link url="' + MovieURL + '">IMDb.com</link>');

However, the same also in the skin:
Code: [Select]
<row>
                <column space="0" halign="left" autosize="true" valign="top">
                  <label>
                    <font>
                      <color>$000000</color>
                      <bold/>
                    </font>
                    <caption>Other URLs: </caption>
                  </label>
                  <custom field="IMDb.com" linkcolor1="$338900"/>
                </column>
              </row>
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline afrocuban

  • Moderator
  • *****
  • Posts: 468
    • View Profile
Re: Previewing movie URLs in skin
« Reply #3 on: April 27, 2013, 07:58:07 pm »
Thanks Ivek!

So, it means it's impossible to do such thing with predefined "url" field?

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2711
    • View Profile
Re: Previewing movie URLs in skin
« Reply #4 on: April 28, 2013, 06:16:10 am »
So, it means it's impossible to do such thing with predefined "url" field?

Sorry, I have no answer to this because I do not know, but I think Nostra easier to answer this question.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: Previewing movie URLs in skin
« Reply #5 on: April 28, 2013, 04:19:10 pm »
So, it means it's impossible to do such thing with predefined "url" field?

That's right. A hyperlink can only be created in a multiselect list or memo field. If you could turn the URLs in [URL] into hyperlinks, the plugins and scripts that rely on them wouldn't work.

Offline Ivek23

  • Global Moderator
  • *****
  • Posts: 2711
    • View Profile
Re: Previewing movie URLs in skin
« Reply #6 on: April 28, 2013, 04:44:02 pm »
So, it means it's impossible to do such thing with predefined "url" field?

That's right. A hyperlink can only be created in a multiselect list or memo field. If you could turn the URLs in [URL] into hyperlinks, the plugins and scripts that rely on them wouldn't work.

Thank you, Rick for the explanation. I also learned something new from this explanation.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline afrocuban

  • Moderator
  • *****
  • Posts: 468
    • View Profile
Re: Previewing movie URLs in skin
« Reply #7 on: April 28, 2013, 04:59:51 pm »
Thanks rick.

Then some option by design for a "url" field in Preferences to store a movie/person link as a text?

I know, I know. We have holidays here, and I have some extra time not using it to get a life ;D
« Last Edit: April 28, 2013, 05:08:24 pm by afrocuban »

 

anything