News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

Abfrage der custom Fields im Layout

Started by gulsti, 08.02.2018 07:19:58

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gulsti

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
mfg.
Gulsti
  •  

ColinM

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
Colin M
  •  

gulsti

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
  •  

ColinM

Hi
Thankyou for repying in Engish.  You wrote
QuoteUnfortunately 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
Colin M
  •  

gulsti

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
  •  

ColinM

Hi
Think I forgot to add the pic illustrating what I mean by the file icon.
Is that what you maen
Colin

[gelöscht durch Administrator]
Colin M
  •  

gulsti

#6
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
mfg.
Gulsti
  •  

ColinM

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
Colin M
  •  

gulsti

#8
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

mfg.
Gulsti
  •  

ColinM

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
Colin M
  •