The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Post reply from external page using AJAX
I am currently trying to write a relatively simple script (or so I thought) using jQuery and Ajax. The goal is to allow users to reply to forum threads from my website.
I am already using the vB - Wordpress bridge, so it would be sweet if users could post from the site instead of having to go to the forum thread first. Here's the code I have thus far: Code:
<head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("form#vbform").submit(function(){ $.post("http://middleearthcenter.com/forums/newreply.php?do=postreply",{ message: $("#vB_Editor_001_textarea").val(), do: "postreply", secuiritytoken: "ENTER_TOKEN_HERE", t: $("#t").val() }, function(xml) { $("#msg").append("RETURNED:"+xml); }); return false; }); }); </script> </head> <body> <div id="msg"></div> <form id="vbform" name="vbform"> Message<br /> <textarea name="message" id="vB_Editor_001_textarea" rows="10" cols="60" style="display:block; width:540px; height:250px" tabindex="1" dir="ltr"> </textarea><br /> Thread number<br /> <input type="text" id="t" name="t" value="20791" /><br /><br /> <input type="submit" value="submit message" /> Now, using Charles to see the results, it does appear to work except for one vital issue. It is not sending along or using my user login info (I have included global.php on the page in question). Question is how do I post as the user I'm logged in as. At the moment it doesn't seem to use that data and simply tries to post as a guest. Any help would be appreciated! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|