Jump to content

IPS Rules Application

Featured Replies

  • Author

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();

 

  • Replies 575
  • Views 53.7k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • CoffeeCake
    CoffeeCake

    Perhaps it's time to open source the code and throw it up on Github for others to help maintain going forward?

  • Adriano Faria
    Adriano Faria

    You, me or even IPS can’t take ownership of other people's work. IPS is doing the only thing they can do: forbid the download and new purchases to try to minimize the damage for others.  If this

  • Hi @Kevin Carwile, I just downloaded and installed the IPS Rules Lite and actually see the functionality behind IPS Rules.  Some immediate feedback: 1) You have, hands-down, the cleanest and most educ

Posted Images

Thanks, I'll give that a go!

 

 

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"
  • Author

Oh, if you need a Topic\Post, just return the $content then. I thought you needed the topic.

  • 1 month later...
 

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

  • Author
 

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.

 

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

 

  • 4 weeks later...

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.

  • Author

Find the rules_scheduled_actions table in your database and delete all the entries.

 

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?

  • 2 weeks later...

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 ?

  • Author
 

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.

  • 1 month later...

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 by Wildcard Chris

  • Author

I dont think that primary id field is a method on the record. I think it is just a property.

 

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?

  • Author

Yeah. Dont use it as a method call. Like... remove the parenthesis.

 

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;

 

  • Author

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.

  • Author

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.

 

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

  • 2 months later...

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 by Doped_Wizard

  • Author

Thats the right rule. It will run when a member actually logs in.

  • 3 weeks later...

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

 

 

  • Author

@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.