This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/main/forums/library/signature.inc

40 lines
894 B
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
class main_forums_signature {
var $signatures = array();
function main_forums_signature($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
function run($u) {
if (is_array($this->signatures)) {
if ($this->signatures[$u] != "")
return $this->signatures[$u];
} else {
$this->signatures = array();
}
$q = $this->db->query(
"SELECT id,value FROM user_preferences "
. "WHERE account IN (0,$u) "
. "AND id IN ('forums_sig','forum_code','smileys') "
. "AND version='main' "
. "ORDER BY account"
);
$p = array();
while ($r = dbFetchArray($q)) {
$p[$r[0]] = $r[1];
}
if ($p["forums_sig"] == "") {
$s = "";
} else {
$s = "<div class='fsig'><hr/>" . $this->lib->call('substitute', $p['forums_sig'], $p['forum_code'] ? 't' : 'f', $p['smileys'] ? 't' : 'f') . "</div>";
}
return ($this->signatures[$u] = $s);
}
}
?>