English > Scripts and Templates
Previewing movie URLs in skin
afrocuban:
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)
afrocuban:
For AllMovie_new script I found the way, defining custom field and the codes would be (for example):
Allmovie script:
--- Code: ---//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>');
--- End code ---
Skin:
--- Code: ---<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>
--- End code ---
Still, the OP question stands if it's possible to import urls in "url" field in such way.
Ivek23:
--- Quote from: afrocuban 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: ---//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>');
--- End code ---
Skin:
--- Code: ---<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>
--- End code ---
Still, the OP question stands if it's possible to import urls in "url" field in such way.
--- End quote ---
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: ---//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>');
--- End code ---
However, the same also in the skin:
--- Code: ---<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>
--- End code ---
afrocuban:
Thanks Ivek!
So, it means it's impossible to do such thing with predefined "url" field?
Ivek23:
--- Quote from: afrocuban on April 27, 2013, 07:58:07 pm ---So, it means it's impossible to do such thing with predefined "url" field?
--- End quote ---
Sorry, I have no answer to this because I do not know, but I think Nostra easier to answer this question.
Navigation
[0] Message Index
[#] Next page
Go to full version