#1 2008-08-06 04:04:42

gomedia
Plugin Author
lambda
Real name: Adi
Website

adi_notes - leave notes for Textpattern users

Summary

adi_notes – leave notes for Textpattern users.

Once installed and activated, you’ll get:

  • a tab under Extensions, to set up adi_notes
  • new tabs under Content, Presentation and Admin to present your pearls of wisdom
  • public & private footnotes in all standard Textpattern admin pages

See the help supplied with the plugin, or have a look online. The adi_notes admin tab also has some tooltips (hover over anything that has a dashed underline).

Why another notepad?

I wanted a way to record useful information so that it was available in the Textpattern Admin interface.

For example, notes for myself:

  • document reasons for particular settings
  • list differences in settings between my local staging environment and the live website

But more importantly I wanted to leave instructions for clients. For example:

  • which fields need to be filled in when adding new articles
  • field formats
  • brief guide to using Textile
  • procedure for adding new content
  • who to call for support

As always, my first port of call was the excellent Textpattern Resources. This led me to Andrew Waer’s ajw_public_notepad. It provides some of my required functionality but it wasn’t quite what I was looking for.

ajw_public_notepad seems to provide a simple messaging or bulletin board functionality. I wanted a more dictatorial approach – “Listen to what I have to say and don’t answer back”. I also wanted to have Textile capability.

For those of you using ajw_public_notepad, here’s a comparison:

ajw_public_notepad

  • one set of notes
  • can be updated by all users
  • external script installation procedure
  • no formatting

adi_notes

  • multiple notes
  • notes can be added by all users
  • public & private notes
  • public notes are visible to all but can only be edited by “admin” users
  • private notes are visible only to individual users
  • user friendly installation
  • Textile formatting

Out of the box functionality

Once the adi_notes plugin has been installed and activated, a new tab appears under Extensions. Here you can perform the installation.

By selecting different visibility options you can have note tabs under Presentation and Admin as well.

Footnotes are added/edited by clicking on the links that will appear at the bottom of every page.

Admin tab features

Users with sufficient privileges will see the adi_notes admin tab, under Extensions. This provides functionality to:

  • Install
  • Uninstall
  • Switch note tab visibility on/off
  • Upgrade from an earlier version of adi_notes
  • Delete old backups taken during an upgrade
  • Change note styles

Version History

  • 1.0
    • enhancement: footnotes
    • enhancement: public/private notes
    • enhancement: in situ editing
  • 0.3
    • added links between notes tabs & admin tab
  • 0.2
    • implemented fix for create table error, thanks gocom
  • 0.1
    • initial release

Requirements

Tested in:

  • Textpattern 4.0.5 – MySQL 5.0.45; PHP 5.2.4 (footnotes not supported)
  • Textpattern 4.0.6 – MySQL 5.0.45, 5.0.51a, 5.0.67; PHP 5.2.4-5.2.5
  • Textpattern 4.0.7 – MySQL 4.1.22, 5.0.45; PHP 5.2.4-5.2.6
  • Textpattern 4.0.8 – MySQL 5.0.45, 5.0.77; PHP 5.2.4- 5.2.9

Download & Installation

Download adi_notes and install the plugin in the usual way. If you are upgrading from a previous version make an independent copy of your notes – see instructions below.

Go to the adi_notes tab under Extensions, select “Install” and click the “Do admin” button.

By default you’ll get a note tab under Content but you can change the visibility to get notes under all or some of: Content, Presentation, Admin.

Add footnotes by clicking the “add note” link that appears at the bottom of each page.

Upgrading from a pre-1.0 version of adi_notes

Due to a change in the adi_notes database table structure, when you upgrade from an early version of adi_notes you will be prompted to perform an “Upgrade” in the adi_notes admin tab.

Although a backup of your notes will be made during the upgrade process it is recommended that you make an independent copy.

Once you are happy with the new version of adi_notes, you can delete the backup by selecting the “Cleanup” option in the adi_notes admin tab.

Bugs

Let me know if you find any problems.

Feedback

Comments are most welcome.

Credits

Much of the code has been lifted from ajw_public_notepad, thanks Andrew.

Last edited by gomedia (2009-05-11 23:50:19)

Offline

 

#2 2008-08-06 04:53:20

maniqui
Moderator
omega
Real name: Julián
From: Buenos Aires, Argentina
Known languages: es,en

Re: adi_notes - leave notes for Textpattern users

Few minutes ago, I was thinking (and groaning a little) that I have to install ajw_public_notepad on a site once again, and start writing some help docs for users.

But then, I clicked on the “Show new posts” link on this forum… and you came with this little new toy to play with :D
Many thanks, Adi!

Haven’t tested it yet, but I already have some feature requests ;)

  • MLP compatible? So you can create notes in different (installed) languages (may be overkilling, but you should expect someone will need it and then he/she will come to ask, so better to be prepared).
  • maybe a way to import/export notes on base64 strings so TxP community can share help snippets. Again, may be too much.

Well, I should test it now and come back with some feedback.
Thanks again.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

 

#3 2008-08-06 05:05:01

maniqui
Moderator
omega
Real name: Julián
From: Buenos Aires, Argentina
Known languages: es,en

Re: adi_notes - leave notes for Textpattern users

Kaboom!

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FALSE, last_mod DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', last_mod_ID' at line 3 CREATE TABLE IF NOT EXISTS adi_notes ( name VARCHAR(64) NOT NULL DEFAULT '', visible BOOLEAN NOT NULL DEFAULT FALSE, last_mod DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', last_mod_ID VARCHAR(64) DEFAULT NULL, restricted_privs VARCHAR(64) NOT NULL DEFAULT '1,2,3,4,5,6', restricted_ID VARCHAR(64) DEFAULT NULL, note TEXT NOT NULL DEFAULT '', PRIMARY KEY (name) ); in /nfs/xxxxxx/html/textpattern/lib/txplib_db.php on line 81

I’m on:
TxP 4.0.6
PHP version: 5.2.6
MySQL: 4.1.11-Debian_4sarge7
Server: Apache/2.0.54

I’ve read you tested it on MySQL > 5. That could be the problem, right?
Any chance to make it work on MySQL > 4 (I think it’s a more common version across many hostings)?

Thanks.

Last edited by maniqui (2008-08-06 05:05:57)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

 

#4 2008-08-06 05:28:54

gomedia
Plugin Author
lambda
Real name: Adi
Website

Re: adi_notes - leave notes for Textpattern users

Julián,

Kaboom indeed! Thanks for your messages and apologies for it not working for you.

I’ll look into the problem immediately. I didn’t think I was doing anything remotely advanced for there to be a problem but you’re right, it smells of something that MySQL 4 doesn’t support.

I’ll have a think about your feature requests as well.

Regards,

Adi

Offline

 

#5 2008-08-06 05:38:57

Gocom
Moderator
omega
Real name: Jukka Svahn
From: Finland
Known languages: EN, FI
Website

Re: adi_notes - leave notes for Textpattern users

Julián, that is possible cause that query is just – invalid for your install. First of all, the field names should be surrounded, also there is missing NOT NULL/NULL and also a invalid default value – actually two for mysql 4, me thinks.

Not tested, written on fly but something like this should work instead:

CREATE TABLE IF NOT EXISTS adi_notes(
	`name` VARCHAR(64) NOT NULL DEFAULT '',
	`visible` INT(1) NOT NULL DEFAULT '0',
	`last_mod` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
	`last_mod_ID` VARCHAR(64) NOT NULL DEFAULT '',
	`restricted_privs` VARCHAR(22) NOT NULL DEFAULT '1,2,3,4,5,6',
	`restricted_ID` VARCHAR(22) NULL DEFAULT '',
	`note` TEXT NOT NULL DEFAULT '',
	PRIMARY KEY(name)
);

Only fixed the query, with out looking the plugin, so hard to know are those nulls bugs or features. :) PS. also made privs field from 64 to 22 – should be enough.

Last edited by Gocom (2008-08-06 05:45:19)


Rah-plugins | What? I’m a little confused… again :-) <txp:is_god />

Offline

 

#6 2008-08-06 06:03:45

gomedia
Plugin Author
lambda
Real name: Adi
Website

Re: adi_notes - leave notes for Textpattern users

Thanks Jukka. My lack of MySQL knowledge has been exposed for all to see.

The datatype of BOOLEAN was a blind guess but it worked for me. I’ve just noticed that it doesn’t exist according to the MySQL online documentation. Easily changed to INT.

I must admit, ajw_public_notepad had `quotes` around the column names & I took them out to see what would happen – nothing went bang so left them out. Moral: don’t fiddle, it might break!

Columns restricted_privs and restricted_ID aren’t used elsewhere – they’re reserved for future use.

The missing NOT NULLs problem was compounded when I copied what went before.

Offline

 

#7 2008-08-06 06:09:57

jm
Plugin Author
omega
Real name: Jon-Michael Deldin
From: Missoula, MT
Website

Re: adi_notes - leave notes for Textpattern users

Adi – you only need the backticks if you’re using a reserved word.

Offline

 

#8 2008-08-06 07:11:55

gomedia
Plugin Author
lambda
Real name: Adi
Website

Re: adi_notes - leave notes for Textpattern users

jm wrote:

Adi – you only need the backticks if you’re using a reserved word.

Thanks, Jon-Michael, much obliged.

Offline

 

#9 2008-08-06 12:10:10

maniqui
Moderator
omega
Real name: Julián
From: Buenos Aires, Argentina
Known languages: es,en

Re: adi_notes - leave notes for Textpattern users

While waiting for “official” fix, I just wanted to say that Gocom’s fix worked perfectly for me :D


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

 

#10 2008-08-06 22:13:33

gomedia
Plugin Author
lambda
Real name: Adi
Website

Re: adi_notes - leave notes for Textpattern users

I’ve implemented the CREATE TABLE fix. Download version 0.2 and give it a go.

Gocom, thanks for your expertise.

maniqui, thanks for your patience. Let me know how you get on with using adi_notes.

Offline

 

Powered by PunBB
© Copyright 2002 – 2005 Rickard Andersson