boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

list stories by user

 
Post new topic   Reply to topic    boardom Forum Index -> How to ?
View previous topic :: View next topic  
Author Message
sh0ck



Joined: 02 May 2004
Posts: 50
Location: Norway

PostPosted: Thu Feb 03, 2005 8:26 am    Post subject: list stories by user Reply with quote

Is there any way to list stories by user? such as e.g. index.php?userID=3
_________________
http://www.licklinux.com
Back to top
View user's profile Send private message Visit poster's website
Sigg3



Joined: 03 Jul 2003
Posts: 896
Location: Oslo, Norway

PostPosted: Sat Feb 05, 2005 12:11 pm    Post subject: Reply with quote

Listening to: Jethro Tull, very best of
Code:
index.php?author=1 will display all posts from the author #1


Ahem..

There's always the readme
_________________
Sigg3.net - You know you're worth it! | b2 Cafelog Resource Center | Fight my BattleImp!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
sh0ck



Joined: 02 May 2004
Posts: 50
Location: Norway

PostPosted: Sat Feb 05, 2005 12:21 pm    Post subject: Reply with quote

lol. sorry, I guess i didn't read that part Razz
_________________
http://www.licklinux.com
Back to top
View user's profile Send private message Visit poster's website
sh0ck



Joined: 02 May 2004
Posts: 50
Location: Norway

PostPosted: Sat Feb 05, 2005 12:32 pm    Post subject: Reply with quote

Another question though... How can I display the user ID outside the b2loop. To get the username I only need to:
Code:

<?php echo $user_login; ?>

I thought that $user_ID would work, but it didn't... Sad
_________________
http://www.licklinux.com
Back to top
View user's profile Send private message Visit poster's website
Sigg3



Joined: 03 Jul 2003
Posts: 896
Location: Oslo, Norway

PostPosted: Sat Feb 05, 2005 5:02 pm    Post subject: Reply with quote

Can't you just strip it?

top:
Code:
<?php /* Don't remove this line, it calls the b2 function files ! */ $blog=1; include ("blog.header.php"); ?>


Then (stripped loop):
Code:

<?php while($row = mysql_fetch_object($result)) { start_b2(); ?>

<!-- The appropriate code -->

<?php } ?> 

But for a simple display of login it might be a little too much trouble.
And you'd have to _call_ it through a variable-include, or something, to make it fetch that n that data.
Thinking about it, it wouldn't work:p

But the b2 user info is stored in the b2users in your db.

Quote:
<?php the_author_ID() ?> - the author's ID number in b2. This number is automatically set when the user registers: to see the ID of an user, go to the Team page. This is static data too, so you can use it like the_author_login() in associating stuff with authors.
See readme for more author stuff

..but they'd have to be logged in.
_________________
Sigg3.net - You know you're worth it! | b2 Cafelog Resource Center | Fight my BattleImp!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
sh0ck



Joined: 02 May 2004
Posts: 50
Location: Norway

PostPosted: Sun Feb 06, 2005 11:40 pm    Post subject: Reply with quote

$the_author_ID variable is for each post in the b2loop. I need to fetch the user ID of a logged in user outside to loop. Since I'm building a journal system I want logged-in users to click a link called "myJournal" which will transfer them to index.php?author=theirIDnumber.
_________________
http://www.licklinux.com
Back to top
View user's profile Send private message Visit poster's website
stevem



Joined: 15 Mar 2003
Posts: 365

PostPosted: Mon Feb 07, 2005 3:23 pm    Post subject: Reply with quote

get_currentuserinfo() gives you $user_ID

get_currentuserinfo() needs
Code:
require_once ('b2config.php');
require_once($b2inc."/b2functions.php");
dbconnect();
before it is called
Back to top
View user's profile Send private message
sh0ck



Joined: 02 May 2004
Posts: 50
Location: Norway

PostPosted: Thu Feb 10, 2005 11:36 pm    Post subject: Reply with quote

It only seems to be working inside the b2-account. If I use it in my template it displays nothing... Anything I might be doing wrong?
_________________
http://www.licklinux.com
Back to top
View user's profile Send private message Visit poster's website
stevem



Joined: 15 Mar 2003
Posts: 365

PostPosted: Fri Feb 11, 2005 4:05 pm    Post subject: Reply with quote

The code get_currentuserinfo uses is in b2functions.php and provided the user is logged in and allows cookies, it should show their details
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> How to ? All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group