Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Update section when Posted=now
Anyone know of a plugin that does this? I have a site with daily posts. Posts dated in the future are available to paid members only, present and past posts, as well as other content, are publicly available. Because of the way the membership system works, I’m pretty sure the members-only content needs to be in a different section than the archives. Seems like the simplest way to do this would be to update the section for each article as it becomes current. But heck if I’m going to log on and switch it every day. Is there a plugin that does this? If not, can you write it? I will pay.
The site is (temporarily) at mollycliborne.com if you want to have a look.
Best,
Molly
Last edited by molly (2005-05-24 21:45:53)
Offline
Re: Update section when Posted=now
(sound of crickets chirping)
What’s wrong? Why no answers? I only know enough about PHP and programming to be dangerous.. so will someone let me know if I’m asking for the impossible with the above? Please feel free to set me straight here. How complicated would it be to write a plugin that does what I want?
Last edited by molly (2005-05-27 01:56:13)
Offline
Re: Update section when Posted=now
Insert into /textpattern/publish.php after the include block (around line 33 in txp 1.0rc3) the following code:
<code>$time = time();
$change = safe_update(“textpattern”, “Section = ‘article’”, “Section LIKE ‘member’ AND Posted < FROM_UNIXTIME($time)”);</code>
Exchange “article” with your public section name and “member” with your member section name.
This updates your database everytime someone visits your website. If you prefer to do the update from your admin area, let me know, I’ll change it into an admin side plugin (perhaps with error messages and number of changes).
However, try it first in a safe environment.
Offline
Re: Update section when Posted=now
That worked perfectly! Thank you.
Offline
Pages: 1