Hello............I have downloaded the files for the smilies. I am not a master hacker though. Can someone kinda give me some help as far as what and where to put these files? I'm not a total idiot, but I'm no rocket scientist either. I appreciate all help! Thanks!
Do you only want the possibility to add/remove graemlins?
If so, there is no easy way to separate those files, since they make use of almost everything of the markup bit. So my suggestion is that you follow the instructions included to install everything. Then, if you really don't want to be able to change or add new markups, just remove those options from the admin menu.
I haven't upgraded to 6.0.2 myself yet so I haven't been able to check if it works, but by looking at the change list I can't see anything that should clash with this hack. Can't promise anything though, so it would be good to hear from someone who has tried.
How does this seem to be working for everyone? Does it seem easy enough for the general population to use? I'm thinking about putting this in for 6.1 but want to make sure it's simple enough for everyday admins to use properly.
Adding smilies is way too easy with this -- if the users knew how easy I'd be bombarded with requests for new smilies. I was also able to easily add markup for underlining and for centering. Being able to add markup for basic html stuff was a major plus because that allowed us to turn html off on all forums without having anyone complain, since we can add markup for anything they wanted to do.
This is a good hack, but I would suggest being able to re-arange the order of graemlins easilly would be a needed addition. Perhaps add this feature to the show graemlins page where it seems most useful. An up and down arrow button to move the selected item mayhaps? I've had issues with reordering them due to server caching the deleted item for several minutes and reinserting it back where it was when I added it. It should of been moved to the end but was put back where it was. Rather annoying but minor overall...
Ok. I've only added a few hacks in the past. What I normally do is add it but not exactly bit for bit. The reason being is I need to be completely comfortable with how the code works in order to program around it/support it. Since everyone is ok with the basics of how it works I'll try not to change to much. Not exactly sure if this will be in 6.1 yet but I'm looking at it anyways.
Food for thought, if your gonna go this far, ya might want to just add in menu options and a page to add/edit the post icons too so people don't have to edit the template by hand. You could use a similar image upload page but make it ask for two images to allow for a yellow and orange image. Or people can just upload the same image twice if they don't have two versions to use. This seems to be the logical place/time to add such a hack into the original release since much of the way it would be done could overlap from what I can tell.
Actually a page for uploading new post icons would be a complete standalone script. The reason for this is that the Graemlin script is just a script to make it easier to add a graemlin markup and makes heavy use of the markup database and such. While the post icons would only need an image upload and some way to name them, which would probably be saved in the name of the file so that it wouldn't need a database or something just for one bit of information.
I have been thinking of adding this to the markuphack but I haven't really bothered since I don't use the post icons on my own forums. It wouldn't be that hard to do though, but it would be better off as a complete standalone script.
Actually, I think I better remove the portion that allows you to remove post icons. This could be a bad thing in that it would make it very easy to end up with alot of broken images on the main display. Best to keep this something they have to consciouscly do by ftp'ing into the server and removing the icons.
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.
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.
The UBB.threads code doesn't appear to loop, although I didn't study it all that closely. Could this be a problem?
What do you mean by looping? And in what way doesn't the nesting of tags work?
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.
But I haven't changed the way the tags are handled, except for some minor tweakings here and there.
do { $count = 0; if (preg_replace($pattern1, $repl1, $subject) != $subject) ++$count; if (preg_replace($pattern2, $repl2, $subject) != $subject) ++$count; if (preg_replace($pattern3, $repl3, $subject) != $subject) ++$count; } while ($count > 0);
(In Perl, this can be done more concisely. I'm not sure if the above is the best way to do it in PHP.)
I found that approach necessary for certain nestable tags.
In later versions of UBB.classic, that approach was added for all of the markup translation.
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.
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... =]
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. =]
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.
You might confer with Charles or Dave to see why UBB.classic does it that way.
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.
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.
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.
I just tried installing this hack and got an error message:
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
Digging through FAQ files, I found the following fix:
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:
shell> mysqladmin -h `hostname` version
If it works, then add "-h `hostname`" to the mysql command line.
Added [font:style], [size:X], [indent] and [right] markups.
It is now possible to change the order of the Graemlins.
Added a simpler form for adding new markups.
Mod Name / Version - MarkupHack 1.0alfa9 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. Working under - UBB.threads 6.0.1, 6.0.2 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 Database Altered - Yes, new table: w3t_Markup 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 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.
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!!
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. =]
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.
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.
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.
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.
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.
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.
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.
Having the insert statement that will fix the old posts will really help.
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.
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.
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.
Next up on my list is an addition to the markups for glowing text and marquee.
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.
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.
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?
[]Great job Gardener! You deserve a medal!
Heh, thanks. =] Will there be a parade too? I like parades. ;] I just did it because it would be a pain to add all markups from my old perl-version by hand... =P
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.