summaryrefslogtreecommitdiff
path: root/forum
diff options
context:
space:
mode:
authordeva <deva>2008-10-12 12:23:03 +0000
committerdeva <deva>2008-10-12 12:23:03 +0000
commit2513086e12cba0a16eec4bba4c858143d9eab423 (patch)
tree18cd36743cea179b19ef1e8bdee977430bb7b81b /forum
parent062a5de0b96efff0e65ada60aab87d371d212d72 (diff)
Added uploading user to file entries.
Diffstat (limited to 'forum')
-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'));