View Full Version : BB Code Enhancements - BBCode - Real Fractions !!!! Math (UPDATED x2)
orange gold
12-24-2010, 10:00 PM
I did it finally! After hours of trying to figure out how to format a real fraction I came up with the code! Please see the screenshot below and judge for yourself.. It is a real post from my forum and it is all selectable text.. no images involved...
*****https://vborg.vbsupport.ru/external/2010/12/9.jpg*****
*****https://vborg.vbsupport.ru/external/2010/12/9.jpg*****
**Please leave feedback, and mark as installed if you used this, thanks!**
YAY!!!
Here is how:
Admin CP > BBCode > New:
Title:
Fraction
BBCode Tag Name:
frc
Replacement(The code below is improved compared to the code when this post first came out):
<button style="background-color:transparent;border-width:0;font-size:inherit;font-family:inherit;font-style:inherit;font:inherit;font-variant:inherit;font-weight:inherit;text-decoration:inherit;text-transform:inherit;text-shadow:inherit;color:inherit">
<center>
<sub><font style="text-decoration: underline; line-height:110%">{option}</font></sub><br>
<sup><font style="text-decoration: overline; line-height:110%">{param}</font></sup>
</center>
</button>
Example:
10˙(10*a+b)
Description:
Puts a value, a, over a value, b. (a/b)
Use {Option}:
Yes.
Leave everything else default... :D
Enjoy!
*****https://vborg.vbsupport.ru/external/2010/12/9.jpg*****
**Please leave feedback, and mark as installed if you used this, thanks!**
sulasno
12-25-2010, 06:37 AM
tagged and thanks
a Maths forum might find it useful
sadiq6210
12-25-2010, 08:36 AM
Unfortunately it is not working with me
see the screenshots (RTL language)
Merjawy
12-25-2010, 09:00 AM
It works just fine on RTL
Just change the Tag name from frac to frc
sadiq6210
12-25-2010, 09:24 AM
oh :D
Thanks =)
I have two more issues :rolleyes:
see the screen-shot
- How to reverse the direction (for RTL lang.)
- As you see, It is very small, how can I increase the font size just to be clear to read?
Merjawy
12-25-2010, 10:14 AM
I am not sure what you mean by reverse direction.. If you mean to have 1/10 before the rest then you just need to switch things around. like this maybe
(10*a+b)˙10
For the font you can insert font size right after the center tag. something like this
<button style="background-color:transparent;border-width:0">
<center><font size=+1>
<sub><u>{option}</u></sub><br>
<sup><font style="text-decoration: overline;">{param}</font></sup>
</center>
</button>
orange gold
12-25-2010, 11:58 AM
Ahh, yes... There is a slight problem I realized.. The font for the fractions is not the same as the font that you are currently typing in.... I will fix it today after I'm done skiing.. but we leave in like 5 min...
Sorry! haha
It will work though... :D
orange gold
12-25-2010, 12:32 PM
EDIT:
Okay! I added the new code that fixes all the font size, color, style, face, weight, etc issues...
Here is the new replacement code.. it is also in the original post now:
<button style="background-color:transparent;border-width:0;font-size:inherit;font-family:inherit;font-style:inherit;font:inherit;font-variant:inherit;font-weight:inherit;text-decoration:inherit;text-transform:inherit;text-shadow:inherit;color:inherit">
<center>
<sub><font style="text-decoration: underline;">{option}</font></sub><br>
<sup><font style="text-decoration: overline;">{param}</font></sup>
</center>
</button>
https://vborg.vbsupport.ru/external/2010/12/9.jpg
sadiq6210
12-25-2010, 01:25 PM
I am not sure what you mean by reverse direction.. If you mean to have 1/10 before the rest then you just need to switch things around. like this maybe
(10*a+b)˙10
For the font you can insert font size right after the center tag. something like this
<button style="background-color:transparent;border-width:0">
<center><font size=+1>
<sub><u>{option}</u></sub><br>
<sup><font style="text-decoration: overline;">{param}</font></sup>
</center>
</button>
EDIT:
Okay! I added the new code that fixes all the font size, color, style, face, weight, etc issues...
Here is the new replacement code.. it is also in the original post now:
<button style="background-color:transparent;border-width:0;font-size:inherit;font-family:inherit;font-style:inherit;font:inherit;font-variant:inherit;font-weight:inherit;text-decoration:inherit;text-transform:inherit;text-shadow:inherit;color:inherit">
<center>
<sub><font style="text-decoration: underline;">{option}</font></sub><br>
<sup><font style="text-decoration: overline;">{param}</font></sup>
</center>
</button>
https://vborg.vbsupport.ru/attachment.php?attachmentid=124799&d=1293287571
Thanks, I appreciate your efforts (f)
About the font size, I just merged the two codes to get this awesome result :up:
https://vborg.vbsupport.ru/attachment.php?attachmentid=124800&stc=1&d=1293290207
About the direction, hmmmm see the previous screenshot (1/10) should be first like your example
https://vborg.vbsupport.ru/attachment.php?attachmentid=124783&stc=1&d=1293254369
I am not sure what you mean by reverse direction.. If you mean to have 1/10 before the rest then you just need to switch things around. like this maybe
(10*a+b)˙10
It is not useful solution to tell the users to write the equation inverse to get it in right direction, I am looking for another fixing, somthing like that:
https://vborg.vbsupport.ru/showpost.php?p=2138810&postcount=3
orange gold
12-25-2010, 05:09 PM
I know the code. I'm on my phone now skiing. Post it when I'm back
orange gold
12-25-2010, 08:05 PM
I'm sorry.. I don't understand what you mean now either....
On the other example.. He just moved my code in reverse order to get it to work.. You fractions are still fine.. You just need to type the 1/10 after the other fraction since your forum is formated in that language... There is nothing wrong with the code... Your forum types from right to left so you need to type the order of the fractions right to left... Or choose a font that doesn't go left to right such as times new romans and set that for your font on the code...
sadiq6210
12-26-2010, 04:47 AM
I'm sorry.. I don't understand what you mean now either....
On the other example.. He just moved my code in reverse order to get it to work.. You fractions are still fine.. You just need to type the 1/10 after the other fraction since your forum is formated in that language... There is nothing wrong with the code... Your forum types from right to left so you need to type the order of the fractions right to left... Or choose a font that doesn't go left to right such as times new romans and set that for your font on the code...
Thanks for your effort =)
I will explain this issue more :)
If I want to write (3/4) ? (1/4) (which is equal 3), It will appear in my forum with RTL language (1/4) ? (3/4) (which is equal 0.33).
I can't tell all users to write (1/4) ? (3/4) when they want to write (3/4) ? (1/4), and when we have a long equation it will be difficult to get right answer due to this issue.
I know the code is true :) and this issue is something should happen logically when we write from right to left with something should be written from left to right. But I am looking for a smart solution for that. i.e: Can we fix the direction (LTR) just we use this code or ......
orange gold
12-26-2010, 12:54 PM
Unfortunatley.. my code isn't what is causing it to write left to right... If I were to add code to mine that would make it write right to left it wouldn't do anything because the fraction tags are all closed after you write one fraction... What you would have to do is create another tag.. say. then the stuff inside the math tags will write left to right.. I think I can create the math tag for you..
It would be something like this in the end to get your desired effect..
4รท4
orange gold
12-26-2010, 01:01 PM
Try making a new BBCode:
Title: Math
BBCode Tag Name: Math
Replacement:
<textarea dir="ltr">{param}</textarea>
Example: 4?4
Description: Makes things go from left to right, for math equations.
Use {option}: no
Everything else the same..
Should work then if you post something like this..
4?4
miahjoerad
09-23-2011, 06:01 PM
Thanks! It Works Wonderfully For Mee :d
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.