Mod Name / Version - MarkupHack 1.0beta2 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 entries from the Instant Markup boxes. All Markups from UBB.threads v6.1.0 are included in this package, as well as quite a few new markups. Working under - UBB.threads 6.1.0 Any pre-requisites - PHP4 Author(s) - Gardener Credits - Dalar, WrÅith and others for help. Demo - Download zip file of screenshots Files Altered - ubbt.inc.php, admin/menu.php, ubbt_instant_ubbcode.tmpl, languages/generic.php Database Altered - Yes, new tables: w3t_Markup w3t_InstantList New Files - admin/editmarkup.php, admin/doeditmarkups.php, admin/addmarkup.php, admin/doaddmarkup.php, admin/addinstant.php, admin/doaddinstant.php, admin/editinstant.php, admin/doeditinstant.php, showpost.php Any other info - Download the attached file and unzip it. Follow the install instructions in the README file within.
Wow! This looks very nice. Something very similar to what I'm wanting to do for 6.1. Would be great to get some feedback on this as everyone installs it because I don't think I'll be able to do a better job than what this looks like.
Feedback would be very welcome from anyone, both on the current functions and which of the things in the todo-list that is actually interesting for people.
One question: how are the settings saved? Right into the 3-4 standard THREADS php and tmp files?
If that was the case and I change things in an offline version of the file (hack or something) and then ftp upload it, it would overwrite the changes made online and confuse everything?
I have tried with little success. It is the markup I had in 551 to add flash to sigs/posts. I have had a lot of pms asking for a v6 update but there just doesnt seem to be enough hours in a day at the moment
First of all I had some reason to make all regexps ungreedy, so you probably only need to have (.*) instead of (.*?) in the pattern.
But the real problem I would say is that your HTML part is 281 characters long. Both the Markup and HTML parts are limited to 255 characters, because I wanted to have the fields as VARCHAR in the database. I suppose I could change to TINYTEXT or something though if more people want to have long strings. I'm not sure how this affects speed and portability though, anyone has any ideas?
If you can trim the HTML part down 31 characters I guess that it would work. Don't know if that is possible though.
Hmm. I haven't really looked at the hack yet, but I do have a question for you. Are the regex patterns pulled from the database each time do/undo markup is called? The reason I ask is because currently the Signatures are parsed for markup when the post is displayed, which on a typical showflat screen would be an extra 10 queries if everyone has a signature.
Yes, that is how it works at the moment, which obviously isn't good on showflat. It will be more as well as each post which has UBBCode turned on will also call the do_markup once each.
I have been trying to think of a way to only do the query once but haven't decided on anything yet so any input would be welcome.
One way could be to put the array as a global variable in the html class and only read from the db if the array is empty. Would that be sufficient?
The post itself isn't too bad because these are parsed at the time the post is made in addpost.php. For some reason I had to do the signature at the time the post is displayed, can't remember why. So, it's only the sigs that will make the extra db calls.
Yeah, if you could grab all the patterns at the beginning of showflat.php and stuff them into an array then make the array global to do_markup there should only be 1 extra db call needed no matter how many times do_markup in the individual processing of that script.
The new markups are in a table in the database, so you can change any files after adding new markups without doing any harm. There are changes to the files ubbt.inc.php and ubbt_instant_ubbcode.tmpl, which you of course have to keep in place in order for it to work, just as any hack. =]
Only uses one query to read markups from database on all pages.
Added a file with descriptions of the new markups to add to the FAQ.
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.
Instructions: 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.
If you separarted all virtual content (admin-organized code) and the hack insert (static pages) that sounds like a great idea. I am very impressed about the concept and will download and test the Components now. Thank you very much.
Now I know in your old version the files were not being added to the posting page. Is there fixed with the addition of 6.0 and the new update or will one have to go editing through multiple files to get a code added?
What do you mean? The Instant Graemlin list is updated automatically on the posting page, but the Instant UBBCode is a bit trickier, the same with the FAQ. I still haven't made up my mind about how to do that yet but I'll try to fix it soon.
Added [ quote = text ] so that the AutoQuote-hack will work. Note that the html will not be exactly the same as in that hack, this version won't use the new language string.
Did a small change to the color markup to remove the quotation marks when editing.
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.1 are included in this package, as well as some new markups.
Instructions: 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.
Hrmm, installed the hack, but got an error when deleting an existing graemlin, see my attached gif file for an image of the error. The thing is, it did delete the ubbcode for it just fine, I tested a post and it was just plain text, but just gave me that error.
That is because the original Graemlin files are located directly under the images directory while the new ones are placed in the new graemlin directory.
I did it this way so that old posts with graemlins in them wouldn't suddenly stop working, which would happen if the old graemlins are moved into the graemlin dir. Also, the update would be a bit more inconvenient as you would have to move the old images.
That said, it shouldn't show an unlink error when the image isn't found of course. I thought that I had fixed this, since I've even mentioned it in the README under notes, but obviously I forgot about it. =P
It's been fixed and will be in the next version, but here is a fix which you can add yourself.
Edit the file admin/dodeletegraemlin.php Find the following line (at line 92):
While we're pointing things out.. your hack is working wonderfully, but it has since caused a conflict with the auto quote hack by WrÅith. Its obviously because of the new string function changes. So, there are only two things I need to do to get it working, but not sure how exactally. This is the part:
Now, can this be added into the ubbt.inc file like normal, or will the string have to be added with your system? I was about to go adding it myself but was confused by some of the options and formatting, and I'm no code monkey so I didn't do it
Maybe this has been brought up already? I dunno, but if you can help that would be great!
WrÅith who wrote the AutoQuote hack has posted a description on how to add those lines when my Markuphack is installed in this thread which should work just fine.
The new version of my MarkupHack, found in this thread already includes the conflicting lines so you don't have to bother with part 7 of the instructions for AutoQuote (where the conflicts are). Although the result in the actual posts won't look exactly the same since the markup in MarkupHack doesn't use the new language string in AutoQuote. But that shouldn't matter at all unless you already have posts using the markup from AutoQuote.
Any plans on adding a Post Icon addition/change option? I figured this out by editing the code by hand. It's pretty simple and may not really be worth the coding time. I'll write up a text on it when I get a chance....
Since I don't use the posting icons myself it isn't at the top of the priority list but I do have plans on adding it. Or actually it would probably be a stand alone script since they don't really need to be in the database.
I just posted a text about adding the Post Icons to UBBT 6.0.1 since I didn't see it up here yet. It is only one template to edit, very easy! I think I got all the details covered.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.