[2.0.17] BBCodes & smilies enhancement

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
15
71%
Very Good
5
24%
Good
1
5%
Fair
0
No votes
Poor
0
No votes
 
Total votes: 21

asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

Great mod for fixing the smilie and bcode placement bugs. URL thing is nice too. But I'm confused about a few things:

1. How should a regular user access the email bbcode enhancements? I know the user can type in the new bbcode by hand like this:

Code: Select all

[email=name@domain.tld+cc@domain.tld?subject]link_name[/email]
but is there supposed to be a bbcode button for the email that helps the user find out about the new possibilities (e.g. an new interface like the new URL interface to help the user walk through the entry)?

2. How do you use the 2x Font function? The Font size dropdown list only shows the original possibilities (tiny, small, normal, large and huge)?

3. I don't understand what this adds with respect to color. The Font colour dropdown list has the same possibilities as it did before...what am I missing?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

And here's another issue:

In firefox (and presumably mozilla) the posting screen jumps up to the top if you insert a smilie in a post that is long enough so that you have scroll bars and are inserting a smilie or bbcode towards the bottom. That does not happen with IE.

Any easy fix for that?

To reproduce the problem, just start a post and type a lot of garbage with a lot of 'enters' in there like this:

df
dsf
dsf
dsf
ds
fsda
f
dsf
dsg
asegf
asd
gs
dfg
sdf
sd
gsadf
g
asdg
sdag
sdf
gsdaf
g
fds
gfdsg
fdsg
fdsg
fds
g

and then insert a smilie or bbcode somewhere in the post where the scroll bar is not at the top (e.g. just stick it close to the bottom of the post). The mod works perfectly to insert the smilie or bbcode where it belongs, but as soon as you insert the smilie or bbcode the scroll bar scrolls up to the top and you are left at the beginning of your post.

Any ideas about that?
Thallium
Registered User
Posts: 395
Joined: Mon Aug 30, 2004 12:30 am
Contact:

they're gone, a little help?

Post by Thallium »

Hi, well I installed this mod and it all seems functional except for one detail. The smilies on the left of the post reply screen are gone, there's the 'emoticons' label, and below that a gap, and then the 'view more emoticons' link, which does work and gives access to all the emoticons, including the ones that should appear above for conveniences sake.

Could someone please tell me what i did wrong, or how to get them back?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

A number of people have asked how to tinker with this mod to allow the user to skip the title of the link and not have it tell the user that he has made an error. Here's the fix for that, which will test for an empty title and if it finds an empty title it will enter the url in the correct format for a url with no title:

Find the part of the mod where it adds the following to templates/subSilver/posting_body.tpl:

Code: Select all

// Start add - BBCodes & smilies enhancement MOD
		if (bbnumber == 16) {
			var errors = '';
			var url = prompt("{L_BBCODE_URL}", "http://");
			var title = prompt("{L_BBCODE_URL_TITLE}", "");
			if (!url) {
				errors += "\n" + "{L_BBCODE_URL_EMPTY}";
			}
			if (!title) {
				errors += "\n" + "{L_BBCODE_URL_TITLE_EMPTY}";
			}
			if (errors) {
				alert("{L_BBCODE_URL_ERRORS}" + "\n" + errors);
				return;
			}

			var text = "[url=" + url + "]" + title + "[/url]";
			if (txtarea.createTextRange && txtarea.caretPos) {
				var caretPos = txtarea.caretPos;
				caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
			} else
			if (txtarea.selectionEnd && (txtarea.selectionStart | txtarea.selectionStart == 0))
			{ 
				mozInsert(txtarea, text, "");
			} else txtarea.value += text;
		} else {
			var text = bbtags[bbnumber];
			if (txtarea.createTextRange && txtarea.caretPos) {
				var caretPos = txtarea.caretPos;
				caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
			} else
			if (txtarea.selectionEnd && (txtarea.selectionStart | txtarea.selectionStart == 0))
			{ 
				mozInsert(txtarea, bbtags[bbnumber], "");
			} else
// End add - BBCodes & smilies enhancement MOD

Change that part of the mod so that it instead reads adds this:

Code: Select all

// Start add - BBCodes & smilies enhancement MOD
		if (bbnumber == 16) {
			var errors = '';
			var url = prompt("{L_BBCODE_URL}", "");
			var title = prompt("{L_BBCODE_URL_TITLE}", "");
			if (!url) {
				errors += "\n" + "{L_BBCODE_URL_EMPTY}";
				alert("{L_BBCODE_URL_ERRORS}" + "\n" + errors);
				return;
			}
			if (!title){
			var text = "[url]" + url + "[/url]";
			}
			else {
			var text = "[url=" + url + "]" + title + "[/url]";
			}
			if (txtarea.createTextRange && txtarea.caretPos) {
				var caretPos = txtarea.caretPos;
				caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
			} else
			if (txtarea.selectionEnd && (txtarea.selectionStart | txtarea.selectionStart == 0))
			{ 
				mozInsert(txtarea, text, "");
			} else txtarea.value += text;
		} else {
			var text = bbtags[bbnumber];
			if (txtarea.createTextRange && txtarea.caretPos) {
				var caretPos = txtarea.caretPos;
				caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
			} else
			if (txtarea.selectionEnd && (txtarea.selectionStart | txtarea.selectionStart == 0))
			{ 
				mozInsert(txtarea, bbtags[bbnumber], "");
			} else
// End add - BBCodes & smilies enhancement MOD
Now does anyone have a suggestion for how to address the question I asked a couple of posts ago about the window scrolling up to the top in firefox when you insert a smilie or bbcode??
Winky
Registered User
Posts: 39
Joined: Mon Sep 13, 2004 7:16 pm
Location: It

Post by Winky »

Hallo,
excuse my bad english :oops:

phpbb ver 2.0.10 modded with easymod

Your great mod was installed succesfully with easymod and some more "major" official mods are there too.


I am having a problem with emoticons external page.


when I open that page trough the link, if I press on the emoticon as first action, emoticon will be correctly pasted onto the board, but if I point the mouse on the board or i do anything else than clicking on that external page as first action, will be impossible to add more emoticons, until I refresh (f5) the main board page (loosing the post)

can anybody help me please?


ty so much


Andreas

Peace
Winky
Registered User
Posts: 39
Joined: Mon Sep 13, 2004 7:16 pm
Location: It

Post by Winky »

I had not a reply here, but probabilly my question was quite lame :oops:



:\ I discovered that this mod has an incompatibility with caret bug fix mod.

removing caret fix mod, the problem reported in my porevious post is disappeared.

Probabilly experts can mix things togheter or probabilly is already done I am not an expert.

Please let me know If caret bug is to be fixed again in another way, or if is already fixed within this module.


take care


Andres


Peace
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

I just realized that my url wizard only works on regular posts, not on private messages. I took a quick look at the code and I suspect the problem is that there is no mod to privmsg.php that would assign the new prompt text to the template for private message. If that's the problem, the fix would be as follows:

Code: Select all

#-----[ OPEN ]------------------------------------------------ 
#
privmsg.php

# 
#-----[ FIND ]------------------------------------------------ 
#
# NOTE: this is a search by part(s) of code line(s)!
# The original line(s) to find is(are) longer and must look like this (if no MOD has already modify them):
#
# 'L_BBCODE_W_HELP' => $lang['bbcode_w_help'],
#
'L_BBCODE_W_HELP' =>

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

// Start add - BBCodes & smilies use enhancement MOD
'L_BBCODE_URL' => $lang['bbcode_url'],
'L_BBCODE_URL_TITLE' => $lang['bbcode_url_title'],
'L_BBCODE_URL_EMPTY' => $lang['bbcode_url_empty'],
'L_BBCODE_URL_TITLE_EMPTY' => $lang['bbcode_url_title_empty'],
'L_BBCODE_URL_ERRORS' => $lang['bbcode_url_errors'],
// End add - BBCodes & smilies use enhancement MOD
If I get a chance I'll try this tonight and report back.
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

Yup, the fix for URL in private messages I posted in my last post works fine.
User avatar
Grooveman
Registered User
Posts: 37
Joined: Sun Jan 18, 2004 1:24 pm
Location: France
Contact:

Post by Grooveman »

Great mod, this one. I've installed it on my board and it works very well. :P

Just 2 points I wonder someone could resolve and that could make this mod even more perfect:

1: In the basic subSilver version, when you hover over a smiley, you get a pop-up field with its description, while in the bottom of the window it will say: javascript:emoticon(':code:'), where :code: would be the code of the smiley. The handy thing about that is that you get to learn the codes of the smileys better that way. And some people just like to see the code.

Is it possible to have the code displayed somewhere, when hovering over a smiley? This could be in the pop-up or in the bottom of the window. It could be an option when installing the mod.

I tried to find in the script if this feature could be added easily, but didn't find any obvious solution (as this would be the case for someone who's not a PHP programmer)...


2: When you insert a smiley, and when you do this after a substantial amount of text, which means the text window has scrolled on, then automatically the text window will be scrolled up when doing the insert. This is easily resolved simply by scrolling back down, or by clicking one of the arrow keys on your keyboard (if necessary after clicking the scroll bar), but nevertheless, it can be an annoyance for less handy folks.... Can this be fixed?


Just 2 suggestions.

Cheers :D
BoomShake007
Registered User
Posts: 72
Joined: Sun Jan 23, 2005 6:53 pm

Post by BoomShake007 »

2 problems:

1. Same as above--When you insert a BBCode with a button after the post scrolls, it refreshes it back to the top (but still inserts it).

2. A few of my users are running Safari, and they have complained that this mod dosent work for them. In reading your notes, Safari wasn't listed, and I was hoping someone may have more information or perhaps a fix.

Thanks, and great mod when it works!
User avatar
-=ET=-
Registered User
Posts: 799
Joined: Sun May 25, 2003 5:32 pm

Post by -=ET=- »

VodkaShot wrote: That would be my second wish because some users may not be aware of that feature and try to use url button anyway.
But more importantly, you need to get rid of that error window which appears after pressing the cancel button.

OK, I'll add it in the new release soon :wink:
asinshesq wrote: 1. How should a regular user access the email bbcode enhancements? I know the user can type in the new bbcode by hand like this:

Code: Select all

[email=name@domain.tld+cc@domain.tld?subject]link_name[/email]
but is there supposed to be a bbcode button for the email that helps the user find out about the new possibilities (e.g. an new interface like the new URL interface to help the user walk through the entry)?

The MOD does not add any BBCode or button. It just enhance what already exists.
asinshesq wrote: 2. How do you use the 2x Font function? The Font size dropdown list only shows the original possibilities (tiny, small, normal, large and huge)?

If you select a font size and want to apply it a second time to another test selection, with phpBB you can't because the dropdown list stay on the size previously selected. With my MOD the font size always go back to "normal" to let you select another time the same different font size as the last selected one.
asinshesq wrote: 3. I don't understand what this adds with respect to color. The Font colour dropdown list has the same possibilities as it did before...what am I missing?

Yep but in phpBB the background of the dropdown list as none of the 2 backgroung colors used to display posts.
Then the fix is to use one of the 2 to give the best overview as possible of how the text will look after the color selection.
I agree that for subSilver it's not very useful, but with some other style and colors it is![/quote]
asinshesq wrote: And here's another issue:

In firefox (and presumably mozilla) the posting screen jumps up to the top if you insert a smilie in a post that is long enough so that you have scroll bars and are inserting a smilie or bbcode towards the bottom. That does not happen with IE.

Any easy fix for that?

Unfortunately, not yet :(
Grooveman wrote: 1: In the basic subSilver version, when you hover over a smiley, you get a pop-up field with its description, while in the bottom of the window it will say: javascript:emoticon(':code:'), where :code: would be the code of the smiley. The handy thing about that is that you get to learn the codes of the smileys better that way. And some people just like to see the code.

Is it possible to have the code displayed somewhere, when hovering over a smiley? This could be in the pop-up or in the bottom of the window. It could be an option when installing the mod.

I tried to find in the script if this feature could be added easily, but didn't find any obvious solution (as this would be the case for someone who's not a PHP programmer)...

After installing my MOD, in posting_body.php, find...

Code: Select all

<td><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" onmouseover="this.style.cursor='hand';" onclick="emoticon('{smilies_row.smilies_col.SMILEY_CODE}');" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></td> 
...and replace...

Code: Select all

title="{smilies_row.smilies_col.SMILEY_DESC}
...by...

Code: Select all

title="{smilies_row.smilies_col.SMILEY_CODE}
:wink:
BoomShake007 wrote: 2. A few of my users are running Safari, and they have complained that this mod dosent work for them. In reading your notes, Safari wasn't listed, and I was hoping someone may have more information or perhaps a fix.

I don't have Safari so I can't test on it. Sorry :(

----------------

A new release is coming soon. It will...
- Fix an issue on Mozilla/Firefox when the insert point is at the beguining of the textarea
- Fix prompt box messages not displayed when using the [url] wizard for PMs
- Add the possibility not to type an url title
- Make the Cancel buttons for the [url] wizard works
- And normaly will add a new fix... to be continued :wink:
Eternal newbie
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

-=ET=- wrote:
VodkaShot wrote:That would be my second wish because some users may not be aware of that feature and try to use url button anyway.
But more importantly, you need to get rid of that error window which appears after pressing the cancel button.

OK, I'll add it in the new release soon :wink: ...

See my September 18, 2004 and December 6, 2004 posts above if you want it earlier ;)
-=ET=- wrote:
asinshesq wrote:...And here's another issue:

In firefox (and presumably mozilla) the posting screen jumps up to the top if you insert a smilie in a post that is long enough so that you have scroll bars and are inserting a smilie or bbcode towards the bottom. That does not happen with IE.

Any easy fix for that?

Unfortunately, not yet :( ...

I found one. See http://www.phpbb.com/phpBB/viewtopic.php?t=221270 for the answer.
User avatar
-=ET=-
Registered User
Posts: 799
Joined: Sun May 25, 2003 5:32 pm

Post by -=ET=- »

asinshesq wrote: See my September 18, 2004 and December 6, 2004 posts above if you want it earlier ;)

It's already done ; and your suggest does not fix the cancel button use :)
asinshesq wrote: I found one. See http://www.phpbb.com/phpBB/viewtopic.php?t=221270 for the answer.

No. This MOD has nothing to do with the issue you want to fix.

The Caret Bug MOD fix an issue, only on IE, when smiles or BBCodes codes are added at the top left of the page instead of the correct position in the textarea.

Your need is to prevent a full scroll down of the text when you add a smilie or a BBCode in a long text on Mozilla/Firefox.
Eternal newbie
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

-=ET=- wrote:
asinshesq wrote:See my September 18, 2004 and December 6, 2004 posts above if you want it earlier ;)

It's already done ; and your suggest does not fix the cancel button use :)

Actually, my cancel button works fine...but perhaps I fixed that later and never posted it ;)

-=ET=- wrote:
asinshesq wrote:...I found one. See http://www.phpbb.com/phpBB/viewtopic.php?t=221270 for the answer.

No. This MOD has nothing to do with the issue you want to fix.

The Caret Bug MOD fix an issue, only on IE, when smiles or BBCodes codes are added at the top left of the page instead of the correct position in the textarea.

Your need is to prevent a full scroll down of the text when you add a smilie or a BBCode in a long text on Mozilla/Firefox.


I'm not talking about the mod at that thread. You are correct that the mod at that thread deals with the IE caret bug mod, but the discussion, if you read all of it in the entire thread and follow the various links, gets you the answer for the firefox and moz smilie isnertion problem. I am running firefox with your mod and smilies insert at the correct place when I try to insert them in the middle of a post.

I had this exact problem, as you can see from this post: http://www.phpbb.com/phpBB/viewtopic.ph ... highlight=
And as you can also see from that thread, Mav suggested I carefully read the entire caret bug thread for the answer. I did that about 6 months ago and I don't really remember the answer, but I do remember struggling over that convoluted thread and finally having a eureeka moment when I figured out why Mav had suggested I look at that thread.

Sorry I don't remember more...if you can't figure it out after staring at it for a while I'll try to retrace my steps but I probably won't have time to do that for a while. Or maybe you could pm Mav?
User avatar
-=ET=-
Registered User
Posts: 799
Joined: Sun May 25, 2003 5:32 pm

Post by -=ET=- »

Hum... :roll:

You post...
asinshesq wrote: Thanks, it does help.

...the 15th of september.

And in the Caret Bug fix topic I've found nothing interresting to fix this issue before this date.

Can you send me your posting_body.tpl file by mail? (my email is in my MODs)
Eternal newbie
Post Reply

Return to “[2.0.x] MOD Database Releases”