Ejemplo n.º 1
0
            $qrpostid = 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'])) {
Ejemplo n.º 2
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'];
	}
Ejemplo n.º 3
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;
	}
Ejemplo n.º 4
0
 } else {
     $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;
Ejemplo n.º 5
0
 // edit / add attachment
 if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] and $vbulletin->userinfo['userid'] and !empty($vbulletin->userinfo['attachmentextensions'])) {
     $values = "values[p]={$postinfo['postid']}&amp;editpost=1";
     require_once DIR . '/packages/vbattach/attach.php';
     $attach = new vB_Attach_Display_Content($vbulletin, 'vBForum_Post');
     $attachmentoption = $attach->fetch_edit_attachments($posthash, $poststarttime, $postattach['bycontent'][$postid], $postid, $values, $editorid, $attachcount, $postinfo['userid']);
     $contenttypeid = $attach->fetch_contenttypeid();
     if (!$foruminfo['allowposting'] and $attachcount == 0) {
         $attachmentoption = '';
     }
 } else {
     $attachmentoption = '';
     $contenttypeid = 0;
 }
 require_once DIR . '/includes/functions_file.php';
 $attachinfo = fetch_attachmentinfo($posthash, $poststarttime, $contenttypeid, array('p' => $postinfo['postid']));
 $editorid = construct_edit_toolbar($newpost['message'], 0, $foruminfo['forumid'], $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']), 'fe', '', $attachinfo, 'content', 'vBForum_Post', $postinfo['postid'], 0, $previewpost, true, 'titlefield');
 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']) {