[SOLVED] Change Url in Categorie View

Phoca Download - download manager
michaf
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 31 Jan 2015, 17:50

[SOLVED] Change Url in Categorie View

Post by michaf »

Hi.
I want to change the piece of Code where the Url/uri is generated in the category View.
All (PDF) files are listed there and linked to the download (Hidden url).
Instead of downloading or showing the file, i want to insert a pdf-viewer at this position that dont need an extension for viewing the files.

So is my question:
In wich file is the construction of the Download Link, so that it can be redirected to, or extended with a Viewer-script ?

Thanks.
Micha
Last edited by michaf on 01 Feb 2015, 12:54, edited 1 time in total.
michaf
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 31 Jan 2015, 17:50

Re: Change Url in Categorie View

Post by michaf »

Oh,- wait.
Don't give me so much input at once. I can't handle so much replies..

A way to do this, seems to be editing the fileview default.php as Template-override.
This is only the template, but it could be used to remove the Part that includes the link and to insert any other code there.

I assume there is a more elegant way to do this,- but this is how i get along for now.

[OT]
In a way, i am -of course - a bit dissapointed that there was no try of a response,- on the other hand:
I have Jan got to know as extremely competent and supportive, so i understand that sometimes there will be no time for answering some questions.
So, i am supportive in the same way and posted my solution here.
[OT]


Greets,

Micha
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [SOLVED] Change Url in Categorie View

Post by Jan »

Hi,

[OT]
Please see the amount of answered questions below my photo. No comment. :-) You have pasted the question in 31.1. and I am answering on 1.2. ... then really no idea what should say users I answer their posts after week or month (One user waited for my answer over a half of year). Please don't forget, these are free extensions made in free time. Sometimes I need to sleep and go to my regular work - except this, there needs to be some time to write over hundred of thousands lines of free code, manage the translations, making documentation, solving possible problems, etc. etc. I hope, you understand, that it is really no easy to answer the questions immediately :-( :-( even if I wish to do. :-(
[OT]

If you mean a category view:

components/com_phocadownload/views/category/view.html.php
components/com_phocadownlaod/views/category/tmpl/default_files.php

In the first there is preparing the output and in the second there is output

The view needs model (for getting items from database) and controller but these have no effect of displaying the files you need.

If there is some helper function such goes to libraries folder:

administrator/components/com_phocadownload/libraries/ ....

Jan
If you find Phoca extensions useful, please support the project
michaf
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 31 Jan 2015, 17:50

Re: [SOLVED] Change Url in Categorie View

Post by michaf »

[OT]Yes, i really know that you're very high supportive. That's why i - of course - understand any delay of repsonse.[/OT]

My temporary solution:
I decided to hijack the Piece of Code where the File-Details are shown:
components/com_phocadownload/views/file/tmpl/default.php
For that i made a Template Override in:
templates/template_name/html/com_phocadownload/file/default.php

So, instead of modifying the link Button to call an extra function with my code,
i just inserted the external File-Viewer Code where usually the File-Details are shown (As 'Date', 'Size', 'Author', etc.) - after "slaughtering" the original Code ;).
As long as no bigger Changes to the file-view will be made in the near future, this Template Override will last a bunch of month'.

Nevertheless, the hint with the libraries-folder could become interesting for posssible other changes.

Thanks,
Micha
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [SOLVED] Change Url in Categorie View

Post by Jan »

Ok :-)
If you find Phoca extensions useful, please support the project
Post Reply