News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

AJAX Instant Quick Reply

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

Previous topic - Next topic

edi67

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Nathaniel

Quote from: LHVWB on June 01, 2008, 07:15:19 AM
For SMF 2 Beta 3.1

I just noticed a bug with the mod which you may wish to fix, when you post a quick reply and then leave the thread which you posted the reply in, the quick reply post is marked as unread. This seems like something which you may wish to fix.

Edit: This may be a bug with SMF 2 Beta itself, it appears that the image for new posts for that board in the forum index is showing that there are new posts, but when I click on it to see the new posts, I cannot see any.  This is very odd!  :o

I believe that this post may have gotten lost in the torrent of posts in this thread. Has anyone else had this problem?

It still seems to be there for me, after you post a quick reply and leave the thread, that quick reply counts as unread.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

SlammedDime

I can't seem to reproduce that issue.  There was an issue where the board index was showing unread topics in that board, but the fix in the first post takes care of that.  When you 'leave the thread', where are you going that it is showing unread?  Message Index, or board index?  If its board index, did you apply the fix?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Nathaniel

The Board index is where I am returning to and even after applying the fix, this problem still occurs.

However I couldn't find the ajax_reply() function instead I found a the code below and applied the fix to the correct line.

Without the fix:

QuickReply.prototype.ajax_reply = function ()
{
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");


With the fix:

QuickReply.prototype.ajax_reply = function ()
{
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");


I am using SMF 2 Beta 3.1, so I am wondering if the corrections that you posted are completely relevant to this version, because I can't get them to work. I have attached my entire xml_topic.js file to this document, so that you can confirm that I haven't done anything really bad. ;)


SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Dannii

#124
Hi SlammedDime,

When you next update this mod (like for beta 4) I suggest you change the way you fix it for pretty URLs. As it is now if you tried uninstalling Pretty URLs after installing this mod there would be conflicts. Luckily however, it should be just as easy to make sure the two mods never have to edit the same lines! :)

You could add these lines to any file that's run before it attempts to do the 301 redirects (index.php, QueryString.php), but I suggest just putting them at the top of Display() right after the globals and before the first comment.

if (isset($_REQUEST['xml']))
$modSettings['pretty_enable_filters'] = false;
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

SlammedDime

Quote from: Dannii on June 03, 2008, 11:38:59 AM
Hi SlammedDime,

When you next update this mod (like for beta 4) I suggest you change the way you fix it for pretty URLs. As it is now if you tried uninstalling Pretty URLs after installing this mod there would be conflicts. Luckily however, it should be just as easy to make sure the two mods never have to edit the same lines! :)

You could add these lines to any file that's run before it attempts to do the 301 redirects (index.php, QueryString.php), but I suggest just putting them at the top of Display() right after the globals and before the first comment.

if (isset($_REQUEST['xml']))
$modSettings['pretty_enable_filters'] = false;

If I do that, then the urls will not be rewritten after the message is run through the display template unless I turn it back on at the end of the display function, which is really adding unnecessary code. I tried attaching ;pretty to the xml POST hoping that would do it after looking at your code, but it didn't work, even with ;topic= in the POST as well.  Any suggestions on using ;pretty?

LHVWB - I'll look at this more closely and see if I might be able to track it down.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Dannii

QuoteIf I do that, then the urls will not be rewritten after the message is run through the display template unless I turn it back on at the end of the display function, which is really adding unnecessary code. I tried attaching ;pretty to the xml POST hoping that would do it after looking at your code, but it didn't work, even with ;topic= in the POST as well.  Any suggestions on using ;pretty?
Ahh true... I hadn't thought of that. So Display() is now doing the normal viewing and sending the new post back with ajax?

I could change the test from if (!isset($_GET['pretty'])) to if (!isset($_REQUEST['pretty'])) on my end so then it will work for POSTs as well. I'll do that when I update it for beta 4, if you can change yours at the same time that would be great. I'm all for mod compatibility :)
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Enders

The quick edit button won't show until you refresh the page ><

Eliana Tamerin

Already reported and acknowledged.

Quote from: SlammedDime on June 01, 2008, 04:23:17 AM
The quick edit button is in fact there, its style is just set to 'display:none'.  Unfortunately its due to the way the javascript is setup in SMF.  I'll make a change in the next release to fix this.
Do NOT PM me for support.

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

Nathaniel

Ah thank you, when I clicked on the boards new post icon, it didn't show any new threads so I was getting kind of confused.

Hopefully that will be fixed with SMF 2 Beta 4, or whatever the next version is. :)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

SlammedDime

Quote from: Dannii on June 03, 2008, 09:05:01 PM
QuoteIf I do that, then the urls will not be rewritten after the message is run through the display template unless I turn it back on at the end of the display function, which is really adding unnecessary code. I tried attaching ;pretty to the xml POST hoping that would do it after looking at your code, but it didn't work, even with ;topic= in the POST as well.  Any suggestions on using ;pretty?
Ahh true... I hadn't thought of that. So Display() is now doing the normal viewing and sending the new post back with ajax?

I could change the test from if (!isset($_GET['pretty'])) to if (!isset($_REQUEST['pretty'])) on my end so then it will work for POSTs as well. I'll do that when I update it for beta 4, if you can change yours at the same time that would be great. I'm all for mod compatibility :)
Sounds like a plan.  I'll test it out ahead of time as well and make sure all is well.  If not, I'm sure I can find some way around it. :)
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

iPollesion

Hey SD,

Thank you for the wonderful mod.

Can you help me install your mod properly?

I think I need to edit the custom theme template for the quick reply to show up.

I'm not too positive on how to do so. I just started learning smf.

The leader of my team for hxxp:age-of-chivalry.com [nonactive] has choosen to use smf and it's my job to make sure I know it.

Would you mind assisting me, letting me know what to do.

I already installed and applied the mod successfully, I just don't see it anywhere, not even on the default theme.

Test account: SlammedDime
Test password: thepwiss3cur3d

URL to the forum: hxxp:www.age-of-chivalry.com/smf/ [nonactive]


Thanks in advanced.

P.S. I'd appreciate it if you could post your response here.

SlammedDime

This does not add quick reply to SMF.  That is already there.  This only changes its functionality.  In order to turn on quick reply, you need to go to your profile, then Look and Layout, then for the option of 'Use Quick Reply', change it to 'Show, on by default'.

For your template, please post Display.template.php from your custom theme here. :)
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

If you have either the Single Post Mod or AJAX Preview mod installed, you'll need to uninstall either or both before installing this.  My mod incorporates the Single Post mod, and is incompatible with the AJAX Preview mod.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

Attach them to your next post and I'll take a look at them. :)
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

SlammedDime

Ok evil-angelist, the attached files should work for you.  Apply the mod, ignoring the failures.  Then replace your Display.php and Display.template.php with the ones attached to this post.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

jossanaijr

Hi SlammedDime,
any news about the use of Ad Management Mod?

SlammedDime

jossanaijr - post Display.template.php from your board.  xml_topic.js too.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

jossanaijr

Quote from: SlammedDime on June 07, 2008, 04:18:24 PM
jossanaijr - post Display.template.php from your board.  xml_topic.js too.
OK but I only can do it tomorrow. No FTP right now. Thanks.

_Anthony_

SlammedDime in smf 1.1.5 even with the fix it still shows new on board index

Advertisement: