Пример #1
0
 public function prepare_render($user, $results)
 {
     $phrase = new vB_Legacy_Phrase();
     $phrase->add_phrase_groups(array('user', 'socialgroups'));
     foreach ($results as $result) {
         $group = $result->get_discussion()->getSocialGroup();
         $privs = array();
         show_group_inlinemoderation($group->get_record(), $privs, true);
         //if we have a right for any item in the result set we have that right
         foreach ($privs as $key => $priv) {
             $this->mod_rights[$key] = ($this->mod_rights[$key] or (bool) $priv);
         }
     }
     ($hook = vBulletinHook::fetch_hook('search_prepare_render')) ? eval($hook) : false;
 }
Пример #2
0
 $url = SCRIPTPATH;
 // Show group name in messages
 $show['group'] = true;
 $show['discussion'] = true;
 // Always show inlinemod
 if ('new' == $type) {
     if ($do_discussions) {
         $show['inlinemod'] = (fetch_socialgroup_modperm('canundeletediscussions') or fetch_socialgroup_modperm('canmoderatediscussions'));
     } else {
         $show['inlinemod'] = (fetch_socialgroup_modperm('canundeletegroupmessages') or fetch_socialgroup_modperm('canmoderategroupmessages'));
     }
 } else {
     $show['inlinemod'] = true;
 }
 // Add moderation options
 show_group_inlinemoderation(false, $show, $do_discussions);
 $show['unapprove'] = $show['approve'];
 // Remove approval if we are viewing deleted
 if ($type == 'deleted') {
     $show['approve'] = false;
 } else {
     if ($type != 'new') {
         $show['undelete'] = false;
         $show['unapprove'] = false;
     }
 }
 // Create bit factory
 $bitfactory = new vB_Group_Bit_Factory($vbulletin, $itemtype);
 // Build message bits for all items
 $messagebits = '';
 while ($item = $collection->fetch_item()) {
Пример #3
0
 if ($messageend >= $messagetotal) {
     $show['allow_ajax_qc'] = 1;
     // also mark discussion as read
     exec_sg_mark_as_read('discussion', $discussion['discussionid']);
 }
 if ($show['quickcomment']) {
     require_once DIR . '/includes/functions_editor.php';
     $stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
     $editorid = construct_edit_toolbar('', false, 'groupmessage', $vbulletin->options['allowsmilies'], true, false, 'qr_small');
 }
 // Construct page navigation
 $pagenavbits = array('do=discuss', "discussionid={$discussion['discussionid']}");
 $pagenav = fetch_group_pagenav($pagenumber, $perpage, $messagetotal, $pagenavbits);
 // Display inline moderation
 if ($show['inlinemod']) {
     show_group_inlinemoderation($group, $show, false);
 }
 $show['postlink'] = can_post_new_message($group);
 $show['subscribe'] = (bool) $vbulletin->userinfo['userid'];
 // Social bookmarking
 if ($vbulletin->options['socialbookmarks']) {
     $guestuser = array('userid' => 0, 'usergroupid' => 0);
     cache_permissions($guestuser);
     $bookmarksites = '';
     if (is_array($vbulletin->bookmarksitecache) and !empty($vbulletin->bookmarksitecache) and $guestuser['permissions']['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview'] and $guestuser['permissions']['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['canviewgroups'] and !($group['options'] & $vbulletin->bf_misc_socialgroupoptions['join_to_view'] or !$vbulletin->options['sg_allow_join_to_view'])) {
         foreach ($vbulletin->bookmarksitecache as $bookmarksite) {
             $bookmarksite['link'] = str_replace(array('{URL}', '{TITLE}'), array(urlencode($vbulletin->options['bburl'] . '/group.php?discussionid=' . $discussion['discussionid']), urlencode($bookmarksite['utf8encode'] ? utf8_encode($discussion['title']) : $discussion['title'])), $bookmarksite['url']);
             ($hook = vBulletinHook::fetch_hook('showthread_bookmarkbit')) ? eval($hook) : false;
             eval('$bookmarksites .= "' . fetch_template('showthread_bookmarksite') . '";');
         }
     }
Пример #4
0
	public function prepare_render($user, $results)
	{
		require_once(DIR . '/includes/functions_socialgroup.php');
		$phrase = new vB_Legacy_Phrase();
		$phrase->add_phrase_groups(array('user', 'socialgroups'));

		foreach ($results AS $result)
		{
			$group = $result->get_message()->getDiscussion()->getSocialGroup();
			$privs = array();
			show_group_inlinemoderation($group->get_record(), $privs, false);

			//if we have a right for any item in the result set we have that right
			foreach ($privs AS $key => $priv)
			{
				$this->mod_rights[$key] = ($this->mod_rights[$key] OR (bool) $priv);
			}
		}
	}