Dan

Constituant
  • Content Count

    78
  • Joined

  • Last visited

  • Days Won

    6

Dan last won the day on June 4

Dan had the most liked content!

Community Reputation

10 Good

About Dan

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Dan

    Compare edited content

    For anyone interested in something similar, I ended up just using the database table core_edit_history by doing the following: $edited = \IPS\Db::i()->select( '*', 'core_edit_history', array( array( 'comment_id=?', $content->pid ), array( 'time=?', $content->edit_time ) ) )->first(); $comparison = similar_text($edited['old'], $edited['new'], $perc); return $perc;
  2. Dan

    Compare edited content

    Im having a bit of trouble trying to compare the content of two edited posts. Using the values provided: content - The created/updated content changed - An array of the properties being saved new - Boolean value indicating if content is new I get the following response from $content stdClass Object ( [warning] => [rulesDataChanged] => [changed] => Array ( ) [skipCloneDuplication] => [reactBlurb] => [likeBlurb] => ) Theres no values? I was hoping to find somewhere the previous post content so that I could compare how different the change was when the content was updated. When I use $changed I am able to grab the post data from $changed->post but thats only the new value, anyone suggest how to find the old value?
  3. For anyone curious in the future its this: $post = \IPS\forums\Topic\Post::load( $content->topic_firstpost );
  4. I have created a rule that does an action when a topic is hidden, but unfortunately I can;t seem to load the post object to get the post content because a topic doesn't contain that information. To be perfectly honest I don't even know where to find documentation on all the class namespaces, so I have kind of been guessing most the way. What am i doing wrong here? $post = \IPS\Content\Item::load( $content->topic_firstpost ); Is what I'm doing not even possible?
  5. Dan

    Available balance in postbit

    I ended up finding this valuable resource hidden away on the site: Final solution for anyone wondering: <a _title="{$currency->_title}" data-ipsTooltip class="ipsSpacer_top ipsSpacer_half ipsBadge ipsBadge_small ipsBadge_{{if $member->balance(1,0)->available< 0}}style5{{else}}style4{{endif}}" href='{url="app=points&module=points&controller=economy&do=statistics&currency={$currency->id}"}'> {$currency->display( $member->balance(1,0)->available )} {$currency->pluralized( $member->balance(1,0)->available )} </a>
  6. Dan

    Available balance in postbit

    @Kevin Carwile when you get a chance could you move this to the support section? I need a little bit of guidance regarding passing variables to templates, so that I can complete my desired result. I haven't had any luck with the IPS4 docs.
  7. Ok so I cant edit my previous posts, but I finally found a solution. I have deduced that the default value for a post state is open. Therefore setting an event condition to check for the state value wont work due to it always being open. Therefore, its not until "Defer To Page End" that the state has been set correctly. So I manipulate my action code to check the state of the content before processing the action code, and obviously have it triggered at point "Defer To Page End".
  8. I wish i could find the file where the event is define to investigate
  9. Update: Event trigger doesnt pick up the link as a new topic. It appears that the code triggers a new post when the topic is moved, despite keeping the same id. Odd. Back to the drawing board!
  10. Hi All, To anyone who is reading this and wants a solution. As per Kevins guidance above, I was able to locate the following: The state field in the database for topic's stores the value "link" when saving a link. Usually this field has the value of open or close, which defines the post being locked or not, etc. Keep in mind i didn't know how to deconstruct the object any other way than to view the database table for forum_topics. Hope this helps anyone in the future!
  11. I understand that, but is it possible for me to edit your application files to only accept the event trigger associated to a new topic rather than a redirect topic? im sure I could look in the db and find a field or something associated to redirect topics to destinguish them. where would I locate the event trigger files? This is kind of important to my use case for this product as I use this particular event trigger to report to somewhere else for management purposes. I have a very large community so it’s triggered fairly regularly for redirects.
  12. Hi, Just wanted to report an issue where the event "Event: Topic has been created" is triggered when a topic is moved and the checkbox is selected to create a redirect to its new location. Could we perhaps have this changed to not trigger on those cases?
  13. Dan

    Fixing the IPS4 Number field decimals bug

    Thanks, good to know! It helps in one of my projects!
  14. Hi, I was wondering if there is any ability to list the available balance in the user postbit for a points system rather than the total (which includes the amount stored in banks, i think referred to as "worth") currencyUserBit Template <a _title="{$currency->_title}" data-ipsTooltip class="ipsSpacer_top ipsSpacer_half ipsBadge ipsBadge_small ipsBadge_{{if $worth < 0}}style5{{else}}style4{{endif}}" href='{url="app=points&module=points&controller=economy&do=statistics&currency={$currency->id}"}'> {$currency->display( $worth )} {$currency->pluralized( $worth )} </a> I want to display the available balance rather than worth, but I dont think the variable ($balance) is available for this particular template? How would I go about changing that? {$balance->currency()->display( $balance->available )}
  15. When i clear cache and disable the rules application, the error in system log is different, confirming it has nothing to do with the rules application. Will go back to IPS support, cheers! Error: Call to a member function content() on null (0) #0 /var/www/html/applications/forums/sources/Topic/Topic.php(1902): IPS\Content\_Item->metaDescription(NULL) #1 /var/www/html/system/Content/Controller.php(242): IPS\forums\_Topic->metaDescription() #2 /var/www/html/applications/forums/modules/front/forums/topic.php(50): IPS\Content\_Controller->manage() #3 /var/www/html/system/Dispatcher/Controller.php(96): IPS\forums\modules\front\forums\_topic->manage() #4 /var/www/html/system/Content/Controller.php(50): IPS\Dispatcher\_Controller->execute() #5 /var/www/html/applications/forums/modules/front/forums/topic.php(39): IPS\Content\_Controller->execute() #6 /var/www/html/system/Dispatcher/Dispatcher.php(146): IPS\forums\modules\front\forums\_topic->execute() #7 /var/www/html/index.php(13): IPS\_Dispatcher->run() #8 {main}