- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
public function count_relation($of_type = ""){
if ($this->is_login()){
$this->get_data($_COOKIE['login']);
if (empty($of_type))
$relations = $this->sql("SELECT COUNT(id) AS count FROM users_relations WHERE user_id='".$this->id."'", 1);
else
$relations = $this->sql("SELECT COUNT(id) AS count FROM users_relations WHERE user_id='".$this->id."' WHERE type='".mysql_escape_string($of_type)."'", 1);
return $invites->relations;
}
return false;
}
Lure Of Chaos 07.04.2011 19:47 # 0