I have an idea with a little and simple module, tell me if it's what you wanted to do.
For this exemple you have to create in your DB a field that i will call vuid (for view uid : your uid + your friends uid).
Then use this function :
function get_list_art() {
//Place there what I describe after
$sql = " SELECT {node}.nid,
{node}.created,
{node_revisions}.title,
{node_revisions}.body
FROM {node}
INNER JOIN {node_revisions}
ON {node}.nid = {node_revisions}.nid
WHERE {node}.uid = ".$vuivalues."
AND {node_revisions}.body != ''
ORDER BY {node}.created DESC
";
$result = db_query(db_rewrite_sql($sql));
$i = 0;
while($art = db_fetch_array($result)) {
$arts[$i]['nid'] = $art['nid'];
$arts[$i]['date'] = format_date($art['created']);
$arts[$i]['title'] = $art['title'];
$arts[$i]['content'] = $art['body'];
$i++;
}
return theme('list_art', $arts);
}
/**
* Implementation of hook_menu().
**/
function list_art_menu() {
$items = array();
$items['list_art'] = array(
'title' => "",
'page callback' => 'get_list_art',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK
);
return $items;
}
/**
* Implementation of hook_theme().
**/
function list_art_theme() {
return array(
'list_art' => array(
'template' => 'list_art',
'arguments' => array('arts' => NULL),
),
);
}
So now I will explain what is my $vuidvalues in the $sql.
You have first to go search all the vuid that refer to your actual $user and implode this array to an SQL expression ( '1' OR '2' OR for exemple)
global $user;
$uiduser = $user->uid;
$vuidtabsql = " SELECT {user}.vuid,
FROM {user}
WHERE {user}.uid = ".$uiduser.";
$vuidtab = db_query(db_rewrite_sql($vuidtabsql));
$vuidvalues = "'".implode("' OR '", $vuidtab)."'";
That was for the .module
Then display the .tpl.php with :
<?php
// $Id$
?>
<h1>Your and your friends stream</h1>
<br>
<br>
<?php foreach($arts as $art) : ?>
<div class="node-blog-fond">
<div class="node-blog-haut">
<h2><?php print l($art['title'] , 'node/'.$art['nid']); ?></h2>
<span class="submitted"><?php print $art['date']; ?></span>
<p><?php print $art['content']; ?></p>
</div>
<div class="node-blog-bas"></div>
</div>
<br>
<?php endforeach; ?>
I just start to learn Drupal and I'm not yet a master of developpement but I hope it's helped.
Give me some feed back !