public static function checkUserVote($imgid, $userid)
{
$db = Factory::getDBO();
$query = 'SELECT v.id AS id' . ' FROM #__phocagallery_img_votes AS v' . ' WHERE v.imgid = ' . (int) $imgid . ' AND v.userid = ' . (int) $userid;
$db->setQuery($query, 0, 1);
$checkUserVote = $db->loadObject();
if ($checkUserVote) {
return true;
}
return false;
}