Submitted for your review are a series of files that extend scheduler.module to permit users to schedule the promotion and demotion of nodes.
Other than the obvious changes, the only other things to notice are:
1) Schema changes to the database,
2) Scheduled entries in the database are not deleted according to the same rules as before. I think it's better this way, but I'll be testing it to make sure.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | scheduler-promotion.patch | 20.16 KB | oadaeh |
| #12 | scheduler-5.x-1.6_promote_0.patch | 7.88 KB | HorsePunchKid |
| #11 | scheduler-5.x-1.4_promote_0.patch | 7.43 KB | HorsePunchKid |
| #2 | scheduler.pgsql.promote.patch | 391 bytes | njivy |
| #1 | scheduler.mysql.promote.patch | 469 bytes | njivy |
Comments
Comment #1
njivy commentedMySQL schema change
Comment #2
njivy commentedPostgreSQL schema change
Comment #3
stelman commentedI'm not sure if I understand this correctly, but I would love to see something like this work to schedule promotion and demotion of nodes to the front page. I like to have the next nearest upcoming event node (event module) show up on the front page, but disappear after its occured, and be replaced by the next upcoming event
Comment #4
deekayen commentedAfter patching, admin/node/scheduler is blank.
Comment #5
m3avrck commentedNot a bad feature request, would be easy to add. Changing status for now.
Comment #6
mariagwyn commentedI just want 2nd or 3rd this feature. I don't really need to unpublish things, but I do need to demote them.
Thanks,
Maria
Comment #7
AjK commentedAdd to TODO.txt
Making this issue "postponed" as I wish to concentrate on Drupal5 compat and any ensuing bugs. Once stable, I will return to these issues as outlined in the projects TODO.txt file
Comment #8
ngstigator commentedactions + scheduled actions already enables scheduled promote/demote of nodes.
Comment #9
GavenHuang commentedAlso consider adding "sticky" option?
Comment #10
HorsePunchKid commentedWould an updated patch that does promotion/demotion instead of publish/unpublish be accepted at this point? I can work on one if its likely to make it into a release; otherwise, it's easier just to do search and replace to change the behavior.
Comment #11
HorsePunchKid commentedHere's an updated patch to do promotion and demotion instead of publishing and unpublishing. Nothing fancy, no extra options. Just a change in terminology where it's visible in the interface and a change in behavior on the backend.
The scheduled actions module doesn't appear to be updated for Drupal 5, for what it's worth.
Comment #12
HorsePunchKid commentedUpdated for scheduler 1.6.
Comment #13
AjK commentedHi, thanks for your work. Note, if you are changing the schema by patch then:-
Comment #14
HorsePunchKid commentedThanks for the suggestions, AjK. I decided, for better or worse, to make this a very "shallow" patch in order to avoid having to touch the schema in any way. The only changes are in the text presented to the user to describe the functionality and in the code that actually perform the scheduling actions. Everything else (form input identifiers, column names, internal variables) are unchanged.
Comment #15
AjK commentedKilling this as no followup work forthcoming
Comment #16
oadaeh commentedThe attached patch gives scheduler the ability to promote and demote nodes as well as publishing and unpublishing them. While I'm sure I've missed an edge case or two, I'm fairly positive that it is flexible enough to handle just about any combination of publishing, unpublishing, promoting, and demoting. It also includes updates to scheduler.install for full database compatibility.
I didn't do any translations, as I don't speak anything other than English. Also, if the wording is inappropriate (promoting vs promotion, etc.), let me know. Try it out and see if it works for you.
Comment #17
eric-alexander schaefer commentedPlease have a look at #276376: Make scheduler more generic?.
Comment #18
hokumboy commentedDoes this feature exist for Drupal 6?
Comment #19
eric-alexander schaefer commentedNot yet.
Comment #20
michemon commentedI implemented the patch on the version 5.x-1.16 and it works.
Only one problem: when the item is demoted, it is considered updated and so it is shown in the recent block.
Michele.
Comment #21
eric-alexander schaefer commentedPostponing until #276376: Make scheduler more generic? is available.
Comment #22
eric-alexander schaefer commentedComment #23
eric-alexander schaefer commentedIt has been decided to keep scheduler nice and tidy and let it schedule publishing and unpublishing of nodes. Your requested feature might be possible with other, more suitable modules like rules, actions and workflow.
Comment #24
najibx commentedyes, scheduler is nice and tidy :-) It make it easy for end user to schedule. Unfortunately, with rules/workflow, i don't think It's going to be as clean/easy as this module. Would it be possible to 'duplicate' this module, with very much similar look & feel, but mainly for promoted/depromoted to frontpage, without disturbing publish/unpublish status?
Could you share share links/specific how to, an alternative point out how it can be implemented alternatively. TQ
Comment #25
eric-alexander schaefer commentedI have been thinking about this again lately. I have some new ideas but right now I want fix open bugs and port scheduler to D7. New features will have to wait until after that (I have lots of ideas).
If you only want to promote/demote and not publish/unpublish you can do this:
Edit scheduler.module, go to function scheduler_cron()
- look for this line: "$n->status = 1;" (line #433 in the current release for D5), change it to "$n->promote = 1;"
- look for this line: "$n->status = 0;" (line #459 in the current release for D5), change it to "$n->promote = 0;"
Please do not try this with you live site, because I did not test it. This will also not work for the D6 release, because the publishing is done differently. If you need this feature for D6 I would have to look up the appropriate actions for promotion of nodes. Tell me if you need that.
BTW: I can't think of a scenario where scheduled promotion/demotion of a node would be handy. Can you tell me what you want to do with that?
Comment #26
oadaeh commentedI can think of one. I have two sites I maintain where events are created months in advance. I would like for the events to always be published, but to only be promoted to the front page for the week before they happen (for more publicity), and then to be automatically demoted (but not unpublished) after the event is over. That scenario is a little more complicated in that the date created would also have to be changed in order for the event to show up at the top of the list, rather than way down on the list, potentially several pages back.
Comment #27
najibx commentedon the sites i built, many of them are careful on content being displayed on the frontpage. I have bunch of blocks, which uses Views to show only nodes that are promoted to the frontpage. However, it also arranged according to date.
I've been thinking, i could use this module to enable the node automatically at future date but during conten creation I must checked "promoted to the front". So when the time come, the node will be published AND promoted to the frontpage. Later, one must demotion manually or it will be taken out by more latest content.
Comment #28
ajzz commented@eric: scheduled promote/demote will be important to one of the sites I am working on, where events are posted months/weeks in advance, but need to be promoted or stickied on the front page when they are most relevant... say a week before the event date. Its hard to coordinate people to do this for a small volunteer group, so automation will help significantly. Similarly to automate the workflow, stories published on the front page could also be demoted with age... I second these features in D6. I'm happy to help test. (also setting up this automation would not be as simple with actions/triggers/workflow)
Comment #29
eldblz commentedAny news about this feature?
Comment #30
eric-alexander schaefer commentedPromote and demote will be implemented after the D7 version is out of the door and the normalization is done (#1006766: Normalize and extend schema).
Comment #31
jonathan1055 commentedComment #32
jonathan1055 commentedThe duplicate is #1092934: Scheduled promotion / demotion from Front page (even though it's newer than this thread)