Implemented Different content types for comment likes

TickTackk

Well-known member
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.
 
Upvote 0
This suggestion has been implemented. Votes are no longer accepted.
If you have the comment record, then there's a content_type field which will either be media or album.
 
From what I saw in the code its just
PHP:
$latestUsers = $likeModel->likeContent('xengallery_comment', $commentId, $comment['user_id']);
 
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.
 
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);
}
 
Back
Top Bottom