Jump to content

Community

Kevin Carwile

IPS Rules Application

Recommended Posts

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

 

Share this post


Link to post
Share on other sites
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"

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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;

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

 

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...