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/get.inc

29 lines
559 B
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
class main_forums_get {
function main_forums_get($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
function run($f) {
$q = $this->db->query(
"SELECT f.id AS id,f.title AS title,f.description AS description,"
. "f.user_post AS user_post,f.topics AS ntopics,"
. "c.id AS pid,c.title AS ptitle "
. "FROM f_forum f,f_category c "
. "WHERE f.id=$f AND c.id=f.category"
);
if (!$q||dbCount($q)!=1) {
return null;
}
$a = dbFetchHash($q);
$f['user_post'] = ($f['user_post'] == 't');
return $a;
}
}
?>