summaryrefslogtreecommitdiff
path: root/forum
diff options
context:
space:
mode:
authordeva <deva>2008-10-26 16:06:16 +0000
committerdeva <deva>2008-10-26 16:06:16 +0000
commit9d7dbbf351aa7983f0fe499a3f80b59ee2f68547 (patch)
tree331d7a2e616a0be0e3a0a1e2b49fbe48e1798f4b /forum
parent648878fb3a0430506c3b0f5a92bc7699b7ceb3ed (diff)
Added signature support in profile and forum posts.
Diffstat (limited to 'forum')
-rw-r--r--forum/utils/posts.php2
-rw-r--r--forum/utils/profile.php3
-rw-r--r--forum/utils/users.php10
3 files changed, 11 insertions, 4 deletions
diff --git a/forum/utils/posts.php b/forum/utils/posts.php
index c301852..209d316 100644
--- a/forum/utils/posts.php
+++ b/forum/utils/posts.php
@@ -69,7 +69,7 @@ class Post {
if(!$client_is_mobile_device) echo "Date: ";
echo date("j. M Y - G:i", $this->date) . "</div>\n";
echo $indent . " <div class=\"message\">\n";
- echo parse($this->message, $indent . " ") . "\n";
+ echo parse($this->message . "\n------\n" . $user->signature, $indent . " ") . "\n";
echo $indent . " </div>\n";
echo $indent . " <div class=\"buttons\">\n";
diff --git a/forum/utils/profile.php b/forum/utils/profile.php
index ee47cb0..7f8372c 100644
--- a/forum/utils/profile.php
+++ b/forum/utils/profile.php
@@ -6,6 +6,7 @@ if($action == "update") {
$current_user->name = $name;
$current_user->email = $email;
$current_user->avatar = $avatar;
+ $current_user->signature = $signature;
if($password != "") {
if($password == $password_confirm) {
$current_user->password = sha1(md5($password));
@@ -34,6 +35,8 @@ while($avatar = readdir($dir)) {
}
?>
</select><br/>
+Signature:<br/>
+<textarea name="signature" cols="60" rows="2"><?php echo $current_user->signature ?></textarea><br/>
<br/>
<button type="submit">Update</button>
</form>
diff --git a/forum/utils/users.php b/forum/utils/users.php
index 93cc23c..7f54eee 100644
--- a/forum/utils/users.php
+++ b/forum/utils/users.php
@@ -12,6 +12,7 @@ class User {
public $avatar;
public $email;
public $notified;
+ public $signature;
public function checkPassword($password)
{
@@ -28,11 +29,12 @@ class User {
fwrite($fp, " password=\"" . $this->password . "\"\n");
fwrite($fp, " name=\"" . htmlspecialchars($this->name, ENT_QUOTES, "UTF-8") . "\"\n");
fwrite($fp, " avatar=\"" . htmlspecialchars($this->avatar, ENT_QUOTES, "UTF-8") . "\"\n");
- fwrite($fp, " email=\"" . htmlspecialchars($this->email, ENT_QUOTES, "UTF-8") . "\">\n");
- fwrite($fp, " </user>\n");
+ fwrite($fp, " email=\"" . htmlspecialchars($this->email, ENT_QUOTES, "UTF-8") . "\">");
+ fwrite($fp, htmlspecialchars($this->signature, ENT_QUOTES, "UTF-8"));
+ fwrite($fp, "</user>\n");
}
- public function User($enabled, $uid, $gid, $username, $password, $name, $email, $avatar, $notified)
+ public function User($enabled, $uid, $gid, $username, $password, $name, $email, $avatar, $signature, $notified)
{
$this->enabled = $enabled;
$this->gid = $gid;
@@ -42,6 +44,7 @@ class User {
$this->email = $email;
$this->name = $name;
$this->avatar = $avatar;
+ $this->signature = $signature;
if($notified == "") $notified = 0;
$this->notified = $notified;
}
@@ -119,6 +122,7 @@ class Users {
$u->getAttribute('name'),
$u->getAttribute('email'),
$u->getAttribute('avatar'),
+ $u->textContent,
$u->getAttribute('notified'));
$this->add($user);