Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
Recent Tutorials
Top posting users this month
Top Achievers
Who is online?
In total there are 12 users online :: 0 Registered, 0 Hidden and 12 Guests :: 1 Bot
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
[SOLVED] Size matters
Page 1 of 2 • Share
Page 1 of 2 • 1, 2
As some of you will know I have some problems on my forum and here is one I'm hoping you may be able to help with.
When some text was made bigger on my original forum it would look like this
But on my new forum it still produces the above if you click edit
But what you see once you submit is this
So my thoughts are is it possible to add some BBcode to correct this issue automatically
When some text was made bigger on my original forum it would look like this
- Code:
[size=50]Source notinite.com[/size]
But on my new forum it still produces the above if you click edit
But what you see once you submit is this
- Code:
[size=50:262yzbt1]Source notinite.com
So my thoughts are is it possible to add some BBcode to correct this issue automatically
By default only a few sizes are supported. It's possible to write a script that parses the bbcode. It can have some side effects like the image resizer not working, but if you want to try it, just let me know.
It's for phpbb2, right ?
It's for phpbb2, right ?
Alright, go to Administration Panel > Modules > JavaScript codes management and create a new script
Placement : In the topics
Paste the following code and submit :
Placement : In the topics
Paste the following code and submit :
- Code:
$(function() { for (var p = $('.postbody'), i=0, j=p.length; i<j; i++) if (p[i].innerHTML.match(/\[\/size\]/i)) p[i].innerHTML = p[i].innerHTML.replace(/\[size=(\d+)\](.*?)\[\/size\]/igm,'<span style="font-size:$1px;">$2</span>') });
Hi Ange, it Seemed to work for a short time about a minute, but now it isn't working but this is what I got for a short time
Did work for a short time but its to big
Back to this now
Don't know if this info helps but if I just Edit and change the size (figure) to something 20 or below it works changing the code from this
Did work for a short time but its to big
Back to this now
Don't know if this info helps but if I just Edit and change the size (figure) to something 20 or below it works changing the code from this
- Code:
[size=55]BBC news[/size]
- Code:
[size=20]BBC news[/size]
My mistake I didn't click the correct button In the topics I clicked the one after thinking it was right but that was for the Gallery. Sorry So it works Can we now find away of reducing the size of the text as shown above.
Thank you Ange for all you help here you really are special
Edit...
I don't know what's going on but I popped out and on my return I got a message from Buttercup to say.....
We made a forum backup to get back empty topic. Our technicians also correct your problem with admin and guest
So I checked the posts with the problem we are discussing here and they had changed again,so I ensured my script was still there and yes it is, I then deleted it and made it again but nothing has changed this time. so I have now created a test forum here http://ourbulgariatestforum.betaboard.net/t1-jarva-test1 Copied the post over and then added the script as above and it is working as I am writting this...I will report back later today with any changes.
Thank you Ange for all you help here you really are special
Edit...
I don't know what's going on but I popped out and on my return I got a message from Buttercup to say.....
We made a forum backup to get back empty topic. Our technicians also correct your problem with admin and guest
So I checked the posts with the problem we are discussing here and they had changed again,so I ensured my script was still there and yes it is, I then deleted it and made it again but nothing has changed this time. so I have now created a test forum here http://ourbulgariatestforum.betaboard.net/t1-jarva-test1 Copied the post over and then added the script as above and it is working as I am writting this...I will report back later today with any changes.
Here is the link http://ourbulgariaforum.freeforums.eu/t6641-british-entrepreneurs-invest-in-bulgaria
I have pm'd you with some log in details
I have pm'd you with some log in details
Only once it's posted, it seems to be fine on here http://ourbulgariatestforum.betaboard.net/t1-jarva-test1
I have copied over everyting from 1 to the other ie all Jscript, Templates etc just in case something was clashing but it seems to be fine.
I have copied over everyting from 1 to the other ie all Jscript, Templates etc just in case something was clashing but it seems to be fine.
Just looked at some other topics where the size appears and if I click Edit make no changes and then send it seems to cure the issue, does this tell you anything? perhaps the code you gave me can not look back?
Well what I am trying to say is the code you gave me works but only if the forum thinks its a new topic or the topic has been edited which in effect is the same as a new post.
The 3 images below will show you that new posts are working with your code so it is able to look forward but can not look back to old posts.
Copied post
Preview of post
Posted
The 3 images below will show you that new posts are working with your code so it is able to look forward but can not look back to old posts.
Copied post
Preview of post
Posted
I have now had time to try your code Ange on other forums I run and it only works with this issue so long as its not retrospective so is there a way we can change it so that it is also retrospective so that it will change the code form the past and is it also possible to make the size smaller because at present although it will work it makes the text huge and I mean huge 1 small line of text can take up half my screen.
What's mentioned here : https://fmdesign.forumotion.com/t329-#2258
Looks to be the same problem. If you look at the tag you posted it has the same problem, but with different characters after the size..
I can add to the regex to replace this, but I think that if there's more tags messed up like this on your forum, then they should fix them.
Looks to be the same problem. If you look at the tag you posted it has the same problem, but with different characters after the size..
- Code:
[size=50:262yzbt1]
I can add to the regex to replace this, but I think that if there's more tags messed up like this on your forum, then they should fix them.
Try replacing the script with this :
- Code:
$(function() { for (var p = $('.postbody'), i=0, j=p.length; i<j; i++) if (p[i].innerHTML.match(/\[\/size\]/i)) p[i].innerHTML = p[i].innerHTML.replace(/\[size=(\d+)\](.*?)\[\/size\]/igm,'<span style="font-size:$1px;">$2</span>').replace(/\[size=(\d+):.*?\](.*?)\[\/size\]/igm,'<span style="font-size:$1px;">$2</span>') });
Hi Ange thank you for your efforts and patients. I have changed the script but there is no change to anything
I clicked Edit and then send and I got this
I then clicked edit again and this is what I see
I have now changed the size to 20 which is more acceptable, but still have this issue.
I clicked Edit and then send and I got this
I then clicked edit again and this is what I see
- Code:
[size=75]Sofia echo Mon, Nov 16 2009[/size]
I have now changed the size to 20 which is more acceptable, but still have this issue.
I changed it a bit so that it'll change the size to 24 if it's above 24.
It should also change the bugged tags too.
- Code:
$(function() {
for (var p = $('.postbody'), i=0, j=p.length,n; i<j; i++) {
if (p[i].innerHTML.match(/\[\/size\]/i)) {
n = Number(p[i].innerHTML.match(/\[size=(\d+).*?\]/i)[1]);
p[i].innerHTML = p[i].innerHTML.replace(/\[size=(\d+).*?\](.*?)\[\/size\]/igm,'<span style="font-size:'+(n > 24 ? '24' : '$1')+'px;">$2</span>')
}
}
});
It should also change the bugged tags too.
Tried it and no change at all I still get this
Which can be viewed here http://ourbulgariaforum.freeforums.eu/t661-bulgarian-december-business-outlook-continues-negative-trend
Edit....
Just to show I have done it correctly....
- Code:
[size=75:11h721wp]novinite 28 December 2009
Which can be viewed here http://ourbulgariaforum.freeforums.eu/t661-bulgarian-december-business-outlook-continues-negative-trend
Edit....
Just to show I have done it correctly....
Ooh you're missing the end tag..
The script aims to replace the content up until the end tag. I'll have to figure out how I'm going to do that.. I could probably go until the end of the line, but that might cause major problems if someone forgets to close the tag....
The script aims to replace the content up until the end tag. I'll have to figure out how I'm going to do that.. I could probably go until the end of the line, but that might cause major problems if someone forgets to close the tag....
@FiB give this a shot :
- Code:
$(function() {
for (var p = $('.postbody'), i=0, j=p.length,n; i<j; i++) {
if (p[i].innerHTML.match(/\[size=.*?\]/i)) {
n = Number(p[i].innerHTML.match(/\[size=(\d+).*?\]/i)[1]);
p[i].innerHTML = p[i].innerHTML.replace(/\[size=(\d+).*?\](.*?)\[\/size\]/igm,'<span style="font-size:'+(n > 24 ? '24' : '$1')+'px;">$2</span>').replace(/\[size=(\d+).*?\](.*?)<br>/igm,'<span style="font-size:'+(n > 24 ? '24' : '$1')+'px;">$2</span><br>');
}
}
});
- Sponsored content
Page 1 of 2 • 1, 2
Similar topics
Create an account or log in to leave a reply
You need to be a member in order to leave a reply.
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum
|
|