Index: branches/5.2.x/units/posts/post_eh.php =================================================================== diff -u -N -r15604 -r16349 --- branches/5.2.x/units/posts/post_eh.php (.../post_eh.php) (revision 15604) +++ branches/5.2.x/units/posts/post_eh.php (.../post_eh.php) (revision 16349) @@ -1,6 +1,6 @@ Application->recallObject($parent_prefix); /* @var $main_object kCatDBItem */ - // update user posts counter - $user_posts = $this->Application->RecallPersistentVar('bb_posts'); - $this->Application->StorePersistentVar('bb_posts', $user_posts + 1); + if ( $this->Application->LoggedIn() ) { + // Update user posts counter. + $user_posts = $this->Application->RecallPersistentVar('bb_posts'); + $this->Application->StorePersistentVar('bb_posts', $user_posts + 1); + } $post_helper = $this->Application->recallObject('PostHelper'); /* @var $post_helper PostHelper */ @@ -394,6 +396,10 @@ { parent::OnAfterConfigRead($event); + if ( !$this->Application->LoggedIn() ) { + return; + } + $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); $virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode'); $virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys'); @@ -444,4 +450,4 @@ $object->SetDBField('PostingText', '[quote id=' . $reply_to . ']' . $source_post->GetDBField('PostingText') . '[/quote]'); } } - } \ No newline at end of file + }