root/dev/common/includes/class.killboard.php @ 190

Revision 190, 1.3 KB (checked in by exi, 16 years ago)

This is a big update...
Moved all admin scripts to common/admin.
Moved all includes and classes to common/includes.
Edited all include-paths to reflect the movement.
Fixed a bug with the session system allowing every registered user to access admin pages.
Replaced calls to date() to use a wrapper so gmdate can be used.
Replaced some calls to $config with calls to the static object.
Fixed a big which caused the portrait_grab to not download a new picute.
Added a classified-state to kills.
Removed the sync_server server script in this tree.
Added code to help modules find the includes to index.php.

Line 
1<?php
2require_once('common/includes/db.php');
3require_once('common/includes/class.config.php');
4
5class Killboard
6{
7    function Killboard($site)
8    {
9        $this->qry_ = new DBQuery();
10
11        $this->site_ = $site;
12        $this->config_ = new Config($site);
13    }
14
15    function isSuspended()
16    {
17        $this->execQuery();
18        return $this->row_['rtl_suspended'] == "1";
19    }
20
21    function getConfig()
22    {
23        $this->execQuery();
24        return $this->config_;
25    }
26
27    function hasCampaigns($active = false)
28    {
29        $qry = new DBQuery();
30        $sql = "select ctr_id
31                 from kb3_contracts
32                 where ctr_campaign = 1
33                   and ctr_site = '".$this->site_."'";
34        if ($active) $sql .= " and ctr_ended is null";
35        $qry->execute($sql);
36        return ($qry->recordCount() > 0);
37    }
38
39    function hasContracts($active = false)
40    {
41        $qry = new DBQuery();
42        $sql = "select ctr_id
43                 from kb3_contracts
44                 where ctr_campaign = 0
45                   and ctr_site = '".$this->site_."'";
46        if ($active) $sql .= " and ( ctr_ended is null or now() <= ctr_ended )";
47        $qry->execute($sql);
48        return ($qry->recordCount() > 0);
49    }
50
51    function execQuery()
52    {
53    }
54}
55?>
Note: See TracBrowser for help on using the browser.