php forum
php mysql forum
php mysql smarty
 
Page 1 of 6 1 2 3 4 5 6 >
Topic Options
#217917 - 06/05/02 11:10 PM Markup Hack 1.0beta2
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
Mod Name / Version - MarkupHack 1.0beta2<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 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. <br />Working under - UBB.threads 6.1.0<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, languages/generic.php<br />Database Altered - Yes, new tables: w3t_Markup w3t_InstantList<br />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<br />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 (77 downloads)



Edited by Gardener (11/15/02 12:51 AM)
_________________________
/Gardener | Complete list of my mods

Top
#217918 - 06/05/02 11:39 PM Re: Customizable Markups Hack for UBBT6 final [Re: c0bra]
Dalar Offline
Member

Registered: 04/22/02
Posts: 231
Loc: Hamilton, Ontario, Canada
Cool!
_________________________
Dalar
Legends of Tacendia
[]http://legendsoftacendia.com/forumimages/icons/troll.gif[/]

Top
#217919 - 06/06/02 12:06 AM File updated [Re: c0bra]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
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 (57 downloads)

_________________________
/Gardener | Complete list of my mods

Top
#217920 - 06/09/02 11:11 PM Re: File updated [Re: c0bra]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25452
Loc: Texas
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 <img src="/forum/images/icons/smile.gif" alt="" />
_________________________
- Allen wavey
- What Drives You?

Top
#217921 - 06/10/02 09:25 AM Screenshots provided [Re: SurfMinister]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
OK, here is a zip with shots of all admin pages.<br /><br />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 (35 downloads)

_________________________
/Gardener | Complete list of my mods

Top
#217922 - 06/10/02 09:50 AM Re: Screenshots provided [Re: c0bra]
MTO Offline
Addict

Registered: 01/31/00
Posts: 1524
Loc: Burgos, Spain.
Wow! Sreenshots are impressive! shocked <img src="/forum/images/icons/laugh.gif" alt="" />
_________________________
Mateo Byler
CruceDeCaminos.com

Top
#217923 - 06/10/02 10:05 AM Re: Screenshots provided [Re: D_Wolfwood]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
Thanks!
_________________________
/Gardener | Complete list of my mods

Top
#217924 - 06/10/02 12:08 PM Re: Screenshots provided [Re: c0bra]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25452
Loc: Texas
oooo yes, nice work. Very requested in the ubb forums <img src="/forum/images/icons/laugh.gif" alt="" />
_________________________
- Allen wavey
- What Drives You?

Top
#217925 - 06/10/02 01:28 PM Re: Screenshots provided [Re: c0bra]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8372
Loc: Olympia, WA
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.
_________________________
StogieSmokers.com

Top
#217926 - 06/10/02 02:18 PM Re: Screenshots provided [Re: Sally]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
Sounds great.<br /><br />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.
_________________________
/Gardener | Complete list of my mods

Top
#217927 - 06/10/02 02:56 PM Re: Screenshots provided [Re: Sally]
caymuc Offline
Enthusiast

Registered: 01/17/01
Posts: 449
One question: how are the settings saved?<br />Right into the 3-4 standard THREADS php and tmp files?<br /><br />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?<br /><br />
_________________________
Carl
Colour-Ize-Forums (test entry: user: 'test' pw: 'test2')

Top
#217928 - 06/11/02 08:31 AM Re: Customizable Markups Hack for UBBT6 final [Re: c0bra]
dRiver Offline
Junior Member

Registered: 11/14/01
Posts: 65
Help?????????<br /><br />Can figure out how to enter this markup string into Gardeners absolutly marvelous hack?<br /><br />$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);<br /><br />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<br /><br />cheers

Top
#217929 - 06/11/02 08:58 AM Re: Customizable Markups Hack for UBBT6 final [Re: lanet]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
First of all I had some reason to make all regexps ungreedy, so you probably only need to have (.*) instead of (.*?) in the pattern.<br /><br />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?<br /><br />If you can trim the HTML part down 31 characters I guess that it would work. Don't know if that is possible though.
_________________________
/Gardener | Complete list of my mods

Top
#217930 - 06/11/02 10:41 AM Re: Customizable Markups Hack for UBBT6 final [Re: c0bra]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8372
Loc: Olympia, WA
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.
_________________________
StogieSmokers.com

Top
#217931 - 06/11/02 11:44 AM Re: Customizable Markups Hack for UBBT6 final [Re: Sally]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
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.<br /><br />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.<br /><br />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?
_________________________
/Gardener | Complete list of my mods

Top
#217932 - 06/11/02 11:50 AM Re: Customizable Markups Hack for UBBT6 final [Re: c0bra]
Rick Offline
Guru

Registered: 05/11/99
Posts: 8372
Loc: Olympia, WA
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.<br /><br />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.
_________________________
StogieSmokers.com

Top
#217933 - 06/11/02 12:00 PM Re: Customizable Markups Hack for UBBT6 final [Re: Sally]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
OK, I got it confused with addpost where do_markup is called twice.<br /><br />I'll make the changes necessary and repost as soon as it is finished.
_________________________
/Gardener | Complete list of my mods

Top
#217934 - 06/11/02 09:59 PM Re: Screenshots provided [Re: rodrigo1]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
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. =]
_________________________
/Gardener | Complete list of my mods

Top
#217935 - 06/11/02 10:14 PM Customizable Markups Hack 1.0alfa7 [Re: c0bra]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
New version of the script!<br /><br />Changes:<br />
  • Only uses one query to read markups from database on all pages.<br />
  • Added a file with descriptions of the new markups to add to the FAQ.<br />
<br />Description:<br />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 /><br />Instructions:<br />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.<br /><br />Screenshots:<br />Download zip file


Attachments
49688-markuphack-1.0alfa7.zip (28 downloads)

_________________________
/Gardener | Complete list of my mods

Top
#217936 - 06/12/02 02:13 AM Re: Screenshots provided [Re: c0bra]
caymuc Offline
Enthusiast

Registered: 01/17/01
Posts: 449
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.
_________________________
Carl
Colour-Ize-Forums (test entry: user: 'test' pw: 'test2')

Top
#217937 - 06/12/02 04:05 AM Re: Screenshots provided [Re: rodrigo1]
omegatron Offline
Member

Registered: 04/05/01
Posts: 3440
Loc: abingdon,md
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?
_________________________
Chuck S

DIVE IN AND VISIT ME:

Omegatron\'s Reefs

Administrator at ReefTalk

Top
#217938 - 06/12/02 09:24 AM Re: Screenshots provided [Re: sf49rminer]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
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.
_________________________
/Gardener | Complete list of my mods

Top
#217939 - 06/17/02 10:55 PM MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: c0bra]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
Another new version of the script!<br /><br />Changes:<br />
  • Updated with changes from UBB.threads 6.0.1<br />
  • 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.<br />
  • Did a small change to the color markup to remove the quotation marks when editing.<br />
<br />Description:<br />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.<br /><br />Instructions:<br />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.<br /><br />Screenshots:<br />Download zip file


Attachments
50419-markuphack-1.0alfa8.zip (19 downloads)

_________________________
/Gardener | Complete list of my mods

Top
#217940 - 06/17/02 11:06 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: c0bra]
JustDave Offline
That 70's Guy

Registered: 06/24/01
Posts: 4097
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 <img src="/forum/images/icons/crazy.gif" alt="" />
_________________________
~Dave
ChattersOnline.com

Top
#217941 - 06/17/02 11:08 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: sjsaunders]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25452
Loc: Texas
I like it too, nice work on it <img src="/forum/images/icons/smile.gif" alt="" />
_________________________
- Allen wavey
- What Drives You?

Top
#217942 - 06/21/02 08:47 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: SurfMinister]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
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 (19 downloads)


Top
#217943 - 06/21/02 09:38 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: palmen]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
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.<br /><br />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.<br /><br />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<br /><br />It's been fixed and will be in the next version, but here is a fix which you can add yourself.<br /><br />Edit the file admin/dodeletegraemlin.php<br />Find the following line (at line 92):<br /><pre><font class="small">code:</font><hr>unlink("{$config['imagepath']}/graemlins/{$imagefile}");</pre><hr><br />And exchange it with the following code:<br /><pre><font class="small">code:</font><hr> if (file_exists($imgfilepath)) {<br /> unlink($imgfilepath);<br /> } else {<br /> $printinfo .= "<b>No image file found to delete for [{$Graemlin}]!</b><br>\n";<br /> }<br /></pre><hr><br />The find the following line (at 113):<br /><pre><font class="small">code:</font><hr>echo "<br />You will be returned to the main page shortly.";</pre><hr><br />And add the following right before:<br /><pre><font class="small">code:</font><hr> echo $printinfo;</pre><hr><br /><br />Hope that helps. And thanks for the bug report!
_________________________
/Gardener | Complete list of my mods

Top
#217944 - 06/21/02 10:04 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: c0bra]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
Thanks! <br /><br />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:<br /><br /><pre><font class="small">code:</font><hr>1. Open ubbt.inc.php<br /><br />2a. Locate the following line:<br /><br /> // -------------<br /> // Quote markup<br /> $Body = str_replace("[{$ubbt_lang['TEXT_QUOTE']}]","</font><blockquote><font class=\"small\">{$ubbt_lang['IN_REPLY']}:</font><hr /><br />",$Body);<br /> $Body = str_replace("[/{$ubbt_lang['TEXT_QUOTE']}]","<br /><br /><hr /></blockquote>",$Body);<br /><br />2b. Replace that with:<br /><br /> // -------------<br /> // Quote markup<br /> $Body = str_replace("[{$ubbt_lang['TEXT_QUOTE']}]","</font><blockquote><font class=\"small\">{$ubbt_lang['IN_REPLY']}:</font><hr /><br />",$Body);<br /> $Body = preg_replace("/\[{$ubbt_lang['TEXT_QUOTE']}(\s*)=(\s*)(.*?)\]/i", "<blockquote><font class=\"small\">{$ubbt_lang['USER_QUOTE']} \\3:</font><hr>", $Body);<br /> $Body = str_replace("[/{$ubbt_lang['TEXT_QUOTE']}]","<hr /></blockquote>",$Body);<br /><br />3a. Locate the following line:<br /><br /> // -------------<br /> // Quote markup<br /> $Body = str_replace("</font><blockquote><font class=\"small\">{$ubbt_lang['IN_REPLY']}:</font><hr /><br />","[{$ubbt_lang['TEXT_QUOTE']}]",$Body);<br /> $Body = str_replace("<br /><br /><hr /></blockquote>","[/{$ubbt_lang['TEXT_QUOTE']}]",$Body);<br /><br />3b. Replace that with:<br /><br /> // -------------<br /> // Quote markup<br /> $Body = str_replace("</font><blockquote><font class=\"small\">{$ubbt_lang['IN_REPLY']}:</font><hr /><br />","[{$ubbt_lang['TEXT_QUOTE']}]",$Body);<br /> $Body = preg_replace("/<blockquote><font class=\"small\">{$ubbt_lang['USER_QUOTE']}(\s*)(.*?):<\/font><hr>/i", "[{$ubbt_lang['TEXT_QUOTE']}=\\2]", $Body);<br /> $Body = str_replace("<hr /></blockquote>","[/{$ubbt_lang['TEXT_QUOTE']}]",$Body);<br /></pre><hr><br /><br />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 <img src="/forum/images/icons/frown.gif" alt="" /><br /><br />Maybe this has been brought up already? I dunno, but if you can help that would be great! <img src="/forum/images/icons/smile.gif" alt="" />

Top
#217945 - 06/21/02 10:37 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: palmen]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
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.<br /><br />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.<br /><br />Hope this helps.
_________________________
/Gardener | Complete list of my mods

Top
#217946 - 06/21/02 10:45 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: c0bra]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
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.

Top
#217947 - 06/22/02 07:24 AM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: palmen]
msula Offline
Addict

Registered: 02/18/02
Posts: 1969
Loc: Lansing, Michigan
Worked great, thanks! I'll edit my one post so I can fix the post, oops <img src="/forum/images/icons/smile.gif" alt="" /> <br /> <br />[EDIT]Hrmm, nevermind that, I can't, the edit time has expired <img src="/forum/images/icons/frown.gif" alt="" /> [/EDIT]


Edited by msula (06/22/02 07:25 AM)

Top
#217948 - 06/22/02 12:48 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: palmen]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
You're welcome!
_________________________
/Gardener | Complete list of my mods

Top
#217949 - 06/22/02 09:32 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: c0bra]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
Thanks for this hack! It works great on 6.0.1 <img src="/forum/images/icons/grin.gif" alt="" />

Top
#217950 - 06/22/02 09:44 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: neuron]
Gardener Offline
Addict

Registered: 05/11/99
Posts: 1956
Loc: Sweden, Uppsala
You are welcome! And it's good to know that it works to install on 6.0.1 for other people.
_________________________
/Gardener | Complete list of my mods

Top
#217951 - 06/22/02 10:35 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: c0bra]
Aglavalin Offline
Enthusiast

Registered: 06/18/02
Posts: 394
Loc: Southern California
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....

Top
#217952 - 06/22/02 11:10 PM Re: MarkupHack 1.0alfa8 (Updated for 6.0.1) [Re: c0bra]
JoshPet Offline
I type Like navaho

Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Just installed this today on 6.0.1 and it does work just great. My users loved all the new graemlins I added instantly.<br /><br />Would love that same ease to add post icons!
_________________________
Joshua Pettit
www.JoshuaPettit.com
My abilities are for hire.

Top