I'm trying to get a page per user that shows either the teaser or full node for a specific content type.

Practical application: I'm using the embed module for embedding youtube videos. I'd like for each user to be able to publish 5 embdedded video nodes. I believe I'm using noderestrict to determine the amount of nodes a user can publish of a certain content type. Now I just need to generate a page for each user.

Any direction is appreciated.

-Jesse

Comments

deaconzero’s picture

Bump... anyone.

I'm interested as well.

apt94jesse’s picture

I just came up with this solution, so there may be a kink or two to work out.

I have created a content type called content_video with cck. Then I used this snippet in a page node set to php input:

<?php
unset($output);
  $content_type = 'content_video';
$usernumber=$_REQUEST['usernumber'];
  $result1 = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.uid = '$usernumber' and n.type = '$content_type' AND n.status = 1 ORDER BY n.created DESC"));
  while ($node = db_fetch_object($result1)) {
    $output .= node_view(node_load(array('nid' => $node->nid)), 1);
  };
print $output;
?>

The line $usernumber=$_REQUEST['usernumber'];

draws out a variable from the url, so on my site I use /video?usernumber=1

This sets $usernumber to 1 and therefore shows all videos by user number 1.

Then in my templated profile page I have a link as follows:

<a href="videos?usernumber=<?php print $user->uid;?>">View Videos</a>

This inserts the users's uid into the url and passes said variable into the page node, dynamically loading that user's video nodes.

Like I said, works for me so far, probably some tweaking to get it perfect. You can also limit the amount of video nodes a user can create by using (I think) the noderestrict module, if you want to put limits on the # of videos someone can have.

Oh, by the way, the video content type just uses a text field where you paste youtube embed code into. Then set the input type to html, activate the embedfilter module, and your site will play the youtube videos, without taking up your bandwidth or storage space.