Facebook 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4289
Latest: JoshuaShoor
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43790
Total Topics: 7602
Most Online Today: 55
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 53
Total: 53

Author Topic: Sorted FTP Import Directory  (Read 234 times)

0 Members and 2 Guests are viewing this topic.

Offline Senkusha

  • Community Suite Customer
  • Member
  • ******
  • Posts: 39
    • View Profile
    • The Kawaii Klub
Sorted FTP Import Directory
« on: April 24, 2025, 01:20:23 pm »
This is by far no way perfect, it was a quick hack, but it seems to work.  Please give this a look over.  Modified code in Themes/default/Downloads2.1.template.php around line 5066

Code: [Select]
// Check to see if there's anything in my special array.
if (isset($myFileArray))
if (count($myFileArray) > 0)
unset($myFileArray);

// Create a new array.
$myFileArray = array();

// Dump the contents of the directory into the new array...
// Loop through all the images in the folder.
$dir = opendir($fpath);
$count = 0;
while ($file = readdir($dir))
{
// Skip the directories!
if (!is_dir($fpath . '/' . $file))
{
$myFileArray[] = $file;
$count ++;
}
}
closedir($dir);

natcasesort($myFileArray);

// Now let's list these files.
// Loop though all the images in the folder
foreach ($myFileArray AS $fkey => $fvalue)
echo '
<tr>
<td><input type="checkbox" name="fimage[]" checked="checked" value="',$fvalue,'" /></td>
<td><a href="',$modSettings['down_url'], $fpath2 ,'/', $fvalue,'" target="_blank">',$fvalue,'</a></td>
<td>',Downloads_format_size(filesize($fpath . '/' . $fvalue),2),'</td>
</tr>';

-- Senkusha
Creative Pioneer exploring anime role playing adventures!
Visit my Creative Anime Role Playing Community
SMF 2.1.4
Like Like x 1 View List

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16673
    • View Profile
Re: Sorted FTP Import Directory
« Reply #1 on: April 25, 2025, 05:11:22 am »
Looks good I would do something similar.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
5273 Views
Last post July 08, 2007, 05:52:16 pm
by SMFHacks
2 Replies
4489 Views
Last post January 18, 2008, 08:35:11 pm
by SMFHacks
1 Replies
6300 Views
Last post February 16, 2008, 11:53:55 am
by SMFHacks
1 Replies
4407 Views
Last post September 12, 2008, 06:58:28 pm
by SMFHacks
9 Replies
6391 Views
Last post November 30, 2010, 09:19:56 pm
by SMFHacks

+- Recent Topics

[Mod]Cloudflare Turnstile for SMF by SMFHacks
May 08, 2025, 10:08:43 am

Disable "Notify me of Comments feature" by Kiwi
May 08, 2025, 02:04:16 am

Trying to access array offset on null by Michel68
May 05, 2025, 08:47:34 am

Default [Additional] Membergroups upon Registration by SMFHacks
April 30, 2025, 10:22:52 am

Sorted FTP Import Directory by SMFHacks
April 25, 2025, 05:11:22 am

Search results items per page? by SMFHacks
April 18, 2025, 04:12:23 pm

Suggestions and request by Senkusha
April 03, 2025, 02:30:43 pm

How does a member add a Classified Listing? by SMFHacks
March 28, 2025, 08:05:50 pm

Auto converting to webp or AVIF by [chrisB]
March 28, 2025, 01:46:00 pm

Thumbnail creation settings by SMFHacks
March 28, 2025, 12:42:51 pm

Powered by EzPortal