Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
File Uploads - Filter file types

 

 


gversion
User

Dec 24, 2011, 3:25 PM

Post #1 of 4 (771 views)
Shortcut
File Uploads - Filter file types Can't Post

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


northernpenguin
User

Dec 26, 2011, 6:42 AM

Post #2 of 4 (732 views)
Shortcut
Re: [gversion] File Uploads - Filter file types [In reply to] Can't Post

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!
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke


robin
User / Moderator


Dec 27, 2011, 11:36 AM

Post #3 of 4 (719 views)
Shortcut
Re: [gversion] File Uploads - Filter file types [In reply to] Can't Post

Hey Greg,

The code generator creates a true/false value ($upload['isImage']) you can use to test images:


Code
          <?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


gversion
User

Dec 27, 2011, 5:01 PM

Post #4 of 4 (708 views)
Shortcut
Re: [robin] File Uploads - Filter file types [In reply to] Can't Post

Hi guys,

Many thanks for helping me out.

Kind regards,
Greg