Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/units/posts/post_eh.php
Show First 20 Lines • Show All 215 Lines • ▼ Show 20 Line(s) | |||||
$object = $event->getObject(); | $object = $event->getObject(); | ||||
/* @var $object kDBItem */ | /* @var $object kDBItem */ | ||||
$parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix'); | $parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix'); | ||||
$main_object = $this->Application->recallObject($parent_prefix); | $main_object = $this->Application->recallObject($parent_prefix); | ||||
/* @var $main_object kCatDBItem */ | /* @var $main_object kCatDBItem */ | ||||
// update user posts counter | if ( $this->Application->LoggedIn() ) { | ||||
// Update user posts counter. | |||||
$user_posts = $this->Application->RecallPersistentVar('bb_posts'); | $user_posts = $this->Application->RecallPersistentVar('bb_posts'); | ||||
$this->Application->StorePersistentVar('bb_posts', $user_posts + 1); | $this->Application->StorePersistentVar('bb_posts', $user_posts + 1); | ||||
} | |||||
$post_helper = $this->Application->recallObject('PostHelper'); | $post_helper = $this->Application->recallObject('PostHelper'); | ||||
/* @var $post_helper PostHelper */ | /* @var $post_helper PostHelper */ | ||||
$category_id = $this->Application->GetVar('m_cat_id'); | $category_id = $this->Application->GetVar('m_cat_id'); | ||||
$post_helper->PropagateCategoryField($category_id, 'Modified', $object->GetDBField('CreatedOn')); | $post_helper->PropagateCategoryField($category_id, 'Modified', $object->GetDBField('CreatedOn')); | ||||
if ( !$this->Application->isAdmin && $main_object->GetDBField('Posts') ) { | if ( !$this->Application->isAdmin && $main_object->GetDBField('Posts') ) { | ||||
▲ Show 20 Lines • Show All 154 Lines • ▼ Show 20 Line(s) | |||||
* @param kEvent $event | * @param kEvent $event | ||||
* @return void | * @return void | ||||
* @access protected | * @access protected | ||||
*/ | */ | ||||
protected function OnAfterConfigRead(kEvent $event) | protected function OnAfterConfigRead(kEvent $event) | ||||
{ | { | ||||
parent::OnAfterConfigRead($event); | parent::OnAfterConfigRead($event); | ||||
if ( !$this->Application->LoggedIn() ) { | |||||
return; | |||||
} | |||||
$virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); | $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); | ||||
$virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode'); | $virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode'); | ||||
$virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys'); | $virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys'); | ||||
$virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig'); | $virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig'); | ||||
$this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); | $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); | ||||
} | } | ||||
/** | /** | ||||
Show All 34 Lines | |||||
/* @var $source_post kDBItem */ | /* @var $source_post kDBItem */ | ||||
$source_post->Load($reply_to); | $source_post->Load($reply_to); | ||||
$object->SetDBField('Subject', 'Re: ' . $source_post->GetDBField('Subject')); | $object->SetDBField('Subject', 'Re: ' . $source_post->GetDBField('Subject')); | ||||
$object->SetDBField('PostingText', '[quote id=' . $reply_to . ']' . $source_post->GetDBField('PostingText') . '[/quote]'); | $object->SetDBField('PostingText', '[quote id=' . $reply_to . ']' . $source_post->GetDBField('PostingText') . '[/quote]'); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
No newline at end of file |