• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Implemented Different content types for comment likes

batpool52!

Well-known member
#1
I think it would way better if the comments separated using content types like xengallery_media_comment and xengallery_media_album. As of now there is no way to know if the alert generated was for a media or album.
 

Chris D

XenForo developer
Staff member
#2
If you have the comment record, then there's a content_type field which will either be media or album.
 

batpool52!

Well-known member
#3
From what I saw in the code its just
PHP:
$latestUsers = $likeModel->likeContent('xengallery_comment', $commentId, $comment['user_id']);
 

Chris D

XenForo developer
Staff member
#4
The alert handler takes the comment ID and queries for the full comment record (and media or album record) and that is passed to the alert template.
 

Chris D

XenForo developer
Staff member
#6
If the part of the code you're working with simply has access to the content type and the content ID you should have enough information to then query to get the rest of the info you need, e.g. if you're extending XenForo_Model_Like::likeContent:

PHP:
if ($contentType == 'xengallery_comment')
{
        $comment = XenForo_Model::create('XenGallery_Model_Comment')->getCommentById($contentId);
}