• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Help me with integration Comments in Notifications

Valerius

Chevereto Member
Notifications for new comments

I am currently working on a comment system which I have integrated in chevereto here a video example of my project


How can I show my comments new comments in notifications? until now it has only managed an empty window in notifications. My table structure in comments:



In Notifications table i am added notification_type comment

In class.notification

Code:
$db->query('SELECT * FROM '.$tables['notifications'].'
                LEFT JOIN '.$tables['likes'].' ON notification_type = "like" AND notification_type_id = like_id AND notification_type_id > 0
                LEFT JOIN '.$tables['follows'].' ON notification_type = "follow" AND notification_type_id = follow_id
           
                LEFT JOIN '.$tables['images'].' ON notification_content_type = "image" AND like_content_type = "image" AND like_content_id = image_id
                LEFT JOIN '.$tables['albums'].' ON notification_content_type = "album" AND like_content_type = "album" AND like_content_id = album_id
                LEFT JOIN '.$tables['users'].' ON user_id = (
                    CASE notification_type
                        WHEN "like" THEN like_user_id
                        WHEN "comment" THEN user_id
                        WHEN "follow" THEN follow_user_id
                        ELSE NULL
                    END
                )

i am added

Code:
LEFT JOIN '.$tables['comments'].' ON notification_type = "comment" AND notification_type_id = id

And I have an error message when clicking on notifications. Where is my mistake?


SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON notification_type = "comment" AND notification_type_id = id\n\t\t\t\tLEFT JOIN chv' at line 4\n'
 
Last edited:
Back
Top