FM Design
Would you like to react to this message? Create an account in a few clicks or log in to continue.

IMPORTANT

FM Design is in read-only mode, please click here for more information.

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

Recent Tutorials
Top posting users this month

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

None

[ View the whole list ]


Most users ever online was 515 on Tue 14 Sep 2021, 15:24

[SOLVED] Size matters

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Fri 20 Feb 2015, 18:45

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

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
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Sat 21 Feb 2015, 00:26

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 ?
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Sat 21 Feb 2015, 03:14

Yes its phpbb2 and I would like to try this Wink
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Sat 21 Feb 2015, 19:46

Alright, go to Administration Panel > Modules > JavaScript codes management and create a new script

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>') });
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Sun 22 Feb 2015, 05:04

Hi Ange, it Seemed to work for a short time about a minute, but now it isn't working Shocked but this is what I got for a short time

Did work for a short time but its to big

[SOLVED] Size matters Captur15

Back to this now

[SOLVED] Size matters Captur16

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]
to this
Code:
[size=20]BBC news[/size]
Hope that makes sense Embarassed but obviously I can't do them all manually.
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Sun 22 Feb 2015, 17:47

That's weird how it would stop working out of nowhere. Is it in a specific topic ?
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Mon 23 Feb 2015, 02:38

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 Embarassed Embarassed Embarassed So it works Wink 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 [SOLVED] Size matters Bow[SOLVED] Size matters Bow

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.
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Mon 23 Feb 2015, 07:37

Weird, where's a link to one of these posts ?
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Mon 23 Feb 2015, 07:44

Here is the link http://ourbulgariaforum.freeforums.eu/t6641-british-entrepreneurs-invest-in-bulgaria

I have pm'd you with some log in details Wink
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Mon 23 Feb 2015, 08:48

That's weird, so it's missing the end tag ?
Code:
[/size]
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Mon 23 Feb 2015, 08:50

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.
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Mon 23 Feb 2015, 08:54

I just added a space between the code and the text below and it now shows ok so maybe its the size of the text?????

FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Mon 23 Feb 2015, 09:01

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?
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Mon 23 Feb 2015, 09:33

I'm as confused as you are.. reflect
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Mon 23 Feb 2015, 09:40

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

[SOLVED] Size matters Copied10

Preview of post

[SOLVED] Size matters Previe10


Posted

[SOLVED] Size matters Posted10
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Tue 24 Feb 2015, 02:59

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.
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Tue 24 Feb 2015, 23:43

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.. reflect
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.
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Wed 25 Feb 2015, 02:46

Anything you can do which will help will be very much appreciated, thank you Ange. [SOLVED] Size matters Bow
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Wed 25 Feb 2015, 08:33

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>') });
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Wed 25 Feb 2015, 08:39

Hi Ange thank you for your efforts and patients. I have changed the script but there is no change to anything

[SOLVED] Size matters Captur17

I clicked Edit and then send and I got this

[SOLVED] Size matters Captur18

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.
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Wed 25 Feb 2015, 09:08

I changed it a bit so that it'll change the size to 24 if it's above 24.
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.
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Wed 25 Feb 2015, 09:14

Tried it and no change at all I still get this
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....

[SOLVED] Size matters Captur19
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Wed 25 Feb 2015, 10:08

Ooh you're missing the end tag.. scratch

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.... reflect
FiB
FiB

Gender : Male
Posts : 185
Points : 3657
Reputation : 14
Location : UK
Language : Eng
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://www.ourbulgariaforum.com

PostFiB Wed 25 Feb 2015, 10:16

Anything is worth a try Ange [SOLVED] Size matters Notebook
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12044
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Wed 25 Feb 2015, 14:57

@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

PostSponsored content

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

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