############################################################## ## MOD Title: Last Post by User in Profile ## MOD Author: alexi02 < N/A > (Alejandro Iannuzzi) http://www.uzzisoft.com ## MOD Description: In the user's profile it shows the thread they last posted in and the time they posted ## MOD Version: 0.1.1 ## ## Installation Level: Easy ## Installation Time: 5 Minutes ## Files To Edit: includes/usercp_viewprofile.php ## language/lang_english/lang_main.php ## templates/subSilver/profile_view_body.tpl ## Included Files: N/A ## ## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 ############################################################## ## For security purposes, please check: http://www.phpbb.com/mods/ ## for the latest version of this MOD. Although MODs are checked ## before being allowed in the MODs Database there is no guarantee ## that there are no security problems within the MOD. No support ## will be given for MODs not found within the MODs Database which ## can be found at http://www.phpbb.com/mods/ ############################################################## ## Author Notes: ## ## A quick way to see the user's last post. ## ############################################################## ## MOD History: ## ## 2006-09-10 - Version 0.1.1 ## - Added LIMIT 0, 1 to Posts SQL query (thanks eviL<3) ## ## 2006-09-10 - Version 0.1.0 ## - Initial Release (for phpBB 2.0.21) ## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ OPEN ]------------------------------------------ # includes/usercp_viewprofile.php # #-----[ FIND ]------------------------------------------ # $template->assign_vars(array( # #-----[ BEFORE, ADD ]------------------------------------------ # // // Start Last Post by User Mod // // Posts SQL $sql = "SELECT post_id, topic_id, post_time FROM " . POSTS_TABLE . " WHERE poster_id = " . $profiledata['user_id'] . " ORDER BY post_time DESC LIMIT 0, 1"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain post information", '', __LINE__, __FILE__, $sql); } $post_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); // If the user has posts to their id if ($post_row) { // Topics SQL $sql = "SELECT topic_title FROM " . TOPICS_TABLE . " WHERE topic_id = " . $post_row['topic_id']; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain topic information", '', __LINE__, __FILE__, $sql); } $topic_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); $last_post_date = '[' . create_date($board_config['default_dateformat'], $post_row['post_time'], $board_config['board_timezone']) . ']'; } // // End Last Post by User Mod // # #-----[ FIND ]------------------------------------------ # 'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']), # #-----[ AFTER, ADD ]------------------------------------------ # 'L_LAST_POST' => $lang['Last_post'], 'LAST_POST_IN_THREAD' => $topic_row['topic_title'], 'LAST_POST_DATE' => $last_post_date, # #-----[ FIND ]------------------------------------------ # 'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . $u_search_author), # #-----[ AFTER, ADD ]------------------------------------------ # 'U_LAST_POST_IN_THREAD_LINK' => append_sid("viewtopic.$phpEx?p=" . $post_row['post_id'] . "#" . $post_row['post_id']), # #-----[ OPEN ]------------------------------------------ # language/lang_english/lang_main.php # #-----[ FIND ]------------------------------------------ # $lang['Search_user_posts'] = 'Find all posts by %s'; // Find all posts by username # #-----[ AFTER, ADD ]------------------------------------------ # $lang['Last_post'] = 'Last Post'; // Last Post by User Mod # #-----[ OPEN ]------------------------------------------ # templates/subSilver/profile_view_body.tpl # #-----[ FIND ]------------------------------------------ # {L_TOTAL_POSTS}:  {POSTS}
[{POST_PERCENT_STATS} / {POST_DAY_STATS}]
{L_SEARCH_USER_POSTS} # #-----[ AFTER, ADD ]------------------------------------------ # {L_LAST_POST}:  {LAST_POST_IN_THREAD} {LAST_POST_DATE} # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM