Esempio n. 1
0
function print_users($usergroupid, $userarray)
{
    global $bgclass, $vbphrase;
    $out = '';
    uksort($userarray, 'strnatcasecmp');
    // alphabetically sort usernames
    foreach ($userarray as $user) {
        exec_switch_bg();
        $user = process_showgroups_userinfo($user);
        eval('$out .= "' . fetch_template('showgroups_adminbit') . '";');
    }
    return $out;
}
Esempio n. 2
0
                ($hook = vBulletinHook::fetch_hook('profile_editusergroups_memberbit')) ? eval($hook) : false;
                eval('$membergroupbits .= "' . fetch_template('modifyusergroups_memberbit') . '";');
            }
        }
        $show['membergroups'] = iif($membergroupbits != '', true, false);
        // do groups user could use as display group
        $checked = array();
        if ($vbulletin->userinfo['displaygroupid']) {
            $checked["{$vbulletin->userinfo['displaygroupid']}"] = 'checked="checked"';
        } else {
            $checked["{$vbulletin->userinfo['usergroupid']}"] = 'checked="checked"';
        }
        $displaygroupbits = '';
        foreach ($groups['member'] as $usergroupid => $usergroup) {
            if ($usergroupid != $vbulletin->userinfo['usergroupid'] and $usergroup['canoverride']) {
                exec_switch_bg();
                ($hook = vBulletinHook::fetch_hook('profile_editusergroups_displaybit')) ? eval($hook) : false;
                eval('$displaygroupbits .= "' . fetch_template('modifyusergroups_displaybit') . '";');
            }
        }
        $show['displaygroups'] = iif($displaygroupbits != '', true, false);
        if (!$show['joinrequests'] and !$show['nonmembergroups'] and !$show['membergroups'] and !$show['displaygroups']) {
            eval(standard_error(fetch_error('no_public_usergroups')));
        }
        $navbits[''] = $vbphrase['group_memberships'];
        $templatename = 'modifyusergroups';
    }
}
if ($_POST['do'] == 'deleteusergroups') {
    $vbulletin->input->clean_array_gpc('p', array('usergroupid' => TYPE_UINT, 'deletebox' => TYPE_ARRAY_BOOL));
    ($hook = vBulletinHook::fetch_hook('profile_deleteusergroups_start')) ? eval($hook) : false;
Esempio n. 3
0
	/**
	* Template method that does all the work to display an issue note, including processing the template
	*
	* @return	string	Templated note output
	*/
	function construct()
	{
		($hook = vBulletinHook::fetch_hook('visitor_messagebit_display_start')) ? eval($hook) : false;

		// preparation for display...
		$this->prepare_start();

		if ($this->message['userid'])
		{
			$this->process_registered_user();
		}
		else
		{
			$this->process_unregistered_user();
		}

		fetch_avatar_from_userinfo($this->message, true);

		$this->process_date_status();
		$this->process_display();
		$this->process_text();
		$this->prepare_end();

		// actual display...
		$userinfo =& $this->userinfo;

		fetch_avatar_from_userinfo($userinfo, true);

		$message =& $this->message;

		global $show, $vbphrase;
		global $spacer_open, $spacer_close;

		global $bgclass, $altbgclass;
		exec_switch_bg();

		$pageinfo_vm_ignored = array(
			'vmid'        => $message['vmid'],
			'showignored' => 1,
		);

		$pageinfo_vm = array('vmid' => $message['vmid']);

		$messageinfo = array(
			'userid'   => $message['profileuserid'],
			'username' => $message['profileusername'],
		);

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

		$templater = vB_Template::create($this->template);
			$templater->register('message', $message);
			$templater->register('messageinfo', $messageinfo);
			$templater->register('pageinfo_vm', $pageinfo_vm);
			$templater->register('pageinfo_vm_ignored', $pageinfo_vm_ignored);
			$templater->register('userinfo', $userinfo);
		return $templater->render();

	}
Esempio n. 4
0
/**
 * Fetches the Profile Fields for a User input form
 *
 * @param	integer	Forum Type: 0 indicates a profile field, 1 indicates an option field
 *
 */
function fetch_profilefields($formtype = 0)
{
    global $vbulletin, $stylevar, $customfields, $bgclass, $show;
    global $vbphrase, $altbgclass, $bgclass1, $tempclass;
    // get extra profile fields
    $profilefields = $vbulletin->db->query_read_slave("\n\t\tSELECT * FROM " . TABLE_PREFIX . "profilefield\n\t\tWHERE editable IN (1,2)\n\t\t\tAND form " . iif($formtype, '>= 1', '= 0') . "\n\t\tORDER BY displayorder\n\t");
    while ($profilefield = $vbulletin->db->fetch_array($profilefields)) {
        $profilefieldname = "field{$profilefield['profilefieldid']}";
        if ($profilefield['editable'] == 2 and !empty($vbulletin->userinfo["{$profilefieldname}"])) {
            continue;
        }
        if ($formtype == 1 and in_array($profilefield['type'], array('select', 'select_multiple'))) {
            $show['optionspage'] = true;
        } else {
            $show['optionspage'] = false;
        }
        if (($profilefield['required'] == 1 or $profilefield['required'] == 3) and $profilefield['form'] == 0) {
            exec_switch_bg(1);
        } else {
            exec_switch_bg($profilefield['form']);
        }
        $tempcustom = fetch_profilefield($profilefield);
        // now add the HTML to the completed lists
        if (($profilefield['required'] == 1 or $profilefield['required'] == 3) and $profilefield['form'] == 0) {
            $customfields['required'] .= $tempcustom;
        } else {
            if ($profilefield['form'] == 0) {
                $customfields['regular'] .= $tempcustom;
            } else {
                switch ($profilefield['form']) {
                    case 1:
                        $customfields['login'] .= $tempcustom;
                        break;
                    case 2:
                        $customfields['messaging'] .= $tempcustom;
                        break;
                    case 3:
                        $customfields['threadview'] .= $tempcustom;
                        break;
                    case 4:
                        $customfields['datetime'] .= $tempcustom;
                        break;
                    case 5:
                        $customfields['other'] .= $tempcustom;
                        break;
                    default:
                        ($hook = vBulletinHook::fetch_hook('profile_fetch_profilefields_loc')) ? eval($hook) : false;
                }
            }
        }
    }
}
Esempio n. 5
0
	/**
	* Template method. Calls all the appropriate methods to build a post and then evaluates the template.
	*
	* @param	array	Post information
	*
	* @return	string	HTML for the post
	*/
	function construct_postbit(&$post)
	{
		global $ad_location;

		$this->post =& $post;
		$thread =& $this->thread;
		$forum =& $this->forum;

		// make sure we can display this post
		if ($this->is_displayable() == false)
		{
			return '';
		}

		global $show, $vbphrase;
		global $spacer_open, $spacer_close;

		global $bgclass, $altbgclass;
		exec_switch_bg();

		$template_hook = array();

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

		// put together each part of the post
		$this->prep_post_start();

		$this->process_date_status();
		$this->process_edit_info();
		$this->process_icon();
		$this->process_ip();

		if (!empty($this->post['userid']))
		{
			$this->process_registered_user();
			$this->process_im_icons();
		}
		else
		{
			$this->process_unregistered_user();
		}

		$this->bbcode_parser->containerid = $this->post['postid'];
		$this->parse_bbcode();

		$this->process_attachments();

		// finish prepping the post
		$this->prep_post_end();

		$pageinfo_post = array(
			'p' => $post['postid']
		);
		if ($this->templatename != 'postbit')
		{
			$pageinfo_post['viewfull'] = 1;
		}

		// execute hook
		($hook = vBulletinHook::fetch_hook('postbit_display_complete')) ? eval($hook) : false;

		$show['last_ad'] = $show['first_ad'] = $show['first_adsense'] = false;
		if ($post['isfirstshown'])
		{
			//this does not appear to be an ad slot, rather it appears to be some shim html
			//that needs to be rendered if the firstpost google ad is included.
			$template = vB_Template::create('ad_showthread_firstpost_sig');
			$template->register('adsense_pub_id', $this->registry->adsense_pub_id);
			$template->register('adsense_host_id', $this->registry->adsense_host_id);
			$ad_location['ad_showthread_firstpost_sig'] = $template->render();

			$template = vB_Template::create('ad_showthread_firstpost_start');
			$template->register('adsense_pub_id', $this->registry->adsense_pub_id);
			$template->register('adsense_host_id', $this->registry->adsense_host_id);
			$ad_location['ad_showthread_firstpost_start'] = trim($template->render(true));

			$ad_location['ad_showthread_firstpost_sig'] = vB_Template::create('ad_showthread_firstpost_sig')->render();
			if ($ad_location['ad_showthread_firstpost_start'])
			{
				$show['first_ad'] = true;
			}

			if ($ad_location['thread_first_post_content'] = trim(vB_Template::create('ad_thread_first_post_content')->render(true)))
			{
				if (preg_match('#^<div id="ad_thread_first_post_content">.+</div>$#si', $ad_location['thread_first_post_content']))
				{
					$show['first_ad'] = true;
				}
				else
				{
					$ad_location['thread_first_post_content'] = '';
				}
			}
		}
		else if (
			$post['islastshown']
				AND
			$ad_location['thread_last_post_content'] = trim(vB_Template::create('ad_thread_last_post_content')->render(true))
		)
		{
			if (preg_match('#^<div id="ad_thread_last_post_content">.+</div>$#si', $ad_location['thread_last_post_content']))
			{
				$show['last_ad'] = true;
			}
			else
			{
				$ad_location['thread_last_post_content'] = '';
			}
		}

		// prepare the member action drop-down menu
		// pass the local template hook so that each drop-down gets its own hook (per-postbit)
		$memberaction_dropdown = construct_memberaction_dropdown($post, $template_hook);

		// evaluate template
		$postid =& $post['postid'];

		$templater = vB_Template::create($this->template_prefix . $this->templatename);
			if ($this->add_promote_links AND $this->registry->products['vbcms'])
			{
				if (!isset($this->registry->userinfo['permissions']['cms']))
				{
					bootstrap_framework();
					vBCMS_Permissions::getUserPerms();
				}

				if ($this->registry->userinfo['permissions']['cms']['canpublish'][0] != -1)
				{
					$templater->register('promote_sectionid', $this->registry->userinfo['permissions']['cms']['canpublish'][0]);
					$templater->register('articletypeid', vB_Types::instance()->getContentTypeID('vBCms_Article'));
					$promote_url = vB_Route::create('vBCms_Route_Content', '1/addcontent/')->getCurrentURL();
					$promote_url .= (strrpos($promote_url, '?') ? '&amp;' : '?') .
						'contenttypeid=' . vB_Types::instance()->getContentTypeID('vBCms_Article') .
						"&amp;postid=" . $post['postid'] . '&amp;parentid=1';
					$templater->register('promote_url', $promote_url);
				}
			}
			$templater->register('ad_location', $ad_location);
			$templater->register('memberaction_dropdown', $memberaction_dropdown);
			$templater->register('pageinfo_post', $pageinfo_post);
			$templater->register('post', $post);
			$templater->register('postid', $postid);
			$templater->register('template_hook', $template_hook);
			$templater->register('thread', $thread);
		$postbit = $templater->render();

		$templater = vB_Template::create('postbit_wrapper');
			$templater->register('post', $post);
			$templater->register('postbit', $postbit);
			$templater->register('spacer_close', $spacer_close);
			$templater->register('spacer_open', $spacer_open);
		$retval = $templater->render();

		return $retval;
	}
Esempio n. 6
0
    eval('$socialgroups_css = "' . fetch_template('socialgroups_css') . '";');
    $templatename = 'socialgroups_group';
}
// #######################################################################
if ($_REQUEST['do'] == 'viewmembers') {
    $vbulletin->input->clean_array_gpc('r', array('perpage' => TYPE_UINT, 'pagenumber' => TYPE_UINT));
    $perpage = $vbulletin->GPC['perpage'];
    $pagenumber = $vbulletin->GPC['pagenumber'];
    $totalmembers = $group['members'];
    sanitize_pageresults($totalmembers, $pagenumber, $perpage);
    $groupmembers = $vbulletin->db->query_read("\n\t\tSELECT userfield.*, usertextfield.*, user.*, UNIX_TIMESTAMP(passworddate) AS passworddate,\n\t\t\tIF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, (user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible,\n\t\t\t" . ($vbulletin->options['avatarenabled'] ? 'avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline, customavatar.width AS avwidth, customavatar.height AS avheight,' : '') . "\n\t\t\tcustomprofilepic.userid AS profilepic, customprofilepic.dateline AS profilepicdateline, customprofilepic.width AS ppwidth, customprofilepic.height AS ppheight,\n\t\t\tuser.icq AS icq, user.aim AS aim, user.yahoo AS yahoo, user.msn AS msn, user.skype AS skype\n\t\tFROM " . TABLE_PREFIX . "socialgroupmember AS socialgroupmember\n\t\tINNER JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = socialgroupmember.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON (user.userid = userfield.userid)\n\t\tLEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (usertextfield.userid = user.userid)\n\t\t" . ($vbulletin->options['avatarenabled'] ? "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON (avatar.avatarid = user.avatarid) LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON (customavatar.userid = user.userid) " : '') . "\n\t\tLEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)\n\t\tWHERE socialgroupmember.groupid = " . $vbulletin->GPC['groupid'] . " AND socialgroupmember.type = 'member'\n\t\tORDER BY user.username\n\t\tLIMIT " . ($pagenumber - 1) * $perpage . ", {$perpage}\n\t");
    require_once DIR . '/includes/functions_bigthree.php';
    while ($groupmember = $vbulletin->db->fetch_array($groupmembers)) {
        $width = 0;
        $height = 0;
        $alt = exec_switch_bg();
        fetch_avatar_from_userinfo($groupmember, true);
        fetch_musername($groupmember);
        $user =& $groupmember;
        fetch_online_status($user, true);
        construct_im_icons($user, true);
        ($hook = vBulletinHook::fetch_hook('group_memberbit')) ? eval($hook) : false;
        eval('$member_list .= "' . fetch_template('memberinfo_small') . '";');
    }
    $navbits = array('group.php' . $vbulletin->session->vars['sessionurl_q'] => $vbphrase['social_groups'], 'group.php?' . $vbulletin->session->vars['sessionurl'] . 'groupid=' . $group['groupid'] => $group['name'], '' => $vbphrase['member_list']);
    $custompagetitle = $group['name'] . ' - ' . $vbphrase['member_list'];
    $pagenav = construct_page_nav($pagenumber, $perpage, $totalmembers, 'group.php?' . $vbulletin->session->vars['sessionurl'] . 'do=viewmembers&amp;groupid=' . $group['groupid'] . ($perpage ? "&amp;pp={$perpage}" : ''));
    eval('$memberinfo_css = "' . fetch_template('memberinfo_css') . '";');
    $templatename = 'socialgroups_memberlist';
}
// #######################################################################
Esempio n. 7
0
 /**
  * Template method that does all the work to display an issue note, including processing the template
  *
  * @return	string	Templated note output
  */
 function construct()
 {
     ($hook = vBulletinHook::fetch_hook('group_messagebit_display_start')) ? eval($hook) : false;
     // preparation for display...
     $this->prepare_start();
     if ($this->message['userid']) {
         $this->process_registered_user();
     } else {
         $this->process_unregistered_user();
     }
     fetch_avatar_from_userinfo($this->message, true);
     $this->process_date_status();
     $this->process_display();
     $this->process_text();
     $this->prepare_end();
     // actual display...
     $group =& $this->group;
     $message =& $this->message;
     global $show, $vbphrase, $stylevar;
     global $spacer_open, $spacer_close;
     global $bgclass, $altbgclass;
     exec_switch_bg();
     ($hook = vBulletinHook::fetch_hook('group_messagebit_display_complete')) ? eval($hook) : false;
     eval('$output = "' . fetch_template($this->template) . '";');
     return $output;
 }
Esempio n. 8
0
/**
 * Fetches the Profile Fields for a User input form
 *
 * @param	integer	Forum Type: 0 indicates a profile field, 1 indicates an option field
 *
 */
function fetch_profilefields($formtype = 0) // 0 indicates a profile field, 1 indicates an option field
{
	global $vbulletin, $customfields, $bgclass, $show;
	global $vbphrase, $altbgclass, $bgclass1, $tempclass;

	// get extra profile fields
	$profilefields = $vbulletin->db->query_read_slave("
		SELECT * FROM " . TABLE_PREFIX . "profilefield
		WHERE editable IN (1,2)
			AND form " . iif($formtype, '>= 1', '= 0'). "
		ORDER BY displayorder
	");
	while ($profilefield = $vbulletin->db->fetch_array($profilefields))
	{
		$profilefieldname = "field$profilefield[profilefieldid]";
		if ($profilefield['editable'] == 2 AND !empty($vbulletin->userinfo["$profilefieldname"]))
		{
			continue;
		}

		if ($formtype == 1 AND in_array($profilefield['type'], array('select', 'select_multiple')))
		{
			$show['optionspage'] = true;
		}
		else
		{
			$show['optionspage'] = false;
		}

		if (($profilefield['required'] == 1 OR $profilefield['required'] == 3) AND $profilefield['form'] == 0) // Ignore the required setting for fields on the options page
		{
			exec_switch_bg(1);
		}
		else
		{
			exec_switch_bg($profilefield['form']);
		}

		$tempcustom = fetch_profilefield($profilefield);

		// now add the HTML to the completed lists

		if (($profilefield['required'] == 1 OR $profilefield['required'] == 3) AND $profilefield['form'] == 0) // Ignore the required setting for fields on the options page
		{
			$customfields['required'] .= $tempcustom;
		}
		else
		{
			if ($profilefield['form'] == 0)
			{
				$customfields['regular'] .= $tempcustom;
			}
			else // not implemented
			{
				switch ($profilefield['form'])
				{
					case 1:
						$customfields['login'] .= $tempcustom;
						break;
					case 2:
						$customfields['messaging'] .= $tempcustom;
						break;
					case 3:
						$customfields['threadview'] .= $tempcustom;
						break;
					case 4:
						$customfields['datetime'] .= $tempcustom;
						break;
					case 5:
						$customfields['other'] .= $tempcustom;
						break;
					default:
						($hook = vBulletinHook::fetch_hook('profile_fetch_profilefields_loc')) ? eval($hook) : false;
				}
			}
		}


	}
}
Esempio n. 9
0
 /**
  * Template method that does all the work to render the item, including processing the template
  *
  * @access public
  *
  * @return	string	Templated note output
  */
 function construct()
 {
     if ($this->hook_display_start) {
         ($hook = vBulletinHook::fetch_hook($this->hook_display_start)) ? eval($hook) : false;
     }
     // preparation for display...
     $this->prepare_start();
     if ($this->use_avatar) {
         fetch_avatar_from_userinfo($this->item, true);
     }
     if ($this->process_user) {
         if ($this->item['userid']) {
             $this->process_registered_user();
         } else {
             $this->process_unregistered_user();
         }
     }
     $this->process_date_status();
     $this->process_display();
     $this->process_text();
     $this->prepare_end();
     // actual display...
     foreach ($this->template_data_vars as $varname) {
         ${$varname} = $this->{$varname};
     }
     global $show, $vbphrase;
     global $spacer_open, $spacer_close;
     global $perpage, $pagenumber;
     global $bgclass, $altbgclass;
     exec_switch_bg();
     if ($this->hook_display_complete) {
         ($hook = vBulletinHook::fetch_hook($this->hook_display_complete)) ? eval($hook) : false;
     }
     $templater = vB_Template::create($this->template);
     if ($this->template_item_var) {
         $templater->register($this->template_item_var, $this->item);
     }
     $templater->register('pagenumber', $pagenumber);
     $templater->register('perpage', $perpage);
     $templater->register('template_hook', $template_hook);
     return $templater->render();
 }
Esempio n. 10
0
 /**
  * Template method. Calls all the appropriate methods to build a post and then evaluates the template.
  *
  * @param	array	Post information
  *
  * @return	string	HTML for the post
  */
 function construct_postbit(&$post)
 {
     $this->post =& $post;
     $thread =& $this->thread;
     $forum =& $this->forum;
     // make sure we can display this post
     if ($this->is_displayable() == false) {
         return '';
     }
     global $show, $vbphrase, $stylevar;
     global $spacer_open, $spacer_close;
     global $bgclass, $altbgclass;
     exec_switch_bg();
     ($hook = vBulletinHook::fetch_hook('postbit_display_start')) ? eval($hook) : false;
     // put together each part of the post
     $this->prep_post_start();
     $this->process_date_status();
     $this->process_edit_info();
     $this->process_icon();
     $this->process_ip();
     if (!empty($this->post['userid'])) {
         $this->process_registered_user();
         $this->process_im_icons();
     } else {
         $this->process_unregistered_user();
     }
     $this->parse_bbcode();
     $this->process_attachments();
     // finish prepping the post
     $this->prep_post_end();
     // execute hook
     ($hook = vBulletinHook::fetch_hook('postbit_display_complete')) ? eval($hook) : false;
     if ($post['isfirstshown']) {
         eval('$ad_location[\'ad_showthread_firstpost_start\'] = "' . fetch_template('ad_showthread_firstpost_start') . '";');
         eval('$ad_location[\'ad_showthread_firstpost_sig\'] = "' . fetch_template('ad_showthread_firstpost_sig') . '";');
     }
     // evaluate template
     $postid =& $post['postid'];
     eval('$postbit = "' . fetch_template($this->templatename) . '";');
     eval('$retval = "' . fetch_template('postbit_wrapper') . '";');
     return $retval;
 }
 /**
  * Template method that does all the work to render the item, including processing the template
  *
  * @access public
  *
  * @return	string	Templated note output
  */
 function construct()
 {
     if ($this->hook_display_start) {
         ($hook = vBulletinHook::fetch_hook($this->hook_display_start)) ? eval($hook) : false;
     }
     // preparation for display...
     $this->prepare_start();
     if ($this->process_user) {
         if ($this->item['userid']) {
             $this->process_registered_user();
         } else {
             $this->process_unregistered_user();
         }
     }
     if ($this->use_avatar) {
         fetch_avatar_from_userinfo($this->item, true);
     }
     $this->process_date_status();
     $this->process_display();
     $this->process_text();
     $this->prepare_end();
     // actual display...
     if ($this->template_item_var) {
         ${$this->template_item_var} = $this->item;
     }
     global $show, $vbphrase, $stylevar;
     global $spacer_open, $spacer_close;
     global $perpage, $pagenumber;
     global $bgclass, $altbgclass;
     exec_switch_bg();
     if ($this->hook_display_complete) {
         ($hook = vBulletinHook::fetch_hook($this->hook_display_complete)) ? eval($hook) : false;
     }
     eval('$output = "' . fetch_template($this->template) . '";');
     return $output;
 }
Esempio n. 12
0
	private function render_custom_fields($custom_fields)
	{
		global $show;

		$customfields = '';
		foreach ($custom_fields as $field)
		{
			$show['customoption'] = ($field['value'] == '') ? false : true;
			exec_switch_bg();

			$templater = vB_Template::create('calendar_showeventsbit_customfield');
			$templater->register('customoption', $field['value']);
			$templater->register('customtitle', $field['title']);

			$customfields .= $templater->render();
		}
		return $customfields;
	}
Esempio n. 13
0
	/**
	* Template method that does all the work to display an issue note, including processing the template
	*
	* @return	string	Templated note output
	*/
	function construct()
	{
		($hook = vBulletinHook::fetch_hook('blog_entry_display_start')) ? eval($hook) : false;

		// preparation for display...
		$this->prepare_start();

		$imgdir_attach = vB_Template_Runtime::fetchStyleVar('imgdir_attach');
		if (!preg_match('#^[a-z]+:#siU', vB_Template_Runtime::fetchStyleVar('imgdir_attach')))
		{
			if ($imgdir_attach[0] == '/')
			{
				$url = parse_url($this->registry->options['bburl']);
				vB_Template_Runtime::addStyleVar('imgdir_attach', 'http://' . $url['host'] . vB_Template_Runtime::fetchStyleVar('imgdir_attach'), 'imgdir');
			}
			else
			{
				vB_Template_Runtime::addStyleVar('imgdir_attach', $this->registry->options['bburl'] . '/' . vB_Template_Runtime::fetchStyleVar('imgdir_attach'), 'imgdir');
			}
		}

		if ($this->blog['userid'])
		{
			$this->process_registered_user();
		}
		else
		{
			$this->process_unregistered_user();
		}

		$this->process_date_status();
		$this->process_display();
		$this->process_text();
		$this->process_attachments();
		$this->prepare_end();

		// actual display...
		$blog = $this->blog;
		$status =& $this->status;

		if ($this->attachments)
		{
			$search = '#(href|src)="attachment\.php#si';
			$replace = '\\1="' . $this->registry->options['bburl'] . '/' . 'attachment.php';
			$items = array(
				't' => $blog['thumbnailattachments'],
				'a' => $blog['imageattachments'],
				'l' => $blog['imageattachmentlinks'],
				'o' => $blog['otherattachments'],
			);

			$newitems = preg_replace($search, $replace, $items);
			unset($items);
			$blog['thumbnailattachments'] = $newitems['t'];
			$blog['imageattachments'] = $newitems['a'];
			$blog['imageattachmentlinks'] = $newitems['l'];
			$blog['otherattachments'] = $newitems['o'];
		}

		global $show, $vbphrase;
		global $spacer_open, $spacer_close;

		global $bgclass, $altbgclass;
		exec_switch_bg();

		$show['readmore'] = $this->readmore;

		$sessionurl = $this->registry->session->vars['sessionurl'];
		$this->registry->session->vars['sessionurl'] = '';

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

		$templater = vB_Template::create($this->template);
			$templater->register('blog', $blog);
			$templater->register('status', $status);
		$output = $templater->render();

		$this->registry->session->vars['sessionurl'] = $sessionurl;
		vB_Template_Runtime::addStyleVar('imgdir_attach', $imgdir_attach, 'imgdir');

		return $output;
	}
Esempio n. 14
0
	/**
	* Template method that does all the work to display an issue note, including processing the template
	*
	* @return	string	Templated note output
	*/
	function construct()
	{
		global $vbulletin;

		($hook = vBulletinHook::fetch_hook('blog_comment_display_start')) ? eval($hook) : false;
		// preparation for display...
		$this->prepare_start();

		if ($this->response['userid'])
		{
			$this->process_registered_user();
		}
		else
		{
			$this->process_unregistered_user();
		}

		$this->process_date_status();
		$this->process_display();
		$this->process_text();
		$this->prepare_end();

		// actual display...
		$bloginfo =& $this->bloginfo;
		$response =& $this->response;

		global $show, $vbphrase;
		global $spacer_open, $spacer_close;

		global $bgclass, $altbgclass;
		exec_switch_bg();

		$show['readmore'] = $this->readmore;

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

		$this->response['blogtitle'] = $this->bloginfo['title'];

		$pageinfo_ip = array(
			'do' => 'viewip',
			'bt' => $this->response['blogtextid'],
		);

		$templater = vB_Template::create($this->template);
		$templater->register('response', $response);
		$templater->register('pageinfo', $this->pageinfo);
		$templater->register('pageinfo_ip', $pageinfo_ip);

		if ($vbulletin->products['vbcms'])
		{

			require_once(DIR . '/includes/class_bootstrap_framework.php');
			vB_Bootstrap_Framework::init();

			if (! isset(vB::$vbulletin->userinfo['permissions']['cms']))
			{
				require_once DIR . '/packages/vbcms/permissions.php';
				vBCMS_Permissions::getUserPerms();
			}

			if (count(vB::$vbulletin->userinfo['permissions']['cms']['cancreate']))
			{
				$templater->register('promote_sectionid', vB::$vbulletin->userinfo['permissions']['cms']['canpublish'][0]);
				$templater->register('articletypeid', vB_Types::instance()->getContentTypeID('vBCms_Article'));
				$promote_url = vB_Route::create('vBCms_Route_Content', '1/addcontent/')->getCurrentURL();
				$promote_url .= (strrpos($promote_url, '?') ? '&' : '?') .
					'contenttypeid=' . vB_Types::instance()->getContentTypeID('vBCms_Article') .
					"&amp;blogcommentid=" . $response['blogtextid'] . '&amp;parentid=1';
				$templater->register('promote_url', $promote_url);
			}
		}


		return $templater->render(($this->registry->GPC['ajax']));
	}
 /**
  * Template method that does all the work to display an issue note, including processing the template
  *
  * @return	string	Templated note output
  */
 function construct()
 {
     // Legacy Hook 'visitor_messagebit_display_start' Removed //
     // preparation for display...
     $this->prepare_start();
     if ($this->message['userid']) {
         $this->process_registered_user();
     } else {
         $this->process_unregistered_user();
     }
     fetch_avatar_from_userinfo($this->message, true);
     $this->process_date_status();
     $this->process_display();
     $this->process_text();
     $this->prepare_end();
     // actual display...
     $userinfo =& $this->userinfo;
     fetch_avatar_from_userinfo($userinfo, true);
     $message =& $this->message;
     global $show, $vbphrase;
     global $spacer_open, $spacer_close;
     global $bgclass, $altbgclass;
     exec_switch_bg();
     $pageinfo_vm_ignored = array('vmid' => $message['vmid'], 'showignored' => 1);
     $pageinfo_vm = array('vmid' => $message['vmid']);
     $messageinfo = array('userid' => $message['profileuserid'], 'username' => $message['profileusername']);
     if (defined('VB_API') && VB_API === true) {
         $message['message'] = strip_tags($message['message']);
     }
     // Legacy Hook 'visitor_messagebit_display_complete' Removed //
     $templater = vB_Template::create($this->template);
     $templater->register('message', $message);
     $templater->register('messageinfo', $messageinfo);
     $templater->register('pageinfo_vm', $pageinfo_vm);
     $templater->register('pageinfo_vm_ignored', $pageinfo_vm_ignored);
     $templater->register('userinfo', $userinfo);
     return $templater->render();
 }