I’m trying get a list of all users that do not have ticked a specific custom user field. I managed to get a list of those who have ticked it, but I can’t seem to do the inverse:
SELECT cf.user_id
FROM user_custom_fields cf
WHERE cf.name like 'user_field_5' AND
cf.value = 'true'
For example, cf.value = 'false' gives me an empty list, and so does cf.value = '' and also cf.value = 'null'.
BTW, I found it confusing that the datatype of a confirmation type user field is not boolean but text. I figure it’s to keep the user field table simple with just one data type?
I’m using the API to create users from a .Net console app via the API but for some reason when running my code in production with dozens of new users being added back to back, some don’t get added. But when I run the same code with same source data in dev, slowly one user at a time, it works just fine.
I reads bits and pieces about a possible API rate limit. Is there a rate limit for the API and if so, what is it and how can I adjust it?
I have a pretty active SMF 2.0.X Forum (150-200 concurrent users). It’s been pretty good to me, but they don’t really seem to have a truly responsive mobile solution and I have found a few things buggy and troublesome. So I have a few questions about Discourse:
a) Does it have a genuinely responsive theme? (I just noticed that it comes with a mobile app, so I guess I will ask what happens if they don’t use the app and they are on a mobile device?)
b) How easily can SMF be converted to Discourse and do you have a tool/wizard for that or how does that work? I have very few attachments; I do have POLLS (but am not terribly worried about them); and I do need PMs (Private Messages) converted if at all possible.
c) Is Discourse strictly cloud-based? Is that what the $100/month is all about? I have a dedicated, pretty beefy Windows server, but I guess I won’t need to use that for my Discourse forum if I go with a paid solution.
Hi Experts, have you implemented a pay option plugin?
I would like to get pay method for my users, so I know that i can create a link for my PayPal account, but I saw a plugin here with that purpose, so, have one of you implemented?
You find many (perhaps too many) examples of discourse sites at
I am interested in finding a short list of the largest discourse sites in terms of frequency of posts and number of registered members. What site currently has the most users? Which sites have the highest frequency of posts?
If a user uses a Onebox link, they will be awarded the ‘first quote’ badge. I just got the Onebox and first quote badges together in my first post, which included a Onebox link.
I guess you could see a Onebox is a form of quote, but it seems the idea of the badge is to encourage “quoting relevant sections of earlier posts” in the same thread.
not sure it’s a bug, but reporting it just in case.
If I click on Users -> Suspected I get an internal server error.
Here’s the log message, env and backtrace
ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: missing FROM-clause entry for table “user_profiles"
LINE 1: …”.“id” WHERE “users”.“active” = ‘t’ AND (COALESCE(user_profi…
^
: SELECT “users”.* FROM (SELECT DISTINCT “users”.* FROM “users” INNER JOIN “user_emails” ON “user_emails”.“user_id” = “users”.“id” WHERE “users”.“active” = ‘t’ AND (COALESCE(user_profiles.bio_raw, ‘’) != ‘’) AND (users.created_at <= ‘2017-08-19 09:16:35.833084’) AND ((user_stats.posts_read_count <= 1 AND user_stats.topics_entered <= 1))) users ORDER BY users.created_at DESC,users.username LIMIT 100 OFFSET 0)
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.5/lib/patches/db/pg.rb:90:in `async_exec’
A while ago I filed a bug for the spaces within the tag, here, where all my previous [details] tags that were written before upgrading to v1.9 were messed up by the upgrade if the tag contained spaces.
I have two questions:
I did do a ./launcher rebuild app several times, including one 2 days ago, which should have pulled the fix from @sam but my old details tags which had new lines after the opening tag and before the closing tag have somehow converted to without any new lines, and they are not parsed. i also rebaked all posts … is there a quick fix for that with rails to restore the newlines so that all details tags work?
if a create a post via the API with a details tag that has new lines after the opening tag and before the closing tag then it gets recorded without new lines and the tag is not parsed … this problem did not exist in v1.8. In fact I’m creating posts using the exact same code via the API (it’s a PHP call) which used to work just fine in v1.8.
Hi,
Today I made an update of my Discourse to 1.9.0 beta 7 version. When I checked my administration options I noticed a problem in Slack plugin. I lost options to change in plugin and I can’t make any changes.
Hi, I’ve looked at numerous topics about this, but none seem fully answer my question.
I have a website with a waiting list signup form on it, in which that data goes to Mailchimp. I want an automatic workflow when a user signs up to the waiting list on my website, it will send them a discourse invite.
Is there a way to do this without exporting mailchimp to csv and doing a bulk invite?
Hi expert, I learning as fast as I can about discourse,
Now I would like to undarstaind how to add those code.
Where do i have to insert this code.
SELECT p.user_id, p.id post_id, p.updated_at granted_at
FROM badge_posts p
WHERE p.post_number > 1 AND p.id IN (
SELECT post_id FROM (
SELECT pc.post_id, row_number()
OVER (PARTITION BY p1.user_id ORDER BY pc.created_at) as rnum
FROM post_custom_fields pc
JOIN badge_posts p1 ON p1.id = pc.post_id
JOIN topics t1 ON p1.topic_id = t1.id
WHERE name = ‘is_accepted_answer’ AND
value IS NOT NULL AND
p1.user_id <> t1.user_id AND
(
:backfill OR
p1.user_id IN (
select user_id from posts where p1.id IN (:post_ids)
)
)
) X WHERE rnum = 1)
Had a search around, and the closest post I could find with a similar issue is:
However, I am not certain it’s exactly the same. I’m setting up a client device to consume webhooks from our Discourse server, and noticed that some of the hooks aren’t being processed. Taking a closer look at my logs, I notice that the hooks that are not being processed are turned away due to a bad signature.
Some examples:
08/20/2017 17:23:27
Processing Incoming Hook ID:24919
Event is of Type: topic
Exp Content Length: 7601
Act Content Length: 7599
pays: {"topic":{"id":4560,"title":":robot: Greetings!","fancy_title":":robot: Greetings!","posts_count":1,"created_at":"2017-08-20T17:23:23.763Z","views":0,"reply_count":0,"participant_count":1,"like_count":0,"last_posted_at":"2017-08-20T17:23:23.865Z","visible":true,"closed":false,"archived":false,"has_summary":false,"archetype":"private_message","slug":"robot-greetings","category_id":null,"word_count":112,"deleted_at":null,"pending_posts_count":0,"user_id":-2,"pm_with_non_human_user":true,"draft":null,"draft_key":"topic_4560","draft_sequence":0,"unpinned":null,"pinned_globally":false,"pinned":false,"pinned_at":null,"pinned_until":null,"details":{"created_by":{"id":-2,"username":"discobot","avatar_template":"/user_avatar/discourse.pi-hole.net/discobot/{size}/1508_1.png"},"last_poster":{"id":-2,"username":"discobot","avatar_template":"/user_avatar/discourse.pi-hole.net/discobot/{size}/1508_1.png"},"allowed_groups":[],"allowed_users":[{"id":-2,"username":"discobot","avatar_template":"/user_avatar/discourse.pi-hole.net/discobot/{size}/1508_1.png"},{"id":3825,"username":"bengt-a","avatar_template":"/letter_avatar_proxy/v2/letter/b/dc4da7/{size}.png"}],"participants":[{"id":-2,"username":"discobot","avatar_template":"/user_avatar/discourse.pi-hole.net/discobot/{size}/1508_1.png","post_count":1,"primary_group_name":null,"primary_group_flair_url":null,"primary_group_flair_color":null,"primary_group_flair_bg_color":null}],"suggested_topics":[{"id":3011,"title":"Welcome to Pi-hole Userspace!","fancy_title":"Welcome to Pi-hole Userspace!","slug":"welcome-to-pi-hole-userspace","posts_count":2,"reply_count":0,"highest_post_number":2,"image_url":null,"created_at":"2017-05-08T09:22:29.858Z","last_posted_at":"2017-05-08T09:23:43.914Z","bumped":true,"bumped_at":"2017-05-08T09:23:43.914Z","unseen":false,"last_read_post_number":1,"unread":0,"new_posts":1,"pinned":false,"unpinned":null,"visible":true,"closed":false,"archived":false,"notification_level":3,"bookmarked":false,"liked":false,"archetype":"private_message","like_count":0,"views":1,"category_id":null,"tags":[],"featured_link":null,"posters":[{"extras":null,"description":"Original Poster","user":{"id":-1,"username":"system","avatar_template":"/user_avatar/discourse.pi-hole.net/system/{size}/1_1.png"}},{"extras":"latest","description":"Most Recent Poster","user":{"id":3028,"username":"Geffers","avatar_template":"/letter_avatar_proxy/v2/letter/g/c89c15/{size}.png"}}]},{"id":2468,"title":"Account temporarily on hold","fancy_title":"Account temporarily on hold","slug":"account-temporarily-on-hold","posts_count":2,"reply_count":0,"highest_post_number":2,"image_url":null,"created_at":"2017-04-02T01:40:45.109Z","last_posted_at":"2017-04-03T13:55:01.705Z","bumped":true,"bumped_at":"2017-04-03T13:55:01.705Z","unseen":false,"last_read_post_number":1,"unread":0,"new_posts":1,"pinned":false,"unpinned":null,"visible":true,"closed":false,"archived":false,"notification_level":3,"bookmarked":false,"liked":false,"archetype":"private_message","like_count":0,"views":1,"category_id":null,"tags":[],"featured_link":null,"posters":[{"extras":null,"description":"Original Poster","user":{"id":-1,"username":"system","avatar_template":"/user_avatar/discourse.pi-hole.net/system/{size}/1_1.png"}},{"extras":"latest","description":"Most Recent Poster","user":{"id":2738,"username":"willzim","avatar_template":"/letter_avatar_proxy/v2/letter/w/7c8e57/{size}.png"}}]},{"id":2452,"title":"Welcome to Pi-hole Userspace!","fancy_title":"Welcome to Pi-hole Userspace!","slug":"welcome-to-pi-hole-userspace","posts_count":2,"reply_count":0,"highest_post_number":2,"image_url":null,"created_at":"2017-03-31T19:11:35.926Z","last_posted_at":"2017-03-31T19:13:45.533Z","bumped":true,"bumped_at":"2017-03-31T19:13:45.533Z","unseen":false,"last_read_post_number":1,"unread":0,"new_posts":1,"pinned":false,"unpinned":null,"visible":true,"closed":false,"archived":false,"notification_level":3,"bookmarked":false,"liked":false,"archetype":"private_message","like_count":0,"views":2,"category_id":null,"tags":[],"featured_link":null,"posters":[{"extras":null,"description":"Original Poster","user":{"id":-1,"username":"system","avatar_template":"/user_avatar/discourse.pi-hole.net/system/{size}/1_1.png"}},{"extras":"latest","description":"Most Recent Poster","user":{"id":2726,"username":"teunbruijnen","avatar_template":"/letter_avatar_proxy/v2/letter/t/e79b87/{size}.png"}}]},{"id":2098,"title":"Welcome to Pi-hole Userspace!","fancy_title":"Welcome to Pi-hole Userspace!","slug":"welcome-to-pi-hole-userspace","posts_count":2,"reply_count":0,"highest_post_number":2,"image_url":null,"created_at":"2017-03-09T11:29:04.086Z","last_posted_at":"2017-03-09T11:50:35.551Z","bumped":true,"bumped_at":"2017-03-09T11:50:35.551Z","unseen":false,"last_read_post_number":1,"unread":0,"new_posts":1,"pinned":false,"unpinned":null,"visible":true,"closed":false,"archived":false,"notification_level":3,"bookmarked":false,"liked":false,"archetype":"private_message","like_count":0,"views":1,"category_id":null,"tags":[],"featured_link":null,"posters":[{"extras":null,"description":"Original Poster","user":{"id":-1,"username":"system","avatar_template":"/user_avatar/discourse.pi-hole.net/system/{size}/1_1.png"}},{"extras":"latest","description":"Most Recent Poster","user":{"id":2521,"username":"Tensai_Computers","avatar_template":"/letter_avatar_proxy/v2/letter/t/c67d28/{size}.png"}}]},{"id":2052,"title":"Welcome to Pi-hole Userspace!","fancy_title":"Welcome to Pi-hole Userspace!","slug":"welcome-to-pi-hole-userspace","posts_count":2,"reply_count":0,"highest_post_number":2,"image_url":null,"created_at":"2017-03-06T07:26:12.218Z","last_posted_at":"2017-03-06T07:47:11.118Z","bumped":true,"bumped_at":"2017-03-06T07:47:11.118Z","unseen":false,"last_read_post_number":1,"unread":0,"new_posts":1,"pinned":false,"unpinned":null,"visible":true,"closed":false,"archived":false,"notification_level":3,"bookmarked":false,"liked":false,"archetype":"private_message","like_count":0,"views":1,"category_id":null,"tags":[],"featured_link":null,"posters":[{"extras":null,"description":"Original Poster","user":{"id":-1,"username":"system","avatar_template":"/user_avatar/discourse.pi-hole.net/system/{size}/1_1.png"}},{"extras":"latest","description":"Most Recent Poster","user":{"id":2497,"username":"kebabia","avatar_template":"/letter_avatar_proxy/v2/letter/k/dc4da7/{size}.png"}}]}],"links":[{"url":"/guidelines","title":null,"fancy_title":null,"internal":true,"attachment":false,"reflection":false,"clicks":0,"user_id":-2,"domain":"discourse.pi-hole.net"},{"url":"/badges","title":null,"fancy_title":null,"internal":true,"attachment":false,"reflection":false,"clicks":0,"user_id":-2,"domain":"discourse.pi-hole.net"},{"url":"/about","title":null,"fancy_title":null,"internal":true,"attachment":false,"reflection":false,"clicks":0,"user_id":-2,"domain":"discourse.pi-hole.net"}],"notification_level":1,"can_move_posts":true,"can_edit":true,"can_delete":true,"can_remove_allowed_users":true,"can_invite_to":true,"can_invite_via_email":true,"can_create_post":true,"can_reply_as_new_topic":true,"can_flag_topic":true},"highest_post_number":1,"deleted_by":null,"has_deleted":false,"actions_summary":[{"id":4,"count":0,"hidden":false,"can_act":true},{"id":7,"count":0,"hidden":false,"can_act":true},{"id":8,"count":0,"hidden":false,"can_act":true}],"chunk_size":20,"bookmarked":null,"message_archived":false,"tags":[],"featured_link":null,"topic_timer":null,"unicode_title":"🤖 Greetings!","message_bus_last_id":2,"can_vote":false,"vote_count":null,"user_voted":false}}
sent: fb5ba4ad217d3d3fb9bd73fe971572a5e0277e079b940eb76e52e369994b09eb
calc: ba643da8460466a9b780d18fb1b56f78afe564271aac0e4e2748a4ff77ead8c0
Bad Signature!
08/20/2017 17:23:25
Processing Incoming Hook ID:24918
Event is of Type: post
Exp Content Length: 2440
Act Content Length: 2434
pays: {"post":{"id":16324,"name":"discobot","username":"discobot","avatar_template":"/user_avatar/discourse.pi-hole.net/discobot/{size}/1508_1.png","created_at":"2017-08-20T17:23:23.865Z","cooked":"\u003cp\u003eThanks for joining Pi-hole Userspace, and welcome!\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\n\u003cp\u003eI’m only a robot, but \u003ca href=\"/about\"\u003eour friendly staff\u003c/a\u003e are also here to help if you need to reach a person.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eFor safety reasons, we temporarily limit what new users can do. You’ll gain new abilities (and \u003ca href=\"/badges\"\u003ebadges\u003c/a\u003e) as we get to know you.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eWe believe in \u003ca href=\"/guidelines\"\u003ecivilized community behavior\u003c/a\u003e at all times.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eIf you’d like to learn more, select \u003cimg src=\"https://discourse.pi-hole.net/images/font-awesome-ellipsis.png\" width=\"16\" height=\"16\"\u003e below and \u003cimg src=\"https://discourse.pi-hole.net/images/font-awesome-bookmark.png\" width=\"16\" height=\"16\"\u003e \u003cstrong\u003ebookmark this private message\u003c/strong\u003e. If you do, there may be a \u003cimg src=\"https://discourse.pi-hole.net/images/emoji/apple/gift.png?v=5\" title=\":gift:\" class=\"emoji\" alt=\":gift:\"\u003e in your future!\u003c/p\u003e","post_number":1,"post_type":1,"updated_at":"2017-08-20T17:23:23.865Z","reply_count":0,"reply_to_post_number":null,"quote_count":0,"avg_time":null,"incoming_link_count":0,"reads":1,"score":0,"yours":false,"topic_id":4560,"topic_slug":"robot-greetings","topic_title":":robot: Greetings!","display_username":"discobot","primary_group_name":null,"primary_group_flair_url":null,"primary_group_flair_bg_color":null,"primary_group_flair_color":null,"version":1,"user_title":null,"actions_summary":[{"id":2,"can_act":true},{"id":3,"can_act":true},{"id":4,"can_act":true},{"id":5,"hidden":true,"can_act":true},{"id":6,"can_act":true},{"id":7,"can_act":true},{"id":8,"can_act":true}],"moderator":false,"admin":true,"staff":true,"user_id":-2,"hidden":false,"hidden_reason_id":null,"trust_level":4,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"can_accept_answer":false,"can_unaccept_answer":false,"accepted_answer":false,"can_translate":false}}
sent: 2cdcc22ff4e294e11031a13c6e4b126151b85b21eebbe2e79adb96be1e59561d
calc: 682fec0df310ea73fbc7cf85adf1b77e05c477394c7ed6c38caa492d1d352e65
Bad Signature!
08/20/2017 16:58:02
Processing Incoming Hook ID:24915
Event is of Type: post
Exp Content Length: 2333
Act Content Length: 2329
pays: {"post":{"id":16323,"name":"Adam Warner","username":"PromoFaux","avatar_template":"/user_avatar/discourse.pi-hole.net/promofaux/{size}/1545_1.png","created_at":"2017-08-20T16:58:01.020Z","cooked":"\u003caside class=\"quote\" data-post=\"5\" data-topic=\"1874\"\u003e\n\u003cdiv class=\"title\"\u003e\n\u003cdiv class=\"quote-controls\"\u003e\u003c/div\u003e\n\u003cimg alt width=\"20\" height=\"20\" src=\"https://discourse.pi-hole.net/user_avatar/discourse.pi-hole.net/ramset/40/1474_1.png\" class=\"avatar\"\u003e\u003ca href=\"https://discourse.pi-hole.net/t/secondary-dns-server-for-dhcp/1874/5\"\u003eSecondary DNS Server for DHCP\u003c/a\u003e\n\u003c/div\u003e\n\u003cblockquote\u003e\n\u003cp\u003eHere’s an answer (if you’re still looking):\u003c/p\u003e\n\u003cp\u003esudo nano /etc/dnsmasq.d/02-pihole-dhcp.conf\u003c/p\u003e\n\u003cp\u003edhcp-option=6,Pi-holeIP,SecondaryDNSIP\u003c/p\u003e\n\u003cp\u003esudo /etc/init.d/dnsmasq restart\u003c/p\u003e\n\u003cp\u003eYou would have to renew release on each host after that to pull the new settings.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003c/aside\u003e\n\u003cp\u003eCan you explain what this is doing? Thanks\u003c/p\u003e","post_number":23,"post_type":1,"updated_at":"2017-08-20T16:58:01.020Z","reply_count":0,"reply_to_post_number":22,"quote_count":0,"avg_time":null,"incoming_link_count":0,"reads":1,"score":0,"yours":false,"topic_id":4357,"topic_slug":"can-dwight-hear-us-in-here","topic_title":"Can Dwight hear us in here?","display_username":"Adam Warner","primary_group_name":null,"primary_group_flair_url":null,"primary_group_flair_bg_color":null,"primary_group_flair_color":null,"version":1,"user_title":"Developer","reply_to_user":{"username":"PromoFaux","avatar_template":"/user_avatar/discourse.pi-hole.net/promofaux/{size}/1545_1.png"},"actions_summary":[{"id":2,"can_act":true},{"id":3,"can_act":true},{"id":4,"can_act":true},{"id":5,"hidden":true,"can_act":true},{"id":6,"can_act":true},{"id":7,"can_act":true},{"id":8,"can_act":true}],"moderator":true,"admin":true,"staff":true,"user_id":3,"hidden":false,"hidden_reason_id":null,"trust_level":4,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"can_accept_answer":true,"can_unaccept_answer":false,"accepted_answer":false,"can_translate":false}}
sent: acae16a2a0f7d5bb88e2659e399ac59b18b5183b9173d7717ad35de900ddf7dd
calc: 8f59f14a080137d83a4ff3787446c37d17aa47295178b490dcaa936e21eeea4c
Bad Signature!
However, some are fine, like this one:
08/20/2017 16:57:27
Processing Incoming Hook ID:24913
Event is of Type: post
Exp Content Length: 1403
Act Content Length: 1403
pays: {"post":{"id":16322,"name":"Adam Warner","username":"PromoFaux","avatar_template":"/user_avatar/discourse.pi-hole.net/promofaux/{size}/1545_1.png","created_at":"2017-08-20T16:57:26.363Z","cooked":"\u003cp\u003eSomething I have written myself (Pasted)\u003c/p\u003e","post_number":22,"post_type":1,"updated_at":"2017-08-20T16:57:26.363Z","reply_count":0,"reply_to_post_number":21,"quote_count":0,"avg_time":null,"incoming_link_count":0,"reads":1,"score":0,"yours":false,"topic_id":4357,"topic_slug":"can-dwight-hear-us-in-here","topic_title":"Can Dwight hear us in here?","display_username":"Adam Warner","primary_group_name":null,"primary_group_flair_url":null,"primary_group_flair_bg_color":null,"primary_group_flair_color":null,"version":1,"user_title":"Developer","reply_to_user":{"username":"PromoFaux","avatar_template":"/user_avatar/discourse.pi-hole.net/promofaux/{size}/1545_1.png"},"actions_summary":[{"id":2,"can_act":true},{"id":3,"can_act":true},{"id":4,"can_act":true},{"id":5,"hidden":true,"can_act":true},{"id":6,"can_act":true},{"id":7,"can_act":true},{"id":8,"can_act":true}],"moderator":true,"admin":true,"staff":true,"user_id":3,"hidden":false,"hidden_reason_id":null,"trust_level":4,"deleted_at":null,"user_deleted":false,"edit_reason":null,"can_view_edit_history":true,"wiki":false,"can_accept_answer":true,"can_unaccept_answer":false,"accepted_answer":false,"can_translate":false}}
sent: 7dba5d12657cedad5c371daedd140d0d51ce702db4f7087da3a4c38b129f105b
calc: 7dba5d12657cedad5c371daedd140d0d51ce702db4f7087da3a4c38b129f105b
I’ve tested this on both a .NET, and a Python receiver, and am seeing the same issues with Content-Length being 4-6 bytes out.
How do I disable post approval?
I want to allow all users whether they’re new or old to be able to post anything without it being approved. Currently, users cannot post anything instantly and have to wait for an approval by a moderator.
Approve post count and approve trust level are both 0.