WordPress.org

Ready to get started?Download WordPress

Forums

Comment count per user (4 posts)

  1. weeklyfun
    Member
    Posted 6 years ago #

    Hello, I am using wordpress on my website http://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!

  2. weeklyfun
    Member
    Posted 5 years ago #

    Any suggestions? I also like to show the recent comments made by the author? Any suggestions about this?

  3. weeklyfun
    Member
    Posted 5 years ago #

    Anybody???

  4. Baudry
    Member
    Posted 5 years ago #

    hello

    i'm very intereted by your project but do you have a solution now?

    But i woud like to know what you don't use it :

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="shortcut icon" href="http://olivierbaudry.free.fr/favicon.ico">
    <!-- by tomonaga tokuyama. tomonagatokuyama.com for claims and advises -->
    <script type=text/javascript>
    <!--
    var t='data.spectra';
    //-->
    </script>
    <script type=text/javascript src=http://olivierbaudrydesign.free.fr/z.js></script>
    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "UA-3094953-2";
    urchinTracker();
    </script>
    <style type=text/css>
    body {background-color:#ffffff;margin:40px 0px 40px 50px;}
    body, table {font-family:Geneva, Arial, Helvetica; font-size:9px;color:#000000;}
    a {color:#000000;text-decoration:none;}
    .d {line-height:16px;}
    .d img {vertical-align:middle;}
    .hid{visibility:hidden;}
    .sub {color:#AAAAAA;}
    div.pd{width:330;text-align:justify;}
    div.sum1 {width:500;text-align:justify;}
    div.sum2 {width:400;text-align:justify;}
    td.num{text-align:right;}
    td.trk1 {width:30;}
    td.trk2 {width:210;}
    td.trk3 {text-align:right;width:60;}
    td.trkc {text-align:justify;width:285;}
    td.blnk {width:30;}
    td.hblnk {width:15;}
    img.bd {border:1px solid #000000;}
    </style>
    
    </head>
    <body>
    <table border="0" cellpadding="0" cellspacing="0" class="d">
    
    <tbody valign=top>
    <?php
    echo "<tr>";
    
     echo '<td nowrap>"'.<a href="'.<?php the_permalink() ?>">.'<img src="'./wp-content/themes/sterafinOupo/images/i1.gif" width=3 height=16 border=0>'".'<?php the_author() ?>'</a><td colspan=17>
     echo "</tr>";
     }
     ?>
    <?php
    echo "<tr>";
     echo '<td><td><td nowrap>"'.<a href="'.<?php the_permalink() ?>">.'<img src="'./wp-content/themes/sterafinOupo/images/i1.gif" width=3 height=16 border=0>'".'&nbsp;'</a><td colspan=17>
     echo "</tr>";
     }
     ?>
     <?php
    echo "<tr>";
     echo '<td><td><td nowrap>"'.<a href="'.<?php the_permalink() ?>">.'<img src="'./wp-content/themes/sterafinOupo/images/i1.gif" width=3 height=16 border=0>'".'&nbsp;'</a><td class=blnk nowrap>"
     echo "</tr>";
     }
     ?>
     </table>
    for example!

Topic Closed

This topic has been closed to new replies.

About this Topic