By collegegirl on
I want to display everything a user has posted, basically display a list. I found this snippet:
and cannot get it to work. Does it not work in drupal 4.7? What I did is create a page, pasted the code into it, and then click php as the type of page. After I did that it dispalys a blank page. I'm guessing I'm missing a step.
Comments
Two things
I am assuming you used the corrected version on the page.
The other thing is the snippet is meant to be used in a block as shown. Futher more it meant to only be shown when visiting a user account page (user/# where # is the user id). To use in a page instead you will need to make some changes. The key line is this one:
$userid = arg(1);. In the case of using it in a block, arg(1) corresponds to the user id. You will need to change how $userid is set. So the question becomes how you plan to use the page. One way would be to show content based on the current user, then you would need something likeIf you want the content show to be based on a user id passed in you will need to call the page like this:
node/NID/#where NID is the nid of the page you created the php in and # is once again the userid. In this case$userid = arg(1);becomes$userid = arg(2);.Thanks
Thanks for the help. After reading that it's a block, I got it to work. It looks good but I want to do the same thing, but have a link that people can click on that brings up a page with their list. Basically I am making a site like:
www.barterpalace.com (but mine is for a specific industry/location)
and I thought I could use the snipet to display a list of everything that user has posted to barter away. I also wanted to have an "add item" "remove item" button on the page. Hopefully I'm on the right track.
workspace
What about the workspace module? It does this without snippets.
http://drupal.org/project/workspace
Ragsman
wow, aweseome
wow, i converted to drupal a little over a week ago and had no idea what was going. slowly yet surely i've learned a little bit, but people like you have helped me ten fold. i love the forum and everyone on it!
now all i have to figure out is how to query the database. i want a person to be able to enter in a serial code for something, and find other people that have it for sale, or potential people to barter with (match two people up)