R
ragtek
Guest
I've seen several add-ons implementing own js stuff to get a quick reply form with autoreloading comments..
It's not necessary to create own js classes to handle this
You can use the xenforo quick_reply template, which will handle EVERYTHING for you
You only need to set some variables
1. formAction => where should the data be sent
2. lastDate => This variable is necessary to get ALL NEW COMMENTS made in the time, while you was viewing the page
And your comments list HAVE TO have the id messageList (requested by discussion.js to know where to put the new comments)
I would suggest to check the quick_reply template & discussion.js file
On serverside you need to grab the latest posts made since lastDate and return them
Demo: http://ragtek.org/xenforo/pages/testpage/
It's not necessary to create own js classes to handle this
You can use the xenforo quick_reply template, which will handle EVERYTHING for you
You only need to set some variables
Code:
<link rel="xenforo_template" type="text/html" href="quick_reply.html">
<xen:set var="$formAction">{xen:link pages, $page}</xen:set>
<xen:set var="$lastDate">{$lastMessageDate}</xen:set>
<xen:set var="$showMoreOptions">0</xen:set>
1. formAction => where should the data be sent
2. lastDate => This variable is necessary to get ALL NEW COMMENTS made in the time, while you was viewing the page
And your comments list HAVE TO have the id messageList (requested by discussion.js to know where to put the new comments)
I would suggest to check the quick_reply template & discussion.js file
On serverside you need to grab the latest posts made since lastDate and return them
Demo: http://ragtek.org/xenforo/pages/testpage/