All times are UTC - 6 hours   |  Page 1 of 1

Dion Designs

Add @ button on phpBB3

Add @ button on phpBB3

Posted: October 23rd 2011, 10:02am
by GH~
Using Dion's script from here: http://www.diondesigns.org/t8401-signature-separator#9964 I made this script.

Code: Select all
    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.

Add @ button on phpBB3

Posted: October 23rd 2011, 10:16am
by LGforum
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: Select all

$(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.

Add @ button on phpBB3

Posted: October 23rd 2011, 11:23am
by Raze
By @ button what do you mean???

Add @ button on phpBB3

Posted: October 23rd 2011, 11:58am
by Dion
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...

Add @ button on phpBB3

Posted: October 23rd 2011, 1:39pm
by LGforum
For me anyway, no guests will be posting, and will not be needing an @ function. :P

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.

Add @ button on phpBB3

Posted: October 23rd 2011, 3:05pm
by Dion
LGforum said:
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.

Add @ button on phpBB3

Posted: October 24th 2011, 7:23am
by GH~
Hmm, yes.
Code: Select all
if(document.getElementById('i_icon_mini_logout')) {
script here
}


Solved. Image

Add @ button on phpBB3

Posted: October 24th 2011, 12:17pm
by Guest
Code: Select all
if(document.getElementById('logout')) {


will also work

Add @ button on phpBB3

Posted: January 11th 2012, 9:59am
by Guest
Sorry but i didn't understand what it is for... :(

Add @ button on phpBB3

Posted: January 11th 2012, 10:24am
by Ryan
when click the "@" symbol upon clicking "reply" it'll go @Niko:

Add @ button on phpBB3

Posted: January 15th 2012, 7:54pm
by Yoshi
May you show me a preview please ?

Add @ button on phpBB3

Posted: June 18th 2013, 6:50pm
by David B
GH~ said:
Hmm, yes.
if(document.getElementById('i_icon_mini_logout')) {
script here
}
Why don't you do this instead?

Code: Select all
<!-- IF S_USER_LOGGED_IN -->
Whatever you want to be do only if the person is a member goes in here.
<!-- ENDIF -->