Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-05-24 17:29:17

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Classified ads: How to implement in TXP (simplified admin page?)

I would like to integrate a classified ads section into my Textpattern site.
Users should be able to edit the entries themselves.
Spontaneously I thought about publishing one anonymous low level admin account.

Questions

How to simplify the content edit admin page?
How to add help?
How to guard other articles from being edited by other authors using the same low level admin account?

Is it possible to make a form which generates an article?

OT: Are there good solutions for classified ads available?


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#2 2009-05-24 18:05:50

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

Re: Classified ads: How to implement in TXP (simplified admin page?)

merz1

If I was approaching it I’d do it client side with ign_password_protect and mem_self_register. Get users to register an account, all of them type Freelancer (for example). Permissions are then automatically handled by the creation of these user accounts and the fact that when someone logs into the client side (via ign_password_protect) users can only edit their own articles.

Once logged in, show a Form that shows some news, a bit of help, lists their existing ads, allows them to add a new one (perhaps edit an existing one?), and so on. Most of that can be done with standard core tags. To insert the data I’d try mem_form / mem_simple_form first or you could try an INSERT with smd_query, though I’ve never tested it. Failing that, you’d have to go PHP but I think mem_simple_form can get you all the way there because you’re only dealing with one table: textpattern.

Creating articles on the fly isn’t tricky as long as you validate the input and make sure the url_title is unique. Everything else is just logic. I’ve even created articles on the fly when someone clicked a link that returned a 404. In an error_404 page I used some tags/PHP to read the name of the article the person was trying to look at, then created an empty article with that name and redirected the browser to it so the content could be typed in. Works a treat.

Last edited by Bloke (2009-05-24 18:07:38)


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

#3 2009-05-24 18:23:14

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Classified ads: How to implement in TXP (simplified admin page?)

Wow! Great answer. A lot to think & tinker with now :)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

Board footer

Powered by FluxBB