Advertisement:

Author Topic: AJAX Instant Quick Reply  (Read 284626 times)

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,280
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
    • ZubaFitness
AJAX Instant Quick Reply
« on: May 29, 2008, 06:59:11 PM »
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)
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.

Quote
If 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
« Last Edit: March 08, 2009, 11:17:23 AM by SlammedDime »
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: AJAX Quick Reply
« Reply #1 on: May 29, 2008, 07:18:33 PM »
Thanks for this great mod :)
İnadına SMF 1.1.X

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
Re: AJAX Quick Reply
« Reply #2 on: May 29, 2008, 07:29:16 PM »
Indeed i think its going to be really popular.

Offline ALEJO

  • Jr. Member
  • **
  • Posts: 160
    • Buzarda
Re: AJAX Quick Reply
« Reply #3 on: May 29, 2008, 07:31:05 PM »
screenshots plz?
solo el mas paranoico sobrevive

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: AJAX Quick Reply
« Reply #4 on: May 29, 2008, 07:37:31 PM »
Those .js files include mootools. for what? for AJAX Quick Reply?
İnadına SMF 1.1.X

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
Re: AJAX Quick Reply
« Reply #5 on: May 29, 2008, 07:38:38 PM »
No, its for the xml stylesheet viewer.  Not for the mod.

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: AJAX Quick Reply
« Reply #6 on: May 29, 2008, 08:05:03 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

Offline karlbenson

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,629
  • Gender: Male
    • @mortonssols on Twitter
    • Criminal Solicitors
Re: AJAX Quick Reply
« Reply #7 on: May 29, 2008, 08:13:00 PM »
try hitting ctrl+f5 and try again.

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

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,280
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
    • ZubaFitness
Re: AJAX Quick Reply
« Reply #8 on: May 29, 2008, 08:16:06 PM »
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...
                     

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,280
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
    • ZubaFitness
Re: AJAX Quick Reply
« Reply #9 on: May 29, 2008, 08:18:56 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...
                     

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,108
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: AJAX Quick Reply
« Reply #10 on: May 29, 2008, 08:50:51 PM »
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


Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,108
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: AJAX Quick Reply
« Reply #12 on: May 29, 2008, 09:13:31 PM »
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

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: AJAX Quick Reply
« Reply #13 on: May 29, 2008, 09:37:33 PM »
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!

Offline Nibogo

  • SMF Hero
  • ******
  • Posts: 6,652
  • Gender: Male
    • smfpacks on Facebook
    • @smfpacks on Twitter
    • SMFPacks
Re: AJAX Quick Reply
« Reply #14 on: May 29, 2008, 10:21:18 PM »
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.

thanks

excuse me but i dont speak english ;)

Offline Charles Hill

  • Sophist Member
  • *****
  • Posts: 1,006
  • Gender: Male
  • question everything
Re: AJAX Quick Reply
« Reply #15 on: May 29, 2008, 10:37:52 PM »
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.

Offline _Anthony_

  • Full Member
  • ***
  • Posts: 547
Re: AJAX Quick Reply
« Reply #16 on: May 29, 2008, 10:41:04 PM »
Very nice slammed i use it

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: AJAX Quick Reply
« Reply #17 on: May 29, 2008, 10:43:19 PM »
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!

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,280
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
    • ZubaFitness
Re: AJAX Quick Reply
« Reply #18 on: May 29, 2008, 10:49:19 PM »
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...
                     

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: AJAX Quick Reply
« Reply #19 on: May 29, 2008, 10:51:37 PM »
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!