예제 #1
0
 /**
  * vBForum_Search_Type_VisitorMessage::prepare_render()
  *
  * @param object $user
  * @param object $results
  * @return
  */
 public function prepare_render($user, $results)
 {
     $phrase = new vB_Legacy_Phrase();
     $phrase->add_phrase_groups(array('user', 'search'));
     foreach ($results as $result) {
         $privs = array();
         //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
 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;
 }
예제 #3
0
	/**
	 * vBForum_Search_Type_VisitorMessage::prepare_render()
	 *
	 * @param object $user
	 * @param object $results
	 * @return
	 */
	public function prepare_render($user, $results)
	{
		$phrase = new vB_Legacy_Phrase();
		$phrase->add_phrase_groups(array('user', 'search'));

		foreach ($results AS $result)
		{
			$privs = array();
			//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);
			}
		}
	}
예제 #4
0
	public function listUi($prefs)
	{
		$phrase = new vB_Legacy_Phrase();
		$phrase->add_phrase_groups(array('vbblogglobal', 'vbblogcat'));

		global $vbulletin;
		$template = vB_Template::create('search_input_blogcomment');
		$template->register('securitytoken', $vbulletin->userinfo['securitytoken']);
		$template->register('contenttypeid', $this->get_contenttypeid());

		$prefsettings = array(
			'select'=> array('searchdate', 'beforeafter', 'sortby',
				'titleonly', 'sortorder', 'starteronly'),
			'cb' => array('nocache', 'exactname'),
		 	'value' => array('query', 'searchuser')
		);

		$this->setPrefs($template, $prefs, $prefsettings);
		vB_Search_Searchtools::searchIntroRegisterHumanVerify($template);
		return $template->render();	}
예제 #5
0
	/**
	 * called before the render to do necessary phrase loading, etc.
	 *
	 * @param object $user
	 * @param object $results
	 * @return
	 */
	public function prepare_render($user, $results)
	{
		$phrase = new vB_Legacy_Phrase();
		$phrase->add_phrase_groups(array('user', 'search'));

	}
예제 #6
0
파일: event.php 프로젝트: hungnv0789/vhtm
	public function render($current_user, $criteria, $template = '')
	{
		//ensure that the phrases used by events are in the phrase list.
	 	$phrase = new vB_Legacy_Phrase();
	 	$phrase->add_phrase_groups(array('calendar', 'holiday', 'timezone', 'posting', 'user'));

		global $show, $bgclass;

		//a bunch of crap set by fetch_event_date_time that we send to the template
		global $date1, $date2, $time1, $time2, $recurcriteria, $eventdate;

		//a bunch of crap set by fetch_event_date_time that I can't find any use of.
		//leaving it in for now in case I missed some use of globals.
		global $titlecolor, $allday;

		$eventinfo = $this->event->get_record();

		//event['dst'] means "don't adjust event time for dst"
		$offset = $current_user->getTimezoneOffset(!$eventinfo['dst']);
		$eventinfo['dateline_from_user'] = $eventinfo['dateline_from'] + $offset * 3600;
		$eventinfo['dateline_to_user'] = $eventinfo['dateline_to'] + $offset * 3600;

		$eventinfo = fetch_event_date_time($eventinfo);
		fetch_musername($eventinfo);

		if (!$eventinfo['holidayid'])
		{
			$bgclass = 'alt2';

			//Custom fields are a little weird.  By default we don't show a blank value, but
			//the conditional is in the template so its possible that the user by change that.
			//We don't show the text block unless we have at least one set field, but again
			//the user can change that.  I'm not sure why somebody would want to do these
			//things but its not worth altering the behavior.  It does mean that we can't
			//rely on either field_text being blank when there are no set fields
			$custom_fields = $this->event->get_custom_fields();
			$custom_field_text = $this->render_custom_fields($custom_fields);
			$show['customfields'] = $this->have_set_customfield($custom_fields);

			$show['holiday'] = false;
			$show['caneditevent'] = $this->event->can_edit($current_user);
			$show['subscribed'] = $this->event->is_subscribed($current_user);
			$show['subscribelink'] = ($eventinfo['subscribed'] AND $this->event->can_subscribe($current_user));
		}
		else
		{
			$custom_field_text = '';
			$show['holiday'] = true;
			$show['caneditevent'] = false;
			$show['subscribed'] = false;
			$show['subscribelink'] = false;
		}

		exec_switch_bg();
		if (!$eventinfo['singleday'] AND
			gmdate('w', $eventinfo['dateline_from_user']) !=
				gmdate('w', $eventinfo['dateline_from'] + ($eventinfo['utc'] * 3600))
		)
		{
			$show['adjustedday'] = true;
			$eventinfo['timezone'] = str_replace(' ', ' ', $vbphrase[fetch_timezone($eventinfo['utc'])]);
		}
		else
		{
			$show['adjustedday'] = false;
		}

		$show['ignoredst'] = ($eventinfo['dst'] AND !$eventinfo['singleday']) ? true : false;
		$show['postedby'] = !empty($eventinfo['userid']) ? true : false;
		$show['singleday'] = !empty($eventinfo['singleday']) ? true : false;
		if (($show['candeleteevent'] OR $show['canmoveevent'] OR $show['caneditevent']) AND !$show['holiday'])
		{
			$show['eventoptions'] = true;
		}

		$calendarinfo = $this->event->get_calendar()->get_record();

		($hook = vBulletinHook::fetch_hook('calendar_getday_event')) ? eval($hook) : false;

		//some globals registered for the template's sake
		global $gobutton, $spacer_open, $spacer_close;
		$templater = vB_Template::create('calendar_showeventsbit');
		$templater->register('calendarinfo', $calendarinfo);
		$templater->register('customfields', $custom_field_text);
		$templater->register('date1', $date1);
		$templater->register('date2', $date2);
		$templater->register('time1', $time1);
		$templater->register('time2', $time2);
		$templater->register('eventdate', $eventdate);
		$templater->register('eventinfo', $eventinfo);
		$templater->register('gobutton', $gobutton);
		$templater->register('recurcriteria', $recurcriteria);
		$templater->register('spacer_close', $spacer_close);
		$templater->register('spacer_open', $spacer_open);

		return $templater->render();
	}
예제 #7
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);
			}
		}
	}