• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
      • Try XenForo Demo
      • New Posts
      • FAQ
      • Calendar
      • Community
        • Groups
        • Albums
        • Member List
      • Forum Actions
        • Mark Forums Read
      • Quick Links
        • Today's Posts
        • Who's Online
      • Sponsor
        • Sponsor a Feature
        • List of Donors
    • Wiki
    • Support
    • What's New?
    • Buy Now
    • Manual
    • 
    • Forum
    • VaultWiki How-Tos
    • VaultWiki Questions
    • Lite - How to post to wiki forum using external form?

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Results 1 to 4 of 4

    Thread: Lite - How to post to wiki forum using external form?

    • Thread Tools
      • Show Printable Version
    1. April 10, 2010 #1
      CedricFP
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      CedricFP is offline
      Junior Member
      Join Date
      April 2, 2010
      Posts
      26
      Rep Power
      197

      Lite - How to post to wiki forum using external form?

      Hello,

      I am using an external form to post to a vault wiki forum (it is the EasyForms hack).

      I am having trouble getting the actual page content into the wiki page.

      The standard code for the form to post to a forum is as follows (I have highlighted what I think is the problem area):

      What command should I use instead so that I can fill the wiki page with content from the form?

      Thanks!

      Code:
      $forumid2 = 99;
      if ($complete)
          {
              if (!$vbulletin->userinfo['userid'])
              {
                  $vbulletin->input->clean_array_gpc('p', array(
                      'humanverify' => TYPE_ARRAY,
                  ));
                  $newpost['humanverify'] = $vbulletin->GPC['humanverify'];
              }
              require_once(DIR . '/includes/functions_editor.php');
              require_once(DIR . '/includes/functions_bigthree.php');
              require_once('./includes/class_dm.php');
              require_once('./includes/class_dm_threadpost.php'); 
              require_once('./includes/functions_databuild.php');
              if (!$closed)
              {
                  $open = 1;
              }
              else
              {
                  $open = 0;
              }
              $threaddm = new vB_DataManager_Thread_FirstPost($vbulletin, ERRTYPE_STANDARD);
              /*$foruminfo = fetch_foruminfo($forumid);*/
              $threaddm->set_info('forum',$foruminfo);
              $threaddm->set_info('user', $vbulletin->userinfo);
              $threaddm->set('forumid', $forumid2);
              $threaddm->set('userid', $vbulletin->userinfo['userid']);
              $threaddm->set('title', $threadtitle);
      [SIZE="6"]        $threaddm->set('pagetext', $formoutput); [/SIZE]
              $allow_smilie = '1';
              $visible = '1';
              $threaddm->set('open', $open);
              if ($form[prefixid])
              {
                  $threaddm->set('prefixid', $form[prefixid]); 
              }
              if ($form[iconid])
              {
                  $threaddm->set('iconid', $iconid); 
              }
              $threaddm->set('allowsmilie', $allow_smilie);
              $threaddm->set('visible', $visible);
              $threaddm->pre_save();
              $threadid = $threaddm->save();
              unset($threaddm);
              build_thread_counters($threadid);
              build_forum_counters($forumid);  
              if (!empty($threaddm->errors))
              {
                  $errorss .= $threaddm->errors;
                  $errormessage = "Form failed to submit. The following error(s) occured: <br /> ".$errorss;
                  eval(standard_error($errormessage));
              }
              $threadinfo = fetch_threadinfo($threadid);
              $newpost['postid'] = $threadinfo['firstpostid'];
              mark_thread_read($threadinfo, $foruminfo, $vbulletin->userinfo['userid'], TIMENOW);
              /*($hook = vBulletinHook::fetch_hook('newthread_post_complete')) ? eval($hook) : false;*/
              if ($form[poll] == 1)
              {
                  $question = $form[pollquestion];
                  $threadinfo = verify_id('thread', $threadid, 0, 1);
                  $polloptions = count($polloption);
                  $vbulletin->GPC['options'] = $polloption;
                  $counter = 0;
                  $optioncount = 0;
                  $badoption = '';
                  while ($counter++ < $polloptions)
                  {
                      if ($vbulletin->options['maxpolllength'] AND vbstrlen($vbulletin->GPC['options']["$counter"]) > $vbulletin->options['maxpolllength'])
                      {
                          $badoption .= iif($badoption, ', ') . $counter;
                      }
                      if (!empty($vbulletin->GPC['options']["$counter"]))
                      {
                          $optioncount++;
                      }
                  }
                  $poll = datamanager_init('Poll', $vbulletin, ERRTYPE_STANDARD);
                  $counter = 0;
                  while ($counter++ < $polloptions)
                  {
                      if ($vbulletin->GPC['options']["$counter"] != '')
                      {
                          $poll->set_option($vbulletin->GPC['options']["$counter"]);
                      }
                  }
                  $poll->set('question', $question);
                  $poll->set('dateline', TIMENOW);
                  $poll->set('active', '1');
                  $poll->set('public', $form['publicpoll']);
                  $poll->set('multiple', $form['multiplepoll']);
                  $pollid = $poll->save();
                  $threadman = datamanager_init('Thread', $vbulletin, ERRTYPE_STANDARD, 'threadpost');
                  $threadman->set_existing($threadinfo);
                  $threadman->set('pollid', $pollid);
                  $threadman->save();
              }
              if ($form[submitmessage])
              {
                  $errormessage = $form[submitmessage];
              }
              else
              {
                  $errormessage = "Form was submitted successfully. Click <a href=\"showthread.php?" . $vbulletin->session->vars['sessionurl'] . "p=" . $newpost[postid] . "#post" . $newpost[postid] . "\">here</a> to view the thread.";
              }
          }
      Reply With Quote Reply With Quote

    2. April 10, 2010 #2
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,959
      Blog Entries
      18
      Rep Power
      687
      Don't call the data managers directly. Instead, pass your values through vBulletin's build_new_post function in includes/functions_newpost.php. The additional wiki data should be generated if you do it this way.

      Depending on how simple the form is, there's one other way. If you only want to input the following data:
      • Page Title
      • Page Content
      • Author's User ID

      You can use VaultWiki's built-in function special_article_creator in vault/special_plugins_newpost.php.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    3. April 10, 2010 #3
      CedricFP
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • View Articles
      CedricFP is offline
      Junior Member
      Join Date
      April 2, 2010
      Posts
      26
      Rep Power
      197
      Thanks for the help. I'll see what I can do.

      I take it that special_article_creator can't work manage thread prefixes?
      Reply With Quote Reply With Quote

    4. April 10, 2010 #4
      pegasus
      • View Profile
      • View Forum Posts
      • View Blog Entries
      • Visit Homepage
      • View Articles
      pegasus is offline
      VaultWiki Team
      Join Date
      March 28, 2004
      Location
      New York, NY
      Posts
      2,959
      Blog Entries
      18
      Rep Power
      687
      It doesn't, it only manages the 3 things I listed. If you need to add any more input than that, you're better off using vB's function.
      - lead developer for VaultWiki
      Reply With Quote Reply With Quote

    Similar Threads

    1. Export data from vault wiki in a vb3 forum to import in a vault wiki vb4 forum after
      By levimatt in forum VaultWiki Questions
      Replies: 22
      Last Post: March 18, 2016, 7:02 PM
    2. Idea: include wiki page in Forum Post (wiki/forum integration)
      By InformationNirvana in forum Ideas & Suggestions
      Replies: 2
      Last Post: December 14, 2011, 12:56 AM
    3. Is it possible to post a wiki article in a forum which also contains threads?
      By howard in forum VaultWiki Questions
      Replies: 3
      Last Post: June 30, 2011, 6:10 PM
    4. Nominate forum post for Wiki inclusion
      By Alfa1 in forum Ideas & Suggestions
      Replies: 4
      Last Post: December 29, 2010, 11:23 AM
    5. Would it be possible to include a wiki entry in a forum post ?
      By InformationNirvana in forum Pre-Sales Questions
      Replies: 3
      Last Post: December 15, 2009, 5:51 PM

    Tags for this Thread

    actual, age, any, better, big, class, closed, complete, content, don, editor, err, errors, existing, external, form, forum, get, getting, having, hello, help, hook, input, into, lite, manage, mark, off, open, other, page, php, poll, post, problem, public, question, see, should, show, showthread, standard, that, things, time, title, url, vault, vbulletin, was, way, wiki, you

    View Tag Cloud

    Bookmarks

    Bookmarks
    • Submit to Digg Digg
    • Submit to del.icio.us del.icio.us
    • Submit to StumbleUpon StumbleUpon
    • Submit to Google Google

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    • BB code is On
    • Smilies are On
    • [IMG] code is Off
    • [VIDEO] code is
    • HTML code is Off

    Forum Rules

    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 4:13 PM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.