I made a page with View Type: Listview; Fields : Image: Add your image here (it's a cck filed); Filters : Node: Published =yes; Node: Type = Story; Sort Criteria : Node: Created Time = descending

<?php
    $view = views_get_view('singlestorypage');
    if (arg(0) == 'node' && is_numeric(arg(1))) { // I'm seeing a single page
    //??? allnodes = count all nodes published
    $nid = arg(1); 
	$OFFSET = $allnodes - $nid +1;
        };
    print views_build_view('embed', $view, array(), false, 5, null, $OFFSET);
?>

the question is how offset works if I have nodes deleted...

Anyway the goal is :
-lest say I'm viewing node/34 published on 18-April
-i wish to print latest 3 nodes published before 18-April
-and so on with everynode I see

it's related to http://drupal.org/node/220566

Comments

idflorin’s picture

nobody ?

joachim’s picture

I'd set your argument to be the submission time of the current node.
Then set your view to have:
- order by node submission time
- limit to 3 nodes

Going by nid might not give you what you want if nodes are deleted, etc.

idflorin’s picture

- "I'd set your argument to be the submission time of the current node." I don't know how to do that

- the nid is a sample, I'm open to any suggestions, as long it's solve the problem.

joachim’s picture

Try the argument 'Node: Posted Full Date'.
You may need to do some conversion, as the creation date held in the node object is probably a different format.