Jump to content

Community

IPS Rules Application


Kevin Carwile

Recommended Posts

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 educational introduction of any mod I've ever seen from the IPS Marketplace.  The fact that you offer "Learn About Rules" directly within the mod makes it so much easier to understand and get started (and you even have a fancy custom background!!).  This is the kind of thoughtful and detailed awesomeness that I like to see from a full-featured mod.        

2) When it comes to your educational introduction, I'd like to suggest you break it into 3 separate tabs or sections.  The first section talks about the basicscomponents of Event / Conditions / Actions.  The second section talks about groups and sets.  The last section talks about advanced topics like custom actions, custom data fields, debugging, and scheduled actions.  Otherwise it's a lot to digest.  (By the way, I still don't understand Rule Sets whatsoever ... it sounds like the movie Inception of dreams within dreams and OMG Leonardo di Caprio needs to save meh!)  

3) When it comes to the the basic ECA, I encourage you to walk through two very simple examples so people can see the coding in action.    

4) I think you should preload 2 or 3 very simple or basic rules so users can immediately mimic or start to see how it works.  

Link to comment
Share on other sites

Second set of impressions:

1.  Import & Expect should be together.  I also think you need three "Add" buttons: Add New Rule, Add New Rule Set, Add New Rule Group.  

2.  (Minor) When I adding a New Rule, I think it would be nice to add an optional Description or Notes section, where admins can free-form type in notes (maybe to help them outline the rule's ECA, or remind them how the rule fits within their rule group, or whatever.  I can see how a notes section might help me personally plan out more elaborate rules).  I'm also not sure why there's a title for every event, condition, and action since all I personally do is re-type the exact action, condition, and action.   

3.  (Minor) Rule Triggered When - I encourage you to consistently utilize present tense: "is updated / is deleted / is changed / is moved."     

4.  (Minor) ECA Categories - You use the square checkbox icon for the major category headings for Content, Content:Pages, Content: Forums, Content:Gallery ... except, those are more of category headings and not choices.  

5.  ECA Categories always includes pre-selected first option - In every event, condition, and action, the first option under the Content category is always selected and I can never uncheck it.  

 

Link to comment
Share on other sites

Third set of impressions:

Now that I've downloaded and imported one of your sample rules (Prestige Reputation System), I can better see how you're utilizing some of the stuff.  The Rule Title is actually akin to the notes section that I was referring to before, so ignore that suggestion of mine.  I also see how you've created a Rule Group, although I still don't understand or see a Rule Set.  I also really like how you can define a custom field to store counters for reputation, which means you can build multiple overlapping systems for reputation and activity.  

I was going to wait for an Awards or Trophy system, although I think there's a way I ought to be able to do it myself using the Rules app with notifications and status updates. The only thing I won't be able to do is change the postbit or make the awards public.  

I'm excited - I can't wait to start creating multiple engagement and awards campaigns for my community. 

 

Suggestions and questions:

ECA's for IP.Gallery -- what about albums?  

 

Link to comment
Share on other sites

however once the 'source' url is entered it doesn't actually ever appear in the topic

You're correct. You will need to add a data tag to your topic theme template where you want it to appear.

So if you created a data field with a data key of 'source_url' and attached it to topics, then the data saved for a topic can be accessed like this:

{$topic->source_url}

In your specific case, I believe you would want to do something such as:

{{if $topic->source_url}}
  <div class="ipsPad">
      <strong>Source:</strong> {$topic->source_url}
  </div>
{{endif}}

 

Link to comment
Share on other sites

You're correct. You will need to add a data tag to your topic theme template where you want it to appear.

So if you created a data field with a data key of 'source_url' and attached it to topics, then the data saved for a topic can be accessed like this:

{$topic->source_url}

In your specific case, I believe you would want to do something such as:

{{if $topic->source_url}}
  <div class="ipsPad">
      <strong>Source:</strong> {$topic->source_url}
  </div>
{{endif}}

 

Kevin - How could I extend that if statement to say to only display if value is not null and if the person viewing the thread is of a specific array of member group ID's so only display to group ID's 4,6,20 for example?

Im thinking of a different use for it but would only want this customer data field to display to admins and mods.

Many Thanks

Link to comment
Share on other sites

Hi @Kevin Carwile - I want to pull the array of data to display front end for admins and mods so I have this;

{{if member.inGroup(array("4,20"))}}
{{if $topic->banned_member}}
          <br>
  <div class="ipsMessage ipsMessage_info ipsSpacer_bottomipsPad">
      <strong>Current Banned Members:</strong> {$topic->banned_member}
  </div>
  {{else}}
  <div class="ipsPad">
    <i>Moderator Notice: No Members Are Currently Banned From This Thread</i>
  </div>
{{endif}}
{{endif}}

Sadly it is only applying to the first group in the array and not all and also I am unable to get the data from banned_member which is a custom data field associated with  IPS\forums\Topic

Can you advise please?

Edited by Police Community
Link to comment
Share on other sites

What template have you edited?

My guess is that $topic is not a variable inside the template. Also, I believe you have the banned_members data set up as array data, so you will need to iterate the array with {{foreach}} to get all the values.

Its forums -> front -> topics -> topic

$topic, $comments, $question=NULL, $votes=array(), $nextUnread=NULL, $pagination, $topicVotes=array()

These are the available variables @Kevin Carwile 

Link to comment
Share on other sites

What I am trying to do is give folks who have gained certain levels of prestige in the forums access to collab(s) where only that level and above have access to sharing for example more detailed fishing reports.

The GC app has rules actions packaged in so you can create rules that create or delete collab memberships. You can make a rule that gives them membership when they reach a certain prestige level.

Link to comment
Share on other sites

Hi @Kevin Carwile - I want to pull the array of data to display front end for admins and mods so I have this;

{{if member.inGroup(array("4,20"))}}
{{if $topic->banned_member}}
          <br>
  <div class="ipsMessage ipsMessage_info ipsSpacer_bottomipsPad">
      <strong>Current Banned Members:</strong> {$topic->banned_member}
  </div>
  {{else}}
  <div class="ipsPad">
    <i>Moderator Notice: No Members Are Currently Banned From This Thread</i>
  </div>
{{endif}}
{{endif}}

Sadly it is only applying to the first group in the array and not all and also I am unable to get the data from banned_member which is a custom data field associated with  IPS\forums\Topic

Can you advise please?

When you use the data property accessor in your template such as $topic->banned_member, it is going to respect the permissions that you have set up on the data field. I would double check that you have given group 20 permission to "view" the data in the permissions settings for the data field.

Also, since the data field "banned_members" is set up as an array of member objects, it's going to return an actual array of member objects in your code. So you would want to iterate that array in your template code.

{{if member.inGroup(array("4,20"))}}
{{if $topic->banned_member}}
  <br>
  <div class="ipsMessage ipsMessage_info ipsSpacer_bottomipsPad">
      <strong>Current Banned Members:</strong>
      <ul>
      {{foreach $topic->banned_member as $member}}
        <li>{$member->link()}</li>
      {{endif}}
      </ul>
  </div>
  {{else}}
  <div class="ipsPad">
    <i>Moderator Notice: No Members Are Currently Banned From This Thread</i>
  </div>
{{endif}}
{{endif}}

 

Link to comment
Share on other sites

If I would want to create a monthly topic in a specific forum, how would this be done?

I am doing a photo contest (a questions forum has been converted to a photo contest forum) and would like for a new topic to appear every month.

Create a custom action in your ACP. Then create a rule which is triggered by the custom action. In that rule, add two actions:

  1. Create the new topic
  2. Schedule the custom action for 1 month in the future

This way each time the custom action is ran, it will create the new topic and then reschedule itself to run again in one month.

Then you just have to trigger it for the first time to set the cycle in motion. You could set up a quick igniter rule that will schedule the custom action on a specific date and time, such as when you post a topic in a certain forum. Then after it's scheduled for the first time, delete or disable the igniter rule. The rest will take care of itself.

Link to comment
Share on other sites

Create a custom action in your ACP. Then create a rule which is triggered by the custom action. In that rule, add two actions:

  1. Create the new topic
  2. Schedule the custom action for 1 month in the future

This way each time the custom action is ran, it will create the new topic and then reschedule itself to run again in one month.

Then you just have to trigger it for the first time to set the cycle in motion. You could set up a quick igniter rule that will schedule the custom action on a specific date and time, such as when you post a topic in a certain forum. Then after it's scheduled for the first time, delete or disable the igniter rule. The rest will take care of itself.

Custom action. :D

That just widened the usage of the "Rules" once more.
Soon up to 10 rules... :)

Link to comment
Share on other sites

a72INmm.png

kEL05lM.png

This happened when I disabled rules. I had it running with no actual rules, it it seems it was cutting my site performance in half. As soon as I removed it, performance increased massively by both metrics.

S2vLxLW.png 

Also, it doesn't seem to use caching at all, as there were quite a lot of largeish SQL queries, dwarfing the stock IPS ones.

:(

Edited by Lukeroge
Link to comment
Share on other sites

Ok just dipping in to this as this seems to be the only thing to notify a user of a post being moved. (testing the lite version)

This is the result - not sure why it's displaying this way.

A moderator has moved your topic Test - Move Me from 5b2a8611673d334f23db35d616e39638 to 36a551d9103f0a64aaf8f83cb510d682

the data in the field is: 

A moderator has moved your topic [item:title] from [oldContainer:title] to [container:title] 

I would like to have the three items include the url to the topic / Old Forum / New Forum respectively but not sure how to do that.

ideally it would be nice if the name of the moderator that moved the post was present in this the body text as well but I am not sure how to invoke that. 

Moderator John Doe moved your topic: Sample Topic from Forum A to Forum Z

-

also got this error running the support tool

ALTER TABLE `rules_arguments` CHANGE COLUMN `argument_custom_action_id` `argument_custom_action_id` INT (11) NOT NULL DEFAULT 0 COMMENT '';

I ran that query in PHPMyAdmin  dot.gif Your SQL query has been executed successfully (Query took 0.0286 sec)

 That error still shows up each time i run the support tool

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy