Would be great :)

Any plans

Here are some code snippets that could be used:

http://drupal.org/project/sitestats
http://drupal.org/project/google_pr
http://drupal.org/node/375563

Comments

daniel wentsch’s picture

I was looking for something similar and decided to go with Computed Field module (http://drupal.org/project/computed_field).
This allows me to run some PHP code on the content of a field (ie the value provided for link field). So I took the functions of sitestats that are needed to return the page rank, put them inside my template.php and call them inside my computed field, passing the entered URL as an argument for _sitestats_getpagerank().
If a node gets edited and saved, calculated field code will run again and thus update the pagerank.

So what I did step by step:
- installed computed field module
- add a link field to my content type
- add a computed field afterwards, calculated code being:
$node_field[0]['value'] = _sitestats_getpagerank($node->field_pagerank_link[0]['url']);
- took all the functions from sitestats.inc and put them into my template PHP (I'll figure out which can be removed later, but I'm planning to make use of alexa, too.)

Works fine for me, maybe this will help you.

jcfiala’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

It's been four years since this bug, and no one's touched it. If you need to you can re-open this ticket, but I suspect you don't need this fixed anymore.