Who is online?
In total there are 3 users online :: 0 Registered, 0 Hidden and 3 Guests

None

[ View the whole list ]


Most users ever online was 246 on Tue 31 Jan - 2:47
Statistics
We have 150 registered users
The newest registered user is Luxic

Our users have posted a total of 2050 messages in 200 subjects
Latest topics
» A small share
by Flora Today at 21:03

» Edit the 404 page on Forumotion
by LGforum Today at 15:29

» How to Change The Homepage?
by LGforum Today at 15:28

» Counter for my notices box
by Niko Today at 15:03

» 21. Show Recent Topics Preview In Accordion
by ReBoRN Yesterday at 19:08

9. Quote Post in Quick Reply (no page change)

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

9. Quote Post in Quick Reply (no page change)

Post by LGforum on Fri 11 Nov - 10:46

9. Quote post in Quick reply

What this script will do is change the function of your Quote button. Instead of taking you to another page with the quoted post, it will now put the post in the Quick Reply editor, without changing page. So when you click on the Quote button, you will see the quote in the quck reply.

Multiple Quote buttons can be clicked on the page for a nice and easy 'Multiquote' feature. Wink

This will work in board type PHPBB3, Invision and PunBB. I didn't check phpbb2... out of laziness.
Also, for punBB (and phpbb2) it will not work if you have edited the class name of Quote button.

What you must do now is visit Javascript Management and create a new file. (or put it in another jQuery function if you know what you're doing). Tick 'in the topics' since it only needs to run on topc pages.

and here is the code:
[noguest]
Code:

var CopyrightNotice='Quick Quote in Quick Reply for forumotion boards. Copyright © by AvacWeb. All Rights Reserved. Use and  modification of this script is not allowed without this entire copyright notice in the original, copied, or modified script. No distribution without consent.';
$(function() {
$('.i_icon_quote').click(function(e) { e.preventDefault();
  var url=this.parentNode.href;
  $('body').append('<div id="LGquote" style="display:none"></div>');
  var x=$('#LGquote');
  x.load(url + ' textarea', function() {
    var message=x.find('textarea').val();
    var y=document.getElementById('quick_reply').message;
    y.value+=message; y.focus();
    $('#LGquote').remove();
  });
 });
});

[/noguest]

The same thing can be done for the Edit feature, but would require a bit more. But it is perfectly possible to click edit and be able to edit your post from the Quick Reply. I wonder if anyone can figure it out from this Wink


Last edited by LGforum on Thu 5 Jan - 3:11; edited 4 times in total

LGforum


Forum Version: Phpbb3
Posts: 729
Join date: 2011-10-05
Location: UK

View user profile http://www.avacweb.com

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by Johnny on Wed 23 Nov - 7:33

Amazing, thanks LGForum >Very Happy

Johnny

Posts: 25
Join date: 2011-11-13

View user profile

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by redindian on Mon 28 Nov - 5:27

Fantastic LGForum. Thank you..

redindian

Posts: 14
Join date: 2011-11-28
Age: 36
Location: Malaysia

View user profile http://www.eegarai.net

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by redindian on Mon 28 Nov - 5:37

Sorry bro, not working in wysiwyg mode.

redindian

Posts: 14
Join date: 2011-11-28
Age: 36
Location: Malaysia

View user profile http://www.eegarai.net

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by Flora on Thu 1 Dec - 4:04

@ redindian's Turn the wysiwyg mode off. Go to: Admin>General>Messages Emails>Configuration. Scroll down under the messages to find: Activate the WYSIWYG mode by default in the posts : Cick "no."

Then try this again. It should work. Smile

Edited to say: I tested this on my board (phpbb3). Works fine. Wink

Flora


Status Status: If you like gardening, please join my site. Ty. :)
Forum Version: Phpbb3
Posts: 151
Join date: 2011-11-18
Location: USA

View user profile http://www.chlorisgarden.com

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by Suuki on Sat 3 Dec - 21:23

Just tested it and it does not work in phpBB2, unless I did something wrong.

Suuki

Posts: 34
Join date: 2011-11-07

View user profile

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by Flora on Sat 3 Dec - 22:24

Suuki wrote:Just tested it and it does not work in phpBB2, unless I did something wrong.


I don't think the problem was that you did something wrong. The code wasn't tested for phpbb2.

Flora


Status Status: If you like gardening, please join my site. Ty. :)
Forum Version: Phpbb3
Posts: 151
Join date: 2011-11-18
Location: USA

View user profile http://www.chlorisgarden.com

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by Suuki on Sat 3 Dec - 22:29

Flora wrote:
Suuki wrote:Just tested it and it does not work in phpBB2, unless I did something wrong.


I don't think the problem was that you did something wrong. The code wasn't tested for phpbb2.


Yeah XD

Suuki

Posts: 34
Join date: 2011-11-07

View user profile

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by redindian on Mon 5 Dec - 18:44

Flora wrote:@ redindian's Turn the wysiwyg mode off. Go to: Admin>General>Messages Emails>Configuration. Scroll down under the messages to find: Activate the WYSIWYG mode by default in the posts : Cick "no."

Then try this again. It should work. Smile

Edited to say: I tested this on my board (phpbb3). Works fine. Wink


Thank you Flora. cheers

redindian

Posts: 14
Join date: 2011-11-28
Age: 36
Location: Malaysia

View user profile http://www.eegarai.net

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by LGforum on Mon 5 Dec - 18:47

Hmm, one day i'll explain the issues with this method and update this tutorial to a much better way.

Howeer until then, i'd recommend to everyone not to use this if you are regularly posting code on the site. Such as this site, this tutorial would be BAD on this site.

EDIT: its been updated to fix the issues.


Last edited by LGforum on Wed 7 Dec - 16:59; edited 1 time in total

LGforum


Forum Version: Phpbb3
Posts: 729
Join date: 2011-10-05
Location: UK

View user profile http://www.avacweb.com

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by Flora on Mon 5 Dec - 19:28

@ redindian - You're welcome. Glad I was able to help. Smile

Flora


Status Status: If you like gardening, please join my site. Ty. :)
Forum Version: Phpbb3
Posts: 151
Join date: 2011-11-18
Location: USA

View user profile http://www.chlorisgarden.com

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by ion-cube on Tue 6 Dec - 2:00

I have been working with this code lately & figuring out solution to a bug; but am unable.
The bug is when the quoted text contains the character &
so when quoted every & converts to &amp; [the original html syntax] for &




ion-cube

Status Status: Testing
Posts: 121
Join date: 2011-10-19
Age: 23
Location: Pakistan

View user profile

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by LGforum on Tue 6 Dec - 2:19

Your correct that is the bug.
However it is the same with every special character. Because this method gets the quotes text from the HTML, then it will always have the issue of presenting special characters with their HTML equivalents.

Since it someone has brought it up. I'll provide a fixed code sometime soon Razz

EDIT: its been fixed.


Last edited by LGforum on Wed 7 Dec - 16:59; edited 1 time in total

LGforum


Forum Version: Phpbb3
Posts: 729
Join date: 2011-10-05
Location: UK

View user profile http://www.avacweb.com

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by ion-cube on Tue 6 Dec - 2:50

well off-topic, I am missing you somewhere else though your company has always been a pleasure; plus may I point out that when quote is clicked page doesnt scrolls down in Firefox/Chrome but yes in Opera.
i hav tried simpler approach like ths
[noguest]
Code:
$(function() {
    $('.i_icon_quote').click(function() {
        var x = this.parentNode.href;

        $.get(x, function(response) {

            var findmsg = response.indexOf('<textarea id="text_editor_textarea');
            var start = response.indexOf('>', findmsg) + 1;
            var end = response.indexOf('</textarea>');
            var message = response.substring(start, end);
            document.post.message.value += message;
      //    window.location = window.location.href += '#bottom'; //removed
      document.getElementById("text_editor_textarea").focus();   

        });
        return false;
    });
});
[/noguest]

ths works $('#text_editor_textarea').focus(); any other approach i be happy to listen

ion-cube

Status Status: Testing
Posts: 121
Join date: 2011-10-19
Age: 23
Location: Pakistan

View user profile

Back to top Go down

Re: 9. Quote Post in Quick Reply (no page change)

Post by LGforum on Tue 6 Dec - 3:23

Focusing on the textarea is great addition, i like it Wink

I miss somewhere else too. But I can't come back unfortunately.

LGforum


Forum Version: Phpbb3
Posts: 729
Join date: 2011-10-05
Location: UK

View user profile http://www.avacweb.com

Back to top Go down

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top


Permissions in this forum:
You cannot reply to topics in this forum