writing an application to promote nodes to frontpage based on voting results

poloparis - February 13, 2009 - 15:57

Hello

I am trying to write a small application to do the following :

- promote stories to frontpage based on the number of votes

This issue used to be addressed by the voting_actions modules, but it has not been ported to D6.
Could anyone give me some pointers. should I look at implementing the node_load or node_promote functions, which hooks you think...

the idea, as you may have already guessed, is that stories are all entered as "not promoted" and only get promoted to frontpage after a certain number of votes is reached

Thank you
PS. I am not versed in writing modules, but am learning. (at least, trying to...)

Which module are you using

nevets - February 13, 2009 - 16:20

Which module are you using for voting?

Hi Nevets I use the

poloparis - February 13, 2009 - 18:25

Hi Nevets
I use the vote_up_down and/or plus1 modules, but does it makes any difference ?
the way I see it the data for the number of votes would be fetched from the database, which is incremented by votingapi indifferently for both voting modules, am I right ?

learning is fun

sunset_bill - February 13, 2009 - 16:26

So instead of any how-to tips or suggestions on other modules you might use, I recommend getting the D5 voting_actions code and seeing how they do it there.

You could also post an issue on voting_actions to see if there's a D6 port in the works...if not, porting to D6 isn't that tough using the Coder and Deadwood modules.

salud,
Bill

Thanks for the Deadwood

Barrett - February 13, 2009 - 16:34

Thanks for the Deadwood reference, Bill. I hadn't come across that before. If it's even a quarter as useful as it claims to be it'll be a real time saver.

Rather than trying to write

Barrett - February 13, 2009 - 16:31

Rather than trying to write a new one, have you considered trying to port Voting Actions to d6? There are a lot of people looking for it (http://drupal.org/node/229869), so it would be a boon to the community and may be a lot easier than trying to build the same functionality from scratch.

Hi guys thank you for your

poloparis - February 13, 2009 - 18:17

Hi guys
thank you for your answers
I am subscribed to this issue as well.

Voting_actions depends on the actions module, which is huge, way above my skills right now. And I think actions has been replaced by the workflow module, so the voting_actions module would then be needed to be not only ported, but adapted to workflow.... definitely way over my head

The reason I asked for pointers to this issue is that I think a module like the one I'm describing should be real small, and quite easy for some to point me in the right direction :

- run a querry to select non promoted story nodes
- run a querry to compare this node's selection votes to an integer
- promote if test ok
- cron task to run at intervals
(- eventually, unpublish if in selection and date compare is too old)

am I searching in the right direction ?

_

WorldFallz - February 13, 2009 - 18:34

Voting actions appears to be dieing, if not dead. I would think contributing to the votingapi rules integration would be effort better spent: http://drupal.org/node/319094

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

Hey WorldFallz, nice to hear

poloparis - February 13, 2009 - 18:56

Hey WorldFallz, nice to hear from you again.
I agree, but rules and votingapi are huge and 2 very complex modules I cannot dream of touching as of now... (one day!)
so in the meantime, i would need my small application.
any suggestion you would choose to share to point me in the right direction ?
Thanks

_

WorldFallz - February 13, 2009 - 19:01

Not off the top of my head (coding still requires a significant effort for me) and if I were to going to put some time aside to look into it i'd definitely work on the rules integration issue (rules is quickly becoming a 'must have' for me). Sorry :(

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

Ok I'm slowly getting the

poloparis - February 13, 2009 - 19:40

Ok I'm slowly getting the beginning of where to look :

in the node.module api, node_promote_action : http://api.drupal.org/api/function/node_promote_action

i just need to figure out how to use it...
I'm actually taking a look at the actions module to try to understand how it is done. If anyone has any tips, that would be great...

Have you accomplished promoted to front page task??

aac - July 12, 2009 - 13:27

Have you accomplished promoted to front page based on votes?
If yes, I am still looking for it. Can you please help?
Thanks!!

 
 

Drupal is a registered trademark of Dries Buytaert.