1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Adding the Quick Reply Editor to own add-ons/pages/whatever

Discussion in 'Development Tutorials [Archive]' started by ragtek, Aug 25, 2011.

  1. ragtek

    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

    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/
     
    Fuhrmann and Digital Doctor like this.

Share This Page