php forum
php mysql forum
php mysql smarty
 
Page 4 of 6 < 1 2 3 4 5 6 >
Topic Options
#217977 - 07/17/02 07:44 PM Re: Looping needed for nested tags? [Re: Sally]
Dave_L_dup1 Offline
Addict

Registered: 04/23/02
Posts: 1929
Loc: Virginia, USA
This hack looks kewl. <img src="/forum/images/icons/cool.gif" alt="" /> <br /><br />There's one potential concern.<br /><br />In UBB.classic, it was necessary to loop over the regex replacement operations to ensure that nested tags were translated properly. The /g (replace-all)modifier doesn't deal adequately with nesting.<br /><br />Some (maybe most) tags aren't nestable, and this wouldn't be a factor in those cases. But some tags, such as a UBB Code font extension I added, required it.<br /><br />The UBB.threads code doesn't appear to loop, although I didn't study it all that closely. Could this be a problem?
_________________________
UBB.threads beta tester / threadsdev.com moderator
Software consulting services including UBB.threads problem resolution / installs / upgrades / customization.

Top
#217978 - 07/17/02 08:02 PM Re: Looping needed for nested tags? [Re: joeuser]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
What do you mean by looping? And in what way doesn't the nesting of tags work?<br /><br />Many of the start and closing tags are exchanged separately, which might cause some problems if they aren't closed properly when writing the post. But on the other hand it makes it possible to nest them, so that text can be both centered and bold. Some of the tags have the start and stop tags connected together, in which case it isn't possible to have any other tags inside them. This is especially true for the url-tags and such, which should have anything else inside.<br /><br />But I haven't changed the way the tags are handled, except for some minor tweakings here and there.
_________________________
/Gardener | Complete list of my mods

Top
#217979 - 07/17/02 08:40 PM Re: Looping needed for nested tags? [Re: c0bra]
Dave_L_dup1 Offline
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
#217980 - 07/17/02 10:00 PM Re: Looping needed for nested tags? [Re: joeuser]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
Ah, OK, now I see. Only one of the each replacement is done for each loop. But isn't the same thing achieved by non-greedy regexps? That is one of the things I have changed in the markups, they are always non-greedy, which I think was because of something like this. Can't remember though... =]<br /><br />But if Scream is going to change the markup system I'd say it is a good idea to look them over and make sure they work as good as possible and are as safe as possible. Changing [ b ] tags (etc) so that they are done with a single regexp is a good thing to start with, because if the user forgets a closing tag, the rest of the page will be bold. Not so good at all. =]
_________________________
/Gardener | Complete list of my mods

Top
#217981 - 07/18/02 01:42 AM Re: Customizable Markups Hack for UBBT6 final [Re: c0bra]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8372
Loc: Olympia, WA
Good idea.
_________________________
StogieSmokers.com

Top
#217982 - 07/18/02 01:02 PM Re: Customizable Markups Hack for UBBT6 final [Re: Sally]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8372
Loc: Olympia, WA
And as a followup. I'll probably be adding the graemlin portion and then work on the markup portion for another version.
_________________________
StogieSmokers.com

Top
#217983 - 07/18/02 03:22 PM Re: Customizable Markups Hack for UBBT6 final [Re: Sally]
Dave_L_dup1 Offline
Addict

Registered: 04/23/02
Posts: 1929
Loc: Virginia, USA
I'm not sure that there's a problem with the way that threads does the markups now. I just thought I'd bring this up as long as this area is being worked on.<br /><br />You might confer with Charles or Dave to see why UBB.classic does it that way.
_________________________
UBB.threads beta tester / threadsdev.com moderator
Software consulting services including UBB.threads problem resolution / installs / upgrades / customization.

Top
#217984 - 07/18/02 03:31 PM Re: Looping needed for nested tags? [Re: c0bra]
Dave_L_dup1 Offline
Addict

Registered: 04/23/02
Posts: 1929
Loc: Virginia, USA
I don't think that the greedy/non-greedy feature is powerful enough to handle nested tags when you're trying to match the entire expression, including the opening and closing tags. When I was implementing my UBBCode font tag, I experimented with that, and had to resort to using a loop. I think the problem was that the inner tags were getting swallowed. But maybe I didn't try hard enough. Or maybe the more advanced regex features (look-ahead/look-behind assertions) would help.
_________________________
UBB.threads beta tester / threadsdev.com moderator
Software consulting services including UBB.threads problem resolution / installs / upgrades / customization.

Top
#217985 - 07/18/02 05:17 PM Re: Looping needed for nested tags? [Re: joeuser]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
I do think it is possible, although my knowledge isn't enough to create it I guess. I might try to do some reading and see if I can come up with anything.<br /><br />But how much of a problem is there, are people having trouble with not being able to use markups? Are layout problems occurring that often? I've seen it once or twice maybe and fixed it in the post and I've got quite a busy board.
_________________________
/Gardener | Complete list of my mods

Top
#217986 - 07/20/02 03:30 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: c0bra]
flyingcrow Offline
Junior Member

Registered: 05/17/01
Posts: 32
I just tried installing this hack and got an error message:<br /><br />ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)<br /><br />Digging through FAQ files, I found the following fix:<br /><br />On a UNIX system without sockets support you must always specify the hostname explicitly when connecting to the server. Try using this command to check the connection to the server:<br /><br />shell> mysqladmin -h `hostname` version<br /><br />If it works, then add "-h `hostname`" to the mysql command line.<br /><br />It worked for me.<br /><br />FC

Top
#217987 - 07/20/02 07:41 PM New release: MarkupHack 1.0alfa9 [Re: c0bra]
Gardener Offline
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)

_________________________
/Gardener | Complete list of my mods

Top
#217988 - 07/20/02 10:56 PM Re: Screenshots provided [Re: c0bra]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
Installs easily and you have finally solved the one draw back that I hated with your initial version. You now have the graemlins and code automatically update in the instant ubbcode. Cool!!
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#217989 - 07/21/02 10:04 AM Re: Screenshots provided [Re: sf49rminer]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
The Graemlins have updated in the instant graemlins box for quite a few versions. But new markups are still not shown in the Markup box, since that would need extra information to be added. But that is planned for the next release along with the FAQ information and then I will probably have a feature freeze for 1.0 and go into beta. =]
_________________________
/Gardener | Complete list of my mods

Top
#217990 - 07/24/02 12:29 AM Re: Screenshots provided [Re: c0bra]
WrĊith Offline
Enthusiast

Registered: 01/31/02
Posts: 310
Loc: California, USA
Hey Gardener:<br /><br />Great hack! I've got it running on my testboard ready to move into production, but I have one question. Where would I change how the graemlins get written into the ubbt_instant_ubbcode.tmpl file? I'd like to increase the number of graemlins in the array from 5 per row to 6 in order to conserve space. I tried looking in the ubbt.inc.php file and I can't see where any variable is defined there.<br /><br />Can you help me out with that?

Top
#217991 - 07/24/02 02:46 AM Re: Screenshots provided [Re: SDS]
WrĊith Offline
Enthusiast

Registered: 01/31/02
Posts: 310
Loc: California, USA
One other thing I've noticed, the Reply w/Quote code isn't correctly translating HTML back to markup. My original hack worked fine, but the code used in this hack isn't replacing the HTML with the correct markup tags. It seems that some of the tags are conflicting with each other. <br /> <br />You can see what I'm talking about here and here.


Edited by WrĊith (07/24/02 02:50 AM)

Top
#217992 - 07/24/02 11:12 AM Re: Screenshots provided [Re: SDS]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
To have rows of six graemlins, you will need to change this row in ubbt_instant_ubbcode.tmpl:<br /><pre><font class="small">code:</font><hr> $instant_graemlins_here .= (($s + 1) % 5) ? "" : "<br />"; //UBBTREMARK</pre><hr><br /><br />The number 5 is the number of graemlins per row, just change it into 6. I'll have a config option for this in the next version, I meant for it to be that way but I forgot about it.<br /><br />Regarding the conflict with the AutoQuote hack I know about that. I thought I had mentioned it in the NOTES in the README file, but I hadn't, I had just hinted about it in the CHANGES file. Not good at all.<br /><br />If you install this hack before the AutoQuote-hack, or haven't written any posts with the AutoQuote button all would be fine. But since I didn't want my hack to have to rely on the AutoQuote-hack I did some small changes to the html-code. <br /><br />To fix this, I will create an extra insert statement to be installed for those who has the AutoQuote hack installed. I'll post it in this thread when it is finished, and I'll include it in the instructions for the next release.
_________________________
/Gardener | Complete list of my mods

Top
#217993 - 07/24/02 03:48 PM Re: Screenshots provided [Re: c0bra]
WrĊith Offline
Enthusiast

Registered: 01/31/02
Posts: 310
Loc: California, USA
Thanks Gardener. I'll make that change.<br /><br />As for the AutoQuote function, I think you're right. Quotes made prior to to the implementation of the hack don't seem to be translated correctly, but quoted posts made after the implementation of the MarkUp hack seem to be mostly o.k. There are a few that haven't come over correctly, but I think that will get worked out eventually.<br /><br />Having the insert statement that will fix the old posts will really help. <img src="/forum/images/icons/smile.gif" alt="" />

Top
#217994 - 07/24/02 07:25 PM Re: Screenshots provided [Re: SDS]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
The thing is that the AutoQuote adds a test string to the language files which it then uses when it creates the html- Since I didn't want to make the MarkupHack demand that language string I made it look like the original quote. And as I don't see the need for that new language string I don't want to add it to the MarkupHack as well.<br /><br />But for those who has had posts done with only the AutoQuote-hack installed, I'll try to provide the code needed for it to make the transition easier.
_________________________
/Gardener | Complete list of my mods

Top
#217995 - 07/24/02 09:37 PM Re: Screenshots provided [Re: c0bra]
WrĊith Offline
Enthusiast

Registered: 01/31/02
Posts: 310
Loc: California, USA
I was inspired today by a post I saw somewhere else on the board, and I rewrote the HTML for the quote boxes. I've attached a file with a screenshot and the revised code if anyone is interested.<br /><br />Next up on my list is an addition to the markups for glowing text and marquee. <img src="/forum/images/icons/smile.gif" alt="" /> <br /><br />I just gotta say that this is by far my most favorite hack of any I've seen. The way that this makes it easy to modify the markup and/or add new graemlins has got to be the coolest thing ever.<br /><br />Great job Gardener! You deserve a medal!


Attachments
53126-Quote.zip (18 downloads)


Top
#217996 - 07/25/02 10:13 AM Re: Screenshots provided [Re: SDS]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
Glowing text and Marquee? Those will never get it into the main distro of the hack for sure. =] I'm not much for colorful and moving things on webpages.<br /><br />The Quote changes looks good, I think I'll add them to my own site. Don't know if it should be included in the hack though, since people might want the original look. What do you others think? Maybe changes like this could be included in an extra script, that changes the markups in the database, that can be run by those who wants it?<br /><br />[]Great job Gardener! You deserve a medal!<hr /></blockquote><br /><br />Heh, thanks. =] Will there be a parade too? I like parades. ;]<br />I just did it because it would be a pain to add all markups from my old perl-version by hand... =P
_________________________
/Gardener | Complete list of my mods

Top
Page 4 of 6 < 1 2 3 4 5 6 >


Who's Online
2 registered (AllenAyres, blaaskaak), 19 Guests and 11 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
PhotoPost BB Code Popup
by AllenAyres
12/01/08 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
12/01/08 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
12/01/08 09:33 AM
Spell Check [beta]
by AllenAyres
12/01/08 09:32 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
Team UBBDev Rides Again!
by AllenAyres
11/11/08 02:16 PM
Active Topics.
by AllenAyres
11/11/08 02:13 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
David DelMonte, nick1, Begbie, cenk, MATTO
13363 Registered Users
Top Posters
AllenAyres 25449
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks