Kevin Carwile Posted November 27, 2017 Author Posted November 27, 2017 I see your sticking point. The form is asking for the topic which you are attempting to update the custom data for (which is the stock action I referred to). But unless there is an explicit topic in the event arguments, how could rules give you an option to choose from? In this case, not just topic comments can be reported, but all sorts of other content can be reported. It cannot be assumed that you can derive a topic in from any given piece of reported content. If I report a comment on an image, and that rule event is invoked, how is rules going to get a topic from that comment? It's undefined. This is why you only have the option to use PHP code to provide the topic for which the stock custom data update action will operate on. Rules knows that it cannot know what topic to use. Therefore you must tell it. You could put a condition on the rule that checks if the content is an object of the 'IPS\forums\Comment' class, which would ensure the rule only runs when a topic comment is reported. This will prevent errors when other types of content are reported, but you are still left with the need to provide the topic itself for the custom data update action. You need to return the topic from your PHP snippet: return $content->item(); jair101 and Dll 2
Dll Posted November 27, 2017 Posted November 27, 2017 1 hour ago, Kevin Carwile said: return $content->item(); This returns an error unfortunately: Result: "Incorrect entity class (IPS\\forums\\Topic). Expecting IPS\\forums\\Topic\\Post<br>Line: 209 of CustomData.php"
Kevin Carwile Posted November 28, 2017 Author Posted November 28, 2017 Oh, if you need a Topic\Post, just return the $content then. I thought you needed the topic. Dll 1
GreatJackal Posted January 9, 2018 Posted January 9, 2018 On 11/27/2017 at 7:52 PM, Kevin Carwile said: Oh, if you need a Topic\Post, just return the $content then. I thought you needed the topic. Hey Will you please consider adding an action that removes reputation points from a user, so i could have a function thats IF member gets warned Remove X reputation from member would be awesome
Kevin Carwile Posted January 9, 2018 Author Posted January 9, 2018 17 hours ago, GreatJackal said: Hey Will you please consider adding an action that removes reputation points from a user, so i could have a function thats IF member gets warned Remove X reputation from member would be awesome The main problem is that reputation is not a bank that you can add to or remove from. It is a tally of reactions to content and therefore is a mathematical function. So adding reputation is not as simple as incrementing a counter. It requires a reaction to be made on a piece of content. It can't simply be arbitrarily added or removed.
GreatJackal Posted January 12, 2018 Posted January 12, 2018 On 1/9/2018 at 4:45 PM, Kevin Carwile said: The main problem is that reputation is not a bank that you can add to or remove from. It is a tally of reactions to content and therefore is a mathematical function. So adding reputation is not as simple as incrementing a counter. It requires a reaction to be made on a piece of content. It can't simply be arbitrarily added or removed. How are apps like this able to exist then - It has a reputation altering "item" We are also able to edit reputation through ACP Not saying you are wrong - but im rather genuinely curious cheers
Songstuff Posted February 8, 2018 Posted February 8, 2018 Urgent: Is there a way to flush the scheduled actions? I had enabled the re-engagement mails, but it has added multiple messages per member. They have no key, so I am guessing that is why they have not been being deleted. Now I have 84 pages of scheduled mails being sent out which is pissing members off. I see no way to clear this queue via admin.
Kevin Carwile Posted February 9, 2018 Author Posted February 9, 2018 Find the rules_scheduled_actions table in your database and delete all the entries.
Songstuff Posted February 9, 2018 Posted February 9, 2018 Urgent: Is there a way to flush the scheduled actions? I had enabled the re-engagement mails, but it has added multiple messages per member. They have no key, so I am guessing that is why they have not been being deleted. Now I have 84 pages of scheduled mails being sent out which is pissing members off. I see no way to clear this queue via admin. Thanks Kevin. Do you plan to add a "flush scheduled actions" button in the future?
gabs007 Posted February 18, 2018 Posted February 18, 2018 Since I moved 70% of my content to clubs, most of the rules dealing with topic creation/modification can not apply anymore. The reason is that I can't specify an action when a member creates a topic in an specific forum inside a club. Are there any plans to update the club topics ?
Kevin Carwile Posted February 20, 2018 Author Posted February 20, 2018 On 2/17/2018 at 9:56 PM, gabs007 said: Since I moved 70% of my content to clubs, most of the rules dealing with topic creation/modification can not apply anymore. The reason is that I can't specify an action when a member creates a topic in an specific forum inside a club. Are there any plans to update the club topics ? Yeah, it's called Group Collaboration. You can find it in the marketplace.
Wildcard Chris Posted April 12, 2018 Posted April 12, 2018 (edited) hey @Kevin Carwile I have a custom database and I'm trying to add the record ID that is created as a tag. I currently have this and it's not working: https://gyazo.com/3256d74ef951d128afb1f6e7bae1f21d Any ideas? Edit: I see I can use [content:id] - The content ID in the replacement tokens, but how would I go about adding that as the tag? Edited April 12, 2018 by Wildcard Chris
Kevin Carwile Posted April 13, 2018 Author Posted April 13, 2018 I dont think that primary id field is a method on the record. I think it is just a property.
Wildcard Chris Posted April 13, 2018 Posted April 13, 2018 58 minutes ago, Kevin Carwile said: I dont think that primary id field is a method on the record. I think it is just a property. So any idea how to grab the content id or record id in the custom php field?
Kevin Carwile Posted April 13, 2018 Author Posted April 13, 2018 Yeah. Dont use it as a method call. Like... remove the parenthesis.
Wildcard Chris Posted April 13, 2018 Posted April 13, 2018 50 minutes ago, Kevin Carwile said: Yeah. Dont use it as a method call. Like... remove the parenthesis. I don't have a parenthesis anywhere? I'm using: //<?php $record->primary_id_field; return;
Kevin Carwile Posted April 13, 2018 Author Posted April 13, 2018 Well I dont know then. You cut all the important clues out of the screen shot you provided such as the event and the available variables to your php code.
Wildcard Chris Posted April 13, 2018 Posted April 13, 2018 (edited) The event is when a record(report), in the pages system, is created: https://gyazo.com/d022b4208013708c9f8b59dc1840a373 Edited April 13, 2018 by Wildcard Chris
Kevin Carwile Posted April 13, 2018 Author Posted April 13, 2018 In the bottom description of that php code editor it shows that the variable that holds the record is named $content. Try using that one.
Wildcard Chris Posted April 13, 2018 Posted April 13, 2018 3 hours ago, Kevin Carwile said: In the bottom description of that php code editor it shows that the variable that holds the record is named $content. Try using that one. It's not working. Is there a way I can use these in the custom php section? As then maybe I can use [content:id] https://gyazo.com/1485e4c5adc66de9c27f93796075ed86
Doped_Wizard Posted July 4, 2018 Posted July 4, 2018 (edited) Hi I am trying to give an award to all members that are registered since 1 year. But there does not seem to be an option to create a date of at least 1 year but only wihtin 1 year? My goal is to give an award every year so 1 year Membership 2 year Membership and so on? Update: so I have done it like this so far.. but the rule is not actually doing anything? Rule: Logged in Event: Member logged in to system Conditions: NOT Member attribute values (Join date) (This is set to NOT within 1 year) Actions: Give an award to a member (1 year Membership) Thank you Edited July 4, 2018 by Doped_Wizard
Kevin Carwile Posted July 5, 2018 Author Posted July 5, 2018 Thats the right rule. It will run when a member actually logs in.
christopher-w Posted July 24, 2018 Posted July 24, 2018 Hey! I'd like to be able to add a class to the body tag depending on the forum being viewed. To achieve this I was thinking of adding a custom data field called class to each forum and then inserting the field using template tags into the class attribute of the body tag in globalTemplate. Although I am not sure if the forum data field would be in scope at that point. Would this be possible using IPS Rules Application? Happy to buy the full version if that's needed. Many thanks
Kevin Carwile Posted July 25, 2018 Author Posted July 25, 2018 @christopher-w That seems like it should work. But the global template is used on all pages, not just forum pages, so that template will not have a reference to any particular forum to grab the custom field value from. My suggestion would be to find a template which is used by the forums app and insert the class in a wrapper element from that template. Otherwise, getting the forum reference to access the custom data field is going to be much more difficult. christopher-w 1
Recommended Posts