Guest


    Add @ button on phpBB3

    Share

    GH~

    Add @ button on phpBB3

    Post  GH~ on 10/23/2011, 11:02 am

    Using Dion's script from here: http://diondesigns.forumotion.com/t8401-signature-separator#9964 I made this script.

    Code:
        var x=$('.signature_div').get();
        for (i=0; i<x.length; i++) {
          var y=$(x[i].parentNode.nextSibling).find('dt').text();
          $(x[i]).after('<br/><p class="right"><input class="button2" value="@" onclick="bbfontstyle(\'[b]@'+y+'[/b] \',\'\');return false" type="button" style="height: 22px;"></p>');
    }


    It automatically add @ button after signature in right side. I just edited script, it's not fully mine.

    LGforum

    Re: Add @ button on phpBB3

    Post  LGforum on 10/23/2011, 11:16 am

    Small thing, people with no signature. Poeple without a signature won't have a signature DIV under their posts. And so the loop will skip them.

    Therefore not adding the '@' button to those posts.


    This will ensure it adds the button to all posts as it grabs name from the author. Not all posts have a signature, but all posts have an author.
    Code:

    $(function(){
        var x=$('.postbody').get();
        var a=$('.profile-icons').get();
        for (i=0; i<x.length; i++) {
          var z=$(x[i]).find('p')[0];
          var y=$(z).find('a').text();
          $(a[i]).prepend('<input class="button2" value="@" onclick="bbfontstyle(\'[b]@'+y+'[/b] \',\'\');return false" type="button" style="height: 22px;">');
    });

    It is for phpbb3 and adds the button next to 'quote' and 'edit' etc.

    Raze

    Re: Add @ button on phpBB3

    Post  Raze on 10/23/2011, 12:23 pm

    By @ button what do you mean???

    Dion

    Re: Add @ button on phpBB3

    Post  Dion on 10/23/2011, 12:58 pm

    Using the "p.author" element for the poster's name will not work for guests, since the author is simple text for guests and not a link, and there is additional unwanted text in that element...

    LGforum

    Re: Add @ button on phpBB3

    Post  LGforum on 10/23/2011, 2:39 pm

    For me anyway, no guests will be posting, and will not be needing an @ function. Razz

    To the author, three options to think about.
    1. guests do not post... problem sorted.
    2. take the posters name from the post profile rather than author string.
    3. Look at example 9, add an IF(){} to only display this code for members.

    And to Raze, we mean the '@' button like what you see in the DD-Edit Text Editor here.

    As a side note:
    The thing i am jealous of in the DD-Edit Text Editor, i must say is the QUOTE feature. To be able to highlight any text on the page and click quote.

    Dion

    Re: Add @ button on phpBB3

    Post  Dion on 10/23/2011, 4:05 pm

    LGforum wrote:For me anyway, no guests will be posting, and will not be needing an @ function.

    It isn't a matter of guests posting...if you are reading the post as a guest, your script would abort because a link would not exist in the "p.author" element.

    Your #3 option above solves this problem, though.


    GH~

    Re: Add @ button on phpBB3

    Post  GH~ on 10/24/2011, 8:23 am

    Hmm, yes.
    Code:
    if(document.getElementById('i_icon_mini_logout')) {
    script here
    }


    Solved. Swat

    Guest
    Guest

    Re: Add @ button on phpBB3

    Post  Guest on 10/24/2011, 1:17 pm

    Code:
    if(document.getElementById('logout')) {


    will also work

    Guest
    Guest

    Re: Add @ button on phpBB3

    Post  Guest on 1/11/2012, 9:59 am

    Sorry but i didn't understand what it is for... Sad

    Ryan

    Re: Add @ button on phpBB3

    Post  Ryan on 1/11/2012, 10:24 am

    when click the "@" symbol upon clicking "reply" it'll go @Niko:

    Yoshi!

    Re: Add @ button on phpBB3

    Post  Yoshi! on 1/15/2012, 7:54 pm

    May you show me a preview please ?

      Current date/time is 5/16/2012, 9:36 am