Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-03-23 14:40:37
- lordrich
- New Member
- Registered: 2006-01-09
- Posts: 3
How to use friends-only posts
One thing I miss about Livejournal is the ability to have articles as friends-only. I realised there must be a way of doing something similar in Textpattern, and this is what I came up with.
Install the plugins chh_article_custom and chh_article_lib
Create a new page template based upon default called private
In the new template, replace <txp:article />
with the line <txp:chh_article_custom section="private,article" listform="default" />
Now create a new section called private. It should use the page private, and all the radio buttons should be marked no.
OK, now we have a section called private which will show all the articles, including articles posted to the private section. And we have a front page which won’t show the articles posted to the private section. What we need to do now is add some form of authentication on the new page and redirect your friends from the front page to the new address of /private/. There are two options here, to use the password tag or to do it on IP address. Since my friends all have static IP addresses I decided to use that method.
At the top of the page default, add this text
Change the ip addresses to those of your friends (these entries are changed to protect the innocent). I’ve commented each entry so I know who it is.
Then at the top of the page called private, add some similar code
And so now when your friends visit http://www.example.com they will be redirected to http://www.example.com/private/ using javascript. When non-friends visit, they will remain on the front page, and when non-friends try visiting /private/ they will see a blank page.
Offline
Re: How to use friends-only posts
I like the idea of this – but the text to paste is gone from the links cited!
Offline
#3 2006-04-25 19:34:55
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: How to use friends-only posts
Yes, pastebin is just a temporary place to share code.
Offline
Pages: 1