summaryrefslogtreecommitdiff
path: root/forum/utils
diff options
context:
space:
mode:
Diffstat (limited to 'forum/utils')
-rw-r--r--forum/utils/files.php12
1 files changed, 9 insertions, 3 deletions
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 "<div class=\"file\">\n";
if($current_user->uid == 0) {
echo " <a class=\"delete\" href=\"?mode=filehandler&amp;task=delete&amp;fid=" . $this->fid . "\">Delete</a>\n";
}
- echo " <div class=\"filename\">Filename: <a href=\"" . $this->link() . "\">" . $this->name . "</a>(" . $this->mimetype. ")</div>\n";
+ echo " <div class=\"filename\">Filename: <a href=\"" . $this->link() . "\">" . $this->name . "</a> (" . $this->mimetype. ")</div>\n";
+ echo " <div class=\"fileuser\">Uploaded by: " . $users->getUser($this->uid)->name . "</div>\n";
echo " <div class=\"filesize\">Size: " . ceil(filesize($PERMSTORE . "/" . $this->fid) / 1024) . "kb</div>\n";
echo " <div class=\"insertcommand\">Use this command to insert the file: {{" . $this->fid . "}}</div>\n";
echo "</div>\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, " <file fid=\"" .
htmlspecialchars($file->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'));