示例#1
0
         }
     }
 } else {
     // editing or posting a new message
     if (empty($discussion)) {
         standard_error(fetch_error('invalidid', $vbphrase['social_group_discussion'], $vbulletin->options['contactuslink']));
     }
     // editing a message
     if ($messageinfo) {
         // Can we edit?
         if (!can_edit_group_message($messageinfo, $group)) {
             print_no_permission();
         }
     } else {
         // posting a new message
         if (!can_post_new_message($group)) {
             print_no_permission();
         }
     }
 }
 if ($_POST['do'] == 'message') {
     $vbulletin->input->clean_array_gpc('p', array('subject' => TYPE_STR, 'message' => TYPE_STR, 'wysiwyg' => TYPE_BOOL, 'disablesmilies' => TYPE_BOOL, 'parseurl' => TYPE_BOOL, 'username' => TYPE_STR, 'ajax' => TYPE_BOOL, 'lastcomment' => TYPE_UINT, 'humanverify' => TYPE_ARRAY, 'loggedinuser' => TYPE_UINT, 'fromquickcomment' => TYPE_BOOL, 'preview' => TYPE_STR, 'advanced' => TYPE_BOOL, 'hideinlinemod' => TYPE_BOOL));
     ($hook = vBulletinHook::fetch_hook('group_message_post_start')) ? eval($hook) : false;
     // unwysiwygify the incoming data
     if ($vbulletin->GPC['wysiwyg']) {
         require_once DIR . '/includes/functions_wysiwyg.php';
         $vbulletin->GPC['message'] = convert_wysiwyg_html_to_bbcode($vbulletin->GPC['message'], $vbulletin->options['allowhtml']);
     }
     // parse URLs in message text
     if ($vbulletin->options['allowbbcode'] and $vbulletin->GPC['parseurl']) {
         require_once DIR . '/includes/functions_newpost.php';
 /**
  * Override parent method
  *
  * @return bool
  */
 protected function is_vote_buttons_enabled()
 {
     parent::is_vote_buttons_enabled();
     require_once DIR . '/includes/functions_socialgroup.php';
     $discussion = fetch_socialdiscussioninfo($this->item['discussionid']);
     $group = fetch_socialgroupinfo($discussion['groupid']);
     if (can_post_new_message($group)) {
     } else {
         $this->error_msg = 'vbv_post_can_not_be_voted';
     }
     if (!empty($this->error_msg)) {
         return false;
     }
     return true;
 }