Comments that say thanks to my post

1

Please login or register to vote for this query.

(click on this box to dismiss)

Wholesome comments to me (no mean comments)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

declare @userID int = ##UserID?9449426##
declare @userName nvarchar(max)

-- TODO: handle the following edge cases
-- In original question: https://stackoverflow.com/questions/69351430/material-ui-dark-mode?noredirect=1#comment122587215_69351430
-- https://stackoverflow.com/questions/69380819/hide-material-ui-autocomplete-popup-until-text-is-typed/69380949?noredirect=1#comment122653723_69380949

-- Find and get the user name based on user ID
SELECT TOP 1 @userName = DisplayName
FROM Users
WHERE Id = @userId

-- Find all answers from this user that have any comments
SELECT *
INTO #myPosts
FROM Posts
WHERE OwnerUserId = @userID
  AND PostTypeId = 2
  AND CommentCount > 0
  AND DeletionDate IS NULL


-- Find all comments of this user posts that show gratitude.
SELECT c.Text AS Comment,
       c.Id AS [Comment Link],
       c.UserId AS [User Link],
       p.Id AS [Post Link]
FROM Comments c
JOIN #myPosts p ON p.Id = c.PostId
WHERE c.UserId != @userId
 AND (LOWER(Text) LIKE '%thank%'
 --  OR LOWER(Text) LIKE '%thank you%'
   OR LOWER(Text) LIKE '%thnx%'
   OR LOWER(Text) LIKE '%thx%'
   OR LOWER(Text) LIKE '%wow%'
   OR LOWER(Text) LIKE '%great!%'
   OR LOWER(Text) LIKE '%mvp%'
   OR LOWER(Text) LIKE '%made my day%'
   OR LOWER(Text) LIKE '%best answer%'
   OR LOWER(Text) LIKE '%savage%')

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results