jDownloadsownloads.com


Author Topic: Add Author to Module  (Read 554 times)

0 Members and 1 Guest are viewing this topic.

Offline tschortsch.de

  • Newbie
  • *
  • Posts: 18
Add Author to Module
« on: 22.03.2020 15:18:20 »
Hello,
I'd like to add the author to the module jdownloads_latest.
Could you please help me?

Yours Georg

Offline Tazzios

  • Newbie
  • *
  • Posts: 26
Re: Add Author to Module
« Reply #1 on: 07.04.2020 16:18:13 »
go to /modules/mod_jdownloads_latest/tmpl
make a duplicate of alternative.php      

add the following code at line 150:
Code: [Select]
// add the author
$html .= '<div style="padding-bottom: 3px; text-align:'.$date_alignment.';"><small><a href="'.$files[$i]->url_home   .'">' .$files[$i]->author.'</a></small></div>';
         
You can also use url_author but both need to contain the full urls to work so:  'https://google.com'
Go to you module and select the new created layout at the 'Alternative Layout' list.

Offline Tazzios

  • Newbie
  • *
  • Posts: 26
Re: Add Author to Module
« Reply #2 on: 07.04.2020 16:43:29 »
Maybe it is an idea if the layout function of jdownloads  also would work for the  modules?

Offline tschortsch.de

  • Newbie
  • *
  • Posts: 18
Re: Add Author to Module
« Reply #3 on: 10.04.2020 16:25:05 »
but both need to contain the full urls to work so:  'https://google.com'
Sorry, but I do not understand that?
Where do I have to insert the url?

Offline tschortsch.de

  • Newbie
  • *
  • Posts: 18
Re: Add Author to Module
« Reply #4 on: 10.04.2020 16:27:31 »
Maybe it is an idea if the layout function of jdownloads  also would work for the  modules?
Yes, that would be great  :)
Can you integrate the code in the module?

Offline ColinM

  • Moderator
  • *
  • Posts: 4.177
Re: Add Author to Module
« Reply #5 on: 11.04.2020 11:00:29 »
Hi
What Tazzios was saying is that when you specify the Author url in the Download it needs to be a full url including the https:// part.Colin

Offline tschortsch.de

  • Newbie
  • *
  • Posts: 18
Re: Add Author to Module
« Reply #6 on: 11.04.2020 16:06:49 »
go to /modules/mod_jdownloads_latest/tmpl
make a duplicate of alternative.php      

add the following code at line 150:
Code: [Select]
// add the author
$html .= '<div style="padding-bottom: 3px; text-align:'.$date_alignment.';"><small><a href="'.$files[$i]->url_home   .'">' .$files[$i]->author.'</a></small></div>';
   
Go to you module and select the new created layout at the 'Alternative Layout' list.      
I tried it that way. But it didn't work.
The author isn't be shown...😥
What is wrong? Could you help me?
« Last Edit: 11.04.2020 16:08:18 by tschortsch.de »

Offline ColinM

  • Moderator
  • *
  • Posts: 4.177
Re: Add Author to Module
« Reply #7 on: 12.04.2020 16:09:29 »
HiFirst just in case please make a backup of your site!!!
Please find attached a zip file called alternate-new.zip.  Extract a file called alternate-new.phpCopy the php file to location <your site>\modules\mod_jdownloads_latest\tmpl\You should find a file called alternate.php there already  - if it is not there check which location you are using.
pic Latest-module-01.png shows the results after doing the setup as noted below.
Check that  tab menu assignment is set up to actually show the module! - see Latest-module-02.pngOn tab Advaced select 'alternate-nes'  - see pic Latest-module-03.png
To test add  an author name to one of the latest Downloads  - see pic Latest-module-04.png
Best wishes
Colin

Offline tschortsch.de

  • Newbie
  • *
  • Posts: 18
Re: Add Author to Module
« Reply #8 on: 13.04.2020 16:36:16 »
Hello Colin, thank you very much. It works ;-)
I made the mistake because I thought that the creator is showing.
But now I replaced the author with creator and it works.