public function isfan($content) { $fant = new EModel("ocs_fan"); $person = OCSUser::id(); $r = $fant->find("*", "where person={$person} and content={$content}"); if (!empty($r)) { return true; } else { return false; } }
public static function approve_invitation($touser) { $idfrom = OCSUser::id(); $datafrom = OCSUser::server_get_user_info($idfrom); $loginfrom = $datafrom[0]["login"]; $info = OCSUser::server_get_user_info($touser); $id = $info[0]["id"]; //creating new table object $ocs_friendinvitation = new EModel("ocs_friendinvitation"); //if($ocs_friendinvitation->is_there("touser","(fromuser=$idfrom and touser=$id) or (touser=$idfrom and fromuser=$id)")) if ($ocs_friendinvitation->is_there("touser", "(touser={$idfrom} and fromuser={$id})")) { EDatabase::q("DELETE FROM ocs_friendinvitation WHERE (fromuser={$id} AND touser={$idfrom}) OR (touser={$id} AND fromuser={$idfrom}) LIMIT 2"); EDatabase::q("INSERT IGNORE INTO ocs_friendship (id1,id2) VALUES ({$idfrom},{$id})"); EDatabase::q("INSERT IGNORE INTO ocs_friendship (id1,id2) VALUES ({$id},{$idfrom})"); //adding activity messages OCSActivity::add($idfrom, 2, OCSUser::login() . " became friend with {$touser}."); OCSActivity::add($id, 2, "{$touser} became friend with " . OCSUser::login() . "."); } }
public function __construct() { parent::__construct("reports"); }
/** * Method to auto-populate the model state. * * @return void */ protected function _populateState() { parent::_populateState(); $cid = JRequest::getVar('cid', array(0), '', 'array'); $id = JRequest::getVar('id', $cid[0], '', 'int'); $this->setState('id', $id); }
public function __construct() { parent::__construct("users"); }
public function __construct() { parent::__construct("posts"); }
/** * Method to auto-populate the model state. * * @return void */ protected function _populateState() { parent::_populateState(); // Initialize variables. $app = JFactory::getApplication(); $context = $this->_context . '.'; // Load the filter state. $published = $app->getUserStateFromRequest($context . 'filter.published', 'published', '*', 'string'); $this->setState('filter.state', $published == '*' ? null : $published); $this->setState('filter.search', $app->getUserStateFromRequest($context . 'filter.search', 'search', '')); // Load the list state. $this->setState('list.start', $app->getUserStateFromRequest($context . 'list.start', 'limitstart', 0, 'int')); $this->setState('list.limit', $app->getUserStateFromRequest($context . 'list.limit', 'limit', $app->getCfg('list_limit'), 'int')); $this->setState('list.ordering', $app->getUserStateFromRequest($context . 'list.ordering', 'filter_order', 'a.ordering', 'cmd')); $this->setState('list.direction', $app->getUserStateFromRequest($context . 'list.direction', 'filter_order_Dir', 'ASC', 'word')); }