 |
 |
 |
 |
#217979 - 07/17/02 08:40 PM
Re: Looping needed for nested tags?
[Re: c0bra]
|
Addict
Registered: 04/23/02
Posts: 1929
Loc: Virginia, USA
|
By looping, I mean doing something like this:<br /><br />do {<br /> $count = 0;<br /> if (preg_replace($pattern1, $repl1, $subject) != $subject) ++$count;<br /> if (preg_replace($pattern2, $repl2, $subject) != $subject) ++$count;<br /> if (preg_replace($pattern3, $repl3, $subject) != $subject) ++$count;<br />} while ($count > 0);<br /><br />(In Perl, this can be done more concisely. I'm not sure if the above is the best way to do it in PHP.)<br /><br />I found that approach necessary for certain nestable tags.<br /><br />In later versions of UBB.classic, that approach was added for all of the markup translation.<br /><br />I think that UBB.classic, unlike UBB.threads, always translates the opening and closing tags in a single regex replacement. Perhaps the advantage of the former approach is that it makes it harder for a user to mess up a post by using unmatched tags. There might also be security benefits, since by regex-ing the text between the opening and closing tags, you can make sure that nothing "sneaky" is being done.
_________________________
UBB.threads beta tester / threadsdev.com moderator Software consulting services including UBB.threads problem resolution / installs / upgrades / customization.
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#217981 - 07/18/02 01:42 AM
Re: Customizable Markups Hack for UBBT6 final
[Re: c0bra]
|
Guru
Registered: 05/11/99
Posts: 8372
Loc: Olympia, WA
|
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#217987 - 07/20/02 07:41 PM
New release: MarkupHack 1.0alfa9
[Re: c0bra]
|
Addict
Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
|
Changes:<br /> - Clarified the INSTALL instructions a bit.<br />
- Added [font:style], [size:X], [indent] and [right] markups.<br />
- It is now possible to change the order of the Graemlins.<br />
- Added a simpler form for adding new markups.<br />
<br /> Mod Name / Version - MarkupHack 1.0alfa9<br /> Description - This is a hack that allows the admin to add/change/delete markup tags from the administration menu, as well as easily add or remove Graemlins. All Markups and Graemlins from UBB.threads v6.0 are included in this package, as well as some new markups. <br /> Working under - UBB.threads 6.0.1, 6.0.2 <br /> Any pre-requisites - PHP4 <br /> Author(s) - Gardener <br /> Credits - Dalar, WrĊith and others for help. <br /> Demo - Download zip file of screenshots<br /> Files Altered - ubbt.inc.php, admin/menu.php, ubbt_instant_ubbcode.tmpl <br /> Database Altered - Yes, new table: w3t_Markup <br /> New Files - admin/editmarkup.php, admin/doeditmarkups.php, admin/addmarkup.php, admin/doaddmarkup.php, admin/addgraemlin.php, admin/doaddgraemlin.php, admin/showgraemlins.php, admin/dodeletegraemlins.php <br /> Any other info - Just download the attached file and unzip it into your UBB.threads directory. Beware that the template file ubbt_instant_ubbcode.tmpl will be overwritten! Then follow the install instructions in the markuphack-README.txt file.
Attachments
52917-markuphack-1.0alfa9.zip (22 downloads)
|
|
Top
|
|
|
|
 |
 |
 |
 |
|
|