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 Total Posts?

 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
WashableMarker



Joined: 22 Dec 2003
Posts: 1

PostPosted: Mon Dec 22, 2003 5:16 am    Post subject: List Total Posts? Reply with quote

anybody got a hack to list the total posts in my blog?
Back to top
View user's profile Send private message
Cyberian75



Joined: 26 Sep 2002
Posts: 986
Location: Washington

PostPosted: Tue Dec 30, 2003 9:09 pm    Post subject: Reply with quote

Code:

function totalnumposts($userid) {
   global $tableposts,$querycount;
   $count = mysql_query("SELECT COUNT(ID) FROM $tableposts WHERE post_author = $userid");
   $count = mysql_result($count, 0);
   $querycount++;
   echo $count;
}



Call it by...

Code:

totalnumposts(your author ID);

_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
jackiefg



Joined: 15 Oct 2003
Posts: 29
Location: Toronto, Ontario, Canada

PostPosted: Mon Jan 05, 2004 1:53 am    Post subject: Sounds great Reply with quote

Is there a way for me to make that into a link to a pop up window?

Like a link on the main page that says "Total post" or "All posts" and then you click and it pops up or even opens a new window?

Sorry I can't figure out how to make a link out of the php text Sad

You won't believe it bought I have bought two books on php, I just don't find any simple explanations in either though.
_________________
jackiefg
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Cyberian75



Joined: 26 Sep 2002
Posts: 986
Location: Washington

PostPosted: Mon Jan 05, 2004 4:52 am    Post subject: Reply with quote

I don't see it feasible to have it opened in a separate window, because this function will only "echo" the total number of rows in a table. If you still want it, you only have to "include" b2config.php and b2functions.php files, then call "dbconnect" function to connect to the database.
_________________
Michael P.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks 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