title: vBulletin 3x - Creating an Ajax Load More Threads Button Results in Error
body: <p>This question is intended for vBulletin developers, some methods may not make since if you are not familiar with the software.</p>
  <p>So this is petty standard feature of most sites today, load more by pressing a button. So what Im trying to do is make an ajax request to a duplicated modified forumdisplay.php to load the next page of threads automatically.</p>
  <p>Heres the procedure.
  In my <code>forumdisplay</code> template I have created an ajax script:</p>
  <pre><code>&lt;script&gt;
  $(document).ready(function(){
      $('.load-more').click(function(){
          perpage = $perpage + 10;
          $('.block-threadlist').load('loadmore.php', {
              perPageNew: perpage
          });
      });
  });
  &lt;/script&gt;
  </code></pre>
  <p><strong>loadmore.php</strong> is essentially a modified duplicate of <strong>forumdisplay.php</strong></p>
  <p>The notable changes are:</p>
  <p>I have included <code>$perPageNew = $_POST['perPageNew'];</code> and I have changed the eval template from <code>FORUMDISPLAY</code> to <code>loadmore</code></p>
  <p>The <code>loadmore</code> template ONLY includes <code>$threadbits</code></p>
  <p>Loading <strong>loadmore.php</strong> in browser, this works exactly how I expect it to, with only showing the threadbits of each thread, un-styled due to not being rendered with the head or any other templates. That's ok though because once they are loaded where they are supposed to be, they should be styled.</p>
  <p>The problem comes when I hit my button.</p>
  <pre><code>&lt;button type=&quot;button&quot; class=&quot;btn btn-primary btn-lg load-more&quot;&gt;Load More&lt;/button&gt;
  </code></pre>
  <p>Which is placed directly below <code>$threadbits</code> in the <strong>forumdisplay</strong> template. I am recieving an error.</p>
  <blockquote>
  <p>If this occurred unexpectedly, please inform the administrator and
  describe the action you performed before you received this error.]]&gt;</p>
  </blockquote>
  <p>That is all the error gives me, with nothing being posted in my php error log.</p>
  <p>I have tried striping as much as I could out of the loadmore.php file so that it only includes what is required for the <code>threadbits</code> but I am not getting anywhere with the error.</p>
  <p>Am I going about doing this the correct way, or would vBulletin require me to approach this in a different manor?</p>