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.

Comments

njivy’s picture

StatusFileSize
new469 bytes

MySQL schema change

njivy’s picture

StatusFileSize
new391 bytes

PostgreSQL schema change

stelman’s picture

Version: » 4.6.x-1.x-dev

I'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

deekayen’s picture

Status: Needs review » Needs work

After patching, admin/node/scheduler is blank.

m3avrck’s picture

Version: 4.6.x-1.x-dev » master
Assigned: njivy » m3avrck
Status: Needs work » Active

Not a bad feature request, would be easy to add. Changing status for now.

mariagwyn’s picture

I just want 2nd or 3rd this feature. I don't really need to unpublish things, but I do need to demote them.
Thanks,
Maria

AjK’s picture

Assigned: m3avrck » AjK
Status: Active » Postponed

Add 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

ngstigator’s picture

actions + scheduled actions already enables scheduled promote/demote of nodes.

GavenHuang’s picture

Also consider adding "sticky" option?

HorsePunchKid’s picture

Would 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.

HorsePunchKid’s picture

StatusFileSize
new7.43 KB

Here'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.

HorsePunchKid’s picture

StatusFileSize
new7.88 KB

Updated for scheduler 1.6.

AjK’s picture

Status: Postponed » Needs work

Hi, thanks for your work. Note, if you are changing the schema by patch then:-

  1. It needs to handle the PG stuff
  2. It needs a scheduler_update_X() function to handle upgrades of existing systems
HorsePunchKid’s picture

Thanks 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.

AjK’s picture

Status: Needs work » Closed (fixed)

Killing this as no followup work forthcoming

oadaeh’s picture

Version: master » 5.x-1.15
Assigned: AjK » oadaeh
Status: Closed (fixed) » Needs review
StatusFileSize
new20.16 KB

The 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.

eric-alexander schaefer’s picture

hokumboy’s picture

Does this feature exist for Drupal 6?

eric-alexander schaefer’s picture

Not yet.

michemon’s picture

I 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.

eric-alexander schaefer’s picture

Postponing until #276376: Make scheduler more generic? is available.

eric-alexander schaefer’s picture

Status: Needs review » Postponed
eric-alexander schaefer’s picture

Assigned: oadaeh » Unassigned
Status: Postponed » Closed (won't fix)

It 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.

najibx’s picture

yes, 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

eric-alexander schaefer’s picture

I 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?

oadaeh’s picture

I 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.

najibx’s picture

on 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.

ajzz’s picture

@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)

eldblz’s picture

Any news about this feature?

eric-alexander schaefer’s picture

Promote and demote will be implemented after the D7 version is out of the door and the normalization is done (#1006766: Normalize and extend schema).

jonathan1055’s picture

Version: 5.x-1.15 » 7.x-1.x-dev
Issue summary: View changes
Status: Closed (won't fix) » Closed (duplicate)
Parent issue: » #1006766: Normalize and extend schema
jonathan1055’s picture

The duplicate is #1092934: Scheduled promotion / demotion from Front page (even though it's newer than this thread)