Hey Arno
Is it possible to add in future the option to limit mirror downloads only to registered users or for a special usergroup?
Would be nice :)
I added it by myself with
$user = JFactory::getUser();
if($user->id > 0) {
$mirror1_link = '<a '.$blank_window1.' href="'.$mirror1_link_dum.'" class="jdbutton '.$download_color_mirror1.' '.$download_size_mirror.'">'.JText::_('COM_JDOWNLOADS_FRONTEND_MIRROR_URL_TITLE_1').'</a>';
it works for me
Hi
Good idea
To implement as something general we would also need to add to the Config - FrontEnd Tab something like "Only show Mirror links if Logged On".
Also which php file did you edit? It may need editing in more than one file.
And did you make it an override?
Colin
It is also now possible to do it with the 'hide' functionality from the jD system plugin and a few placeholders in the layout.
@mkhde
Just to expand and illustrate the point made by Arno note that the Mirror links are shown by the layout placeholders {mirror_1} and {mirror_2} respectively.
If one looks at the Advanced section of the jDownloads System plugin it is seen that it supports 'hide' functionality plugins such as {jdreg}.
That is if some text is contained within {jdreg} to its closing {/jdreg} then it will only be seen by any processing code if the user belongs to the registered user group or any user group that has the Registered UG as one of its forefathers. This would include Author, Editor and Publisher UGs and any other UG that has the Registered UG as its parent, or grandparent and so on.
So if for example the layout contained something such as below
<div class=jd_mirror>click on {mirror_1} to download from Mirror 1.</div>
then everyone would see the message and the mirror action button.
But if it is modified to say
<div class=jd_mirror>{jdreg}click on {mirror_1} to download from Mirror 1.{/jdreg}</div>
then only logged on users, that is those with a forefather in the Registered UG, would see the message and the action button.
Colin