• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • 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