File Uploads - Filter file types
4 posts by 3 authors in: Forums > CMS Builder
Last Post: December 27, 2011 (RSS)
Hello,
On my website users can upload files to their listings. Files can be images (e.g. GIF/JPG) and documents (e.g. PDF/DOC).
The uploaded images are being displayed neatly in a photo gallery lightbox.
Is there a way I can display a bullet point list of only the PDF or DOC(X) files that have been uploaded?
Thank you,
Greg
On my website users can upload files to their listings. Files can be images (e.g. GIF/JPG) and documents (e.g. PDF/DOC).
The uploaded images are being displayed neatly in a photo gallery lightbox.
Is there a way I can display a bullet point list of only the PDF or DOC(X) files that have been uploaded?
Thank you,
Greg
Re: [gversion] File Uploads - Filter file types
Hi Greg
Well, it really depends on how you wrote your code, but if you use the basic code from code generator you will notice the "if statement".
The if statement first displays thumbnails based on certain conditions, else the full image, and if a document, a link for download.
By using this basic structure, you should be able to build your own filter system.
You can also check The CMSB Cookbook for additional information (http://www.thecmsbcookbook.com).
Happy Holiday!
Well, it really depends on how you wrote your code, but if you use the basic code from code generator you will notice the "if statement".
The if statement first displays thumbnails based on certain conditions, else the full image, and if a document, a link for download.
By using this basic structure, you should be able to build your own filter system.
You can also check The CMSB Cookbook for additional information (http://www.thecmsbcookbook.com).
Happy Holiday!
--
northernpenguin
Northern Penguin Technologies
"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke
northernpenguin
Northern Penguin Technologies
"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke
Re: [gversion] File Uploads - Filter file types
By robin - December 27, 2011
Hey Greg,
The code generator creates a true/false value ($upload['isImage']) you can use to test images:
Hope that helps,
Robin
The code generator creates a true/false value ($upload['isImage']) you can use to test images:
<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>
<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>
Hope that helps,
Robin
Robin
Programmer
interactivetools.com
Programmer
interactivetools.com
Re: [robin] File Uploads - Filter file types
Hi guys,
Many thanks for helping me out.
Kind regards,
Greg
Many thanks for helping me out.
Kind regards,
Greg