jDownloadsownloads.com

Advertisement

Author Topic: Abfrage der custom Fields im Layout  (Read 286 times)

0 Members and 1 Guest are viewing this topic.

Offline gulsti

  • Newbie
  • *
  • Posts: 8
Abfrage der custom Fields im Layout
« on: 08.02.2018 07:19:58 »
Hallo,

ich nutze die aktuelle Version von jDownloads 3.2x, das ganze in Moment unter Windows 10 unter Xampp, da ich mein vorhandenes Projekt mit ca. 12.000 Downloads nach joomla portieren mag.

Ich hab in den Custom Field, eine URL abgelegt zu einen Programm Symbol des Downloads, nur es sind halt nicht immer alle Downloads mit Symbolen versorgt.

Kann man die custom fields dann im Layout abfragen, ob diese einen Inhalt haben oder nicht?

mfg.
gulsti
« Last Edit: 09.02.2018 17:14:20 by gulsti »
mfg.
Gulsti

Offline ColinM

  • Moderator
  • *
  • Posts: 3.241
Re: Abfrage der custom Fields im Layout
« Reply #1 on: 11.02.2018 10:46:48 »
Hi
As my German is only good for a 'tourist' I have used Google translate so please excuse any misunderstanding.
Incidentally I also use XAMPP on Win10 for development and testing

The two points you wrote which by Google Translate are:
1. "I have put in the Custom Field, a URL to a program icon of the download, only there are not always all downloads with icons supplied."
2. "Can you then query the custom fields in the layout, whether they have content or not? "

From 1. above I think you are saying that there is not an icon symbol for all file types. Is that correct?
You can always add additional file type icons into <site>/images/jdownloads/fileimages   Typically these are 48px by 48px and have a name 'type'.png so for example the pdf icon is in pdf.png  If you do not select an icon when creating a Download, ie leave field blank and also leave the field "Default image for Downloads" in jD Config - Pictures tab empty then jD will search that directory for a match to show the correct icon. 

I do not quite understand item 2 above.  I believe you are asking if the custom field will 'action' the url.  If that is so then no it does not, it will just show the url.

Best wishes
Colin

Offline gulsti

  • Newbie
  • *
  • Posts: 8
Re: Abfrage der custom Fields im Layout
« Reply #2 on: 11.02.2018 13:09:30 »
hi,

I'll try it in English (deepl. com). Unfortunately it would be too much work to upload all the icons since there are over 12000 downloads.
Therefore, it is easier to have the icons in a custom field. Since not all downloads always have an icon, I used to check this in my old CMS with a PHP if request if there is a URL and if not a replacement symbol.  Therefore yes the question if I can create a query in the layout and check if the custom field has content and I display the icon, or if no one is registered that I can take a replacement icon.

Thanks
mfg.
Gulsti

Offline ColinM

  • Moderator
  • *
  • Posts: 3.241
Re: Abfrage der custom Fields im Layout
« Reply #3 on: 12.02.2018 11:57:24 »
Hi
Thankyou for repying in Engish.  You wrote
Quote
Unfortunately it would be too much work to upload all the icons since there are over 12000 downloads.
By an 'icon' I mean the picture usually associated with a file type - see attached pic.  Is that what you mean?

Note the icon pictures that I mean are already uploaded in jD. And each Download has a reference in the data base to the relevant 'icon picture' to show.
Colin

Offline gulsti

  • Newbie
  • *
  • Posts: 8
Re: Abfrage der custom Fields im Layout
« Reply #4 on: 12.02.2018 14:38:35 »
No, the icons are the icons of the programs (programm. exe) that are in the download database (Freeware/Open Source), like sourceforge for example.

However, it could also be a screenshot of a program that was entered by URL in the custom field (without upload[http://domain.com/screenshot.jpg]) on the server. The old system I used so far was the download module of PHPNuke, which I rewrote myself.

It's all about whether I can query the custom field in the layout to see if there's anything in it or not, and then I can display the screenshot (icon) or show a replacement.

gulsti
mfg.
Gulsti

Offline ColinM

  • Moderator
  • *
  • Posts: 3.241
Re: Abfrage der custom Fields im Layout
« Reply #5 on: 14.02.2018 22:36:18 »
Hi
Think I forgot to add the pic illustrating what I mean by the file icon.
Is that what you maen
Colin

Offline gulsti

  • Newbie
  • *
  • Posts: 8
Re: Abfrage der custom Fields im Layout
« Reply #6 on: 15.02.2018 08:39:16 »
Hello,

Yes, this is a standard symbol, so it was not meant by the icon. If so, then it should be an icon icon like on my current website as shown here to the left of the program names:
.../freeware-zeige-details-23962-AVG_AntiVirus_Free.html
or as on the start page in the list on the left:

Gulsti
« Last Edit: Yesterday at 10:42:44 by Arno »
mfg.
Gulsti

Offline ColinM

  • Moderator
  • *
  • Posts: 3.241
Re: Abfrage der custom Fields im Layout
« Reply #7 on: 15.02.2018 11:06:10 »
Gulsti
Having seen your site I now understand that you would like to have an icon that is, in principle, specific to each individual Download.  In jD terms each Download can have multiple pictures and one of these could readily be the specific icon.  Where the picture is displayed is a function of the Layout so it could be placed where the ' file type icon' appears.

With the standard jD software that does mean loading the relevant image with each Download.  Given the number you are dealing with that is impractical.  Also the Layout have no query mechanism as standard.

I believe you have a database with the icons on your system.  So the way forward would to to perhaps create a new 'placeholder' say {prog-icon} or to adapt the code that jD uses to locate a picture in its appropriate database table to look elsewhere.  The key question is how at present do you identify and locate the correct  'program icon'?
Colin

Offline gulsti

  • Newbie
  • *
  • Posts: 8
Re: Abfrage der custom Fields im Layout
« Reply #8 on: 15.02.2018 12:51:03 »
Ah... ;-)
I'll include it without the icons first. I have to make sure that everything is possible with JD and the many downloads.
I will probably have to write some plugins for the different editions, or rewrite existing ones. So far I have only programmed for PHPnuke... so I have to change completely for Joomla.
Thank you very much for the effort to help me up to here.

By the way, the forum system swallows umlauts in the text and cuts off text if you write in German with umlauts.
 
gulsti

« Last Edit: 15.02.2018 12:53:01 by gulsti »
mfg.
Gulsti

Offline ColinM

  • Moderator
  • *
  • Posts: 3.241
Re: Abfrage der custom Fields im Layout
« Reply #9 on: 20.02.2018 10:55:46 »
Gulsti,
Pleased to have helped a bit!
Think the forum is a 'traditional USA language' one that does not handle all the propoer characters - thanks for telling me
Colin

 

Advertisement