|
From: Markus P. <mar...@us...> - 2005-04-28 13:58:44
|
Update of /cvsroot/mxbb/core/modules/mx_coreblocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18294/modules/mx_coreblocks Modified Files: mx_announce.php Log Message: Fixed a couple of issues with the Announcement block (urls). Index: mx_announce.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_coreblocks/mx_announce.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mx_announce.php 19 Apr 2005 15:55:39 -0000 1.13 --- mx_announce.php 28 Apr 2005 13:58:32 -0000 1.14 *************** *** 84,115 **** $min_topic_time = time() - ( $announce_nbr_days * 86400 ); ! $topic_type = ''; ! $t_commas = ''; ! if ( $announce_display_global == 'TRUE' ) ! { ! $topic_type = POST_GLOBAL_ANNOUNCE; ! $t_commas = ','; ! } ! if ( $announce_display == 'TRUE' ) { ! $topic_type .= $t_commas . POST_ANNOUNCE; ! $t_commas = ','; } ! if ( $announce_display_sticky == 'TRUE' ) { ! $topic_type .= $t_commas . POST_STICKY ; ! $t_commas = ','; } ! if ( $announce_display_normal == 'TRUE' ) { ! $topic_type .= $t_commas . POST_NORMAL ; } ! if( empty($topic_type) ) { ! $topic_type = 0; } ! $sql = "SELECT t.*, u.username, u.user_id, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid, p2.post_time AS last_post_time ! FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt, " . POSTS_TABLE . " p2 WHERE p.topic_id = t.topic_id AND t.topic_type IN ( " . $topic_type . " ) --- 84,108 ---- $min_topic_time = time() - ( $announce_nbr_days * 86400 ); ! $topic_type = array(); ! if( $announce_display_global == 'TRUE' ) { ! $topic_type[] = POST_GLOBAL_ANNOUNCE; } ! if( $announce_display == 'TRUE' ) { ! $topic_type[] = POST_ANNOUNCE; } ! if( $announce_display_sticky == 'TRUE' ) { ! $topic_type[] = POST_STICKY; } ! if( $announce_display_normal == 'TRUE' ) { ! $topic_type[] = POST_NORMAL; } + $topic_type = ( empty($topic_type) ? 0 : implode(', ', $topic_type) ); ! $sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid, p2.post_time AS last_post_time ! FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2, " . POSTS_TEXT_TABLE . " pt WHERE p.topic_id = t.topic_id AND t.topic_type IN ( " . $topic_type . " ) *************** *** 121,124 **** --- 114,118 ---- AND t.forum_id IN ( $announce_forum ) AND p2.post_id = t.topic_last_post_id + AND u2.user_id = p2.poster_id ORDER BY p.post_time $post_time_order LIMIT $start, " . $announce_nbr_display; *************** *** 325,332 **** 'TOPIC_ID' => $postrow[$i]['topic_id'], 'SIGNATURE' => $user_sig, ! 'FOLDER_IMG' => $folder_image, 'IMAGE' => TEMPLATE_ROOT_PATH . 'images/' . $annoucement_image, ! 'U_URL' => $last_post_url, 'REPLIES' => $replies, --- 319,328 ---- 'TOPIC_ID' => $postrow[$i]['topic_id'], 'SIGNATURE' => $user_sig, ! 'FOLDER_IMG' => PHPBB_URL . $folder_image, 'IMAGE' => TEMPLATE_ROOT_PATH . 'images/' . $annoucement_image, ! 'U_TOPIC_URL' => append_sid(PHPBB_URL . "viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $postrow[$i]['topic_id']), ! 'U_LAST_POST_URL' => $last_post_url, ! 'U_PROFILE_POSTER' => append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&u=$poster_id"), 'REPLIES' => $replies, |