Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-28 04:06:46

TexanPenguin
New Member
From: Wollongong, Australia
Registered: 2006-11-28
Posts: 4
Website

Editing TXP core files (and the effect it has on upgrading)

Hi all,

I’m a web designer/developer from Wollongong, Australia, doing a commercial job in TXP.

Prior to this job I’d never used Textpattern, but its feature set seemed to be applicable to the job, so I dived in head-first.

Anyway, one request the client has is that the user privilege levels be renamed and adapted to his needs. I understand that a future version of TXP will have more precise end-user level-editing, but until that point, I can only assume the best way to accomplish this is by following the steps outlined here

Now the thing that has me concerned is that this is clearly hacking the Textpattern source files (something I’m more than willing to do; I have plenty of PHP experience, but only very mild experience with the TXP functions). I am just wondering, then, if undertaking this kind of hacking is going to mean the Textpattern installation would be unable to be upgraded when new versions are released. If so, is there some way I can accomplish this without breaking the system?

Up until now, all the problems I’d had were able to be sorted out by writing/editing plug-ins (it’s testament to the quality of the TXP community that I was able to do this without needing to ask any questions of my own until now), but this doesn’t seem to be one of those times, as it relates to changing hard-coded Textpattern functions.

So in short: what’s the best way of doing this?

Offline

#2 2006-11-28 15:51:12

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Editing TXP core files (and the effect it has on upgrading)

There’s a plugin for editing permissions – would that work?

As far as upgrading, you’ll need to make the same modifications to each release. It’s a real pain, especially if you use SVN releases (update frequently), so it’s easier to use a plugin.

Offline

#3 2006-11-28 15:58:06

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Editing TXP core files (and the effect it has on upgrading)

Have a look at the revision log for the textpattern/lib/admin_config.php file.
Just one minor change in 2006 which would have been easy to merge manually with your own version.

The plugin approach mentioned by jm is nice, but uses javascript to hide things from users (instead of really disabling them). Editing the admin_config.php file is probably better if you have some experience in PHP.

Offline

#4 2006-11-28 21:05:36

TexanPenguin
New Member
From: Wollongong, Australia
Registered: 2006-11-28
Posts: 4
Website

Re: Editing TXP core files (and the effect it has on upgrading)

Oh, good, that’s what I like to hear! Of course, admin_config.php itself says loud and clear that it’s mostly deprecated and that its functions will be soon merged into the DB, so there’s a little bit of worry about that, but since 4.0.4 seems otherwise reasonably stable, I might just recommend to the client that he not upgrade TXP.

As a side-note, has anyone ever actually annotated the admin_config permissions list, explaining what each function actually DOES? That would be very useful.

Offline

#5 2006-11-28 21:44:19

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Editing TXP core files (and the effect it has on upgrading)

Permissions are in the database: the txp_priv table. (Or isn’t this table used yet?)

Descriptions here.

Edit: o.k. see what you mean. These are not actual descriptions of the functions.

Last edited by els (2006-11-28 21:53:17)

Offline

#6 2006-11-28 21:57:45

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Editing TXP core files (and the effect it has on upgrading)

Els wrote:

Permissions are in the database: the txp_priv table. (Or isn’t this table used yet?)

No, not used. Without an interface to edit permissions, it would be a step backwards to push them in the db (harder to edit and an additional query; for hardly any benefit).

Offline

#7 2006-11-28 21:59:21

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Editing TXP core files (and the effect it has on upgrading)

I see. Thanks for clarifying Sencer.

Offline

Board footer

Powered by FluxBB