Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ferofrantisek

Pages: 1 [2]
21
Development / make Custom Field names same as Directors (ctDirectors)
« on: September 08, 2014, 11:45:08 am »
Hi.
I would like ask if someone could help. Sorry for my bad English. I am doing script for anime database http://anidb.net.  I would like make Field names same as Directors (ctDirectors) but with names Original Work:, Story Composition:, Series Composition: with url reference and with switch to people. (so I can group movies by Original Work and show movies with original work = …) I make this but link to URL is not working as in Director: and I am getting stuck.  Original Work is type multiselect list in Custom Field. Output is in the field Original Work:
<link url="http://anidb.net/perl-bin/animedb.pl?show=creator&creatorid=147">Tomino Yoshiyuki
<link url="http://anidb.net/perl-bin/animedb.pl?show=creator&creatorid=1352">Yatate Hajime
script:
//Original Work:  ~ source for example: http://anidb.net/perl-bin/animedb.pl?show=anime&aid=6517
curPos := Pos('">Original Work:</a', HTML);
LogMessage('17 Original Work: ');
 if curPos > 0 then begin
  EndPos := curPos;
  TmpStr := '';
  curPos := PosFrom('creatorid=', HTML, curPos);
  curPos1 := PosFrom('</tr>', HTML, EndPos)
  LogMessage('17.1                      zistujem ci zacina cyklus');
 while (curPos < curPos1) and (curPos > EndPos) do begin               
 URL :=  'http://anidb.net/perl-bin/animedb.pl?show=creator&creatorid=' + TextBetween(HTML, 'creatorid=', '">', false, curPos);
  LogMessage('17.2 Original Work:  url '+URL);
          TransName := TextBetween(HTML,  '">', '</a>', false, curPos);
               LogMessage('17.3                       zadavam meno '+TransName);
 curPos := PosFrom('creatorid=', HTML, curPos);
 if TmpStr <> '' then
              TmpStr := TmpStr + #13;
if URL <> '' then
              TmpStr := TmpStr + '<link url="' + URL + '">';
TmpStr := TmpStr + TransName;
 AddCustomFieldValueByName('Original Work:', TmpStr);
   end;
  end;
 Thank you very much. Fero

Pages: 1 [2]
anything