Previous Thread
Next Thread
Print Thread
Rating: 5
Page 1 of 3 1 2 3
#217917 06/05/2002 11:10 PM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.
Attachments
48839-markuphack-1_0beta2.zip (0 Bytes, 261 downloads)

Last edited by Gardener; 11/15/2002 1:51 AM.
Sponsored Links
Joined: Apr 2002
Posts: 206
Member
Member
Offline
Joined: Apr 2002
Posts: 206
Cool!

c0bra #217919 06/06/2002 12:06 AM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Damn, I forgot to update one of the files, so here is a new file where the update is actually included. =]
Attachments
48856-markuphack-1.0alfa6.zip (0 Bytes, 57 downloads)

c0bra #217920 06/09/2002 11:11 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Do you happen to have a demo or screen shots of this one? A good bit involved, I'd like to see a little bit before getting knee-deep in it


- Allen wavey
- What Drives You?
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
OK, here is a zip with shots of all admin pages.

Didn't make a screenshot of the instant graemlin box since it looks exactly the same if no new graemlins are added. =]
Attachments
49365-markuphack-screenshots.zip (0 Bytes, 38 downloads)

Sponsored Links
Joined: Jan 2000
Posts: 796
MTO Offline
Addict
Addict
Offline
Joined: Jan 2000
Posts: 796
Wow! Sreenshots are impressive! shocked

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Thanks!

c0bra #217924 06/10/2002 12:08 PM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
oooo yes, nice work. Very requested in the ubb forums


- Allen wavey
- What Drives You?
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
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.


UBB.threads Developer
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Sounds great.

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.

Sponsored Links
Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
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?


Joined: Nov 2001
Posts: 54
Junior Member
Junior Member
Offline
Joined: Nov 2001
Posts: 54
Help?????????

Can figure out how to enter this markup string into Gardeners absolutly marvelous hack?

$Body =preg_replace("/\[flash=(.*?),(.*?)\](.*?)\[\/flash\]/is","<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width=\\1 height=\\2><param name=movie value=\\3><param name=play value=true><param name=loop value=true><param name=quality value=high><embed src=\\3 width=\\1 height=\\2 play=true loop=true quality=high></embed></object>",$Body);

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

cheers

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
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.


UBB.threads Developer
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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?

Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
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.


UBB.threads Developer
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
OK, I got it confused with addpost where do_markup is called twice.

I'll make the changes necessary and repost as soon as it is finished.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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. =]

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
New version of the script!

Changes:
  • 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.

Screenshots:
Download zip file
Attachments
49688-markuphack-1.0alfa7.zip (0 Bytes, 29 downloads)

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
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.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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?

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Another new version of the script!

Changes:
  • Updated with changes from UBB.threads 6.0.1
  • 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.

Screenshots:
Download zip file
Attachments
50419-markuphack-1.0alfa8.zip (0 Bytes, 20 downloads)

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thanks! This really is an impressive piece of work. I hope I can eventualy get my site updated so I can start using this... lol

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
I like it too, nice work on it


- Allen wavey
- What Drives You?
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
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.
Attachments
50831-error.gif (0 Bytes, 52 downloads)

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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):
code:
unlink("{$config['imagepath']}/graemlins/{$imagefile}");


And exchange it with the following code:
code:
if (file_exists($imgfilepath)) {
unlink($imgfilepath);
} else {
$printinfo .= "<b>No image file found to delete for [{$Graemlin}]!</b><br>\n";
}


The find the following line (at 113):
code:
echo "<br />You will be returned to the main page shortly.";


And add the following right before:
code:
echo $printinfo;



Hope that helps. And thanks for the bug report!

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Thanks!

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:

code:
1. Open ubbt.inc.php

2a. Locate the following line:

// -------------
// Quote markup
$Body = str_replace("[{$ubbt_lang['TEXT_QUOTE']}]","</font><blockquote><font class="small">{$ubbt_lang['IN_REPLY']}:</font><hr /><br />",$Body);
$Body = str_replace("[/{$ubbt_lang['TEXT_QUOTE']}]","<br /><br /><hr /></blockquote>",$Body);

2b. Replace that with:

// -------------
// Quote markup
$Body = str_replace("[{$ubbt_lang['TEXT_QUOTE']}]","</font><blockquote><font class="small">{$ubbt_lang['IN_REPLY']}:</font><hr /><br />",$Body);
$Body = preg_replace("/\[{$ubbt_lang['TEXT_QUOTE']}(\s*)=(\s*)(.*?)\]/i", "<blockquote><font class="small">{$ubbt_lang['USER_QUOTE']} \\3:</font><hr>", $Body);
$Body = str_replace("[/{$ubbt_lang['TEXT_QUOTE']}]","<hr /></blockquote>",$Body);

3a. Locate the following line:

// -------------
// Quote markup
$Body = str_replace("</font><blockquote><font class="small">{$ubbt_lang['IN_REPLY']}:</font><hr /><br />","[{$ubbt_lang['TEXT_QUOTE']}]",$Body);
$Body = str_replace("<br /><br /><hr /></blockquote>","[/{$ubbt_lang['TEXT_QUOTE']}]",$Body);

3b. Replace that with:

// -------------
// Quote markup
$Body = str_replace("</font><blockquote><font class="small">{$ubbt_lang['IN_REPLY']}:</font><hr /><br />","[{$ubbt_lang['TEXT_QUOTE']}]",$Body);
$Body = preg_replace("/<blockquote><font class="small">{$ubbt_lang['USER_QUOTE']}(\s*)(.*?):<\/font><hr>/i", "[{$ubbt_lang['TEXT_QUOTE']}=\\2]", $Body);
$Body = str_replace("<hr /></blockquote>","[/{$ubbt_lang['TEXT_QUOTE']}]",$Body);



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!

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Hope this helps.

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Thanks, I don't know why I didn't download that one in the first place, argh! I'll do that tomorrow and let you know how it turns out.

Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Worked great, thanks! I'll edit my one post so I can fix the post, oops

[EDIT]Hrmm, nevermind that, I can't, the edit time has expired [/EDIT]

Last edited by msula; 06/22/2002 7:25 AM.
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
You're welcome!

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
Thanks for this hack! It works great on 6.0.1

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
You are welcome! And it's good to know that it works to install on 6.0.1 for other people.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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....

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Just installed this today on 6.0.1 and it does work just great. My users loved all the new graemlins I added instantly.

Would love that same ease to add post icons!

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
A great source for graemlins:
http://www.web-kun.de/Forum-Smileys/bunt.htm

There are several categories to click along the left side too. Simply right-click and download, then add with this hack.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Great resource JoshPet, thanks for sharing the URL!

More smilies can be found here: mysmilies.com

Page 1 of 3 1 2 3

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)