Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
CoffeeCake Posted August 24, 2020 Posted August 24, 2020 Is there a built in variable/placeholder that can be used to insert the body of content issued a warning by a moderator? This was a feature in vBulletin and we'd like to bring it back for IPS. I see that default messages can be included to the member, yet am looking for something like {content_body} or similar. I.e. you posted: {content_body}, even if this change is made at the template level and is universally used for all issued warnings.
bfarber Posted August 24, 2020 Posted August 24, 2020 I'm not clear what you are trying to edit to include the body. Is this a notification (which one?), are you wanting to show it in the report or in the post, or something else? The answer is almost certainly "yes there's a variable that has that" but I need more information on where/context to tell you which one to use.
CoffeeCake Posted August 24, 2020 Author Posted August 24, 2020 As an example, suppose a member creates a post laced with profanity. A moderator wants to issue a warning via the warning system to the member reminding them of the rules. We'd like to include the post the member made in the "message to member" that they view and acknowledge, as often these posts are deleted and no longer visible to the member. For example: Quote Hi bfarber, Please remember that it's not nice to use foul language. Signed, Moderator X Your naughty post appears below for reference: 7 minutes ago, bfarber said: Your mama is a bleepity bleep bleep. We'd like to insert the problematic content within the body of the moderator message (or within the template) simply to add the context of "this was the bit you posted that was a problem."
Solution bfarber Posted August 25, 2020 Solution Posted August 25, 2020 If the post on the site is not actually deleted but hidden, then you can use a variable within the template to show the content. Something like $warning->content()->mapped('body') If the post is in fact deleted, then you would need to retrieve the value at the time the warning is issued and store the body with the note for the member. That would require a plugin.
CoffeeCake Posted August 25, 2020 Author Posted August 25, 2020 Great, thanks. We'll look into that. 👍
Pavel Chernitsky Posted August 26, 2020 Posted August 26, 2020 14 hours ago, bfarber said: If the post on the site is not actually deleted but hidden, then you can use a variable within the template to show the content. Something like $warning->content()->mapped('body') If the post is in fact deleted, then you would need to retrieve the value at the time the warning is issued and store the body with the note for the member. That would require a plugin. Hey, I've actually also been looking into that. It's kinda weird a member doesn't get to see the post they were warned about (if it's been hidden). I tried what you suggested, or at least I think I did, I just pasted "$warning->content()->mapped('body')" into the "Default note for member" part in the relevant warning. I was not surprised when I was it just added that exact text ($warning->content()->mapped('body')) into the note that the member received 😂 Can you please give more specific instructions on what do to for stupid idiots who know exactly 0 things about programing like yours truly? Thanks in advance 🙂
CoffeeCake Posted August 26, 2020 Author Posted August 26, 2020 In the vast majority of cases, we'd be issuing a warning for a post hidden just before due to whatever the warning is about. I think the instructions @bfarber shared are to put them in a template hook (or modify the templates) that display the warning to the user, rather than include it in the "message to member" box. Alternatively, the template that generate the box for the moderator to enter the warning could be prepopulated via a template hook to be preloaded with quoted content. I have not had a chance to test this yet. Once we figure it out, I'll share here. 🙂
Pavel Chernitsky Posted August 26, 2020 Posted August 26, 2020 You lost me at "template hook". I'm hopeless when it comes to that kind of thing. I literally need this to be hand fed to me.
bfarber Posted August 26, 2020 Posted August 26, 2020 I didn't provide exact instructions but rather general guidance. The code I supplied in option 1 there was to be pasted into the template that displays the warning, but will only work so long as the post isn't deleted.
Pavel Chernitsky Posted August 26, 2020 Posted August 26, 2020 (edited) 3 minutes ago, bfarber said: I didn't provide exact instructions but rather general guidance. Well, I bet that's why it didn't work 😅 Let's say the post is not deleted (it can't be, our mods can only hide posts), how would one go about having the post appear in the warning? And please, talk to me like I'm a 2 year old monkey, and a pretty dumb one at that 🙂 Edited August 26, 2020 by Pavel Chernitsky
Zone Plate Posted September 30, 2020 Posted September 30, 2020 On 8/26/2020 at 10:51 AM, Pavel Chernitsky said: Well, I bet that's why it didn't work 😅 Let's say the post is not deleted (it can't be, our mods can only hide posts), how would one go about having the post appear in the warning? And please, talk to me like I'm a 2 year old monkey, and a pretty dumb one at that 🙂 Did you ever get this figured out?
Pavel Chernitsky Posted October 1, 2020 Posted October 1, 2020 Nope. I don't currently have anyone that can write code so there's nothing I can really do regarding that.
Recommended Posts