Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2005-09-29 23:05:55
- gregmay
- Member
- Registered: 2005-09-29
- Posts: 12
Automatic Reposting
Hi! Fairly new to the board, but really enjoying textpattern. Great plugins!
On that note, I’m wondering if there is a plugin out there that allows you to have articles reposted automatically on a daily/weekly/monthly basis? I basically want to have an article that comes up as “new” every so often. I know that I could manually update the article’s date and time and repost it, but I’m hoping to make it as automatic as possible.
If there’s something out there already, please let me know. If there isn’t, I’d be happy to donate to an effort to create such a plugin- I don’t think I have sufficient chops to make it happen on my own.
Thanks!
Offline
Re: Automatic Reposting
If you want to randomise the display of your articles you will be better of with <code><txp:article_custom form=“form_of_your_choice” limit=“1” sortby=“rand()” sortdir=“desc” /></code>. Create a form_of_your_choice and use <a href=“http://textpattern.org/plugins/390/upmdatetime”>upm_datetime</a> to display current date. So your form will look like…
<code>
<txp:title>
posted on <txp:upm_datetime />
<txp:body>
</code>
So it will actually give your users the idea that the article was posted on the same day.
I hope that helped.
“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”
— Albert Einstein
Offline
#3 2005-09-30 06:11:10
- gregmay
- Member
- Registered: 2005-09-29
- Posts: 12
Re: Automatic Reposting
Thanks for the tip, but I’m not sure that it fits my needs. I have an article that I want to have automatically reposted every week (say, an article with ads in it). I could go in and modify the date/time on the original post, but I just want it to happen automatically every incremental period, regardless of what else happens with the site. I don’t want to randomize anything, and upm_datetime doesn’t give me the ability to enter arguments (say, add 1 to the month) and automatically repost.
Offline
Re: Automatic Reposting
Okie..
Lets say you have 10 articles in a category “Automobiles”. Using <code><txp:article_custom form=“a_form_of_your_choice” limit=“1” sortby=“rand()” category=“Automibles” /></code> you can randomly display one article from Automobiles [which will carry today’s date (current date) ]. Ofcourse you have to use a form similar to the one provided in the previous post. AND also instal <code>upm_datetime</code>.
If you would like to dsiplay specific articles on a specific day, then you have no other choice. You have to do it manually. (that’s as far as my knowledge goes).
“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”
— Albert Einstein
Offline
Re: Automatic Reposting
You could set up some sort of cron job to update the mysql `LastMod` field.. Or something like that. If you’d like, I can look into that a bit tomorrow.
I’m not really sure how one would do a plugin for that, unless the plugin were called every time a page is requested, and at that point checks to see what time it is, if the article is older than x, and if it is, updates the field in the database. (Any thoughts, other plugin devs?) But that seems like an awful lot of overhead for something that could be easily set up with a cron job. Of course, that is assuming that you’d have access to cron jobs on your server, and I think that a lot of servers don’t have that access.
In terms of making this a plugin though, are you looking to only have a single article or a few (tops) updated every so often? Or are you looking to have a whole lot of articles updated every so often?
Offline
#6 2005-09-30 07:16:36
- Niconemo
- Member
- From: Rhône-Alpes, France
- Registered: 2005-04-18
- Posts: 557
Re: Automatic Reposting
Another (not perfect at all) solution would be to post the same article by advance 12 times a year with date incremented… To take less time, it could be done once for all with a SQL command directly in the database.
I know… this is not terrible… I can say I have tried ;)
Edit…
A javascript can display a div at particular days… If this div contains one single article it can do the job, no ?
Is it really the post date tha matters or displaying the article ?
Last edited by Niconemo (2005-09-30 07:22:34)
Nico
Offline
#7 2005-09-30 12:19:11
- gregmay
- Member
- Registered: 2005-09-29
- Posts: 12
Re: Automatic Reposting
Thanks for some ideas guys. I could in fact create several copies of the article and set them ahead of time, and I might end up doing that. I see what you mean about it being a difficult area for a plugin to solve, it’s hard for me to picture a plausible solution as well. I don’t have access to cron jobs, unfortunately, and don’t see a way to set timed batch jobs or anything like that.
I was, foolishly I guess, thinking that I could add a tag to specific articles asking that they be called weekly/monthly, and the article would be published with that meta information (dates/times in the future to be published). When the page is loaded, a function would be called to check whether there are any pages which have to be reposted, and it would update them appropriately. And, as akokskis pointed out, I suppose that this could be overkill, because that function is going to be called every time the page is loaded, and might have to do a lot of looking to see if something needs to be republished. Hmmm…
Open to suggestions, and thanks for your help so far!
Offline
Pages: 1