websiteWebsite
codingteam CodingTeam
A free forge, lightweight and extensible.

 

Browse the code

Revision log Information on the revision
Revision: 233 (differences)
Author: xbright
Log message: * Updated project.news
* Updated MUCkl configuration files (it's recommend to use binding)
Change revision:
<?php
#    This file is a part of CodingTeam. See <http://www.codingteam.net>.
#    Copyright (C) 2007-2009 CodingTeam (See AUTHORS and THANKS for details)
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as
#    published by the Free Software Foundation, version 3 only.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
class Jabber {
    private $ct_db;
 
    function __construct($db)
    {
        $this->ct_db = $db;
    }
 
    function addRoom($projectid, $array)
    {
        return $this->ct_db->insert('projects_jabber', array('projectid' => $projectid,
                                                             'jid' => $array['jid'],
                                                            ));
    }
 
    function deleteRoom($projectid, $jid)
    {
        $req = $this->ct_db->delete('projects_jabber', array('projectid' => $projectid, 'jid' => $jid));
    }
 
    function roomExists($projectid, $jid)
    {
        $req = $this->ct_db->select('projects_jabber', array('projectid' => $projectid, 'jid' => $jid), '*');
        if (count($req))
            return TRUE;
        else
            return FALSE;
    }
 
    function getRooms($projectid)
    {
        return $this->ct_db->select('projects_jabber', array('projectid' => $projectid), '*', 'ORDER BY nbuser DESC');
    }
}
?>