require_once(DIR . '/includes/functions_attach.php'); $forum_allowsmilies = ($foruminfo['allowsmilies'] ? 1 : 0); $editor_parsesmilies = ($forum_allowsmilies AND $postinfo['allowsmilie'] ? 1 : 0); $post =& $postinfo; $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'])) { $values = "values[t]=$threadinfo[threadid]"; 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, $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'],
$checked['signature'] = 'checked="checked"'; } else { $checked['signature'] = ''; } } if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostpoll']) { $show['poll'] = true; } 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'];
} if ($postinfo['userid']) { $userinfo = fetch_userinfo($postinfo['userid']); $postinfo['username'] = $userinfo['username']; } if ($edit['iconid']) { $posticons = construct_icons($edit['iconid'], $foruminfo['allowicons']); } else { $posticons = construct_icons($postinfo['iconid'], $foruminfo['allowicons']); } // edit / add attachment if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] and $vbulletin->userinfo['userid'] and !empty($vbulletin->userinfo['attachmentextensions'])) { $values = "values[p]={$postinfo['postid']}&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')) {
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; }
{ print_no_permission(); } require_once(DIR . '/includes/functions_editor.php'); require_once(DIR . '/includes/functions_newpost.php'); ($hook = vBulletinHook::fetch_hook('blog_post_editentry_start')) ? eval($hook) : false; // 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, $editorid, $attachcount, explode(',', $bloginfo['memberids'])); $contenttypeid = $attach->fetch_contenttypeid(); } else { $attachmentoption = ''; $contenttypeid = 0; } if ($vbulletin->GPC['advanced'] OR !defined('POSTPREVIEW')) { $title = $bloginfo['title']; $reason = $blog['reason']; $blog['allowsmilie'] = $bloginfo['allowsmilie']; construct_checkboxes(