Paid affiliate advertisement

$5 for quick fix of Review List to list in botton of node with View 2 module

jacren - May 21, 2009 - 05:27

Can anyone get reviews list display at the bottom of a node instead of new page? Here is a sample coding someone did this function with View 1. I am looking to get a correct coding that's working for View 2. Will paypal to you for payment.

Please refer to this for sample coding: http://drupal.org/node/247652

<?php
if (user_access('read reviews')) { // check if user have access
 
if (arg(0) == 'node' && is_numeric(arg(1))) { // check current page path
   
$nid = arg(1);
   
$node = node_load($nid);
   
$type = $node->type;
    if (
variable_get('nodereview_use_' . $type, 0) && db_result(db_query("SELECT COUNT(*) FROM {nodereview_axes} WHERE node_type='%s'", $type))) {
     
$view = views_get_view('review_list');
     
$view_args = array($nid);
     
$pager = TRUE;
     
$limit = 10;
      print
views_build_view('embed', $view, $view_args, $pager, $limit);
    }
  }
}
?>

I can't touch it for $5, but

criznach - May 21, 2009 - 05:43

I can't touch it for $5, but it looks pretty straight-forward. Unless the nodereview module has changed significantly, I suspect all that needs to change is the call to views_build_view() and it's arguments. See the documentation for views 2 embedding here:

http://groups.drupal.org/node/10129

No idea how to get it work..

jacren - May 21, 2009 - 13:55

Should I raise the bar? :)

without checking your

mm167 - May 21, 2009 - 07:53

(updated)

is the $5 still available?
is there any argument required in your view?

We go the drupal way. How about you?
http://www.drupalway.com

Yeah, still available.

jacren - May 21, 2009 - 13:57

No sure what argument and the coding in this area..

Anyhow, if u able to provide that put the reviews at the bottom of a node instead of new page with latest nodereview and views module. u will win it.

1. views-build_views is

mm167 - May 21, 2009 - 14:19

1. views_build_views is replaced by views_embed_view in D6 views2
so, keep your example code lines, and ..

2. replace this line
print views_build_view('embed', $view, $view_args, $pager, $limit);
by
print views_embed_view('view_name_xx', 'default', arg);

3. of course, u should already prepared a views, named 'view_name_xx'

4. (optional) in general, there should be a arg for your views. for example nid, uid,...etc
if u have such arg, put it as the 3rd parameter.

if there's no such argument in your views, forget it.

Thanks for your $10.
You may BUY me a beer ($10) in http://www.drupalway.com/node/3)

good day
---------------------------------------------------------
toll free is good, but pay toll may go faster ...
we go the drupalway. how about u?
www.drupalway.com - pay toll to go faster

We go the drupal way. How about you?
http://www.drupalway.com

Cheers!

jacren - May 21, 2009 - 16:13

After follow your pointer, I have it fixed.

Your beer is ready. :) Payment is sent.

Thanks for your help.

good to hear my solution

mm167 - May 22, 2009 - 01:03

good to hear my solution fixed your issue.

thanks for your beer.

Good day.

We go the drupal way. How about you?
http://www.drupalway.com

 
 

Drupal is a registered trademark of Dries Buytaert.