News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

AJAX Instant Quick Reply

Started by SlammedDime, May 29, 2008, 06:59:11 PM

Previous topic - Next topic

SlammedDime

Link to Mod

Very Very Very Important.  If you have Sleepy's View Single Post mod installed, you MUST uninstall it before installing this.  This incorporates that mod as well in order to work properly.

This mod allows for AJAX Quick Reply.  Quick reply must be enabled on your board for this to work, this does not replace the built in quick reply.  Normally, when a post is submitted, the page will reload and your new post will be displayed.  This eliminates the need to reload the page and your post shows up instantly.

Here is a video that demonstrates the functionality: http://www.mattzuba.com/_public/ajax.swf.html

Some quick notes about how it works (only (1) applies to SMF 1.1.5):
1) If a user is not on the last page of a topic or viewing all, the post will post as normal
2) If visual verification is enabled for posting, it will post as normal
3) If posts are moderated, it will post as normal.
4) If there are any errors during posting, it will post as normal

Note:
I will make the modification to anyone's custom Display.template.php, provided they have at least attempted it on their own.  Please post an unmodified copy, however.  I run it through the package parser and make manual adjustments as needed.

If anyone would like me to see why it isn't working on their site, they will need to provide a link to their site as well as a test account to be used.

Support Topic: http://www.simplemachines.org/community/index.php?topic=241917.0

Known Issues:
After posting, boardindex still shows board as unread (or, has new replies)
Quote from: SlammedDime on May 30, 2008, 07:19:10 PM
Fix for 1.1.5 or B3.1:
Open xml_topic.js
Code (Find) Select
function ajax_reply()
{
   var i, x = new Array();
   x[x.length] = 'topic=' + parseInt(document.forms.postmodify.elements['topic'].value);
   x[x.length] = 'subject=' + escape(textToEntities(document.forms.postmodify['subject'].value.replace(/&#/g, "&#"))).replace(/\+/g, "%2B");


Code (Replace) Select
function ajax_reply()
{
   var i, x = new Array();
   x[x.length] = 'topic=' + parseInt(document.forms.postmodify.elements['topic'].value);
   x[x.length] = 'goback=' + parseInt(document.forms.postmodify.elements['goback'].value);
   x[x.length] = 'subject=' + escape(textToEntities(document.forms.postmodify['subject'].value.replace(/&#/g, "&#"))).replace(/\+/g, "%2B");


Sorry.

QuoteIf you install Pretty Urls AFTER installing this mod, you will have to manually make the changes in /Sources/Display.php.
Code (Find) Select
   if ((isset($context['pretty']['oldschoolquery']) || $context['pretty']['query_string']['board'] != $context['pretty']['board_urls'][$board]) && $modSettings['pretty_enable_filters'])
Code (Replace) Select
   if (!isset($_REQUEST['xml']) && (isset($context['pretty']['oldschoolquery']) || $context['pretty']['query_string']['board'] != $context['pretty']['board_urls'][$board]) && $modSettings['pretty_enable_filters'])

Change Log:
Legend:
* = New feature
+ = Improved feature
! = Fixed bug
? = Other stuff

Version 1.0.1
-------------
! Invalid semantics in XMLtemplate.php
! Now works properly if javascript is disabled in user's browser
+ When Show Newest Posts first is enabled, new posts now go to top, rather than bottom.
? Install checks for pretty urls and makes changes if needed

Version 1.0.0
-------------
* Release


FAQ
Q: After installing the mod, I don't see quick reply on my topic pages.
A: This mod does not add quick reply to your board.  One of SMF's included features is quick reply.  This only changes it's functionality.  To enable quick reply, you have to go to your profile and change your Look and Layout Preferences to display it.

Q: I installed this mod, but don't see any settings for it.
A: That's because there are none.  It only changes existing functionality and there is nothing to configure.

Q: Will this work on my theme?
A: In short: It will work on just about any non-semantic theme on 1.1.x (any theme based on the Core theme).  It will work on just about any semantic theme for 2.0.  If your 2.0 theme uses tables to display posts, rather than div's, this will not work at this time.

Q: It doesn't work...
A: I don't like that phrase.  Be more detailed.  What exactly is happening?  What isn't happening?  I can't do much without a test account and link to your board either, so please post that
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Hoochie Coochie Man

Thanks for this great mod :)
İnadına SMF 1.1.X

karlbenson

Indeed i think its going to be really popular.

ALEJO

solo el mas paranoico sobrevive

Hoochie Coochie Man

Those .js files include mootools. for what? for AJAX Quick Reply?
İnadına SMF 1.1.X

karlbenson

No, its for the xml stylesheet viewer.  Not for the mod.

Hoochie Coochie Man

Quote from: karlbenson on May 29, 2008, 07:38:38 PM
No, its for the xml stylesheet viewer.  Not for the mod.

I see, anyway. it didn't work on me..

I wrote my message and press "send"button.  but nothings hapened.
Then when I fresh the page. my message appear.!!

if someone use this mode, please let me know..
İnadına SMF 1.1.X

karlbenson

try hitting ctrl+f5 and try again.

I've been testing it on one of my forums
http://www.adrevenueshare.com/index.php

SlammedDime

Hoochie - This mod heavily depends on proper modification of Display.template.php if it exists in a custom theme.  The new function as well as the modification to the existing template function are crucial.

See the bottom of the first post of this topic.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

Quote from: ALEJO on May 29, 2008, 07:31:05 PM
screenshots plz?
Its not possible to get screen shots of this.  It doesn't add anything visually to SMF, merely changes the functionality of how quick reply works.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

vbgamer45

Awesome Mod! I have installed it on the forums I run on SMF 1.1.x thanks so much!
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro


vbgamer45

There is not anything to take a screenshot of it just changes some logic. So when you make a quick reply it does not reload the page.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Eliana Tamerin

Works great on a vanilla install.

However, Slammed, the mod can't install properly (read: automatically) when the Sticky First Post mod is installed. I looked myself, and I think it will only require a few reference edits, nothing that would change the actual code of the mod. If you want, I can go through further to see what all would be required, unless you'd prefer to do so.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!


Charles Hill

AJAX allows stuff to happen without having to reload the page.  There is nothing new visually with this mod.  So there is no point in taking a screen shot.

_Anthony_

Very nice slammed i use it

Eliana Tamerin

Oh, and Slammed, what happens if someone doesn't have JS enabled? I tried it without JS on a page and the Post button will not work.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

SlammedDime

AJAX: Asynchronous JavaScript And XML :)

I do see your point though.  It should post as normal if Javascript is disabled.  I'll look into adding that functionality.  The percentage of users that don't have this enabled is very very small, so i don't consider it an immediate change.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Eliana Tamerin

Hence why I tested it without JS enabled to see if you'd programmed something in. ;) There are some people who prefer to browser the web without JS unless absolutely necessary.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Advertisement: