Is it possible to have a hyperlink in the file description?

Phoca Download - download manager
User avatar
buxster07
Phoca Member
Phoca Member
Posts: 24
Joined: 21 May 2018, 16:44

Is it possible to have a hyperlink in the file description?

Post by buxster07 »

If I am using the Download Module and I list a series of files and allow the descriptions to be shown, would it be possible to have a clickable hyperlink in the description displayed?

Currently, when I place a description with a hyperlink, it does not actually show as clickable.

Tags:
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9451
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Is it possible to have a hyperlink in the file description?

Post by Benno »

Hi,
from which Phoca Download Module are you talking?

Kind regards,
Benno
User avatar
buxster07
Phoca Member
Phoca Member
Posts: 24
Joined: 21 May 2018, 16:44

Re: Is it possible to have a hyperlink in the file description?

Post by buxster07 »

Hi Benno,

In this case, I am using the Phoca Download Module. I have a module loaded onto a web page and the module pulls in a file list from a category. This works wonderfully as it has a list of files and their respective descriptions.

Now when I go to Components > Phoca Download > Files, and then I go to a certain file, and edit the description, I attempted to put a hyperlink in the description. But when I go to the web page where the file module resides, the hyperlink is not clickable. Is there a way for the Phoca Download Module to have a hyperlink within a file's description line?
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9451
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Is it possible to have a hyperlink in the file description?

Post by Benno »

Hi,
Confirmed! Hyperlinks & BBCode not working. I will ask Jan.
Image
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Is it possible to have a hyperlink in the file description?

Post by Jan »

Hi, which module version do you use?

The description does not include HTML, it is text only. E.g. because when you want to short it and the count of characters is applied:

So the solution can be to remove the strip_tags function:
mod_phocadownload_file.php line cca 280

From:

Code: Select all

if ( $displayDesc == 1 ) {

					$desc	= PhocaDownloadUtils::strTrimAll($v->description);
					$desc 	= strip_tags( $desc );
					if (StringHelper::strlen($desc) < $descCharacters || StringHelper::strlen($desc) == $descCharacters) {
					} else {
						$desc = StringHelper::substr($desc, 0, $descCharacters) . '...';
					}

					$output .= '<div class="pd-mf-desc">'.$desc. '</div>';
				}
To:

Code: Select all

if ( $displayDesc == 1 ) {

					//$desc	= PhocaDownloadUtils::strTrimAll($v->description);
					//$desc 	= strip_tags( $desc );
					//if (StringHelper::strlen($desc) < $descCharacters || StringHelper::strlen($desc) == $descCharacters) {
					//} else {
					//    $desc = StringHelper::substr($desc, 0, $descCharacters) . '...';
					//}

					$output .= '<div class="pd-mf-desc">'.$v->description. '</div>';
				}
If you find Phoca extensions useful, please support the project
User avatar
buxster07
Phoca Member
Phoca Member
Posts: 24
Joined: 21 May 2018, 16:44

Re: Is it possible to have a hyperlink in the file description?

Post by buxster07 »

Hello Jan,

I am using this extension version:
Phoca Download File Module 3.1.8
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9451
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Is it possible to have a hyperlink in the file description?

Post by Benno »

Hi,
Jans solution works perfectly with v3.1.8 :)
Image

Kind regards,
Benno
User avatar
buxster07
Phoca Member
Phoca Member
Posts: 24
Joined: 21 May 2018, 16:44

Re: Is it possible to have a hyperlink in the file description?

Post by buxster07 »

Thank you much for the quick response! The script works wonderfully!!!!!
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9451
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Is it possible to have a hyperlink in the file description?

Post by Benno »

Thanks for feedback --> Solved!

Kind regards,
Benno
Post Reply