I mean, maybe the last 20 thanks.
- User1 thanked you in the "post1" at 22/3,08 18.22 CET
- User2 thanked you in the "post3" at 22/3,08 18.22 CET
- User1 thanked you in the "post4" at 22/3,08 18.00 CET
- User4 thanked you in the "post1" at 21/3,08 22.00 CET
and so on....
Do you understand what I meant?
alexi02 wrote:To view all the users and the topics who have thanked a user in their profile follow the instructions below. In the profile you will firstly see a link on the "Thanked x times in x posts". This links back to the profile page and then displays the Thanked Listing which shows the users whom have thanked the post, the topic title and the post number (all with links of course).
1. Modify the Thank Post by User 0.2.5a as per this post
http://www.phpbb.com/community/viewtopi ... 7#p2938797
2. Then follow the modifications below.
Open includes/usercp_profile.php
FindReplace withCode: Select all
$thanked_post_count = $db->sql_fetchrow($result); $db->sql_freeresult($result); $thanks_given = $user_row['user_thanks_given']; $thanks_received = $user_row['user_thanks_received'] . ' ' . $lang['Thanks_thanked_2'] . ' ' . $thanked_post_count['thanks_count'] . ' ' . $lang['Thanks_thanked_3']; } else { $thanks_given = ""; $thanks_received = ""; } // // End Thank Post by User Mod //
Code: Select all
$thanked_post_count = $db->sql_fetchrow($result); $db->sql_freeresult($result); $temp_url = "profile.$phpEx?mode=viewprofile&u=" . $profiledata['user_id'] . "&thankslist=1"; $thanks_given = $user_row['user_thanks_given']; $thanks_received = '<a href="' . $temp_url . '">' . $user_row['user_thanks_received'] . ' ' . $lang['Thanks_thanked_2'] . ' ' . $thanked_post_count['thanks_count'] . ' ' . $lang['Thanks_thanked_3'] . '</a>'; } else { $thanks_given = ""; $thanks_received = ""; } // // End Thank Post by User Mod // // Thanks Listing if ( isset($HTTP_GET_VARS['thankslist']) || $HTTP_GET_VARS['thankslist'] ) { // Thanked Listing SQL $sql = "SELECT thanks_from_user_id, thanks_count, topic_id, post_id FROM " . POSTS_TABLE . " WHERE poster_id = " . $profiledata['user_id'] . " AND thanks_count <> 0"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain posts information", '', __LINE__, __FILE__, $sql); } $thanked_listing = $db->sql_fetchrowset($result); $db->sql_freeresult($result); $thanked_listing_count = count($thanked_listing); for ($i = 0; $i < $thanked_listing_count; $i++) { $thanked_users = explode("|",$thanked_listing[$i]['thanks_from_user_id']); $thanked_count = $thanked_listing[$i]['thanks_count']; // Loop through all users who thanked the post for ($x = 0; $x < $thanked_count; $x++) { // Users SQL $sql = "SELECT user_id, username FROM " . USERS_TABLE . " WHERE user_id = " . $thanked_users[$x]; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql); } $user_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); if ($x >= 1) { $thanks_compiled .= ", "; } // Add user to thanked by list $temp_url = "profile.$phpEx?mode=viewprofile&u=" . $user_row['user_id']; $thanks_compiled .= '<a href="' . $temp_url . '">' . $user_row['username'] . '</a>'; } // Topic SQL $sql = "SELECT topic_title FROM " . TOPICS_TABLE . " WHERE topic_id = " . $thanked_listing[$i]['topic_id']; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql); } $topic_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); $temp_url_post = "viewtopic.$phpEx?p=" . $thanked_listing[$i]['post_id'] . "#" . $thanked_listing[$i]['post_id']; $temp_url_topic = "viewtopic.$phpEx?t=" . $thanked_listing[$i]['topic_id']; $thanks_post = '<a href="' . $temp_url_post . '"> (Post #' . $thanked_listing[$i]['post_id'] . ')</a>'; $thanks_topic = '<a href="' . $temp_url_topic . '">' . $topic_row['topic_title'] . '</a>'; $thanks_listing .= "Thanked by $thanks_compiled in $thanks_topic - $thanks_post<br/>"; $thanks_compiled = ''; } $template->assign_block_vars('thankslist', array( 'THANKS_LISTING' => $thanks_listing, 'L_THANKS_LISTING' => $lang['Thanks_listing']) ); }
Open templates/subSilver/profile_view_body.tpl
FindAfter addCode: Select all
<tr> <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_THANKS_RECEIVED}:</span></td> <td> <b><span class="gen">{THANKS_RECEIVED}</span></b></td> </tr>
Code: Select all
<!-- BEGIN thankslist --> <tr> <td valign="top" align="right" nowrap="nowrap"><span class="gen">{thankslist.L_THANKS_LISTING}:</span></td> <td> <span class="gen">{thankslist.THANKS_LISTING}</span></td> </tr> <!-- END thankslist -->
Open language/lang_english/lang_main.php
FindAfter addCode: Select all
$lang['Thanks_thanks'] = 'Thanks'; $lang['Thanks_thanked_1'] = 'Thanked'; $lang['Thanks_thanked_2'] = 'Times in'; $lang['Thanks_thanked_3'] = 'Posts';
Code: Select all
$lang['Thanks_listing'] = 'Thanked Listing';