Back to PhocaGalleryCommentImage class

Method checkUserComment

public static
checkUserComment
(mixed $imgid, mixed $userid)

Method checkUserComment - Source code

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