OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Manipulate the download link

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Manipulate the download link

Postby Szdnez » Thu Jan 07, 2010 5:23 pm

Hey,

I want to "manipulate" the links that are generated to downald e.g. a pdf of an article. For example
Code: Select all
<meta http-equiv="refresh" content="2;URL=http://localhost/ojs/index.php/MyMagazin/article/download/1/1"/>
in interstitial.tpl should look like this
Code: Select all
<meta http-equiv="refresh" content="2;URL=http://vg07.met.vgwort.de/na/46077f60b9fce26ee4ff9008ca6978?l=http://localhost/ojs/index.php/MyMagazin/article/download/1/1"/>

I do not want to edit interstitial.tpl or the Request::url() (where the link is generated) because this are system files/classes. But I have no idea how could I do this in another way. Can I register a plugin to do this (which hook?) ? Or are there other technics?

Thanks for your help
Szdnez
 
Posts: 17
Joined: Tue Oct 20, 2009 12:48 pm

Re: Manipulate the download link

Postby mcrider » Thu Jan 14, 2010 1:42 pm

Hi Szdnez,

Honestly, I would just edit the template and keep track of the change for when you upgrade (since it is such a simple fix). If you wanted to do this with a plugin, you could do it with an output filter plugin (see for example the SEHL plugin in plugins/generic/sehl/)... These plugins take OJS' output and allow you to filter it and make modifications (so it would wait for the <meta> tag and then output something else).

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: Manipulate the download link

Postby Szdnez » Sat Jan 16, 2010 10:52 am

Thanks for the advice. It is quite ugly to parse the html code but it works now without manipulating any core classes. And for the future, do not change interstitial.tpl or pdfInterstitial.tpl ;-)
Szdnez
 
Posts: 17
Joined: Tue Oct 20, 2009 12:48 pm


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 5 guests