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

Revision 213, 1.3 KB (checked in by ralle030583, 15 years ago)

All files (i hope i havent forgott something) was modified to use the the config in this way:
- config::get($key)
- config::del($key)
- config::set($key,value)

Exception Templates/Smarty?:
The templates still uses $config->get($key) and $config->set($key,$value) cause
it seems that smarty dont like the :: notification

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