|
#1
|
|||
|
|||
|
ADDON: About Text AddOn
Hi all,
I did a little addon that allows to use two new tags: <ABOUT_TEXT> <ABOUT_TEXT_ALT> I use it on my site to write down a couple of words about me. Without it I had to open html template files to change text. I hope you enjoy it (and test it btw). I had an issue about the text lengh which is now restricted to mysql varchar type maximum (255). I tried to use text/longtext types but my server seems to not accept it. Any suggestion? download it here: http://www.tomsights.net/templates/t...about_text.zip live here: http://www.tomsights.net/index.php?x=about bye Tommaso TomSights.net |
|
#2
|
||||
|
||||
|
Hey cool. I was going to suggest this is a feature for 1.7, then decided it might be better as an addon. I'll have to test it when I get home.
__________________
My Photoblog If you find my help useful please consider feeding the PixelPost Kitty If you're short on cash just feed my ego |
|
#3
|
||||
|
||||
|
Nice addon, I'll surely have a look at it.
__________________
My photoblog, powered by PixelPost 1.9 dev SVN | My Pixelpost Addons | My Cool Photoblog profile
|
|
#4
|
||||
|
||||
|
Quote:
[edit] did you use DEFAULT values with text data type too? because text and blob can not have default values. without the default values in the ALTER statements it should work |
|
#5
|
|||
|
|||
|
Thanks Sentinel!
I cut the default value and now it works with text type. Updated here: http://www.tomsights.net/templates/t...about_text.zip At this time the two fileds "about_text" and "about_text_alt" must be removed before reinstalling the addon. I'll work on a tool to delete them from the the db via pixelpost addon page. bye Tommaso TomSights.net |
|
#6
|
||||
|
||||
|
Nice addon! Am going to give it a try later this AM.
A couple of comments I have after looking at the code: 1. Most of the other addons that I have installed (advanced comment stats and image stats) create a new database table to store their info in. Your addon is altering the pixelpost config table. Would it be easier to code the install/uninstall portions if you created a new table called 'about', rather than altering the configuration table? 2. In the code, you are using <font> tags to show the message that the texts have been updated. The <font> tag is deprecated and should probably be changed to <span> tags (<span style=\"color: blue;\">Updated about texts.</span>). |
|
#7
|
||||
|
||||
|
Nice start but this must be refined some more.
As dhdesign has stated, creating its own table is a much better practice than adding onto pixelposts default tables. Also, you insert the about text into the database "as is" without taking the proper steps to encode and decode the text. For example, when someone enters the following about text: Hello there. This is dwilkinsjr's photoblog. it will insert into the database as: Hello there. This is dwilkinsjr\'s photoblog. Sometimes, the database will not add the \ by itself and then some issues may arise. Anyway, when this same person uses the tag to display their about text on their website, the \ will remain depending on the servers magic_quote settings. Hopefully you understand what I am saying. I tried to explain it as best as possible. I will clean your addon up for you and reconfigure it to use its own database table. If you wish to see this copy, please send me a private message.
__________________
Pixelpost Documentation | Visual Pixels | My Addons | Transition Bottlerocket Fund |
|
#8
|
|||
|
|||
|
Thanks dwilkinsjr, I will continue on your version with the part of uninstall.
Quote:
bye
__________________
Porfolio |
|
#9
|
||||
|
||||
|
Quote:
The code is bellow but it may be easier to grab it from http://public.dwilkinsjr.com/pixelpo...bout_text.phps PHP Code:
__________________
Pixelpost Documentation | Visual Pixels | My Addons | Transition Bottlerocket Fund Last edited by Dkozikowski; 05-16-2007 at 08:38 AM. |
|
#10
|
||||
|
||||
|
dwilkinsjr -
I refined the code you wrote to remove the table layout for the admin form. Feel free to use this version if you want. PHP Code:
__________________
My photoblog: KP Images |
| Post Reply |
| Thread Tools | |
|
|