root/dev/common/class.killboard.php @ 181

Revision 181, 1.3 KB (checked in by exi, 14 years ago)

Changed admin/options to show the actual page as page title.
admin_menu.php now also loads settings from mods.
Added event manager and the first 2 events (comment/killmail added).
Changed config to be in a separate file and modified it to be called static with config::get().
http_request now stores the socket status in $this->status.
Changed MapView? to store pictures based on KB_SITE so it doesnt show a map with wrong colors for the current killboard on a multi-site installation.
Changed options to handle element options (like 'edit:size:40').
Changed options to use the static calls to config.
Changed Page to use the static calls to config.
Changed Session to use session_name() to determine if it should start a session.
index.php now loads module-init-scripts.
Changed post.php to use config and it should now also use the mailserver configuration directive to send emails.
Added a mail_forward-mod to show how easy it can be to develop mods once there are enough events listed.
Fixed 2 typos in battle_overview.tpl.

Line 
1<?php
2require_once("db.php");
3require_once('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.