Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-06-05 06:53:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Tree functions for plugin authors

Would it be possible to modify txplib_db.php such that it adds a $tbl argument to the four tree functions?

As it stands txp_category is hard-coded as the table name. If there was an optional extra attribute $tbl='txp_category' then people who wish to make use of binary tree functionality wouldn’t have to duplicate the core code just to offer this in a plugin. Thus I could employ my own table and use the core functions to traverse it.

unified diff (based on vanilla TXP 4.0.6)

Thoughts?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2008-06-05 08:10:26

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Tree functions for plugin authors

A reasonable request.

Offline

#3 2008-06-06 13:24:33

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Tree functions for plugin authors

Offline

#4 2008-06-06 14:56:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

Re: Tree functions for plugin authors

w00t! Thank you, wet. Sorry I missed one of the $tbls in my diff.

*slaps hand*


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB