Beispiel #1
0
	public function getInlineEditBodyView()
	{
		global $vbphrase;
		require_once DIR . '/includes/functions_databuild.php';
		require_once DIR . '/includes/functions.php';
		fetch_phrase_group('cpcms');


		$this->editing = true;

		//confirm that the user has edit rights
		if (!$this->content->canEdit() AND !($this->getUserId() == vB::$vbulletin->userinfo['userid'])
			AND !$this->content->canPublish())
		{
			return $vb_phrase['no_edit_permissions'];
		}


		vB::$vbulletin->input->clean_array_gpc('r', array(
			'postid' => vB_Input::TYPE_UINT,
			'blogcommentid' => vB_Input::TYPE_UINT,
			'do' => vB_Input::TYPE_STR,
			'blogid' => TYPE_UINT
		));

		if ($_REQUEST['do'] == 'delete')
		{
			$dm = $this->content->getDM();
			$dm->delete();
			$this->cleanContentCache();
			return $vbphrase['article_deleted'];
		}

		if ($_REQUEST['do'] == 'apply' OR $_REQUEST['do'] == 'update')
		{
			$this->SaveData($view);
		}



		require_once DIR . '/packages/vbcms/contentmanager.php';
		// Load the content item
		if (!$this->loadContent($this->getViewInfoFlags(self::VIEW_PAGE)))
		{
			throw (new vB_Exception_404());
		}

		global $show;

		$show['img_bbcode'] = true;
		// Get smiliecache and bbcodecache
		vB::$vbulletin->datastore->fetch(array('smiliecache','bbcodecache'));

		// Create view
		$view = $this->createView('inline', self::VIEW_PAGE);

		// Add the content to the view
		$view = $this->populateViewContent($view, self::VIEW_PAGE, false);
		$pagetext = $this->content->getPageText();
		// Get postings phrasegroup
		// need posting group
		require_once DIR . '/includes/functions_databuild.php';
		fetch_phrase_group('posting');

		// Build editor
		global $messagearea;
		require_once DIR . '/includes/functions_file.php';
		require_once DIR . '/includes/functions_editor.php';
		require_once(DIR . '/packages/vbattach/attach.php');

		$view->formid = "cms_content_data";
		$view->can_edit = $this->content->canEdit();

		if ($this->content->canEdit())
		{
			$attach = new vB_Attach_Display_Content(vB::$vbulletin, 'vBCms_Article');
			//this will set a number of its parameters if they are not already set.
			$posthash = null;
			$poststarttime = null;
			$postattach = array();
			$attachcount = 0;

			$values = "values[f]=" . $this->content->getNodeId() ;

			$attachmentoption = $attach->fetch_edit_attachments($posthash, $poststarttime, $postattach, $this->content->getNodeId(), $values, '', $attachcount);

			$attachinfo = fetch_attachmentinfo($posthash, $poststarttime, $this->getContentTypeId(), array('f' => $this->content->getNodeId()));

			$view->editorid = construct_edit_toolbar(
				$pagetext,
				false,
				new vBCms_Editor_Override(vB::$vbulletin),
				true,
				true,
				true,
				'cms_article',
				'',
				$attachinfo
			);


			$templater = vB_Template::create('vbcms_article_editor');
			$templater->register('attachmentoption', $attachmentoption);
			$templater->register('attachmentoption', $attachmentoption);
			$templater->register('posthash', $posthash);
			$templater->register('poststarttime', $poststarttime);
			$templater->register('contenttypeid', $this->getContentTypeId());
			$templater->register('values', $values);
			$templater->register('contentid', $this->content->getNodeId());
			$templater->register('insertinline ', 1);
			$templater->register('checked', $checked);
			$templater->register('disablesmiliesoption', $disablesmiliesoption);
			$templater->register('editorid', $view->editorid);
			$templater->register('messagearea', $messagearea);
			$tag_delimiters = addslashes_js(vB::$vbulletin->options['tagdelimiter']);
			$templater->register('tag_delimiters', $tag_delimiters);
			$content = $templater->render();
			$view->editor = $content;
		}
		else
		{
			$view->previewtext = $this->content->getPreviewText();;
		}

		$view->url = $this->content->getUrl();
		$view->type = new vB_Phrase('vbcms', 'content');
		$view->adding = 	new vB_Phrase('cpcms', 'adding_x', $vbphrase['article']);
		$view->html_title = $this->content->getHtmlTitle();
		$view->title = $this->content->getTitle();
		$view->metadata = $this->content->getMetadataEditor();
		$segments = array('node' => $this->content->getUrlSegment(),
							'action' => vB_Router::getUserAction('vBCms_Controller_Content', 'View'));
		$view->view_url = vBCms_Route_Content::getURL($segments);
		// Add URL to submit to
		$segments = array('node' => $this->content->getUrlSegment(),
							'action' => vB_Router::getUserAction('vBCms_Controller_Content', 'EditPage'));
		$view->submit_url = vBCms_Route_Content::getURL($segments);
		$segments = array('node' => $this->content->getUrlSegment(),
							'action' => vB_Router::getUserAction('vBCms_Controller_Content', 'View'));
		$view->editbar = $this->content->getEditBar($view->submit_url, vBCms_Route_Content::getURL($segments), $view->formid);

		$view->publisher = $this->content->getPublishEditor($view->submit_url, $view->formid,
			true, true, $this->content->getPublicPreview(), $this->content->getComments_Enabled());
		$view->authorid = ($this->content->getUserId());
		$view->authorname = ($this->content->getUsername());
		$view->viewcount = ($this->content->getViewCount());
		$view->parentid = $this->content->getParentId();
		$view->post_started = ($this->content->getPostStarted());
		$view->post_posted = ($this->content->getPostPosted());

		$view->comment_count = ($this->content->getReplyCount());
		$view->contentid = $this->content->getContentId(true);

		$view->show_threaded = true;
		$view->per_page = 10;
		$view->indent_per_level = 5;
		$view->max_level = 4;
		// Add form check
		$this->addPostId($view);
		return $view;
	}
Beispiel #2
0
                 $pm['recipients'] = '';
             } else {
                 $pm['recipients'] = implode(' ; ', $recipients);
             }
         }
         ($hook = vBulletinHook::fetch_hook('private_newpm_blank')) ? eval($hook) : false;
     }
     construct_checkboxes(array('savecopy' => true, 'parseurl' => true, 'signature' => iif($vbulletin->userinfo['signature'] !== '', true)));
     $show['bcclink'] = true;
 }
 $folderjump = construct_folder_jump(0, $pm['folderid']);
 $posticons = construct_icons($pm['iconid'], $vbulletin->options['privallowicons']);
 require_once DIR . '/includes/functions_editor.php';
 // set message box width to usercp size
 $stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
 $editorid = construct_edit_toolbar($pm['message'], 0, 'privatemessage', iif($vbulletin->options['privallowsmilies'], 1, 0));
 // generate navbar
 if ($pm['pmid']) {
     $navbits['private.php?' . $vbulletin->session->vars['sessionurl'] . "folderid={$pm['folderid']}"] = $foldernames["{$pm['folderid']}"];
     $navbits['private.php?' . $vbulletin->session->vars['sessionurl'] . "do=showpm&pmid={$pm['pmid']}"] = $pm['title'];
     $navbits[''] = iif($pm['forward'], $vbphrase['forward_message'], $vbphrase['reply_to_private_message']);
 } else {
     $navbits[''] = $vbphrase['post_new_private_message'];
 }
 $show['sendmax'] = iif($permissions['pmsendmax'], true, false);
 $show['sendmultiple'] = $permissions['pmsendmax'] != 1;
 $show['parseurl'] = $vbulletin->options['privallowbbcode'];
 // build forum rules
 $bbcodeon = iif($vbulletin->options['privallowbbcode'], $vbphrase['on'], $vbphrase['off']);
 $imgcodeon = iif($vbulletin->options['privallowbbimagecode'], $vbphrase['on'], $vbphrase['off']);
 $htmlcodeon = iif($vbulletin->options['privallowhtml'], $vbphrase['on'], $vbphrase['off']);
Beispiel #3
0
if ($_REQUEST['do'] == 'quickedit')
{
	$vbulletin->input->clean_array_gpc('p', array(
		'editorid' => TYPE_NOHTML,
	));

	require_once(DIR . '/includes/class_xml.php');
	require_once(DIR . '/includes/functions_editor.php');

	$vminfo = verify_visitormessage($vbulletin->GPC['vmid']);

	$editorid = construct_edit_toolbar(
		htmlspecialchars_uni($vminfo['pagetext']),
		false,
		'visitormessage',
		true,
		true,
		false,
		'qenr',
		$vbulletin->GPC['editorid']
	);

	$xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');

	$xml->add_group('quickedit');
	$xml->add_tag('editor', process_replacement_vars($messagearea), array(
		'reason'       => '',
		'parsetype'    => 'visitormessage',
		'parsesmilies' => true,
		'mode'         => $show['is_wysiwyg_editor']
	));
	$xml->close_group();
Beispiel #4
0
			$attachmentoption = $attach->fetch_edit_attachments($posthash, $poststarttime, $postattach, 0, $values, $vbulletin->GPC['editorid'], $attachcount);
			$contenttypeid = $attach->fetch_contenttypeid();
		}
		else
		{
			$attachmentoption = '';
			$contenttypeid = 0;
		}

		// This function creates the global var $messagearea, that is used below
		construct_edit_toolbar(
			htmlspecialchars_uni($postinfo['pagetext']),
			0,
			$foruminfo['forumid'],
			$forum_allowsmilies,
			$postinfo['allowsmilie'],
			false,
			'qe',
			$vbulletin->GPC['editorid'],
			array(),
			'forum'
		);

		$xml->add_group('quickedit');
			$xml->add_tag('editor', process_replacement_vars($messagearea), array(
				'reason'       => $postinfo['edit_reason'],
				'parsetype'    => $foruminfo['forumid'],
				'parsesmilies' => $editor_parsesmilies,
				'mode'         => $show['is_wysiwyg_editor'],
				'content'      => 'forum'
			));
			if ($contenttypeid)
Beispiel #5
0
 $templater->register('tueboxchecked', $tueboxchecked);
 $templater->register('wedboxchecked', $wedboxchecked);
 $templater->register('weeklybox', $weeklybox);
 $templater->register('yearlycombo1', $yearlycombo1);
 $templater->register('yearlycombo2', $yearlycombo2);
 $templater->register('yearlycombo3', $yearlycombo3);
 $templater->register('yearlycombo4', $yearlycombo4);
 $templater->register('yearlycombo5', $yearlycombo5);
 $recurrence .= $templater->render();
 $show['deleteoption'] = false;
 // Make Rest of Nav Bar
 $navbits[''] = $vbphrase['add_new_event'];
 $navbits = construct_navbits($navbits);
 $navbar = render_navbar_template($navbits);
 require_once DIR . '/includes/functions_editor.php';
 $editorid = construct_edit_toolbar('', 0, 'calendar', $calendarinfo['allowsmilies'], true, false, 'fe', '', array(), 'content', 'vBForum_Calendar', 0, 0, false, true, 'titlefield');
 $dstchecked = 'checked="checked"';
 $show['parseurl'] = $calendarinfo['allowbbcode'];
 $show['misc_options'] = ($show['parseurl'] or !empty($disablesmiliesoption));
 $show['additional_options'] = ($show['misc_options'] or $show['custom_optional']);
 ($hook = vBulletinHook::fetch_hook('calendar_add_complete')) ? eval($hook) : false;
 $templater = vB_Template::create('calendar_edit');
 $templater->register_page_templates();
 $templater->register('calendarinfo', $calendarinfo);
 $templater->register('customfields_optional', $customfields_optional);
 $templater->register('customfields_required', $customfields_required);
 $templater->register('disablesmiliesoption', $disablesmiliesoption);
 $templater->register('dstchecked', $dstchecked);
 $templater->register('editorid', $editorid);
 $templater->register('eventinfo', $eventinfo);
 $templater->register('forumrules', $forumrules);
Beispiel #6
0
                $threadpms .= $postbit_obj->construct_postbit($threadpm);
            }
        }
    }
    // generate navbar
    $navbits['private.php?' . $vbulletin->session->vars['sessionurl'] . "folderid={$pm['folderid']}"] = $foldernames["{$pm['folderid']}"];
    $navbits[''] = $pm['title'];
    $pm['original_title'] = $pm['title'];
    if ($show['quickreply']) {
        // get pm info
        require_once DIR . '/includes/functions_newpost.php';
        $pm = fetch_privatemessage_reply($pm);
        // create quick reply editor
        require_once DIR . '/includes/functions_editor.php';
        $stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
        $editorid = construct_edit_toolbar($pm['message'], false, 'privatemessage', $vbulletin->options['privallowsmilies'], true, false, 'qr_pm');
        $pm['savecopy'] = $vbulletin->userinfo['pmdefaultsavecopy'];
    }
    // report pm icon?
    $show['reportlink'] = (($vbulletin->options['rpforumid'] or $vbulletin->options['enableemail'] and $vbulletin->options['rpemail']) and $vbulletin->userinfo['userid'] != $pm['fromuserid']);
    $templatename = 'pm_showpm';
}
// ############################# start pm message history #############################
if ($_REQUEST['do'] == 'showhistory') {
    require_once DIR . '/includes/class_postbit.php';
    require_once DIR . '/includes/functions_bigthree.php';
    $vbulletin->input->clean_gpc('r', array('pmid' => TYPE_UINT));
    require_once DIR . '/includes/class_xml.php';
    $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
    $xml->add_group('response');
    if ($vbulletin->userinfo['userid'] and $vbulletin->GPC['pmid']) {
Beispiel #7
0
		}
		else
		{
			$optionselected = '';
			$optionclass = '';
		}
		$forum_options .= render_option_template($optiontitle, $optionvalue, $optionselected, $optionclass);
	}

	$post =& $announcementinfo;

	// build editor
	$editorid = construct_edit_toolbar(
		$announcementinfo['pagetext'],
		0, // is html?
		'announcement', // forumid
		true, // allow smilies
		($announcementinfo['announcementoptions'] & $vbulletin->bf_misc_announcementoptions['allowsmilies']) ? 1 : 0 // parse smilies
	);

	// build navbar
	$navbits = array();

	if ($announcementinfo['forumid'] == -1)
	{
		$navbits["announcement.php?" . $vbulletin->session->vars['sessionurl'] . "do=view&a=$announcementinfo[announcementid]"] = $vbphrase['global_announcement'];
	}
	else
	{
		$foruminfo =& $vbulletin->forumcache["$announcementinfo[forumid]"];
		$parentlist = array_reverse(explode(',', substr($foruminfo['parentlist'], 0, -3)));
Beispiel #8
0
// Only allow AJAX QC on the first page
$show['quickcomment'] = ($vbulletin->userinfo['userid'] and $viewself and $vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_visitor_messaging'] and $userinfo['vm_enable'] and $userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canviewmembers'] and (!$userinfo['vm_contactonly'] or $userinfo['userid'] == $vbulletin->userinfo['userid'] or $userinfo['bbuser_iscontact_of_user'] or can_moderate(0, 'canmoderatevisitormessages')) and ($userinfo['userid'] == $vbulletin->userinfo['userid'] and $vbulletin->userinfo['permissions']['visitormessagepermissions'] & $vbulletin->bf_ugp_visitormessagepermissions['canmessageownprofile'] or $userinfo['userid'] != $vbulletin->userinfo['userid'] and $vbulletin->userinfo['permissions']['visitormessagepermissions'] & $vbulletin->bf_ugp_visitormessagepermissions['canmessageothersprofile']));
$show['post_visitor_message'] = $show['quickcomment'];
$show['allow_ajax_qc'] = ($pagenumber == 1 and $messagetotal) ? 1 : 0;
$pagenavbits = array("u={$userinfo['userid']}", "u2={$userinfo2['userid']}");
if ($perpage != $vbulletin->options['vm_perpage']) {
    $pagenavbits[] = "pp={$perpage}";
}
if ($vbulletin->GPC['showignored']) {
    $pagenavbits[] = 'showignored=1';
}
$pagenavurl = 'converse.php?' . $vbulletin->session->vars['sessionurl'] . implode('&', $pagenavbits);
$block_data['pagenav'] = construct_page_nav($pagenumber, $perpage, $messagetotal, $pagenavurl, '');
if ($show['quickcomment']) {
    require_once DIR . '/includes/functions_editor.php';
    $block_data['editorid'] = construct_edit_toolbar('', false, 'visitormessage', $vbulletin->options['allowsmilies'], true, false, 'qr_small', '', array(), 'content', 'vBForum_VisitorMessage', 0, $userinfo['userid']);
    $block_data['messagearea'] =& $messagearea;
    $block_data['clientscript'] = $vBeditTemplate['clientscript'];
}
$navbits = construct_navbits(array(fetch_seo_url('member', $userinfo) => $userinfo['username'], '' => construct_phrase($vbphrase['conversation_between_x_and_y'], $userinfo['username'], $userinfo2['username'])));
$navbar = render_navbar_template($navbits);
$usercss = construct_usercss($userinfo, $show['usercss_switch']);
$show['usercss_switch'] = ($show['usercss_switch'] and $vbulletin->userinfo['userid'] != $userinfo['userid']);
construct_usercss_switch($show['usercss_switch'], $usercss_switch_phrase);
($hook = vBulletinHook::fetch_hook('converse_complete')) ? eval($hook) : false;
$templater = vB_Template::create('memberinfo_block_visitormessaging');
$templater->register('block_data', $block_data);
$templater->register('prepared', $prepared);
$templater->register('userinfo', $userinfo);
$templater->register('userinfo2', $userinfo2);
$html = $templater->render();
Beispiel #9
0
        require_once DIR . '/includes/functions_editor.php';
        require_once DIR . '/includes/functions_attach.php';
        $posthash = md5(TIMENOW . $vbulletin->userinfo['userid'] . $vbulletin->userinfo['salt']);
        $poststarttime = TIMENOW;
        // Use our permission to attach or the person who owns the post? check what vB does in this situation
        if ($vbulletin->userinfo['permissions']['vbblog_entry_permissions'] & $vbulletin->bf_ugp_vbblog_entry_permissions['blog_canpostattach']) {
            $values = "values[blogid]={$bloginfo['blogid']}";
            require_once DIR . '/packages/vbattach/attach.php';
            $attach = new vB_Attach_Display_Content($vbulletin, 'vBBlog_BlogEntry');
            $attachmentoption = $attach->fetch_edit_attachments($posthash, $poststarttime, $postattach, $bloginfo['blogid'], $values, $vbulletin->GPC['editorid'], $attachcount);
            $contenttypeid = $attach->fetch_contenttypeid();
        } else {
            $attachmentoption = '';
            $contenttypeid = 0;
        }
        $editorid = construct_edit_toolbar(htmlspecialchars_uni($bloginfo['pagetext']), false, 'blog_entry', $vbulletin->userinfo['permissions']['vbblog_entry_permissions'] & $vbulletin->bf_ugp_vbblog_entry_permissions['blog_allowsmilies'], $bloginfo['allowsmilie'], false, 'qe', $vbulletin->GPC['editorid']);
        require_once DIR . '/includes/functions_file.php';
        $xml->add_group('quickedit');
        $xml->add_tag('editor', $messagearea, array('reason' => $bloginfo['edit_reason'], 'parsetype' => 'blog_entry', 'parsesmilies' => $vbulletin->userinfo['permissions']['vbblog_comment_permissions'] & $vbulletin->bf_ugp_vbblog_comment_permissions['blog_allowsmilies'], 'mode' => $show['is_wysiwyg_editor']));
        add_ajax_attachment_xml($xml, $contenttypeid, $posthash, $poststarttime, array('b' => $bloginfo['blogid']));
        $xml->close_group();
        $xml->print_xml();
    }
}
// #############################################################################
// retrieve a calendar
if ($_POST['do'] == 'calendar') {
    $vbulletin->input->clean_array_gpc('p', array('month' => TYPE_UINT, 'year' => TYPE_UINT, 'userid' => TYPE_UINT));
    $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
    // can't view any blogs, no need for a calendar
    if (!($vbulletin->userinfo['permissions']['vbblog_general_permissions'] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewown']) and !($vbulletin->userinfo['permissions']['vbblog_general_permissions'] & $vbulletin->bf_ugp_vbblog_general_permissions['blog_canviewothers'])) {
Beispiel #10
0
     $show['poll'] = false;
 }
 $attachcount = 0;
 if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] and $vbulletin->userinfo['userid'] and !empty($vbulletin->userinfo['attachmentextensions'])) {
     $values = "values[f]={$foruminfo['forumid']}";
     require_once DIR . '/packages/vbattach/attach.php';
     $attach = new vB_Attach_Display_Content($vbulletin, 'vBForum_Post');
     $attachmentoption = $attach->fetch_edit_attachments($posthash, $poststarttime, $postattach, 0, $values, $editorid, $attachcount);
     $contenttypeid = $attach->fetch_contenttypeid();
 } else {
     $attachmentoption = '';
     $contenttypeid = 0;
 }
 require_once DIR . '/includes/functions_file.php';
 $attachinfo = fetch_attachmentinfo($posthash, $poststarttime, $contenttypeid, array('f' => $foruminfo['forumid']));
 $editorid = construct_edit_toolbar($newpost['message'], 0, $foruminfo['forumid'], $foruminfo['allowsmilies'], 1, $forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] and $vbulletin->userinfo['userid'] and !empty($vbulletin->userinfo['attachmentextensions']), 'fe', '', $attachinfo, 'forum');
 $subject = $newpost['title'];
 // display prefixes
 require_once DIR . '/includes/functions_prefix.php';
 $prefix_options = fetch_prefix_html($foruminfo['forumid'], $newpost['prefixid'], true);
 // get username code
 $usernamecode = vB_Template::create('newpost_usernamecode')->render();
 $show['podcasturl'] = $foruminfo['podcast'];
 // can this user open / close this thread?
 if ($vbulletin->userinfo['userid'] and $forumperms & $vbulletin->bf_ugp_forumpermissions['canopenclose'] or can_moderate($foruminfo['forumid'], 'canopenclose')) {
     $threadinfo['open'] = 1;
     $show['openclose'] = true;
     $show['closethread'] = true;
 } else {
     $show['openclose'] = false;
 }
Beispiel #11
0
			array(
				'parseurl'       => true,
				'disablesmilies' => ($sidebarinfo AND !$sidebarinfo['allowsmilie'])
		));
	}

	if ($sidebarinfo)
	{
		$show['delete'] = true;
		$show['edit'] = true;
	}

	$editorid = construct_edit_toolbar(
		$customblock['message'],
		false,
		'blog_entry',
		$userinfo['permissions']['vbblog_entry_permissions'] & $vbulletin->bf_ugp_vbblog_entry_permissions['blog_allowsmilies'],
		true,
		false
	);
	$usernamecode = vB_Template::create('newpost_usernamecode')->render();

	if ($type == 'block')
	{
		$blocks['count'] = $userinfo['customblocks'];
		$blocklimit = $userinfo['permissions']['vbblog_customblocks'];
		$show['block'] = true;
	}
	else
	{
		$blocklimit = $userinfo['permissions']['vbblog_custompages'];
	}
Beispiel #12
0
 if (empty($postarray)) {
     eval(standard_error(fetch_error('no_applicable_posts_selected')));
 } else {
     if (count($postarray) == 1) {
         eval(standard_error(fetch_error('not_much_would_be_accomplished_by_merging')));
     }
 }
 $postcount = count($postarray);
 $threadcount = count($threadlist);
 $forumcount = count($forumlist);
 if ($previewpost) {
     $pagetext = htmlspecialchars_uni($edit['message']);
 } else {
     $pagetext = htmlspecialchars_uni($pagetext);
 }
 $editorid = construct_edit_toolbar($pagetext, 0, $foruminfo['forumid'], iif($foruminfo['allowsmilies'], 1, 0), 1);
 $usernamebit = '';
 if (count($userselect) > 1) {
     $guests = array();
     uasort($userselect, 'strnatcasecmp');
     // alphabetically sort usernames
     foreach ($userselect as $optionvalue => $optiontitle) {
         preg_match('#^(\\d+)\\|(.+)$#', $optionvalue, $matches);
         if (!intval($matches[1])) {
             $guests[] = $optiontitle;
         } else {
             $optionselected = $optionvalue == "{$userid}|{$username}" ? "selected='selected'" : "";
             eval('$usernamebit .= "' . fetch_template('option') . '";');
         }
     }
     if (!empty($guests)) {
Beispiel #13
0
		$contenttypeid = vB_Types::instance()->getContentTypeID('vBForum_Post');
	}
	else
	{
		$contenttypeid = 0;
	}

	require_once(DIR . '/includes/functions_file.php');
	$attachinfo = fetch_attachmentinfo($posthash, $poststarttime, $contenttypeid, array('t' => $threadinfo['threadid']));

	$editorid = construct_edit_toolbar(
		'',
		0,
		$foruminfo['forumid'],
		($foruminfo['allowsmilies'] ? 1 : 0),
		1,
		false,
		'qr',
		'',
		$attachinfo,
		'forum'
	);
	$messagearea = "
		<script type=\"text/javascript\">
		<!--
			var threaded_mode = $threadedmode;
			var require_click = $show[qr_require_click];
			var is_last_page = $show[allow_ajax_qr]; // leave for people with cached JS files
			var allow_ajax_qr = $show[allow_ajax_qr];
			var last_post_id = $LASTPOSTID;
			var ajax_last_post = " . intval($effective_lastpost) . ";
		// -->
Beispiel #14
0
         }
     }
     if ($_GET['do'] == 'edit' and isset($file)) {
         $_POST = $file;
         $_POST['dname'] = $file['name'];
         $_POST['url'] = $vbulletin->input->clean($file['url'], TYPE_NOHTML);
     }
     if ($_POST['pin'] == 1) {
         $pinned = 'selected="selected"';
         $unpinned = '';
     } else {
         $pinned = '';
         $unpinned = 'selected="selected"';
     }
     // Get the message editor for the description
     $editorid = construct_edit_toolbar(htmlspecialchars_uni($file['description']), 0, 'nonforum', iif($vbulletin->options['privallowsmilies'], 1, 0));
     $category_array = $dl->construct_select_array(0, array('' => '----------'), '');
     foreach ($category_array as $cat_key => $cat_value) {
         if ($_POST['category'] == $cat_key or $_GET['cat'] == $cat_key) {
             $selected = 'selected="selected"';
         } else {
             $selected = '';
         }
         $category_select .= '<option value="' . $cat_key . '" ' . $selected . '>' . $cat_value . '</option>';
     }
     eval('$dmain_jr = "' . fetch_template('downloads_file_addit') . '";');
     eval('$dmain .= "' . fetch_template('downloads_wrapper_top') . '";');
 } else {
     if ($_GET['do'] == 'manfiles') {
         $navbits['downloads.php?do=manfiles'] = $vbphrase['ecdownloads_manage_files'];
         $dlcustomtitle = $vbphrase['ecdownloads_manage_files'];
Beispiel #15
0
    // set show signature hidden field
    $showsig = iif($vbulletin->userinfo['signature'], 1, 0);
    // set quick reply initial id
    if ($threadedmode == 1) {
        $qrpostid = $curpostid;
        $show['qr_require_click'] = 0;
    } else {
        if ($vbulletin->options['quickreply'] == 2) {
            $qrpostid = 0;
            $show['qr_require_click'] = 1;
        } else {
            $qrpostid = 'who cares';
            $show['qr_require_click'] = 0;
        }
    }
    $editorid = construct_edit_toolbar('', 0, $foruminfo['forumid'], $foruminfo['allowsmilies'] ? 1 : 0, 1, false, 'qr');
    $messagearea = "\n\t\t<script type=\"text/javascript\">\n\t\t<!--\n\t\t\tvar threaded_mode = {$threadedmode};\n\t\t\tvar require_click = {$show['qr_require_click']};\n\t\t\tvar is_last_page = {$show['allow_ajax_qr']}; // leave for people with cached JS files\n\t\t\tvar allow_ajax_qr = {$show['allow_ajax_qr']};\n\t\t\tvar ajax_last_post = " . intval($effective_lastpost) . ";\n\t\t// -->\n\t\t</script>\n\t\t{$messagearea}\n\t";
    if (is_browser('mozilla') and $show['wysiwyg'] == 2) {
        // Mozilla WYSIWYG can't have the QR collapse button,
        // so remove that and force QR to be expanded
        $show['quickreply_collapse'] = false;
        unset($vbcollapse["collapseobj_quickreply"], $vbcollapse["collapseimg_quickreply"], $vbcollapse["collapsecel_quickreply"]);
    } else {
        $show['quickreply_collapse'] = true;
    }
} else {
    if ($show['ajax_js']) {
        require_once DIR . '/includes/functions_editor.php';
        $vBeditJs = construct_editor_js_arrays();
        // check that $editor_css has been built
        if (!isset($GLOBALS['editor_css'])) {
Beispiel #16
0
 $entry_handler =& $entry_factory->create($bloginfo);
 $entry_handler->attachments = $postattach;
 $entry_handler->userinfo = $bloginfo;
 $entry_handler->construct();
 $blog =& $entry_handler->blog;
 $status =& $entry_handler->status;
 // *********************************************************************************
 // save parsed post HTML
 if (!empty($saveparsed)) {
     $db->shutdown_query("\r\n\t\t\tREPLACE INTO " . TABLE_PREFIX . "blog_textparsed (blogtextid, dateline, hasimages, pagetexthtml, styleid, languageid)\r\n\t\t\tVALUES {$saveparsed}\r\n\t\t");
     unset($saveparsed);
 }
 // quick comment
 if ($show['quickcomment']) {
     require_once DIR . '/includes/functions_editor.php';
     $editorid = construct_edit_toolbar('', false, 'blog_comment', $vbulletin->userinfo['permissions']['vbblog_comment_permissions'] & $vbulletin->bf_ugp_vbblog_comment_permissions['blog_allowsmilies'], true, false, 'qr');
     $show['ajax_js'] = true;
 } else {
     if ($vbulletin->options['quickedit']) {
         $templater = vB_Template::create('editor_clientscript');
         $vBeditTemplate['clientscript'] = $templater->render();
         $show['ajax_js'] = true;
     }
 }
 $show['quickedit'] = $vbulletin->options['quickedit'];
 // get ignored users
 $ignore = array();
 if (trim($vbulletin->userinfo['ignorelist'])) {
     $ignorelist = preg_split('/( )+/', trim($vbulletin->userinfo['ignorelist']), -1, PREG_SPLIT_NO_EMPTY);
     foreach ($ignorelist as $ignoreuserid) {
         $ignore["{$ignoreuserid}"] = 1;
Beispiel #17
0
if ($_REQUEST['do'] == 'newnote') {
    if (!$canpost) {
        print_no_permission();
    }
    if (empty($checked['parseurl'])) {
        $checked['parseurl'] = 'checked="checked"';
    }
    if ($vbulletin->options['unallowsmilies'] == 1) {
        $templater = vB_Template::create('newpost_disablesmiliesoption');
        $templater->register('checked', $checked);
        $disablesmiliesoption = $templater->render();
    }
    $show['editnote'] = false;
    // include useful functions
    require_once DIR . '/includes/functions_newpost.php';
    $editorid = construct_edit_toolbar($eventinfo['event'], 0, 'usernote');
    // generate navbar
    $navbits = array(fetch_seo_url('member', $userinfo) => $vbphrase['view_profile'], 'usernote.php?' . $vbulletin->session->vars['sessionurl'] . "u={$userinfo['userid']}" => construct_phrase($vbphrase['user_notes_for_x'], $userinfo['username']), $vbphrase['post_user_note']);
    $navbits = construct_navbits($navbits);
    $navbar = render_navbar_template($navbits);
    $show['parseurl'] = $vbulletin->options['unallowvbcode'];
    $show['misc_options'] = ($show['parseurl'] or !empty($disablesmiliesoption));
    ($hook = vBulletinHook::fetch_hook('usernote_newnote')) ? eval($hook) : false;
    $templater = vB_Template::create('usernote_note');
    $templater->register_page_templates();
    $templater->register('checked', $checked);
    $templater->register('disablesmiliesoption', $disablesmiliesoption);
    $templater->register('editorid', $editorid);
    $templater->register('forumjump', $forumjump);
    $templater->register('forumrules', $forumrules);
    $templater->register('messagearea', $messagearea);
Beispiel #18
0
function quickReply()
{
    global $vbulletin;
    // *********************************************************************************
    // build quick reply if appropriate
    if ($show['quickreply']) {
        require_once DIR . '/includes/functions_editor.php';
        $show['wysiwyg'] = $forum['allowbbcode'] ? is_wysiwyg_compatible() : 0;
        $istyles_js = construct_editor_styles_js();
        // set show signature hidden field
        $showsig = iif($vbulletin->userinfo['signature'], 1, 0);
        // set quick reply initial id
        if ($threadedmode == 1) {
            $qrpostid = $curpostid;
            $show['qr_require_click'] = 0;
        } else {
            if ($vbulletin->options['quickreply'] == 2) {
                $qrpostid = 0;
                $show['qr_require_click'] = 1;
            } else {
                $qrpostid = 'who cares';
                $show['qr_require_click'] = 0;
            }
        }
        $editorid = construct_edit_toolbar('', 0, $foruminfo['forumid'], $foruminfo['allowsmilies'] ? 1 : 0, 1, false, 'qr');
        $messagearea = "\n\t\t\t<script type=\"text/javascript\">\n\t\t\t<!--\n\t\t\t\tvar threaded_mode = {$threadedmode};\n\t\t\t\tvar require_click = {$show['qr_require_click']};\n\t\t\t\tvar is_last_page = {$show['allow_ajax_qr']}; // leave for people with cached JS files\n\t\t\t\tvar allow_ajax_qr = {$show['allow_ajax_qr']};\n\t\t\t\tvar ajax_last_post = " . intval($effective_lastpost) . ";\n\t\t\t// -->\n\t\t\t</script>\n\t\t\t{$messagearea}\n\t\t";
        if (is_browser('mozilla') and $show['wysiwyg'] == 2) {
            // Mozilla WYSIWYG can't have the QR collapse button,
            // so remove that and force QR to be expanded
            $show['quickreply_collapse'] = false;
            unset($vbcollapse["collapseobj_quickreply"], $vbcollapse["collapseimg_quickreply"], $vbcollapse["collapsecel_quickreply"]);
        } else {
            $show['quickreply_collapse'] = true;
        }
    } else {
        if ($show['ajax_js']) {
            require_once DIR . '/includes/functions_editor.php';
            $vBeditJs = construct_editor_js_arrays();
            eval('$vBeditTemplate[\'clientscript\'] = "' . fetch_template('editor_clientscript') . '";');
        }
    }
}
Beispiel #19
0
             construct_checkboxes(array('disablesmilies' => !$messageinfo['allowsmilie'], 'parseurl' => 1));
             $message['message'] = htmlspecialchars_uni($messageinfo['pagetext']);
         } else {
             $message['message'] = '';
         }
     }
     $navbits['group.php?' . $vbulletin->session->vars['sessionurl'] . "groupid={$group['groupid']}"] = $group['name'];
     if ($messageinfo) {
         $show['edit'] = true;
         $show['delete'] = (fetch_socialgroup_modperm('candeletegroupmessages', $group) or fetch_socialgroup_modperm('canremovegroupmessages') or $messageinfo['postuserid'] == $vbulletin->userinfo['userid'] and $vbulletin->userinfo['permissions']['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['canmanagemessages']);
         $navbits[] = $vbphrase['edit_group_message'];
     } else {
         $navbits[] = $vbphrase['post_new_group_message'];
     }
     $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') . '";');
     // auto-parse URL
     if (!isset($checked['parseurl'])) {
         $checked['parseurl'] = 'checked="checked"';
     }
     $show['parseurl'] = $vbulletin->options['allowbbcode'];
     $show['misc_options'] = ($show['parseurl'] or !empty($disablesmiliesoption));
     $show['additional_options'] = ($show['misc_options'] or !empty($attachmentoption));
     $show['physicaldeleteoption'] = can_moderate(0, 'canremovegroupmessages');
     $navbits = construct_navbits($navbits);
     eval('$navbar = "' . fetch_template('navbar') . '";');
     ($hook = vBulletinHook::fetch_hook('group_message_form_complete')) ? eval($hook) : false;
     // complete
     eval('print_output("' . fetch_template('socialgroups_editor') . '");');
 }
Beispiel #20
0
	public function getConfigEditorView()
	{
		require_once DIR . '/includes/functions_databuild.php';
		fetch_phrase_group('posting');

		$config = $this->widget->getConfig();

		require_once DIR . '/includes/functions_editor.php';
		construct_edit_toolbar($config['html'], false, new vBCms_Editor_Override(vB::$vbulletin), true, true, false, 'cms_article');

		return $GLOBALS['messagearea'];
	}
Beispiel #21
0
             $postbit_obj =& $postbit_factory->fetch_postbit('pm');
             $threadpms .= $postbit_obj->construct_postbit($threadpm);
         }
     }
 }
 // generate navbar
 $navbits['private.php?' . $vbulletin->session->vars['sessionurl'] . "folderid={$pm['folderid']}"] = $foldernames["{$pm['folderid']}"];
 $navbits[''] = $pm['title'];
 $pm['original_title'] = $pm['title'];
 if ($show['quickreply']) {
     // get pm info
     require_once DIR . '/includes/functions_newpost.php';
     $pm = fetch_privatemessage_reply($pm);
     // create quick reply editor
     require_once DIR . '/includes/functions_editor.php';
     $editorid = construct_edit_toolbar($pm['message'], false, 'privatemessage', $vbulletin->options['privallowsmilies'], true, false, 'qr_pm', '', array(), 'content', 'vBForum_PrivateMessage', 0, $pm['pmid']);
     $pm['savecopy'] = $vbulletin->userinfo['pmdefaultsavecopy'];
 }
 $includecss['postbit'] = 'postbit.css';
 $includeiecss['postbit'] = 'postbit-ie.css';
 $page_templater = vB_Template::create('pm_showpm');
 $page_templater->register('allowed_bbcode', $allowed_bbcode);
 $page_templater->register('bccrecipients', $bccrecipients);
 $page_templater->register('ccrecipients', $ccrecipients);
 $page_templater->register('editorid', $editorid);
 $page_templater->register('messagearea', $messagearea);
 $page_templater->register('pm', $pm);
 $page_templater->register('postbit', $postbit);
 $page_templater->register('receipt_question_js', $receipt_question_js);
 $page_templater->register('threadpms', $threadpms);
 $page_templater->register('vBeditTemplate', $vBeditTemplate);
Beispiel #22
0
         }
     }
     if (!$foruminfo['allowposting'] and $attachcount == 0) {
         $attachmentoption = '';
         $attach_editor = array();
     } else {
         $attachurl = "p={$postinfo['postid']}&amp;editpost=1";
         $newpost_attachmentbit = prepare_newpost_attachmentbit();
         eval('$attachmentoption = "' . fetch_template('newpost_attachment') . '";');
         $attach_editor['hash'] = $postinfo['postid'];
         $attach_editor['url'] = "newattachment.php?{$session['sessionurl']}p={$postinfo['postid']}&amp;editpost=1&amp;poststarttime={$poststarttime}&amp;posthash={$posthash}";
     }
 } else {
     $attachmentoption = '';
 }
 $editorid = construct_edit_toolbar($newpost['message'], 0, $foruminfo['forumid'], iif($foruminfo['allowsmilies'], 1, 0), ($postinfo['allowsmilie'] and !$edit['disablesmilies']) ? 1 : 0, $forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] and $vbulletin->userinfo['userid'] and $postinfo['userid'] and !empty($vbulletin->userinfo['attachmentextensions']));
 if ($isfirstpost and can_moderate($threadinfo['forumid'], 'canmanagethreads')) {
     $show['deletepostoption'] = true;
 } else {
     if (!$isfirstpost and can_moderate($threadinfo['forumid'], 'candeleteposts')) {
         $show['deletepostoption'] = true;
     } else {
         if (($forumperms & $vbulletin->bf_ugp_forumpermissions['candeletepost'] and !$isfirstpost or $forumperms & $vbulletin->bf_ugp_forumpermissions['candeletethread'] and $isfirstpost) and $vbulletin->userinfo['userid'] == $postinfo['userid']) {
             $show['deletepostoption'] = true;
         } else {
             $show['deletepostoption'] = false;
         }
     }
 }
 if ($foruminfo['podcast'] and $threadinfo['firstpostid'] == $postinfo['postid']) {
     $show['podcasturl'] = true;
Beispiel #23
0
        $yearlycombo5 = array(1 => 'selected="selected"');
        $thistype = 'daily';
        eval('$recurrence .= "' . fetch_template('calendar_edit_recurrence') . '";');
    }
    $class = array();
    exec_switch_bg();
    $class['event'] = $bgclass;
    exec_switch_bg();
    $class['options'] = $bgclass;
    $show['todate'] = $type == 'single' ? false : true;
    $show['deleteoption'] = false;
    // Make Rest of Nav Bar
    $navbits[''] = $vbphrase['add_new_event'];
    $navbits = construct_navbits($navbits);
    eval('$navbar = "' . fetch_template('navbar') . '";');
    $editorid = construct_edit_toolbar('', 0, 'calendar', $calendarinfo['allowsmilies']);
    $dstchecked = 'checked="checked"';
    $show['parseurl'] = $calendarinfo['allowbbcode'];
    $show['misc_options'] = ($show['parseurl'] or !empty($disablesmiliesoption));
    $show['additional_options'] = ($show['misc_options'] or $show['custom_optional']);
    ($hook = vBulletinHook::fetch_hook('calendar_add_complete')) ? eval($hook) : false;
    eval('print_output("' . fetch_template('calendar_edit') . '");');
}
// ############################################################################
// ############################### UPDATE EVENT ###############################
// ############################################################################
if ($_POST['do'] == 'update') {
    $vbulletin->input->clean_array_gpc('p', array('title' => TYPE_STR, 'message' => TYPE_STR, 'parseurl' => TYPE_BOOL, 'disablesmilies' => TYPE_BOOL, 'deletepost' => TYPE_BOOL, 'deletebutton' => TYPE_STR, 'wysiwyg' => TYPE_BOOL, 'timezoneoffset' => TYPE_NUM, 'userfield' => TYPE_ARRAY_STR, 'dst' => TYPE_UINT, 'fromdate' => TYPE_ARRAY_UINT, 'fromtime' => TYPE_ARRAY_STR, 'todate' => TYPE_ARRAY_INT, 'totime' => TYPE_ARRAY_STR, 'recur' => TYPE_ARRAY_UINT, 'type' => TYPE_STR, 'loggedinuser' => TYPE_INT));
    if ($vbulletin->GPC['loggedinuser'] != 0 and $vbulletin->userinfo['userid'] == 0) {
        // User was logged in when writing post but isn't now. If we got this
        // far, guest posts are allowed, but they didn't enter a username so
/**
 * Fetches the AJAX Quick Comment Box for a Picture
 *
 * @param	array	Information Regarding the Picture
 * @param	integer	The current "page" number
 * @param	array	Message Statistics
 *
 */
function fetch_picturecomment_editor($pictureinfo, $pagenumber, $messagestats)
{
	global $vbulletin, $vbphrase, $show;

	// Only allow AJAX QC on the first page
	$show['quickcomment']  = ($vbulletin->userinfo['userid'] AND
		$vbulletin->userinfo['permissions']['albumpermissions'] & $vbulletin->bf_ugp_albumpermissions['canpiccomment']
	);
	$show['allow_ajax_qc'] = (($pagenumber == ceil($messagestats['total'] / $messagestats['perpage'])) AND $messagestats['total']) ? 1 : 0;

	if ($show['quickcomment'])
	{
		require_once(DIR . '/includes/functions_editor.php');

		$editorid = construct_edit_toolbar(
			'',
			false,
			'picturecomment',
			$vbulletin->options['allowsmilies'],
			true,
			false,
			'qr_small'
		);
	}
	else
	{
		$editorid = '';
	}

	return $editorid;
}
Beispiel #25
0
            $show['qr_require_click'] = 1;
        } else {
            $qrpostid = 'who cares';
            $show['qr_require_click'] = 0;
        }
    }
    $posthash = md5(TIMENOW . $vbulletin->userinfo['userid'] . $vbulletin->userinfo['salt']);
    $poststarttime = TIMENOW;
    if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] and $vbulletin->userinfo['userid'] and !empty($vbulletin->userinfo['attachmentextensions'])) {
        $contenttypeid = vB_Types::instance()->getContentTypeID('vBForum_Post');
    } else {
        $contenttypeid = 0;
    }
    require_once DIR . '/includes/functions_file.php';
    $attachinfo = fetch_attachmentinfo($posthash, $poststarttime, $contenttypeid, array('t' => $threadinfo['threadid']));
    $editorid = construct_edit_toolbar('', 0, $foruminfo['forumid'], $foruminfo['allowsmilies'] ? 1 : 0, 1, false, 'qr', '', $attachinfo, 'forum', 'vBForum_Post', 0, $threadinfo['threadid']);
    $messagearea = "\n\t\t<script type=\"text/javascript\">\n\t\t<!--\n\t\t\tvar threaded_mode = {$threadedmode};\n\t\t\tvar require_click = {$show['qr_require_click']};\n\t\t\tvar is_last_page = {$show['allow_ajax_qr']}; // leave for people with cached JS files\n\t\t\tvar allow_ajax_qr = {$show['allow_ajax_qr']};\n\t\t\tvar last_post_id = {$LASTPOSTID};\n\t\t\tvar ajax_last_post = " . intval($effective_lastpost) . ";\n\t\t// -->\n\t\t</script>\n\t\t{$messagearea}\n\t";
    if (is_browser('mozilla') and $show['wysiwyg'] == 2) {
        // Mozilla WYSIWYG can't have the QR collapse button,
        // so remove that and force QR to be expanded
        $show['quickreply_collapse'] = false;
        unset($vbcollapse["collapseobj_quickreply"], $vbcollapse["collapseimg_quickreply"], $vbcollapse["collapsecel_quickreply"]);
    } else {
        $show['quickreply_collapse'] = true;
    }
}
$show['quickedit'] = ($vbulletin->options['quickedit'] and $show['ajax_js']);
// #############################################################################
// make a displayable version of the thread notes
if (!empty($thread['notes'])) {
    $thread['notes'] = str_replace('. ', ".\\n", $thread['notes']);
Beispiel #26
0
	public function getConfigEditorView()
	{
		require_once DIR . '/includes/functions_databuild.php' ;
		fetch_phrase_group('posting');
		global $show;

		require_once DIR . '/includes/functions_editor.php' ;
		require_once(DIR . '/includes/functions_file.php');

		$config = $this->getConfig();


		$attachmentoption = '';
		$attachcount = 0;
		$posthash = 0;
		$poststarttime = 0;
		$postattach = 0;
		$contenttypeid = 0;
		$attachinfo = fetch_attachmentinfo($posthash, $poststarttime, $contenttypeid);

		$view->editorid = construct_edit_toolbar($pagetext, 0, 'blog_entry',1, 1, true,'fe', '', false);

		$templater = vB_Template::create('vbcms_comments_editor');
		$templater->register('attachmentoption', $attachmentoption);
		$templater->register('checked', $checked);
		$templater->register('disablesmiliesoption', $disablesmiliesoption);
		$templater->register('editorid', $view->editorid);
		$templater->register('messagearea', $messagearea);
		$tag_delimiters = addslashes_js(vB::$vbulletin->options['tagdelimiter']);
		$templater->register('tag_delimiters', $tag_delimiters);
		$content = $templater->render();

		return $GLOBALS['messagearea'];
	}
Beispiel #27
0
 if ($photoplog_file_catid > 0 && in_array($photoplog_file_catid, array_keys($photoplog_ds_catopts))) {
     $photoplog_categorybit = $photoplog_ds_catopts["{$photoplog_file_catid}"]['options'];
     $photoplog_catoptions = convert_bits_to_array($photoplog_categorybit, $photoplog_categoryoptions);
     $do_html = $photoplog_catoptions['allowhtml'] ? 1 : 0;
     $do_smilies = $photoplog_catoptions['allowsmilies'] ? 1 : 0;
     $do_bbcode = $photoplog_catoptions['allowbbcode'] ? 1 : 0;
     // this is to show the little image toolbar icon
     $do_imgcode = $photoplog_catoptions['allowimgcode'] ? 1 : 0;
     $vbulletin->options['allowbbimagecode'] = $do_imgcode;
 } else {
     photoplog_output_page('photoplog_error_page', $vbphrase['photoplog_error'], $vbphrase['photoplog_no'] . ' ' . $vbphrase['photoplog_category']);
 }
 $vbulletin->bbcodecache = array();
 require_once DIR . '/includes/functions_editor.php';
 // yep this is how fileid is passed in
 $editorid = construct_edit_toolbar('', $do_html, 'nonforum', $do_smilies, $photoplog['fileid']);
 $photoplog['upload_box'] = $vbphrase['photoplog_not_available'];
 $photoplog_box_count = intval($vbulletin->options['photoplog_box_count']);
 if ($photoplog_box_count > 0) {
     $photoplog['upload_box'] = "<span class=\"smallfont\">" . $vbphrase['photoplog_upload_file_from_computer'] . "</span>";
     $photoplog['upload_box'] .= "<br /><input class=\"bginput\" type=\"file\" name=\"userfile[]\" size=\"30\" />";
 }
 $photoplog_url_count = intval($vbulletin->options['photoplog_url_count']);
 if ($photoplog_url_count > 0 && $photoplog_box_count > 0) {
     $photoplog['upload_box'] .= "<br /><br /><span class=\"smallfont\"><strong>" . $vbphrase['photoplog_or'] . "</strong> " . $vbphrase['photoplog_upload_file_from_url_link'] . "</span>";
     $photoplog['upload_box'] .= "<br /><input class=\"bginput\" type=\"text\" name=\"userlink\" size=\"40\" />";
 } else {
     if ($photoplog_url_count > 0) {
         $photoplog['upload_box'] = "<span class=\"smallfont\">" . $vbphrase['photoplog_upload_file_from_url_link'] . "</span>";
         $photoplog['upload_box'] .= "<br /><input class=\"bginput\" type=\"text\" name=\"userlink\" size=\"40\" />";
     }
Beispiel #28
0
 /**
  * Prepare any data needed for the output
  *
  * @param	string	The id of the block
  * @param	array	Options specific to the block
  */
 function prepare_output($id = '', $options = array())
 {
     global $show, $vbphrase, $messagearea, $vBeditTemplate;
     require_once DIR . '/includes/functions_visitormessage.php';
     require_once DIR . '/includes/class_bbcode.php';
     require_once DIR . '/includes/class_visitormessage.php';
     if (is_array($options)) {
         $options = array_merge($this->option_defaults, $options);
     } else {
         $options = $this->option_defaults;
     }
     if ($options['vmid']) {
         $messageinfo = verify_visitormessage($options['vmid'], false);
     }
     $state = array('visible');
     if (fetch_visitor_message_perm('canmoderatevisitormessages', $this->profile->userinfo)) {
         $state[] = 'moderation';
     }
     if (can_moderate(0, 'canmoderatevisitormessages') or $this->registry->userinfo['userid'] == $this->profile->userinfo['userid'] and $this->registry->userinfo['permissions']['visitormessagepermissions'] & $this->registry->bf_ugp_visitormessagepermissions['canmanageownprofile']) {
         $state[] = 'deleted';
         $deljoinsql = "LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON (visitormessage.vmid = deletionlog.primaryid AND deletionlog.type = 'visitormessage')";
     } else {
         $deljoinsql = '';
     }
     $state_or = array("visitormessage.state IN ('" . implode("','", $state) . "')");
     // Get the viewing user's moderated posts
     if ($this->registry->userinfo['userid'] and !fetch_visitor_message_perm('canmoderatevisitormessages', $this->profile->userinfo)) {
         $state_or[] = "(visitormessage.postuserid = " . $this->registry->userinfo['userid'] . " AND state = 'moderation')";
     }
     $perpage = (!$options['perpage'] or $options['perpage'] > $this->registry->options['vm_maxperpage']) ? $this->registry->options['vm_perpage'] : $options['perpage'];
     if ($messageinfo['vmid']) {
         $getpagenum = $this->registry->db->query_first("\n\t\t\t\tSELECT COUNT(*) AS comments\n\t\t\t\tFROM " . TABLE_PREFIX . "visitormessage AS visitormessage\n\t\t\t\tWHERE userid = " . $this->profile->userinfo['userid'] . "\n\t\t\t\t\tAND (" . implode(" OR ", $state_or) . ")\n\t\t\t\t\tAND dateline >= {$messageinfo['dateline']}\n\t\t\t");
         $options['pagenumber'] = ceil($getpagenum['comments'] / $perpage);
     }
     $pagenumber = $options['pagenumber'];
     do {
         if (!$pagenumber or $options['tab'] != $id and $options['tab'] != '') {
             $pagenumber = 1;
         }
         $start = ($pagenumber - 1) * $perpage;
         $hook_query_fields = $hook_query_joins = $hook_query_where = '';
         ($hook = vBulletinHook::fetch_hook('member_profileblock_visitormessage_query')) ? eval($hook) : false;
         if ($this->registry->options['globalignore'] != '') {
             if (!can_moderate(0, 'candeletevisitormessages') and !can_moderate(0, 'canremovevisitormessages')) {
                 require_once DIR . '/includes/functions_bigthree.php';
                 $coventry = fetch_coventry('string');
             }
         }
         $messagebits = '';
         $messages = $this->registry->db->query_read("\n\t\t\t\tSELECT " . (!isset($this->profile->prepared['vm_total']) ? "SQL_CALC_FOUND_ROWS" : "") . "\n\t\t\t\t\tvisitormessage.*, user.*, visitormessage.ipaddress AS messageipaddress\n\t\t\t\t\t" . ($this->registry->userinfo['userid'] ? ",IF(userlist.userid IS NOT NULL, 1, 0) AS bbuser_iscontact_of_user" : "") . "\n\t\t\t\t\t" . ($deljoinsql ? ",deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason" : "") . "\n\t\t\t\t\t" . ($this->registry->options['avatarenabled'] ? ",avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS avheight, customavatar.width_thumb AS avwidth_thumb, customavatar.height_thumb AS avheight_thumb, filedata_thumb, NOT ISNULL(customavatar.userid) AS hascustom" : "") . "\n\t\t\t\t\t{$hook_query_fields}\n\t\t\t\tFROM " . TABLE_PREFIX . "visitormessage AS visitormessage\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "user AS user ON (visitormessage.postuserid = user.userid)\n\t\t\t\t" . ($this->registry->userinfo['userid'] ? "LEFT JOIN " . TABLE_PREFIX . "userlist AS userlist ON (userlist.userid = user.userid AND userlist.type = 'buddy' AND userlist.relationid = " . $this->registry->userinfo['userid'] . ")" : "") . "\n\t\t\t\t" . ($this->registry->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\t\t\t{$deljoinsql}\n\t\t\t\t{$hook_query_joins}\n\t\t\t\tWHERE visitormessage.userid = " . $this->profile->userinfo['userid'] . "\n\t\t\t\t\tAND (" . implode(" OR ", $state_or) . ")\n\t\t\t\t" . ($coventry ? "AND visitormessage.postuserid NOT IN (" . $coventry . ")" : '') . "\n\t\t\t\t\t{$hook_query_where}\n\t\t\t\tORDER BY visitormessage.dateline DESC\n\t\t\t\tLIMIT {$start}, {$perpage}\n\t\t\t");
         if (!isset($this->profile->prepared['vm_total'])) {
             list($messagetotal) = $this->registry->db->query_first("SELECT FOUND_ROWS()", DBARRAY_NUM);
         } else {
             $messagetotal = $this->profile->prepared['vm_total'];
         }
         if ($start >= $messagetotal) {
             $pagenumber = ceil($messagetotal / $perpage);
         }
     } while ($start >= $messagetotal and $messagetotal);
     $this->block_data['messagestart'] = $start + 1;
     $this->block_data['messageend'] = min($start + $perpage, $messagetotal);
     $bbcode = new vB_BbCodeParser($this->registry, fetch_tag_list());
     $factory = new vB_Visitor_MessageFactory($this->registry, $bbcode, $this->profile->userinfo);
     $messagebits = '';
     if ($this->registry->userinfo['userid'] and empty($options['showignored'])) {
         $ignorelist = preg_split('/( )+/', trim($this->registry->userinfo['ignorelist']), -1, PREG_SPLIT_NO_EMPTY);
     } else {
         $ignorelist = array();
     }
     $firstrecord = array();
     $read_ids = array();
     while ($message = $this->registry->db->fetch_array($messages)) {
         // Process user.options
         $message = array_merge($message, convert_bits_to_array($message['options'], $this->registry->bf_misc_useroptions));
         if (!$firstrecord) {
             $firstrecord = $message;
         }
         if ($ignorelist and in_array($message['postuserid'], $ignorelist)) {
             $message['ignored'] = true;
         }
         if (empty($options['showignored']) and in_coventry($message['postuserid'])) {
             $message['ignored'] = true;
         }
         $response_handler =& $factory->create($message);
         $response_handler->converse = true;
         if (!$message['vm_enable'] and (!can_moderate(0, 'canmoderatevisitormessages') or $this->registry->userinfo['userid'] == $message['postuserid']) or $message['vm_contactonly'] and !can_moderate(0, 'canmoderatevisitormessages') and $message['postuserid'] != $this->registry->userinfo['userid'] and !$message['bbuser_iscontact_of_user']) {
             $response_handler->converse = false;
         }
         $response_handler->cachable = false;
         $messagebits .= $response_handler->construct();
         if (!$message['messageread'] and $message['state'] == 'visible') {
             $read_ids[] = $message['vmid'];
         }
         $lastcomment = !$lastcomment ? $message['dateline'] : $lastcomment;
     }
     $readvms = 0;
     // If it's our profile and the visible or default tab then we hope they've read it
     // if ($this->profile->userinfo['userid'] == $this->registry->userinfo['userid'] AND ($options['tab'] == $id OR $options['tab'] == '') AND !empty($read_ids))
     if ($this->profile->userinfo['userid'] == $this->registry->userinfo['userid']) {
         if (!empty($read_ids)) {
             $readvms = sizeof($read_ids);
             $this->registry->db->query_write("UPDATE " . TABLE_PREFIX . "visitormessage SET messageread = 1 WHERE vmid IN (" . implode(',', $read_ids) . ")");
         }
         if ($this->profile->userinfo['vmunreadcount'] - $readvms > 0 and $this->registry->options['globalignore'] != '') {
             // We still have unread VMs somewhere, and Tachy is enabled
             build_visitor_message_counters($this->profile->userinfo['userid']);
         } else {
             if ($readvms) {
                 // This is more than likely on the second page
                 $this->registry->db->query_write("\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "user\n\t\t\t\t\tSET vmunreadcount = IF(vmunreadcount >= {$readvms}, vmunreadcount - {$readvms}, 0)\n\t\t\t\t\tWHERE userid = " . $this->registry->userinfo['userid']);
             }
         }
     }
     if ($pagenumber == 1 and (!isset($this->profile->prepared['vm_total']) or !isset($this->profile->prepared['lastvm_time']) or !isset($this->profile->prepared['lastvm_date']))) {
         $pminfo = array('dateline' => $firstrecord['dateline'], 'messages' => $messagetotal);
     } else {
         $pminfo = null;
     }
     $this->profile->prepare('vm_total', $pminfo);
     $this->block_data['messagebits'] = $messagebits;
     $this->block_data['lastcomment'] = $lastcomment;
     $show['delete'] = fetch_visitor_message_perm('candeletevisitormessages', $this->profile->userinfo);
     $show['undelete'] = fetch_visitor_message_perm('canundeletevisitormessages', $this->profile->userinfo);
     $show['approve'] = fetch_visitor_message_perm('canmoderatevisitormessages', $this->profile->userinfo);
     $show['inlinemod'] = ($show['delete'] or $show['undelete'] or $show['approve']);
     // Only allow AJAX QC on the first page
     $show['quickcomment'] = $show['post_visitor_message'];
     $show['allow_ajax_qc'] = ($pagenumber == 1 and $messagetotal) ? 1 : 0;
     $pageinfo = array('tab' => $id);
     if ($options['perpage'] != $this->registry->options['vm_perpage']) {
         $pageindo['pp'] = $options['perpage'];
     }
     if (!empty($options['showignored'])) {
         $pageinfo['showignored'] = 1;
     }
     $this->block_data['pagenav'] = construct_page_nav($pagenumber, $perpage, $messagetotal, '', '', $id, 'member', $this->profile->userinfo, $pageinfo);
     $this->block_data['messagetotal'] = $messagetotal;
     $show['view_conversation'] = (!$this->profile->prepared['myprofile'] and THIS_SCRIPT != 'converse' and $this->registry->userinfo['vm_enable']);
     if ($show['quickcomment']) {
         require_once DIR . '/includes/functions_editor.php';
         $this->block_data['editorid'] = construct_edit_toolbar('', false, 'visitormessage', $this->registry->options['allowsmilies'], true, false, 'qr_small', '', array(), 'content', 'vBForum_VisitorMessage', 0, $this->profile->userinfo['userid']);
         $this->block_data['messagearea'] = $messagearea;
         $this->block_data['clientscript'] = $vBeditTemplate['clientscript'];
     }
 }
Beispiel #29
0
 }
 if ($signature) {
     if (!$previewmessage) {
         require_once DIR . '/includes/class_bbcode.php';
         $bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
         $bbcode_parser->set_parse_userinfo(fetch_userinfo($vbulletin->userinfo['userid'], FETCH_USERINFO_SIGPIC), $vbulletin->userinfo['permissions']);
         $previewmessage = $bbcode_parser->parse($signature, 'signature');
     }
     // save a conditional by just overwriting the phrase
     $vbphrase['submit_message'] =& $vbphrase['save_signature'];
     eval('$preview = "' . fetch_template('newpost_preview') . '";');
 }
 require_once DIR . '/includes/functions_editor.php';
 // set message box width to usercp size
 $stylevar['messagewidth'] = $stylevar['messagewidth_usercp'];
 $editorid = construct_edit_toolbar(htmlspecialchars_uni($signature), 0, 'signature', $vbulletin->userinfo['permissions']['signaturepermissions'] & $vbulletin->bf_ugp_signaturepermissions['allowsmilies']);
 $show['canbbcode'] = $vbulletin->userinfo['permissions']['signaturepermissions'] & $vbulletin->bf_ugp_signaturepermissions['canbbcode'] ? true : false;
 // ############### DISPLAY SIG IMAGE CONTROLS ###############
 require_once DIR . '/includes/functions_file.php';
 $inimaxattach = fetch_max_upload_size();
 if ($permissions['signaturepermissions'] & $vbulletin->bf_ugp_signaturepermissions['cansigpic']) {
     $show['cansigpic'] = true;
     $show['sigpic_url'] = (ini_get('allow_url_fopen') != 0 or function_exists('curl_init'));
     $maxnote = '';
     if ($permissions['sigpicmaxsize'] and ($permissions['sigpicmaxwidth'] or $permissions['sigpicmaxheight'])) {
         $maxnote = construct_phrase($vbphrase['note_maximum_size_x_y_or_z'], $sigperms_display['sigpicmaxwidth'], $sigperms_display['sigpicmaxheight'], $sigperms_display['sigpicmaxsize']);
     } else {
         if ($permissions['sigpicmaxsize']) {
             $maxnote = construct_phrase($vbphrase['note_maximum_size_x'], $sigperms_display['sigpicmaxsize']);
         } else {
             if ($permissions['sigpicmaxwidth'] or $permissions['sigpicmaxheight']) {
Beispiel #30
0
        $reportobj->do_report($vbulletin->GPC['reason'], $commentinfo);
        $url =& $vbulletin->url;
        print_standard_redirect('redirect_reportthanks');
    }
}
if ($_POST['do'] == 'quickedit') {
    if ($commentinfo and !fetch_user_picture_message_perm('caneditmessages', $pictureinfo, $commentinfo)) {
        print_no_permission();
    } else {
        if (!$commentinfo and !$canpostmessage) {
            print_no_permission();
        }
    }
    $vbulletin->input->clean_array_gpc('p', array('editorid' => TYPE_NOHTML));
    require_once DIR . '/includes/class_xml.php';
    require_once DIR . '/includes/functions_editor.php';
    $editorid = construct_edit_toolbar(htmlspecialchars_uni($commentinfo['pagetext']), false, 'picturecomment', true, true, false, 'qe', $vbulletin->GPC['editorid'], array(), 'content', 'vBForum_PictureComment', $commentinfo['commentid']);
    $xml = new vB_AJAX_XML_Builder($vbulletin, 'text/xml');
    $xml->add_group('quickedit');
    $xml->add_tag('editor', process_replacement_vars($messagearea), array('reason' => '', 'parsetype' => 'picturecomment', 'parsesmilies' => true, 'mode' => $show['is_wysiwyg_editor']));
    $xml->add_tag('ckeconfig', vB_Ckeditor::getInstance($editorid)->getConfig());
    $xml->close_group();
    $xml->print_xml();
}
($hook = vBulletinHook::fetch_hook('picture_comment_complete')) ? eval($hook) : false;
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # CVS: $RCSfile$ - $Revision: 63231 $
|| ####################################################################
\*======================================================================*/