Any plans on adding support for Views? I would really like to be able to create a personalized news page with complete teasers for users, using views of the output of this module. Is that possible? Thanks.

Comments

danithaca’s picture

It's possible, but I need to study the ViewsAPI first. Also, my priority is to add other features first such as using GA feedback or nodeapi. So if there's no other coder, this feature might not be added soon.

If you or other developers are interested in implementing this feature, you just need to use:

  $items = history_rec_related($node->nid); // gives you the related items
  $items = history_rec_recommended($user->uid); // gives you the personalized recommenations
dwkitchen’s picture

So to use this code in Views I did the following:

First a change to the module I removed the line

$items = array_map('_history_rec_format_node', $items);

from history_rec_related() at line 94 and history_rec_recommended() at line 101 and inserted it into history_rec_block() twice at line 66 & 75.

I would propose that this is a change to the module

Then in my view I created an Argument for Nid and select 'Provide default argument -> PHP Code'

and used this code:


$node_nid = arg(1);

$recomended_nodes = history_rec_related($node_nid);

$nodes = array();
foreach ($recomended_nodes as $rid) {
  $nodes[] = $rid[id];
}
return implode(",", $nodes);

(don't use the php wraper in the text area)

David

JoeMcGuire’s picture

My understanding is that views support needs to be added at the Recommender API level?

I've submitted a patch for the recommender API
#673786: add views support

danithaca’s picture

thanks!! due to some personal matters, i can't work on it now. but i'll get back to it as soon as possible. thanks.

jm.federico’s picture

Status: Active » Postponed (maintainer needs more info)

Hello

I'll wait until recommender API gets views support and I'll review this issue then.

teelmo’s picture

I'm also interested in Views support

danithaca’s picture

Status: Postponed (maintainer needs more info) » Fixed

fixed. see #673786: add views support.
for the D7 release, Views is supported too.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.