SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
February 11, 2012, 12:11:01 am

Login with username, password and session length
Members
Total Members: 9905
Latest: mvpjersey15
Stats
Total Posts: 27798
Total Topics: 4859
Online Today: 79
Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Users: 0
Guests: 80
Total: 80
+ 
|-+ 
| |-+ 
| | |-+ 
| | | |-+ 
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Help w/ Downloads System  (Read 2023 times)
SNewman
Newbie
*
Offline Offline

Posts: 9


View Profile
« on: January 25, 2009, 09:47:20 am »

Posted in Latest Mods also, figured this would be a more appropriate board.

Hey guys!  I just want to start by saying I have purchased SMF Gallery Pro, and am using Downloads system (obviously) and both are great!  Oh, and I'm using SMF 2.0 Beta 4.  Basically what I'm trying to do is when you select a category and it lists all the files, I want to add an icon next to the file name based upon the file type.  Here's the code I have so far:

File: Themes/default/Downloads2.template.php
Code:
foreach ($context['downloads_files'] as $i => $file)
      {
   
         echo '<tr>';
         
                        $fName = $file['orginalfilename'];
                        $ext = substr(strrchr($fName, '.'), 1);
                       
                             if(file_exists("Themes/default/images/docType/" . $ext . ".gif"))
                                  $ikon = "http://www.psplockhaven.org/Themes/default/images/docType/" . $ext . ".gif";
                              else
                                  $ikon = "http://www.psplockhaven.org/Themes/default/images/docType/genericBlue.gif";
                         
                        echo '<td><img src="' . $ikon . '" alt="' . $ext . '"></td>';

         if (!empty($modSettings['down_set_t_title']))   
            echo  '<td><a href="' . $scripturl . '?action=downloads;sa=view;down=', $file['ID_FILE'], '">', $file['title'], '</a></td>';

Just as a tiny note, for a while I had been using originalfilename for the column name (correct spelling), before discovering the column name had been misspelled.  Perhaps this can be fixed in a future release?  Anyway, the column name definitely exists, so I don't know what the problem is.  It either returns 0 or nothing for $ikon.  Any help would be greatly appreciated.  Thanks in advance!
Logged
SNewman
Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #1 on: January 30, 2009, 11:18:58 am »

Any help whatsoever?
Logged
SMFHacks
Administrator
Hero Member
*****
Offline Offline

Posts: 9399


View Profile
« Reply #2 on: January 30, 2009, 07:59:33 pm »

At this time. My time is limited so working mainly on product updates.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Recent
[February 10, 2012, 03:36:31 pm]

[February 10, 2012, 02:42:09 pm]

[February 10, 2012, 02:23:51 pm]

[February 10, 2012, 10:26:45 am]

[February 09, 2012, 05:30:55 pm]

by exit
[February 09, 2012, 04:47:13 pm]

[February 08, 2012, 09:09:16 pm]

[February 08, 2012, 09:11:02 am]

[February 08, 2012, 09:07:32 am]

[February 08, 2012, 03:46:49 am]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
SMF and SimpleMachines are registered trademarks of Simple Machines. SMFHacks.com is not affiliated with nor endorsed by Simple Machines.
Page created in 0.199 seconds with 19 queries.