Automatic preview ?

Phoca Download - download manager
Webbolo
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 22 Apr 2014, 15:05

Automatic preview ?

Post by Webbolo »

Hello and congratulations for this useful component. I wanted to ask if I set the preview image automatically with the same picture of the download. Having many images is not easy to set them all one at a time, thank you!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48568
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Automatic preview ?

Post by Jan »

Hi, for now there is no such option, so this needs to be customized directly - to have such feature :idea:

Jan
If you find Phoca extensions useful, please support the project
Webbolo
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 22 Apr 2014, 15:05

Re: Automatic preview ?

Post by Webbolo »

Ok thank you!

Can you explain to me what I need to change to get a preview to download the same file? thanks
Webbolo
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 22 Apr 2014, 15:05

Re: Automatic preview ?

Post by Webbolo »

tell me you know the administration file with form fields?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48568
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Automatic preview ?

Post by Jan »

Hi, sorry I don't understand?
If you find Phoca extensions useful, please support the project
Webbolo
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 22 Apr 2014, 15:05

Re: Automatic preview ?

Post by Webbolo »

Hi,
I found the solution.
With this change, If you upload a file in the Specific Icon1, the system loads the specific icon1 that you put in field.
If you have not entered any icon Specification file1, the system inserts the file preview... the "specific icon1" will always be equal to the file preview.
In the code bottom, I have eliminated the icon specific2.

The insert if it helps someone:

File: components/com_phocadownload/views/category/tmpl/default_files.php

Change line 62:

Code: Select all

//Specific icons
				if (isset($v->image_filename_spec1) && $v->image_filename_spec1 != '') {
					$pdFile .= '<div class="pd-float2">'.$l->getImageDownload($v->image_filename_spec1).'</div>';
				} 
				if (isset($v->image_filename_spec2) && $v->image_filename_spec2 != '') {
					$pdFile .= '<div class="pd-float2">'.$l->getImageDownload($v->image_filename_spec2).'</div>';
				} 
WITH:

Code: Select all

if (isset($v->image_filename_spec1) && $v->image_filename_spec1 != '') {
					$pdFile .= '<div class="pd-float2">'.$l->getImageDownload($v->image_filename_spec1).'</div>'; 
					}
			        	else if (isset($v->filename_preview) && $v->filename_preview != '') {
			        
								$filePath	= PhocaDownloadPath::getPathSet('filepreview');
								$filePath	= str_replace ( '../', JURI::base(true).'', $filePath['orig_rel_ds']);
								$previewLink = $filePath . $v->filename_preview;	
								$pdFile .= '<div class="pd-float2"><img src="'.$previewLink.'"> </div>';	 
				   }
				       
				//if (isset($v->image_filename_spec2) && $v->image_filename_spec2 != '') {
//					$pdFile .= '<div class="pd-float2">'.$l->getImageDownload($v->image_filename_spec2).'</div>';
//				} 
Bye
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48568
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Automatic preview ?

Post by Jan »

Ok, thank you for the guide.

Jan
If you find Phoca extensions useful, please support the project
Post Reply