summaryrefslogtreecommitdiffstats
path: root/inc/image.inc.php
blob: 5b8f0771490d762b3defcc2478c73065a44d6160 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

class Image
{

	public static function deleteOwnedBy($userid)
	{
		if ($userid === false || !is_numeric($userid))
			return false;
		return Database::exec('DELETE FROM image WHERE ownerid = :userid', array('userid' => $userid));
	}
	
	public static function getImageCount($login)
	{
		$ret = Database::queryFirst('SELECT Count(*) AS cnt FROM image '
			. ' INNER JOIN user ON (image.ownerid = user.userid) '
			. ' WHERE user.login = :login', array('login' => $login));
		if ($ret === false)
			return 0;
		return $ret['cnt'];
	}

}