Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
February 20, 20169 yr got to be something like an email sent out to remind them and whatnot anything that might wake up members that are inactive
February 22, 20169 yr @Kevin Carwile, how can I create a condition, if a file has been attached to a forum post ? Thanks
February 23, 20169 yr Author @Kevin Carwile, how can I create a condition, if a file has been attached to a forum post ? Thanks That's not so easy. But I'll give you the solution anyway in case you are the adventurous type. The attachments aren't actually "attached" until after the content created/updated events have happened (internal ips workflow thing). So you can't check the condition on a rule attached directly to one of those events because the attachment won't actually have been claimed yet. Also, there is no stock condition to check if a topic or post has an attachment, so it would require a custom php snippet to do that. So... for the solution: You need to first create a custom action which you will trigger from a rule when the content is created/updated and set the action execution to wait until the end of the page load so that the "attachment" can be processed before your custom action is actually fired. And then you would check the condition in your custom action rule. The custom php code portion of the condition would look like this (this means you need to add an argument to your custom action called "Content", which would either be a content item class or a content comment class, and would make $content available to your custom php code): /** * If content being checked is a topic/item, check if any post has an attachment */ if ( $content instanceof \IPS\Content\Item ) { $locationKey = $content::$application . '_' . ucfirst( $content::$module ); return (bool) \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( 'location_key=? AND id1=?', $locationKey, $content->activeid ) )->first(); } /** * If content being checked is a post, see if it has an attachment */ else if ( $content instanceof \IPS\Content\Comment ) { $item = $content->item(); $locationKey = $item::$application . '_' . ucfirst( $item::$module ); return (bool) \IPS\Db::i()->select( 'COUNT(*)', 'core_attachments_map', array( 'location_key=? AND id1=? AND id2=?', $locationKey, $item->activeid, $content->activeid ) )->first(); } return FALSE; Edited February 23, 20169 yr by Kevin Carwile
February 28, 20169 yr Does this work with Adv Tags and Prefix? I use that in my sales forum and have a prefix that is SOLD. I'd like the topic to close if the prefix is changed to that.
March 1, 20169 yr Does this work with Adv Tags and Prefix? I use that in my sales forum and have a prefix that is SOLD. I'd like the topic to close if the prefix is changed to that. Yes, it will work. Nice use! Edited March 1, 20169 yr by chilihead
March 1, 20169 yr Yes, it will work. Don't suppose you've already cooked something up have you? I've been trying to work it out without much luck.
March 1, 20169 yr Author Don't suppose you've already cooked something up have you? I've been trying to work it out without much luck. No. But what have you got?
March 1, 20169 yr I'm stuck on the how to check for the prefix as being sold Rule: Auto close on sold items Disabled Event: Topic has been created or updated Conditions: Content attribute values (Check for SOLD prefix) Actions: Lock content (Close Topic)Rule: Auto close on sold items Disabled Event: Topic has been created or updated Conditions: Content attribute values (Check for SOLD prefix) Actions: Lock content (Close Topic)
March 1, 20169 yr Author Try creating a custom action to check for the sold prefix on the topic and close it, and then trigger that custom action from your rule when a "topic has been created or updated". And make sure to set the action execution to the "end of page load" setting. I believe the problem you are having is because of a timing nuance. When the topic is created/updated with new tags, then the event actually happens before the tags are saved to the topic in core processing.
March 9, 20169 yr Editing an administrative profile field using the edit profile form on a member's profile (front not ACP) doesn't save.
March 19, 20169 yr If dev mode is enabled, the app breaks the site because an E_NOTICE is emitted by line 435 of your ipsPatternsActiveRecord hook (__set) when you try to get an undefined index from _data (because it's being set for the first time). You should probably add an array_key_exists or isset check there to prevent that error. Also, can you add some indexes to the Rules tables? The queries are currently fairly slow, and adding an index should help quite a lot. Edited March 19, 20169 yr by Colonel_mortis
March 19, 20169 yr What tables dont have indexes? Which queries are slow? rules_rules doesn't have any indexes, and is queried a few times with where parameters.
March 20, 20169 yr Author rules_rules doesn't have any indexes, and is queried a few times with where parameters. I see. So how many rows do you have in your rules_rules table?
March 20, 20169 yr I see. So how many rows do you have in your rules_rules table? Actually, never mind, turns out I was looking at the wrong column, and it is taking an insignificant amount of time. Sorry about that.
April 14, 20168 yr Author Is there a demo site I can access to evaluate this solution? cheers The lite version of the app is available as a free download. No demo site except your own.
April 15, 20168 yr Ah great, ive installed this lite version now... looks great! Have downloaded the example rules and trying to set up member engagement. Looking at Scheduled Actions I see Send a re-engagement email to the member listed 5 times. Is this normal behavior?
April 30, 20168 yr Hi Kevin, I'm using the forms app with your Rules app and I'm trying to come up with a way to not let a user submit a form unless it checks the currently logged in member for my 'steamid' variable and only lets them submit it when it finds that the steamid isn't 0. Any ideas?
April 30, 20168 yr Author Hi Kevin, I'm using the forms app with your Rules app and I'm trying to come up with a way to not let a user submit a form unless it checks the currently logged in member for my 'steamid' variable and only lets them submit it when it finds that the steamid isn't 0. Any ideas? Not really possible I dont think. You can perform the check after the form is saved, but you can't do on the fly form validation like that.