示例#1
0
 /**
  * Sets up different display variables for the Group Message
  *
  * @access protected
  */
 function process_display()
 {
     global $show, $vbphrase;
     $this->item['canview'] = ($this->item['state'] == 'visible' or $this->item['state'] == 'deleted' and fetch_socialgroup_modperm('canundeletediscussions', $this->group) or $this->item['state'] == 'moderation' and fetch_socialgroup_modperm('canmoderatediscussions', $this->group));
     // Simplify moderation for templating
     if (fetch_socialgroup_modperm('canmoderategroupmessages', $this->group)) {
         $this->item['moderated_replies'] = ($this->item['moderation'] > 1 or $this->item['state'] != 'moderation' and $this->item['moderation'] == 1);
     } else {
         $this->item['moderated_replies'] = 0;
     }
     $this->item['moderated'] = $this->item['state'] == 'moderation';
     // Show inline selection tools
     if ($this->show_moderation_tools and !$this->force_inline_selection) {
         $this->item['inlinemod'] = ($this->item['state'] != 'deleted' and fetch_socialgroup_modperm('canmoderatediscussions', $this->group) or fetch_socialgroup_modperm('canundeletediscussions', $this->group) or fetch_socialgroup_modperm('canremovediscussions', $this->group));
         $show['inlinemod'] = ($show['inlinemod'] or $this->item['inlinemod']);
     } else {
         $show['inlinemod'] = $this->item['inlinemod'] = $this->force_inline_selection;
     }
     // Show edit links
     $this->item['edit'] = ($this->show_moderation_tools and can_edit_group_discussion($this->item, $this->group));
     $show['edit'] = $this->item['edit'];
     if ($this->check_read) {
         if (!$this->item['is_read']) {
             if (!$this->item['readtime']) {
                 $this->item['readtime'] = 0;
                 // no database marking, check cookie
                 if (!$this->registry->options['threadmarking'] or !$this->registry->userinfo['userid']) {
                     $this->item['readtime'] = max(fetch_bbarray_cookie('discussion_marking', $this->item['discussionid']), $this->registry->userinfo['lastvisit']);
                 }
             }
             // posts older than markinglimit days won't be highlighted as new
             $oldtime = TIMENOW - $this->registry->options['markinglimit'] * 24 * 60 * 60;
             $this->item['readtime'] = max($this->group['readtime'], $this->item['readtime'], $oldtime);
             $this->item['is_read'] = $this->item['readtime'] > $this->item['lastpost'];
             $this->item['goto_readtime'] = array('goto' => $this->item['readtime']);
         }
     } else {
         $this->item['is_read'] = true;
     }
     $this->item['readstate'] = $this->item['is_read'] ? 'old' : 'new';
     $this->item['replies'] = max(0, $this->item['visible'] - 1);
     if ($this->show_subscription) {
         $this->item['showsubsinfo'] = $this->show_subscription;
         $this->item['notification'] = $this->item['emailupdate'] ? $vbphrase['instant'] : $vbphrase['none'];
     } else {
         $this->item['showsubsinfo'] = false;
         $this->item['notification'] = "";
     }
 }
示例#2
0
         $message['message'] = htmlspecialchars_uni($messageinfo['pagetext']);
         if ($edit_discussion) {
             $message['title'] = htmlspecialchars_uni($messageinfo['title']);
         }
     } else {
         $message['message'] = '';
     }
 }
 $navbits['group.php?' . $vbulletin->session->vars['sessionurl']] = $vbphrase['social_groups'];
 $navbits['group.php?' . $vbulletin->session->vars['sessionurl'] . 'cat=' . $group['socialgroupcategoryid']] = $group['categoryname'];
 $navbits['group.php?' . $vbulletin->session->vars['sessionurl'] . "groupid={$group['groupid']}"] = $group['name'];
 $navbits['group.php?' . $vbulletin->session->vars['sessionurl'] . "do=discuss&discussionid={$discussion['discussionid']}"] = $discussion['title'];
 if ($messageinfo) {
     $show['edit'] = true;
     if ($messageinfo['gmid'] == $discussion['firstpostid']) {
         $show['delete'] = (fetch_socialgroup_modperm('candeletediscussions', $group) or $messageinfo['postuserid'] == $vbulletin->userinfo['userid'] and (fetch_socialgroup_perm('canmanagediscussions') or fetch_socialgroup_perm('canmanagemessages') and can_edit_group_discussion($discussion)));
         $show['physicaldeleteoption'] = fetch_socialgroup_modperm('canremovediscussions', $group);
         $delete_discussion = true;
     } else {
         $show['delete'] = (fetch_socialgroup_modperm('candeletegroupmessages', $group) or $messageinfo['postuserid'] == $vbulletin->userinfo['userid'] and $messageinfo['gmid'] != $discussion['firstpostid'] and fetch_socialgroup_perm('canmanagemessages'));
         $show['physicaldeleteoption'] = fetch_socialgroup_modperm('canremovegroupmessages', $group);
     }
     $navbits[] = $edit_discussion ? $vbphrase['edit_discussion'] : $vbphrase['edit_message'];
 } else {
     $navbits[] = $edit_discussion ? $vbphrase['post_new_discussion'] : $vbphrase['reply_to_discussion'];
 }
 $istyles_js = construct_editor_styles_js();
 $editorid = construct_edit_toolbar($message['message'], false, 'groupmessage', $vbulletin->options['allowsmilies'], true, false);
 eval('$usernamecode = "' . fetch_template('newpost_usernamecode') . '";');
 // carry page number in case we do a hard delete
 $pagenumber = $vbulletin->input->clean_gpc('g', 'pagenumber', TYPE_UINT);
示例#3
0
文件: group.php 项目: hungnv0789/vhtm
		if ($messageinfo)
		{
			$show['edit'] = true;

			if ($messageinfo['gmid'] == $discussion['firstpostid'])
			{
				$show['delete'] = (
					fetch_socialgroup_modperm('candeletediscussions', $group)
					OR (
						$messageinfo['postuserid'] == $vbulletin->userinfo['userid']
						AND ((
							fetch_socialgroup_perm('canmanagediscussions')
							)
						OR (
							fetch_socialgroup_perm('canmanagemessages')
							AND can_edit_group_discussion($discussion)
						))
					)
				);

				$show['physicaldeleteoption'] = fetch_socialgroup_modperm('canremovediscussions', $group);
				$delete_discussion = true;
			}
			else
			{
				$show['delete'] = (
					fetch_socialgroup_modperm('candeletegroupmessages', $group)
					OR (
						$messageinfo['postuserid'] == $vbulletin->userinfo['userid']
						AND $messageinfo['gmid'] != $discussion['firstpostid']
						AND fetch_socialgroup_perm('canmanagemessages')