|
From: Jon O. <jon...@us...> - 2005-12-05 19:25:36
|
Update of /cvsroot/mxbb/core27x/modules/mx_last_msg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23896/core27x/modules/mx_last_msg Modified Files: mx_last_msg.php Log Message: updated Index: mx_last_msg.php =================================================================== RCS file: /cvsroot/mxbb/core27x/modules/mx_last_msg/mx_last_msg.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mx_last_msg.php 6 May 2005 06:48:06 -0000 1.1 --- mx_last_msg.php 5 Dec 2005 19:25:26 -0000 1.2 *************** *** 1,13 **** <?php ! /*************************************************************************** ! * mx_last_msg.php ! * ------------------- ! * begin : April, 2002 ! * copyright : (C) 2002 MX-System ! * email : su...@mx... ! * ! * $Id$ ! * ! ***************************************************************************/ $block_config = read_block_config( $block_id ); --- 1,22 ---- <?php ! /** ------------------------------------------------------------------------ ! * subject : mx-portal, CMS & portal ! * begin : june, 2002 ! * copyright : (C) 2002-2005 MX-System ! * email : jon...@ho... ! * project site : www.mx-system.com ! * ! * description : ! * ------------------------------------------------------------------------- ! * ! * $Id$ ! */ ! ! /** ! * This program is free software; you can redistribute it and/or modify ! * it under the terms of the GNU General Public License as published by ! * the Free Software Foundation; either version 2 of the License', or ! * ('at your option) any later version. ! */ $block_config = read_block_config( $block_id ); *************** *** 30,35 **** // Read block Configuration // - - $PostNumber = $block_config[$block_id][Last_Msg_Number_Title]['parameter_value']; $display_date = $block_config[$block_id][Last_Msg_Display_Date]['parameter_value']; --- 39,42 ---- *************** *** 69,73 **** $forum_lst_msg = $auth_data_sql_msg; } ! // Added for 2.705 if ( empty( $forum_lst_msg ) ) { --- 76,80 ---- $forum_lst_msg = $auth_data_sql_msg; } ! if ( empty( $forum_lst_msg ) ) { *************** *** 90,95 **** $url_prev = mx_url( 'lmsg_start' , $start_prev ); // append_sid( $URL_INDEX . ( ( strpos($URL_INDEX, '?') != false ) ? '&' : '?' ) . 'lmsg_start=' . $start_prev ); } $template->assign_vars(array( - // 'L_TITLE' => ( !empty( $lang['Latest_Post'] ) ? $lang['Latest_Post'] : 'Last Message' ), 'L_TITLE' => ( !empty( $title ) ? $title : 'Last Message' ), 'U_TARGET' => $target, --- 97,102 ---- $url_prev = mx_url( 'lmsg_start' , $start_prev ); // append_sid( $URL_INDEX . ( ( strpos($URL_INDEX, '?') != false ) ? '&' : '?' ) . 'lmsg_start=' . $start_prev ); } + $template->assign_vars(array( 'L_TITLE' => ( !empty( $title ) ? $title : 'Last Message' ), 'U_TARGET' => $target, *************** *** 108,132 **** $GetType = "topics"; // posts ou topics - // $private = "USER"; - $timediff = 0; // Différence de temps entre le serveur et l'heure du forum en heures, en clair si votre forum est reglé sur GMT et que vous habitez en France il suffit de mettre 0 pour qu'il se regle sur le fuseau français (a verfifier selon les cas)(GMT+1) - - // if ( $private == "USER") { - // $private1 = " AND f.auth_view < 1"; - // } - //elseif ( $private == "PRIVATE") { - // $private1 = " AND f.auth_view < 2"; - // } - //elseif ( $private == "MODO") { - // $private1 = " AND f.auth_view <3"; - // } - //elseif ( $private == "ADMIN") { - // $private1 = " AND f.auth_view <5"; - // } - //else { - // $private =""; - // } - $sql = "SELECT t.topic_title, p.topic_id, t.topic_last_post_id, p.post_time, f.forum_name, f.forum_id, u.username, u.user_id, p.post_username, u2.username as user2, u2.user_id as id2 --- 115,120 ---- *************** *** 154,174 **** $postrow = $db->sql_fetchrowset($result); ! for($row_count = 0; $row_count < count($postrow); $row_count++) { ! $row_color = ( !($row_count%2) ) ? $theme['td_color1'] : $theme['td_color2']; ! $row_class = ( !($row_count%2) ) ? $theme['td_class1'] : $theme['td_class2']; ! ! ! $message = $postrow[$row_count]['topic_title']; ! $url = append_sid( PHPBB_URL . 'viewtopic.php?t='.$postrow[$row_count]['topic_id'].'#'.$postrow[$row_count]['topic_last_post_id']); ! ! if( $postrow[$row_count]['topic_status'] == TOPIC_MOVED ) { $topic_type = $lang['Topic_Moved'] . ' '; $topic_id = $postrow[$row_count]['topic_moved_id']; ! $folder_image = $images['folder']; $folder_alt = $lang['Topics_Moved']; $newest_post_img = ''; --- 142,159 ---- $postrow = $db->sql_fetchrowset($result); ! for( $row_count = 0; $row_count < count($postrow); $row_count++ ) { ! $row_color = ( !( $row_count % 2 ) ) ? $theme['td_color1'] : $theme['td_color2']; ! $row_class = ( !( $row_count % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; + $message = $postrow[$row_count]['topic_title']; + $url = append_sid(PHPBB_URL . 'viewtopic.php?t=' . $postrow[$row_count]['topic_id'] . '#' . $postrow[$row_count]['topic_last_post_id']); ! if ( $postrow[$row_count]['topic_status'] == TOPIC_MOVED ) { $topic_type = $lang['Topic_Moved'] . ' '; $topic_id = $postrow[$row_count]['topic_moved_id']; ! $folder_image = $images['folder']; $folder_alt = $lang['Topics_Moved']; $newest_post_img = ''; *************** *** 176,190 **** else { ! if( $postrow[$row_count]['topic_type'] == POST_ANNOUNCE ) { $folder = $images['folder_announce']; $folder_new = $images['folder_announce_new']; } ! else if( $postrow[$row_count]['topic_type'] == POST_STICKY ) { $folder = $images['folder_sticky']; $folder_new = $images['folder_sticky_new']; } ! else if( $postrow[$row_count]['topic_status'] == TOPIC_LOCKED ) { $folder = $images['folder_locked']; --- 161,175 ---- else { ! if ( $postrow[$row_count]['topic_type'] == POST_ANNOUNCE ) { $folder = $images['folder_announce']; $folder_new = $images['folder_announce_new']; } ! else if ( $postrow[$row_count]['topic_type'] == POST_STICKY ) { $folder = $images['folder_sticky']; $folder_new = $images['folder_sticky_new']; } ! else if ( $postrow[$row_count]['topic_status'] == TOPIC_LOCKED ) { $folder = $images['folder_locked']; *************** *** 193,197 **** else { ! if($replies >= $board_config['hot_threshold']) { $folder = $images['folder_hot']; --- 178,182 ---- else { ! if ( $replies >= $board_config['hot_threshold'] ) { $folder = $images['folder_hot']; *************** *** 206,239 **** $newest_post_img = ''; ! if( $userdata['session_logged_in'] ) { ! $tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t"]) : array(); ! $tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f"]) : array(); ! if( $postrow[$row_count]['post_time'] > $userdata['user_lastvisit'] ) ! { ! if( !empty($tracking_topics) || !empty($tracking_forums) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) ) ! { ! $unread_topics = true; ! if( !empty($tracking_topics[$postrow[$row_count]['topic_id']]) ) ! { ! if( $tracking_topics[$postrow[$row_count]['topic_id']] >= $postrow[$row_count]['post_time'] ) ! { ! $unread_topics = false; ! } ! } ! if( !empty($tracking_forums[$postrow[$row_count]['topic_id']]) ) ! { ! if( $tracking_forums[$postrow[$row_count]['topic_id']] >= $postrow[$row_count]['post_time'] ) ! { ! $unread_topics = false; ! } ! } ! if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) ) { ! if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] >= $postrow[$row_count]['post_time'] ) { $unread_topics = false; --- 191,224 ---- $newest_post_img = ''; ! if ( $userdata['session_logged_in'] ) { ! $tracking_topics = ( isset( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t'] ) ) ? unserialize( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t"] ) : array(); ! $tracking_forums = ( isset( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f'] ) ) ? unserialize( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f"] ) : array(); ! if ( $postrow[$row_count]['post_time'] > $userdata['user_lastvisit'] ) ! { ! if ( !empty( $tracking_topics ) || !empty( $tracking_forums ) || isset( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] ) ) ! { ! $unread_topics = true; ! if ( !empty( $tracking_topics[$postrow[$row_count]['topic_id']] ) ) ! { ! if ( $tracking_topics[$postrow[$row_count]['topic_id']] >= $postrow[$row_count]['post_time'] ) ! { ! $unread_topics = false; ! } ! } ! if ( !empty( $tracking_forums[$postrow[$row_count]['topic_id']] ) ) ! { ! if ( $tracking_forums[$postrow[$row_count]['topic_id']] >= $postrow[$row_count]['post_time'] ) ! { ! $unread_topics = false; ! } ! } ! if ( isset( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] ) ) { ! if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] >= $postrow[$row_count]['post_time'] ) { $unread_topics = false; *************** *** 241,250 **** } ! if( $unread_topics ) { $folder_image = $folder_new; $folder_alt = $lang['New_posts']; ! $newest_post_img = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> '; } else --- 226,235 ---- } ! if ( $unread_topics ) { $folder_image = $folder_new; $folder_alt = $lang['New_posts']; ! $newest_post_img = '<a href="' . append_sid(PHPBB_URL . "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> '; } else *************** *** 261,268 **** $folder_alt = ( $postrow[$row_count]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['New_posts']; ! $newest_post_img = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> '; } } ! else { $folder_image = $folder; --- 246,253 ---- $folder_alt = ( $postrow[$row_count]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['New_posts']; ! $newest_post_img = '<a href="' . append_sid(PHPBB_URL . "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> '; } } ! else { $folder_image = $folder; *************** *** 281,358 **** } ! IF ( $display_author == "TRUE" ) ! { ! $topic_author = ( $postrow[$row_count]['user_id'] != ANONYMOUS ) ? '<a href="' . append_sid( PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $postrow[$row_count]['user_id']) . '">' : ''; ! $topic_author .= ( $postrow[$row_count]['user_id'] != ANONYMOUS ) ? $postrow[$row_count]['username'] : ( ( $postrow[$row_count]['post_username'] != '' ) ? $postrow[$row_count]['post_username'] : $lang['Guest'] ); ! $topic_author .= ( $postrow[$row_count]['user_id'] != ANONYMOUS ) ? '</a>' : ''; ! } ! else ! { ! $topic_author = ''; ! } ! if ( $display_last_author == "TRUE" ) ! { ! $last_post_author = ( $postrow[$row_count]['id2'] == ANONYMOUS ) ? ( ($postrow[$row_count]['post_username'] != '' ) ? $postrow[$row_count]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $postrow[$row_count]['id2']) . '">' . $postrow[$row_count]['user2'] . '</a>'; ! } ! else ! { ! $last_post_author = ''; ! } ! ! if( strlen($message ) > $nb_characteres ) ! { ! $message = substr( $message, 0, $nb_characteres); ! $position_espace = strrpos($message, " "); ! $message = substr($message, 0, $position_espace); ! $message .= "..."; ! } ! if ( $display_date == "TRUE" ) ! { ! $message_date = create_date($board_config['default_dateformat'], $postrow[$row_count]['post_time'],$board_config['board_timezone']); ! } ! else ! { ! $message_date = ''; ! } ! ! if ( $display_forum == "TRUE" ) ! { ! $forum_name = $postrow[$row_count]['forum_name']; ! $forum_url = append_sid( PHPBB_URL . 'viewforum.php?f=' . $postrow[$row_count]['forum_id']); ! } ! else ! { ! $forum_name = ''; ! $forum_url = ''; ! } ! if ( $display_icon_view == "TRUE" ) ! { ! $last_post_url = '<a href="' . append_sid(PHPBB_URL . "viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$row_count]['topic_last_post_id']) . '#' . $postrow[$row_count]['topic_last_post_id'] . '"><img src="' . PHPBB_URL. $images['icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>'; ! } ! else ! { ! $last_post_url = ''; ! } ! ! $template->assign_block_vars("msg_row", array( ! "ROW_COLOR" => "#" . $row_color, ! "ROW_CLASS" => $row_class, ! "LAST_MSG" => $message, ! "LAST_MSG_DATE" => $message_date, ! "FORUM_NAME" => $forum_name, ! "U_LAST_MSG" => $url, ! "U_FORUM" => $forum_url , ! 'LAST_POST_IMG' => $last_post_url, ! 'FOLDER_IMG' => $folder_image, ! 'TOPIC_AUTHOR' => $topic_author, ! 'LAST_POST_AUTHOR' => $last_post_author, ! 'L_TOPIC_FOLDER_ALT' => $folder_alt ! ) ! ); ! } --- 266,340 ---- } ! if ( $display_author == "TRUE" ) ! { ! $topic_author = ( $postrow[$row_count]['user_id'] != ANONYMOUS ) ? '<a href="' . append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $postrow[$row_count]['user_id']) . '">' : ''; ! $topic_author .= ( $postrow[$row_count]['user_id'] != ANONYMOUS ) ? $postrow[$row_count]['username'] : ( ( $postrow[$row_count]['post_username'] != '' ) ? $postrow[$row_count]['post_username'] : $lang['Guest'] ); ! $topic_author .= ( $postrow[$row_count]['user_id'] != ANONYMOUS ) ? '</a>' : ''; ! } ! else ! { ! $topic_author = ''; ! } ! if ( $display_last_author == "TRUE" ) ! { ! $last_post_author = ( $postrow[$row_count]['id2'] == ANONYMOUS ) ? ( ( $postrow[$row_count]['post_username'] != '' ) ? $postrow[$row_count]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $postrow[$row_count]['id2']) . '">' . $postrow[$row_count]['user2'] . '</a>'; ! } ! else ! { ! $last_post_author = ''; ! } ! if ( strlen($message) > $nb_characteres ) ! { ! $message = substr($message, 0, $nb_characteres); ! $position_espace = strrpos($message, ' '); ! $message = substr($message, 0, $position_espace); ! $message .= '...'; ! } ! if ( $display_date == "TRUE" ) ! { ! $message_date = create_date($board_config['default_dateformat'], $postrow[$row_count]['post_time'], $board_config['board_timezone']); ! } ! else ! { ! $message_date = ''; ! } + if ( $display_forum == "TRUE" ) + { + $forum_name = $postrow[$row_count]['forum_name']; + $forum_url = append_sid(PHPBB_URL . 'viewforum.php?f=' . $postrow[$row_count]['forum_id']); + } + else + { + $forum_name = ''; + $forum_url = ''; + } + + if ( $display_icon_view == "TRUE" ) + { + $last_post_url = '<a href="' . append_sid(PHPBB_URL . "viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$row_count]['topic_last_post_id']) . '#' . $postrow[$row_count]['topic_last_post_id'] . '"><img src="' . PHPBB_URL . $images['icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>'; + } + else + { + $last_post_url = ''; + } + + $template->assign_block_vars('msg_row', array( + 'ROW_COLOR' => "#" . $row_color, + 'ROW_CLASS' => $row_class, + 'LAST_MSG' => $message, + 'LAST_MSG_DATE' => $message_date, + 'FORUM_NAME' => $forum_name, + 'U_LAST_MSG' => $url, + 'U_FORUM' => $forum_url, + 'LAST_POST_IMG' => $last_post_url, + 'FOLDER_IMG' => $folder_image, + 'TOPIC_AUTHOR' => $topic_author, + 'LAST_POST_AUTHOR' => $last_post_author, + 'L_TOPIC_FOLDER_ALT' => $folder_alt + )); } |