Comment count per user
-
Hello, I am using wordpress on my website https://www.weeklyfun.nl
I use this code in my template author.php:
<?php get_header(); ?> <td valign="top" align="left" class="middlebar"> <!-- This sets the $curauth variable --> <?php if(isset($_GET['author_name'])) : $curauth = get_userdatabylogin($author_name); else : $curauth = get_userdata(intval($author)); endif; ?> <div class="catbg">Profiel van: <?php echo $curauth->nickname; ?></div> <div class="windowbg"> <table class="collapse"> <tr> <td valign="top" align="left"><b>UserID: </b></td><td valign="top" align="left"><?php echo $curauth->ID; ?></td> </tr><tr> <td valign="top" align="left"><b>Level: </b></td><td valign="top" align="left"><?php echo $curauth->user_level; ?></td> </tr><tr> <td valign="top" align="left"><b>Geregistreerd: </b></td><td valign="top" align="left"><?php echo $curauth->user_registered; ?></td> </tr><tr> <td valign="top" align="left"><b>Nick: </b></td><td valign="top" align="left"><?php echo $curauth->nickname; ?></td> </tr><tr> <td valign="top" align="left"><b>Website: </b></td><td valign="top" align="left"><a href="<?php echo $curauth->user_url; ?>" target="_blank"><?php echo $curauth->user_url; ?></a></td> </tr><tr> <td valign="top" align="left"><b>Aantal artikels: </b></td><td valign="top" align="left"><?php $nposts = get_usernumposts($author); echo $nposts;?></td> </tr><tr> <td valign="top" align="left"><b>Biografie: </b></td><td valign="top" align="left"><?php echo $curauth->description; ?></td> </tr> </table> <br /> <b><?php echo $curauth->nickname; ?></b> heeft de volgende artikelen bijgedragen:<br /><br /> <table class="collapse"><tr> <td valign="top" align="left"><b>Titel</b></td> <td valign="top" align="left"><b>Datum gepost</b></td> <td valign="top" align="left"><b>In categorie</b></td> </tr> <!-- The Loop --> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <tr> <td valign="top" align="left"> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"> <?php the_title(); ?></a></td> <td valign="top" align="left"><?php the_time('j-n-Y'); ?></td> <td valign="top" align="left"><?php the_category(' &');?></td> </tr> <?php endwhile; else: ?> <tr><td valign="middle" align="center" colspan="3"><b><?php _e('Geen, niks, nada, niente, noppes.'); ?></b></td></tr> <?php endif; ?> <!-- End Loop --> </table> </div> </td> <?php include (TEMPLATEPATH . '/sidebar2.php'); ?> <?php get_footer(); ?>
What code do I have to use to count all the comments a user has made. As you can see I use already a code to count the number of articles a user has submitted. Now I want to have the code for the number of comments a user has made.
Yes, I have already search the template tags, and all the docs and supporttopics before posting my question here, but I can’t find a working solution.
Please help me!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Comment count per user’ is closed to new replies.