#1
|
|||
|
|||
BB codes not working right
So ive been bothered by this for a while and I cant seem to find the issue.
When I edited text in the index page only some bb codes work, bold, underline so forth However color and size ones wont, they exist in bbcode.php and says it should convert them however for some reason it is not. Heres bbcode.php Code:
<?php // This file parses BBCode for user editable pages // Thanks to TheMagnitude for this code and for sharing // BBcodes mod credit to Teshia function bbconvert($text) { // CONVERT ALL HTML SPECIAL CHARS TO THERE ENTITIES $text = htmlentities($text, ENT_QUOTES); // PARSE BB CODE $text = preg_replace('|\[b\](.+?)\[\/b\]|i', '<strong>$1</strong>', $text); $text = preg_replace('|\[i\](.+?)\[\/i\]|i', '<em>$1</em>', $text); $text = preg_replace('|\[u\](.+?)\[\/u\]|i', '<u>$1</u>', $text); $text = preg_replace('|\[img\](.+?)\[\/img\]|i', '<img src="$1" border="0">', $text); $text = preg_replace('|\[url=(.+?)\](.+?)\[\/url\]|i', '<a href="$1" target="_blank">$2</a>', $text); $text = preg_replace('|\[color=(.+?[^;])\](.+?)\[\/color\]|i', '<span style="color:$1;">$2</span>', $text); $text = preg_replace('|\[size=(.+?[^;])\](.+?)\[\/size\]|i', '<span style="font-size:$1;">$2</span>', $text); $text = preg_replace('|\[left\](.+?)\[\/left\]|i', '<span style="text-align: left;">$1</span>', $text); $text = preg_replace('|\[right\](.+?)\[\/right\]|i', '<span style="text-align: right;">$1</span>', $text); $text = preg_replace('|\[center\](.+?)\[\/center\]|i', '<center>$1</center>', $text); $text = preg_replace('|\[urlsame=(.+?)\](.+?)\[\/urlsame\]|i', '<a href="$1" target="_self">$2</a>', $text); $text = preg_replace('|\[s\](.+?)\[\/s\]|i', '<del>$1</del>', $text); $text = preg_replace('|\[url\](.+?)\[\/url\]|i', '<a href="$1" target="_blank">$1</a>', $text); $text = preg_replace('|\:hr\:|i', '<hr>', $text); $text = preg_replace('|\[youtube\](.+?)\[\/youtube\]|i', '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/$1"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" width="425" height="350"></embed></object>', $text); $text = preg_replace('|\[profile\](.+?)\[\/profile\]|i', '<a href="profile.php?user=$1">$1</a>', $text); $text = preg_replace('|\[imgmap\](.+?)\[\/imgmap\]|i', '<img src="$1" border="0" usemap="#map1">', $text); $text = preg_replace('|\[map\]|i', '<map name="map1">', $text); $text = preg_replace('|\[\/map\]|i', '</map>', $text); $text = preg_replace('|\[where=(.+?)\,(.+?)\,(.+?)\,(.+?)=(.+?)\]|i', '<area shape="rect" coords="$1,$2,$3,$4" href="$5">', $text); $text = preg_replace('|\[wherecirc=(.+?)\,(.+?)\,(.+?)\=(.+?)\]|i', '<area shape="circle" coords="$1,$2,$3" href="$4">', $text); // RETURN HTML RESULT return $text; } ?> |
#2
|
|||
|
|||
Nvm I sorted at least the color some codes didn't work with others im guessing and voided all of them
|
#3
|
||||
|
||||
Well actually starting from Mys v1.3.0 we will be using this WYSIWYG text editor, the BBcodes will no longer be needed. But if you insist on using Bbcodes and they wont work for you, lemme know and I will see what I can do to help you.
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#4
|
|||
|
|||
Ive got most to work took some work goggling to figure out size ive noticed some bb codes dont work with others it just voids them so
I had that issue before I just never solved why but trial and error seems to show some dont work with others |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
forum codes not working? | Nemesis | Questions and Supports | 18 | 07-02-2012 02:31 PM |
How do i use the codes | Soffi | Questions and Supports | 5 | 12-28-2011 02:21 PM |
promo codes | maximillion | Questions and Supports | 5 | 07-05-2011 06:28 PM |
BB CODES | zhiichiro | Questions and Supports | 4 | 03-24-2009 05:52 PM |
codes | Blackmagic | Questions and Supports | 3 | 01-13-2009 07:30 PM |
What's New? |
What's Hot? |
What's Popular? |