Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Function makefilelist Not Working Right

Asked Modified Viewed 869 times
G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
asked
Senior Member

I am having a problem getting 'makefilelist' to work correctly on my infusion. Here is my function:
<?php
function loadMyFiles($dir) {
   $ignoreMyFiles = '.|..|.htaccess|index.php|.tmp';
   $uploads = makefilelist(UPLOAD_FOLDER.$dir, $ignoreMyFiles, TRUE, 'files');
   return (isset($uploads)) ? $uploads : false;
}
?>

And here is my calling code:
opentable("Uploaded Files");
include INFUSIONS."news_letter_panel/include/functions.php";
 $uploads = loadMyFiles(UPLOAD_FOLDER);
 if (is_array($uploads) && count($uploads) > 0) {
 echo "<table width='730' align='center' border='0' class='tbl-brdr3'><tr>n";
 echo "<td bgcolor='#840000' colspan='6' align='center'><span style='color:white;'><h4><strong>Uploaded Filenames For Attachments</strong></h4></span></td></tr><tr>n";
 $i = 1;
 foreach($uploads AS $file_name) {
 echo "<td bgcolor='#B7DBFF' align='center'><b>$file_name</b></td>n";
if ($i % 6 == 0) {
 echo "</tr><tr>n";
}
 $i++;
 }
}
 echo "</tr></table>n";
closetable();

All I'm trying to do is show the files w/ext in the uploads directory. Any help would be appreciated!
Edited by Grimloch on 26-12-2022 16:55,
0 replies

1 post

G
Grimloch
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions
answered
Senior Member

Well guys once again; nevermind I fixed it my self. Instead of this:
$uploads = loadMyFiles(UPLOAD_FOLDER);

It needed to be:
$uploads = loadMyFiles($uploads);

Another dumb mistake by yours truly !!
0 replies

Labels

Statistics

  • Views 0 views
  • Posts 1 post
  • Votes 0 votes
  • Topic users 1 member

1 participant

G
G
Energy can neither be created nor destroyed; only transformed !
  • Senior Member, joined since
  • Contributed 722 posts on the community forums.
  • Started 141 threads in the forums
  • Started this discussions
  • Answered 2 questions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet