From 2513086e12cba0a16eec4bba4c858143d9eab423 Mon Sep 17 00:00:00 2001 From: deva Date: Sun, 12 Oct 2008 12:23:03 +0000 Subject: Added uploading user to file entries. --- forum/utils/files.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'forum') diff --git a/forum/utils/files.php b/forum/utils/files.php index b91957b..2190f42 100644 --- a/forum/utils/files.php +++ b/forum/utils/files.php @@ -5,6 +5,7 @@ include_once($UTIL_DIR . "/mimetypes.php"); class File { public $fid; + public $uid; public $name; public $mimetype; @@ -15,20 +16,22 @@ class File { public function show() { - global $PERMSTORE, $current_user; + global $PERMSTORE, $current_user, $users; echo "
\n"; if($current_user->uid == 0) { echo " fid . "\">Delete\n"; } - echo "
Filename: link() . "\">" . $this->name . "(" . $this->mimetype. ")
\n"; + echo "
Filename: link() . "\">" . $this->name . " (" . $this->mimetype. ")
\n"; + echo "
Uploaded by: " . $users->getUser($this->uid)->name . "
\n"; echo "
Size: " . ceil(filesize($PERMSTORE . "/" . $this->fid) / 1024) . "kb
\n"; echo "
Use this command to insert the file: {{" . $this->fid . "}}
\n"; echo "
\n"; } - public function File($fid, $name, $mimetype) + public function File($fid, $uid, $name, $mimetype) { $this->fid = $fid; + $this->uid = $uid; $this->name = $name; $this->mimetype = $mimetype; } @@ -57,6 +60,8 @@ class Files { foreach($this->files as $file) { fwrite($fp, " fid, ENT_QUOTES, "UTF-8") . "\"\n"); + fwrite($fp, " uid=\"" . + htmlspecialchars($file->uid, ENT_QUOTES, "UTF-8") . "\"\n"); fwrite($fp, " name=\"" . htmlspecialchars($file->name, ENT_QUOTES, "UTF-8") . "\"\n"); fwrite($fp, " mimetype=\"" . @@ -118,6 +123,7 @@ class Files { foreach ($files as $f) { $file = new File($f->getAttribute('fid'), + $f->getAttribute('uid'), $f->getAttribute('name'), $f->getAttribute('mimetype')); -- cgit v1.2.3