1
hipoonios
Links in fields (TDMDownloads)
  • 2012/11/29 5:17

  • hipoonios

  • Friend of XOOPS

  • Posts: 298

  • Since: 2005/9/24


I'm thinking of using TDMDownloads for my next project. This is what I understood the best and most up-to-date download module for Xoops right now.

I see you can create extra fields in the module. That's awesome. Because I need that. However, i'm trying to put links in the fields but they don't become clickable. This is useful if you want to have more download mirrors for a file or want to link to more websites.

Can this be fixed somehow?

2
hipoonios
Re: Links in fields (TDMDownloads)
  • 2012/11/30 20:00

  • hipoonios

  • Friend of XOOPS

  • Posts: 298

  • Since: 2005/9/24


Resized Image


I really need help with this. This is the only thing that stopping me to use Xoops for my next project. Else I must look for another CMS

As i said in my opening post. I want to have links my fields. There is already one field in the module called "Home Page". That link is clickable. But I need more than that. Maybe the easiest way is to clone the "home page" field somehow?

I would like to have like 2-3 more "home page" fields.

3
trabis
Re: Links in fields (TDMDownloads)
  • 2012/12/1 16:56

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Hi,

Edit file singlefile.php around line 169

Replace:
if ($contenu != ''){ $champ_sup ' ' $downloads_field[$i]->getVar('title') . ': ' $contenu$champ_sup_vide++; }

with:
if ($contenu != ''){ $myts MyTextSanitizer::getInstance(); $myts->makeClickable($contenu); $champ_sup ' ' $downloads_field[$i]->getVar('title') . ': ' $contenu$champ_sup_vide++; }


If the field contains a link or a email it will become clickable,

4
hipoonios
Re: Links in fields (TDMDownloads)
  • 2012/12/2 10:44

  • hipoonios

  • Friend of XOOPS

  • Posts: 298

  • Since: 2005/9/24


It works! Thank you very much. But there is one small problem left.

Is it possible to make the link show "here" like the "home page" field? Because now the links is too long and don't fit very well in the table.

Resized Image


Or maybe this needs too much hacking?

5
trabis
Re: Links in fields (TDMDownloads)
  • 2012/12/2 13:37

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Quote:

hipoonios wrote:
Or maybe this needs too much hacking?


Not much.

Singlefile.php change line 169 should look like this
if ($contenu != ''){
            
TDMDownloads_MakeClickable($contenu_MD_TDMDOWNLOADS_SINGLEFILE_ICI);
            
$champ_sup ' ' $downloads_field[$i]->getVar('title') . ': ' $contenu;
            
$champ_sup_vide++;
        }


Now open TDMDownloads/include/functions.php and add this function (see attached file, I could not paste it here).



6
hipoonios
Re: Links in fields (TDMDownloads)
  • 2012/12/2 15:06

  • hipoonios

  • Friend of XOOPS

  • Posts: 298

  • Since: 2005/9/24


Works fine!

Now I can use Xoops for my next project. No need to look at another CMS!

Login

Who's Online

193 user(s) are online (93 user(s) are browsing Support Forums)


Members: 0


Guests: 193


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits