This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
documentation:create_first_plugin [2015/06/11 11:19] mooeditor [How to using like system] |
documentation:create_first_plugin [2015/08/24 05:12] 127.0.0.1 external edit |
||
---|---|---|---|
Line 2: | Line 2: | ||
//NOTE: We’re currently working on documenting these sections. We believe the information here is accurate, however be aware we are also still working on this chapter. Additional information will be provided as we go which should make this chapter more solid.// | //NOTE: We’re currently working on documenting these sections. We believe the information here is accurate, however be aware we are also still working on this chapter. Additional information will be provided as we go which should make this chapter more solid.// | ||
+ | |||
+ | Sample Plugin: [[https://www.moosocial.com//wiki/lib/plugins/ckgedit/fckeditor/userfiles/file/moo-note-1.0.zip|https://www.moosocial.com//wiki/lib/plugins/ckgedit/fckeditor/userfiles/file/moo-note-1.0.zip]] | ||
+ | |||
====== Welcome to the mooSocial guides ====== | ====== Welcome to the mooSocial guides ====== | ||
Line 1872: | Line 1875: | ||
View note | View note | ||
- | notescontroller.php | + | <file php notescontroller.php> |
+ | |||
+ | //Comment system | ||
+ | MooCore::getInstance()->setSubject($note); | ||
+ | // | ||
+ | |||
+ | </file> | ||
+ | |||
+ | |||
+ | <file php view.ctp> | ||
+ | |||
+ | //Comment system | ||
+ | <div class="content_center"> | ||
+ | <div class="bar-content full_content p_m_10"> | ||
+ | <?php echo $this->renderComment();?> | ||
+ | </div> | ||
+ | </div> | ||
+ | // | ||
+ | |||
+ | </file> | ||
+ | |||
+ | |||
+ | <file php NoteHelper.php> | ||
+ | |||
+ | //Comment system | ||
+ | public function checkPostStatus($note,$uid) | ||
+ | { | ||
+ | if (!$uid) | ||
+ | return false; | ||
+ | |||
+ | $friendModel = MooCore::getInstance()->getModel('Friend'); | ||
+ | if ($uid == $note['Note']['user_id']) | ||
+ | return true; | ||
+ | |||
+ | if ($note['Note']['privacy'] == PRIVACY_EVERYONE) | ||
+ | { | ||
+ | return true; | ||
+ | } | ||
+ | |||
+ | if ($note['Note']['privacy'] == PRIVACY_FRIENDS) | ||
+ | { | ||
+ | $areFriends = $friendModel->areFriends( $uid, $note['Blog']['user_id'] ); | ||
+ | if ($areFriends) | ||
+ | return true; | ||
+ | } | ||
+ | |||
+ | |||
+ | return false; | ||
+ | } | ||
+ | public function checkSeeActivity($note,$uid) | ||
+ | { | ||
+ | return $this->checkPostStatus($note,$uid); | ||
+ | } | ||
+ | // | ||
+ | |||
+ | </file> | ||
- | view.ctp | ||
- | notehelper.php | ||
===== How to using report system ===== | ===== How to using report system ===== | ||
Line 1882: | Line 1938: | ||
View note: | View note: | ||
- | view.tcp | + | <file php view.tcp> |
+ | |||
+ | //Report system | ||
+ | <?=$this->Html->link( | ||
+ | __d('Note', 'Report Note'), array( | ||
+ | 'controller' => 'reports', | ||
+ | 'action' => 'ajax_create', | ||
+ | 'plugin' => '', | ||
+ | $note['Note']['moo_type'], | ||
+ | $note['Note']['id'] | ||
+ | ), array('data-target'=>'#themeModal','class'=>'button button-action topButton button-mobi-top','data-toggle'=>'modal') | ||
+ | ); | ||
+ | // | ||
+ | |||
+ | </file> | ||
====== Plugin Development Suggestions ====== | ====== Plugin Development Suggestions ====== |