SMFHacks.com
** Home Forum Index Hacks Products Login Register Search
Welcome, Guest. Please login or register.
September 06, 2010, 09:43:41 pm

Login with username, password and session length
Members
Total Members: 8386
Latest: jmanceli2010
Stats
Total Posts: 21963
Total Topics: 4072
Online Today: 38
Online Ever: 399
(March 21, 2008, 10:16:14 pm)
Users Online
Users: 4
Guests: 32
Total: 36
Sponsored Links
+  SMFHacks.com
|-+  Forum
| |-+  Modifications/Themes
| | |-+  Modifications Talk
| | | |-+  Help w/ Downloads System
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Help w/ Downloads System  (Read 1730 times)
SNewman
Newbie
*
Offline Offline

Posts: 9


View Profile Email
« 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 Email
« Reply #1 on: January 30, 2009, 11:18:58 am »

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

Posts: 7331


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
[Today at 09:27:47 pm]

[Today at 09:52:21 am]

[September 05, 2010, 11:59:21 am]

[September 05, 2010, 08:55:27 am]

[September 04, 2010, 10:54:28 pm]

[September 04, 2010, 04:50:32 pm]

[September 03, 2010, 09:19:13 pm]

[September 02, 2010, 02:24:17 pm]

[September 01, 2010, 08:36:20 am]

[August 31, 2010, 01:07:25 pm]
Random Picture
Donate to SMFHacks.com
Help Support the SMFHacks.com mod making.
Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.7 © Bloc
Page created in 4.701 seconds with 19 queries.