1. 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

Discussion in 'Media Gallery Closed Suggestions' started by batpool52!, Feb 6, 2015.

  1. batpool52!

    batpool52! 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.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    If you have the comment record, then there's a content_type field which will either be media or album.
     
  3. batpool52!

    batpool52! Well-Known Member

    From what I saw in the code its just
    PHP:
    $latestUsers $likeModel->likeContent('xengallery_comment'$commentId$comment['user_id']);
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    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.
     
  5. batpool52!

    batpool52! Well-Known Member

    --- nothing useful here --- read the post below.
     
    Last edited: Feb 6, 2015
  6. Chris D

    Chris D XenForo Developer Staff Member

    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);
    }
     
    batpool52! likes this.
  7. batpool52!

    batpool52! Well-Known Member

    I missed that part :D Time to get rest after 34 hours of no sleep.
     
  8. Chris D

    Chris D XenForo Developer Staff Member

    Don't write code while tired. It doesn't work ;)
     
    batpool52! likes this.

Share This Page