Facebook 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4293
Latest: siriusblack
New This Month: 2
New This Week: 1
New Today: 0
Stats
Total Posts: 43802
Total Topics: 7605
Most Online Today: 473
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 243
Total: 243

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

0 Members and 3 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: 16678
    • 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
5397 Views
Last post July 08, 2007, 05:52:16 pm
by SMFHacks
2 Replies
4605 Views
Last post January 18, 2008, 08:35:11 pm
by SMFHacks
1 Replies
6416 Views
Last post February 16, 2008, 11:53:55 am
by SMFHacks
1 Replies
4499 Views
Last post September 12, 2008, 06:58:28 pm
by SMFHacks
9 Replies
6636 Views
Last post November 30, 2010, 09:19:56 pm
by SMFHacks

+- Recent Topics

SMF Classifieds 6.0 by SMFHacks
June 18, 2025, 08:26:33 pm

The path must not be empty - Bulk Uploader Issues by SMFHacks
June 13, 2025, 09:03:52 pm

A day? by davejo
June 11, 2025, 04:14:35 pm

Dual 'Upload Url' by davejo
June 06, 2025, 04:27:45 pm

Automatic Sorting of Categories by Kiwi
June 03, 2025, 10:32:32 pm

[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

Powered by EzPortal