From 42c62cb041a2b2b95c9cda0c20fcf70334fd244c Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 1 Nov 2011 09:32:21 +0000 Subject: Rewl og krat... needs cleaning up - after port to GIT. --- forum/utils/files.php | 62 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 26 deletions(-) (limited to 'forum/utils/files.php') diff --git a/forum/utils/files.php b/forum/utils/files.php index 7356ff8..2fa3ec4 100644 --- a/forum/utils/files.php +++ b/forum/utils/files.php @@ -18,18 +18,23 @@ class File { public function show() { global $PERMSTORE, $current_user, $users; - echo "
\n"; + + $str = ""; + + $str .= "
\n"; if($current_user->uid == 0) { - echo " fid . "\">X\n"; + $str .= " fid . "\">X\n"; } - echo " \n"; - echo "
{{" . $this->fid . "}}
\n"; - echo " \n"; - echo "
" . $this->mimetype. "
\n"; - echo "
" . $users->getUser($this->uid)->name . "
\n"; - echo "
" . ceil(filesize($PERMSTORE . "/" . $this->fid) / 1024) . "kb
\n"; - echo "
" . date("M jS Y - G:i", $this->date) . "
\n"; - echo "
\n"; + $str .= " \n"; + $str .= "
{{" . $this->fid . "}}
\n"; + $str .= " \n"; + $str .= "
" . $this->mimetype. "
\n"; + $str .= "
" . $users->getUser($this->uid)->name . "
\n"; + $str .= "
" . ceil(filesize($PERMSTORE . "/" . $this->fid) / 1024) . "kb
\n"; + $str .= "
" . date("M jS Y - G:i", $this->date) . "
\n"; + $str .= "
\n"; + + return $str; } public function File($fid, $uid, $name, $date, $mimetype) @@ -83,25 +88,30 @@ class Files { public function show() { global $current_user; - echo "
\n"; - echo "
\n"; - echo "
\n"; + + $str = ""; + + $str .= "
\n"; + $str .= "
\n"; + $str .= "
\n"; if($current_user->uid == 0) { - echo "
\n"; + $str .= "
\n"; } - echo "
Preview
\n"; - echo "
Command
\n"; - echo "
Filename
\n"; - echo "
Mimetype
\n"; - echo "
User
\n"; - echo "
Size
\n"; - echo "
Date
\n"; - echo "
\n"; - echo "
\n"; + $str .= "
Preview
\n"; + $str .= "
Command
\n"; + $str .= "
Filename
\n"; + $str .= "
Mimetype
\n"; + $str .= "
User
\n"; + $str .= "
Size
\n"; + $str .= "
Date
\n"; + $str .= "
\n"; + $str .= "
\n"; foreach($this->files as $file) { - $file->show(); + $str .= $file->show(); } - echo "
\n"; + $str .= "
\n"; + + return $str; } public function getFile($fid) @@ -154,7 +164,7 @@ class Files { $this->add($file); } - + krsort($this->files); } public function Files($file) -- cgit v1.2.3