Skip to content

Instantly share code, notes, and snippets.

@balibali
Created July 14, 2010 00:15
Show Gist options
  • Save balibali/474788 to your computer and use it in GitHub Desktop.
Save balibali/474788 to your computer and use it in GitHub Desktop.
diff --git a/lib/model/doctrine/PluginDiary.class.php b/lib/model/doctrine/PluginDiary.class.php
index 4928da5..6815b21 100644
--- a/lib/model/doctrine/PluginDiary.class.php
+++ b/lib/model/doctrine/PluginDiary.class.php
@@ -128,4 +128,18 @@ abstract class PluginDiary extends BaseDiary
$image->delete();
}
}
+
+ public function postInsert($event)
+ {
+ if (Doctrine::getTable('SnsConfig')->get('op_diary_plugin_update_activity', true))
+ {
+ $body = 'Posted "'.$this->title.'"';
+ $options = array(
+ 'public_flag' => $this->is_open ? 0 : $this->public_flag,
+ 'uri' => '@diary_show?id='.$this->id,
+ 'source' => 'Diary',
+ );
+ Doctrine::getTable('ActivityData')->updateActivity($this->member_id, $body, $options);
+ }
+ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment