1 (edited by User33 2009-01-18 00:56)

Topic: [Release] Latest posts on profile

Shows the user's latest posts on his/her profile.

You can change the options on Administration » Settings » Features (Options coming soon)

Download Link: http://punbb.informer.com/unofficial/pu … _posts.zip

Screenshot:
http://arch.kimag.es/share/61209669.png

If you find any bugs or have any tips, please post them here.

Updates

  • 1.0.2: Fixed error where it shows every user's posts (thanks to gokieks)

  • 1.0.1: Made some fixes

  • 1.0.0: First release

Thanks to downliner for the idea.

Re: [Release] Latest posts on profile

Taking a look at the code now big_smile Many thanks

Re: [Release] Latest posts on profile

Sweet! great addition. smile

Re: [Release] Latest posts on profile

Updated to 1.0.1

Re: [Release] Latest posts on profile

When you first install it on an existing forum, it shows the last 5 overall posts made on the forum for every user, regardless of who actually made those posts.

Re: [Release] Latest posts on profile

Thanks! Updated to 1.0.2

Re: [Release] Latest posts on profile

1.0.2 seems to work well.  It even parses out posts in non-public forums when not logged in, which is neat.  Good job! smile

Re: [Release] Latest posts on profile

Dont want to take your thread off topic Garciat, move this is you wish, but I managed to get what I was looking for working smile Using 1.2, the below will show latest topics on the users profile instead of latest posts. I still haven't got the hang of making extensions but maybe this can easily be ported over also, or added as an option to this extension?

The original query I used:

<?php

$result = $db->query('SELECT * FROM '.$db_prefix.'topics WHERE poster = \''.pun_htmlspecialchars($user['username']).'\' AND forum_id = x ORDER BY last_post DESC LIMIT 6') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
while($cur_topic = $db->fetch_assoc($result))

{   
?>

<li><a href="viewtopic.php?id=<?php echo $cur_topic['id']; ?>"><?php echo $cur_topic['subject']; ?></a></li>

<?php
}
?>

This matches the poster name in the *topics field to that of the username.

The query below is thanks to MattF, improving the query by using User ID instead of usernames:

<?php
$result = $db->query('SELECT DISTINCT t.id, t.subject, t.poster FROM '.$db_prefix.'topics FROM '.$db_prefix.'topics AS t LEFT JOIN '.$db_prefix.'posts AS p ON t.poster=p.poster WHERE p.poster_id= \''.intval($user['id']).'\' AND forum_id=x ORDER BY t.id DESC LIMIT 6') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
while($cur_topic = $db->fetch_assoc($result))

{   
?>

<a href="viewtopic.php?id=<?php echo $cur_topic['id']; ?>"><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></a>

<?php
}
?>