require_once ("LANGUAGE_FILE.php"); $cookie_user_info_arr = determine_user_priv(); $google_ad = _THRESHOLD_G_AD; $page_type = 'forums'; $search_type = 'forums'; $page_num = 'off'; $title = 'Forums - Read Message'; $meta_description = _SITE_NAME . ' Forums, a place to discuss photographic related topics, and more.'; $forum_id = intval($_REQUEST['f']); $thread_id = intval($_REQUEST['t']); $clean_message_id = intval($_REQUEST['m']); $cookie_user_id = $cookie_user_info_arr['user_id']; if ($forum_id == 11 || $forum_id == 12 || $forum_id == 13) //MOD TALK FORUM { if (empty($cookie_user_info_arr)) //DO NOT ALLOW NON_MEMBERS INTO MOD TALK FORUM { header("HTTP/1.0 404 Not Found"); header("Location: /404.php"); exit; } elseif (!in_array('tos', $cookie_user_info_arr['priv_type_arr'])) //ONLY ALLOW TOS MODS ACCESS TO MOD TALK FORUM { header("HTTP/1.0 404 Not Found"); header("Location: /404.php"); exit; } } //$forum_name_arr = array_values($forums_arr); $forum_name = $forums_arr[$forum_id]; // CODE FOR SMARTADS $query = "SELECT ft.thread_name FROM (for_threads AS ft) WHERE ft.thread_id = $thread_id" ; $result = mysql_query($query) or die ('Invalid r_query 3'); $row = mysql_fetch_array($result); $thread_name = str_replace('_TO', _TO, $row['thread_name']); SmartAds::setContext('thread', array(1,2)); SmartAds::addTarget("forumname" , $forum_name) ; SmartAds::addTarget("threadname" , $thread_name ) ; // END OF SMARTADS //Reset ehold field to NO if the same thread is visited... if (!empty($cookie_user_id)) { $subcount_query = "SELECT COUNT(*) FROM for_subscriptions WHERE user_id = $cookie_user_id AND thread_id = $thread_id AND ehold = 'Yes'"; $subcount_result = mysql_query($subcount_query) or die ('Invalid subcount_query'); $subcount_total = @mysql_result($subcount_result, 0); if ($subcount_total == 1) { $subuquery = "UPDATE for_subscriptions SET ehold = 'No' WHERE user_id = $cookie_user_id AND thread_id = $thread_id"; $suburesult = mysql_query($subuquery) or die ('Invalid subuquery'); } } if (empty($_GET['tt'])) { $thread_type = 'threaded'; } else { $thread_type = 'flat'; } if (!empty($_GET['highlight'])) { $highlight = $_GET['highlight']; } // brendan $query = "SELECT ft.message_id, fm.message, ft.thread_name, ft2.thread_id, u.user_name, ft.user_id, DATE_FORMAT(ft.create_date, '%Y-%m-%d %k:%i') AS create_date, ft2.photo_id, ft2.workshop_photo_id, ft2.thread_status, CONCAT(ui.first_name, ' ', ui.last_name) AS full_name, ft2.theme_id, pt.theme_title, u.acct_status FROM (for_threads AS ft, for_threads2 AS ft2, for_messages AS fm, users AS u, user_intros AS ui) LEFT JOIN photos AS p ON p.photo_id = ft2.photo_id AND p.cur_status = 'Active' LEFT JOIN photos_themes AS pt ON pt.theme_id = ft2.theme_id WHERE ft2.forum_id = $forum_id AND ft2.thread_id = $thread_id AND ft.message_id = $clean_message_id AND u.user_id = ft.user_id AND fm.message_id = ft.message_id AND u.user_id = ui.user_id AND ui.lang_id = 0 AND ft.thread_id = ft2.thread_id AND ft2.thread_status2 = 'Active' AND ft.msg_status = 'active'"; $result = mysql_query($query) or die ('Invalid r_query'); $row = mysql_fetch_array($result); $thread_id = $row['thread_id']; $thread_name = str_replace('_TO', _TO, $row['thread_name']); $user_id = $row['user_id']; $user_name = $row['user_name']; //$full_name = $row['full_name']; if ($row['acct_status'] == 'Enabled') { $full_name = $row['full_name']; } else { $full_name = ''; } $message = nl2br($row['message']); $msg_id = $row['message_id']; $create_date = $row['create_date']; $photo_id = $row['photo_id']; $workshop_photo_id = $row['workshop_photo_id']; $thread_status = $row['thread_status']; $theme_id = $row['theme_id']; $theme_title = $row['theme_title']; if ($photo_id != 0 || $workshop_photo_id != 0 || $theme_id != 0) { $colspan = 3; } else { $colspan = 4; } if (empty($thread_id)) { header("HTTP/1.0 404 Not Found"); header("Location: /404.php"); exit; mail_err_info(); } html_begin($title, $meta_keywords, $meta_description); echo '' . "\n"; echo ''; echo '
'; echo '' . "\n"; echo '' . "\n"; if (!empty($cookie_user_id)) { if ($cookie_user_info_arr['mem_type'] == 'admin' || in_array('forum', $cookie_user_info_arr['priv_type_arr'])) { if ($thread_status == 'Open') { $lockit = 'Lock Thread'; } else { $lockit = 'Unlock Thread'; } echo '' . "\n"; } } if ($thread_type == 'threaded') { if (!empty($highlight)) { $final_message = highlight($highlight, $message); } else { $final_message = $message; } echo ''; echo ''; echo ''; echo ''; echo ''; echo '' . "\n"; if ($theme_id > 0) { echo ''; } echo '' . "\n"; } if ($photo_id > 0) { if ($forum_id != 11 && $forum_id != 13 || $cur_status == 'Active') { $photo_info_arr = get_photo_info($photo_id); $thumb_info_arr['photo_name'] = $photo_info_arr['photo_name']; $thumb_info_arr['photo_id'] = $photo_info_arr['photo_id']; $thumb_info_arr['original_photo_id'] = $photo_info_arr['original_photo_id']; $thumb_info_arr['swidth'] = $photo_info_arr['swidth']; $thumb_info_arr['sheight'] = $photo_info_arr['sheight']; $thumb_info_arr['user_id'] = $photo_info_arr['user_id']; $thumb_info_arr['user_name'] = $photo_info_arr['user_name']; $thumb_info_arr['city_name'] = $city_name; $thumb_info_arr['nice_city_name'] = $nice_city_name; $thumb_info_arr['state_name'] = $state_name; $thumb_info_arr['nice_state_name'] = $nice_state_name; $thumb_info_arr['region_name'] = $region_name; $thumb_info_arr['nice_region_name'] = $nice_region_name; $thumb_info_arr['country_name'] = $photo_info_arr['country_name']; $thumb_info_arr['nice_country_name'] = $photo_info_arr['nice_country_name']; $thumb_info_arr['nice_continent_name'] = $photo_info_arr['nice_continent_name']; $thumb_info_arr['num_critiques'] = $photo_info_arr['num_critiques']; $thumb_info_arr['num_favorites'] = $photo_info_arr['num_favorites']; $thumb_info_arr['user_score'] = $photo_info_arr['user_score']; $thumb_info_arr['user_critique_score'] = $photo_info_arr['user_critique_score']; $thumb_info_arr['user_workshop_score'] = $photo_info_arr['user_workshop_score']; $thumb_info_arr['user_note_score'] = $photo_info_arr['user_note_score']; $thumb_info_arr['score_sym'] = $photo_info_arr['score_sym']; $thumb_info_arr['score'] = $photo_info_arr['score']; $thumb_info_arr['title_name'] = $photo_info_arr['title_name']; $thumb_info_arr['camera_name'] = $photo_info_arr['camera_name']; echo '' . "\n"; } else { $query = "SELECT p.photo_name, p.user_id, p.swidth, p.sheight, u.user_name, u.user_critique_score, u.user_note_score, u.user_workshop_score, u.score_sym, u.user_score, pt.title_name FROM photos AS p, users AS u, photo_titles AS pt WHERE p.photo_id = $photo_id AND u.user_id = p.user_id AND pt.photo_id = p.photo_id AND pt.lang_id = 0"; $result = mysql_query($query) or die ('Invalid query'); if (mysql_num_rows($result) == 1) { $row = mysql_fetch_array($result); $thumb_info_arr['photo_name'] = $row['photo_name']; $thumb_info_arr['user_id'] = $row['user_id']; $thumb_info_arr['photo_id'] = $photo_id; $thumb_info_arr['swidth'] = $row['swidth']; $thumb_info_arr['sheight'] = $row['sheight']; $thumb_info_arr['user_name'] = $row['user_name']; $thumb_info_arr['user_critique_score'] = $row['user_critique_score']; $thumb_info_arr['user_note_score'] = $row['user_note_score']; $thumb_info_arr['user_workshop_score'] = $row['user_workshop_score']; $thumb_info_arr['score_sym'] = $row['score_sym']; $thumb_info_arr['user_score'] = $row['user_score']; $thumb_info_arr['title_name'] = $row['title_name']; } echo '' . "\n"; } } elseif ($theme_id > 0) { $w_query = "SELECT photo_id FROM photos_themes_ord WHERE theme_id = $theme_id ORDER BY order_no LIMIT 1"; $w_result = mysql_query($w_query) or die ('Invalid w_query'); $w_row = mysql_fetch_array($w_result); $photo_id = $w_row['photo_id']; $photo_info_arr = get_photo_info($photo_id); $thumb_info_arr['photo_name'] = $photo_info_arr['photo_name']; $thumb_info_arr['photo_id'] = $photo_info_arr['photo_id']; $thumb_info_arr['original_photo_id'] = $photo_info_arr['original_photo_id']; $thumb_info_arr['swidth'] = $photo_info_arr['swidth']; $thumb_info_arr['sheight'] = $photo_info_arr['sheight']; $thumb_info_arr['user_id'] = $photo_info_arr['user_id']; $thumb_info_arr['user_name'] = $photo_info_arr['user_name']; $thumb_info_arr['city_name'] = $city_name; $thumb_info_arr['nice_city_name'] = $nice_city_name; $thumb_info_arr['state_name'] = $state_name; $thumb_info_arr['nice_state_name'] = $nice_state_name; $thumb_info_arr['region_name'] = $region_name; $thumb_info_arr['nice_region_name'] = $nice_region_name; $thumb_info_arr['country_name'] = $photo_info_arr['country_name']; $thumb_info_arr['nice_country_name'] = $photo_info_arr['nice_country_name']; $thumb_info_arr['nice_continent_name'] = $photo_info_arr['nice_continent_name']; $thumb_info_arr['num_critiques'] = $photo_info_arr['num_critiques']; $thumb_info_arr['num_favorites'] = $photo_info_arr['num_favorites']; $thumb_info_arr['user_score'] = $photo_info_arr['user_score']; $thumb_info_arr['user_critique_score'] = $photo_info_arr['user_critique_score']; $thumb_info_arr['user_workshop_score'] = $photo_info_arr['user_workshop_score']; $thumb_info_arr['user_note_score'] = $photo_info_arr['user_note_score']; $thumb_info_arr['score_sym'] = $photo_info_arr['score_sym']; $thumb_info_arr['score'] = $photo_info_arr['score']; $thumb_info_arr['title_name'] = $photo_info_arr['title_name']; $thumb_info_arr['camera_name'] = $photo_info_arr['camera_name']; echo '' . "\n"; } elseif ($workshop_photo_id > 0) { $w_query = "SELECT pw.original_photo_id, pw.swidth, pw.sheight, pw.user_id AS workshop_user_id, u.user_name, u.user_score, u.user_critique_score, pw.photo_name AS workshop_photo_name, pw.photo_id AS workshop_photo_id, u.user_workshop_score, u.user_note_score, u.score_sym FROM photos_workshop AS pw, users AS u WHERE pw.photo_id = $workshop_photo_id AND u.user_id = pw.user_id"; $w_result = mysql_query($w_query) or die ('Invalid w_query'); $w_row = mysql_fetch_array($w_result); $original_photo_id = $w_row['original_photo_id']; $workshop_photo_id = $w_row['workshop_photo_id']; $workshop_swidth = $w_row['swidth']; $workshop_sheight = $w_row['sheight']; $workshop_user_id = $w_row['workshop_user_id']; $workshop_photo_name = $w_row['workshop_photo_name']; $workshop_user_name = $w_row['user_name']; $workshop_user_score = $w_row['user_score']; $workshop_user_critique_score = $w_row['user_critique_score']; $workshop_user_workshop_score = $w_row['user_workshop_score']; $workshop_user_note_score = $w_row['user_note_score']; $workshop_score_sym = $w_row['score_sym']; $photo_info_arr = get_photo_info($original_photo_id); $thumb_info_arr['photo_name'] = $w_row['workshop_photo_name']; $thumb_info_arr['photo_id'] = $w_row['workshop_user_id']; $thumb_info_arr['original_photo_id'] = $w_row['original_photo_id']; $thumb_info_arr['swidth'] = $w_row['swidth']; $thumb_info_arr['sheight'] = $w_row['sheight']; $thumb_info_arr['user_id'] = $w_row['workshop_user_id']; $thumb_info_arr['user_name'] = $photo_info_arr['user_name']; $thumb_info_arr['country_name'] = $photo_info_arr['country_name']; $thumb_info_arr['nice_country_name'] = $photo_info_arr['nice_country_name']; $thumb_info_arr['nice_continent_name'] = $photo_info_arr['nice_continent_name']; $thumb_info_arr['num_critiques'] = $photo_info_arr['num_critiques']; $thumb_info_arr['num_favorites'] = $photo_info_arr['num_favorites']; $thumb_info_arr['user_score'] = $photo_info_arr['user_score']; $thumb_info_arr['user_critique_score'] = $photo_info_arr['user_critique_score']; $thumb_info_arr['user_workshop_score'] = $photo_info_arr['user_workshop_score']; $thumb_info_arr['user_note_score'] = $photo_info_arr['user_note_score']; $thumb_info_arr['score_sym'] = $photo_info_arr['score_sym']; $thumb_info_arr['score'] = $photo_info_arr['score']; $thumb_info_arr['title_name'] = $photo_info_arr['title_name']; $thumb_info_arr['camera_name'] = $photo_info_arr['camera_name']; $edited_by = '
Edited by: ' . $workshop_user_name . ' ' . get_user_score_status($workshop_user_id, $workshop_user_score, $workshop_user_critique_score, $workshop_user_workshop_score, $workshop_user_note_score, $workshop_score_sym) . ''; echo '' . "\n"; } echo '' . "\n"; if ($thread_type == 'flat') { $thread_view = '[' . _THREADED_VIEW . ']'; $post_reply = ''; } else { $thread_view = '[' . _FLAT_VIEW . ']'; if ($cookie_user_info_arr['user_disable'] == 'off') { if ($thread_status != 'locked' && !empty($cookie_user_info_arr['user_id'])) { $post_reply = '[' . _POST_REPLY . '] '; } //echo '' . "\n"; echo '' . "\n"; } elseif (!empty($photo_id)) { if ($thread_type == 'threaded' && $cookie_user_info_arr['user_disable'] == 'off') { $post_reply .= '&pid=' . $photo_id . '&action=r">' . _POST_REPLY . '] '; } //echo '' . "\n"; echo '' . "\n"; } elseif (!empty($workshop_photo_id)) { if ($thread_type == 'threaded') { $post_reply .= '&wpid=' . $workshop_photo_id . '&action=r">' . _POST_REPLY . '] '; } //echo '' . "\n"; echo '' . "\n"; } elseif (!empty($country_id)) { if ($thread_type == 'threaded') { $post_reply .= '&cid=' . $country_id . '&action=r">' . _POST_REPLY . '] '; } //echo '' . "\n"; echo '' . "\n"; } else { if ($thread_type == 'threaded') { $post_reply .= '&action=r">' . _POST_REPLY . '] '; } //echo '' . "\n"; echo '' . "\n"; } } else { //echo ''; echo ''; } } else { //echo '' . "\n"; echo '' . "\n"; } if ($thread_type == 'threaded') { echo '' . "\n"; } $halfdayago = mktime (date("H")-12,date("i"),0,date("m"),date("d"), date("Y")); $alt=0; if ($thread_type == 'threaded') { $alt=0; $iteration = 1; $count = 0; $indent_level = 0; $query = "SELECT ft2.forum_id, UNIX_TIMESTAMP(ft.create_date) AS thread_date, ft.message_id, fm.message, ft.thread_name, ft2.thread_id, ft.reply_id, u.user_name, ft.user_id, DATE_FORMAT(ft.create_date, '%Y-%m-%d %H:%i') AS create_date, ft2.photo_id, u.user_score, u.user_critique_score, ft2.thread_status, u.user_workshop_score, CONCAT(ui.first_name, ' ', ui.last_name) AS full_name, u.user_note_score, u.score_sym, u.acct_status FROM for_threads AS ft, for_threads2 AS ft2, for_messages AS fm, users AS u, user_intros AS ui WHERE ft2.thread_id = $thread_id AND u.user_id = ft.user_id AND fm.message_id = ft.message_id AND ui.user_id = u.user_id AND ui.lang_id = 0 AND ft.thread_id = ft2.thread_id AND ft2.thread_status2 = 'Active' AND ft.msg_status = 'active' ORDER BY ft.create_date"; //echo $query; $result = mysql_query($query) or die ('Invalid display_thread_query'); while ($row = mysql_fetch_array($result)) { if ($row['reply_id'] == 0) { $orig_msg_id = $row['message_id']; $original_message_id = $row['message_id']; } $message_id = $row['message_id']; $thread_info_arr['reply_id'][] = $row['reply_id']; $thread_info_arr['thread_id'][$message_id] = $row['thread_id']; $thread_info_arr['thread_name'][$message_id] = str_replace('_TO', _TO, $row['thread_name']); $thread_info_arr['thread_status'][$message_id] = $row['thread_status']; $thread_info_arr['user_id'][$message_id] = $row['user_id']; $thread_info_arr['user_name'][$message_id] = $row['user_name']; // $thread_info_arr['full_name'][$message_id] = $row['full_name']; if ($row['acct_status'] == 'Enabled') { $thread_info_arr['full_name'][$message_id] = $row['full_name']; } else { $thread_info_arr['full_name'][$message_id] = ''; } $thread_info_arr['user_score'][$message_id] = $row['user_score']; $thread_info_arr['user_critique_score'][$message_id] = $row['user_critique_score']; $thread_info_arr['user_workshop_score'][$message_id] = $row['user_workshop_score']; $thread_info_arr['user_note_score'][$message_id] = $row['user_note_score']; $thread_info_arr['score_sym'][$message_id] = $row['score_sym']; $thread_info_arr['message'][$message_id] = $row['message']; $thread_info_arr['message_id'][] = $row['message_id']; $thread_info_arr['create_date'][$message_id] = $row['create_date']; $thread_info_arr['photo_id'][$message_id] = $row['photo_id']; $thread_info_arr['thread_date'][$message_id] = $row['thread_date']; $thread_info_arr['forum_id'][$message_id] = $row['forum_id']; } //INSERT DELAYED into tmp_log table $query = "INSERT DELAYED INTO tmp_log (log_type, id, counter) VALUES ('for_thread', $thread_id, 1) ON DUPLICATE KEY UPDATE counter=counter+1"; $result = mysql_query($query) or die ('Invalid log query'); display_thread($orig_msg_id, 0); echo '
[Edit Message] [Delete Message] [Delete Thread] [' . $lockit . '] [Move Thread]'; if ($forum_id == 11 && $photo_id > 0) { $query12 = "SELECT cur_status FROM photos WHERE photo_id = $photo_id"; $result12 = mysql_query($query12) or die ('Invalid query12'); $row12 = mysql_fetch_array($result12); $cur_status = $row12['cur_status']; if ($cur_status == 'Inactive') { echo ' [Reactivate Photo]'; } } echo '
' . $thread_name . '' . $user_name . '::' . $create_date . '
Theme: ' . $theme_title . '
' . $final_message . ''; echo display_thumbnail ($thumb_info_arr, $header='country-link'); echo ''; echo '
'; echo $thumb_info_arr['title_name'] . '
'; echo '' . $thumb_info_arr['user_name'] . ' ' . get_user_score_status($thumb_info_arr['user_id'], $thumb_info_arr['user_score'], $thumb_info_arr['user_critique_score'], $thumb_info_arr['user_workshop_score'], $thumb_info_arr['user_note_score'], $thumb_info_arr['score_sym']) . ''; echo '
'; echo display_thumbnail ($thumb_info_arr, $header='country-link'); echo ''; if ($thumb_info_arr['num_critiques'] > 0) { $score = $thumb_info_arr['score']; } else { $score = '-'; } if (!empty($thumb_info_arr['camera_name'])) { $camera = " \n" . 'Camera: ' . $thumb_info_arr['camera_name']; } else { $camera = ''; } $img = 'Title: ' . htmlentities($thumb_info_arr['title_name']) . $thumb_info_arr['camera_name'] . ''; $thumb_header = '' . $thumb_info_arr['country_name'] . '
'; $img = '' . $img . ''; $thumb_footer = '
' . $thumb_info_arr['title_name'] . ' (' . $score . ') WP
' . $thumb_info_arr['user_name'] . ' ' . get_user_score_status($photo_info_arr['user_id'], $thumb_info_arr['user_score'], $thumb_info_arr['user_critique_score'], $thumb_info_arr['user_workshop_score'], $thumb_info_arr['user_note_score'], $thumb_info_arr['score_sym']) . ''; echo $thumb_header . $img . $thumb_footer; echo $edited_by . '
[compare]-[thumbnails]
' . $post_reply . $thread_view . ' [' . _TRANSLATE . ']
' . $post_reply . $thread_view . ' [' . _TRANSLATE . ']
' . $post_reply . $thread_view . ' [' . _TRANSLATE . ']
' . $post_reply . $thread_view . ' [' . _TRANSLATE . ']
' . $post_reply . $thread_view . ' [' . _TRANSLATE . ']
' . $post_reply . $thread_view . ' [' . _TRANSLATE . ']
' . $post_reply . $thread_view . ' [' . _TRANSLATE . ']
' . $post_reply . $thread_view . ' [' . _TRANSLATE . ']
' . $post_reply . $thread_view . ' [' . _TRANSLATE . ']
' . $post_reply . $thread_view . ' [' . _TRANSLATE . ']
This thread is locked. ' . $thread_view . ' [' . _TRANSLATE . ']
This thread is locked. ' . $thread_view . ' [' . _TRANSLATE . ']
[' . _ONLY_TE_MEMBERS_MAY_POST . '] ' . $thread_view . ' [' . _TRANSLATE . ']
[' . _ONLY_TE_MEMBERS_MAY_POST . '] ' . $thread_view . ' [' . _TRANSLATE . ']
' . _THREAD . '' . _USERNAME . ' ' . _DATE . '
'; echo '
' . "\n"; } else { //INSERT DELAYED into tmp_log table $query = "INSERT DELAYED INTO tmp_log (log_type, id, counter) VALUES ('for_thread', $thread_id, 1) ON DUPLICATE KEY UPDATE counter=counter+1"; $result = mysql_query($query) or die ('Invalid log query'); if ($theme_id > 0) { echo 'Theme: ' . $theme_title . ''; } display_flat_mode($thread_id); echo ''; echo ''; echo '' . "\n"; } html_end(); function display_thread ($message_id, $indent_level) { global $thread_info_arr, $_COOKIE, $alt, $clean_message_id; for ($i=0; $i<$indent_level;$i++) { $indent .= ':'; } $bgcolor = altColor($alt); $new = display_new($_COOKIE['lvisit'], $thread_info_arr['thread_date'][$message_id]); if ($clean_message_id == $message_id) { $edited_thread_name = '' . $thread_info_arr['thread_name'][$message_id] . ' ' . $new; } else { $edited_thread_name = '' . $thread_info_arr['thread_name'][$message_id] . ' ' . $new; } echo '' . $indent . $edited_thread_name . ''; echo '' . $thread_info_arr['user_name'][$message_id] . ' ' . get_user_score_status($thread_info_arr['user_id'][$message_id], $thread_info_arr['user_score'][$message_id], $thread_info_arr['user_critique_score'][$message_id], $thread_info_arr['user_workshop_score'][$message_id], $thread_info_arr['user_note_score'][$message_id], $thread_info_arr['score_sym'][$message_id]) . ''; echo '::'; echo '' . $thread_info_arr['create_date'][$message_id] . '' . "\n"; // unset($indent); // unset($indent_level); //print_r($thread_info_arr['message_id']); // scan each message in array looking for replies to this one // if there are any, make recursive call foreach ($thread_info_arr['message_id'] as $key => $msg) { //echo 'msg: '.$msg . ' key: ' . $key . ' message_id: ' . $message_id . ' reply_id: ' . $thread_info_arr['reply_id'][$key] . '
'; if ($thread_info_arr['reply_id'][$key] == $message_id) { if ($thread_info_arr['reply_id'][$key] > $prev_reply_id) { $indent_level++; } $alt++; display_thread($thread_info_arr['message_id'][$key], $indent_level); $prev_reply_id = $thread_info_arr['reply_id'][$key]; //echo 'a' . $msg . '
'; } } //return $thread_info_arr[$message_id]; } function display_flat_mode($thread_id) { global $edited_thread_name, $photo_id, $workshop_photo_id, $new, $_COOKIE, $cookie_user_info_arr; $query = "SELECT ctr.nice_country_name, ctr.continent_id, p.photo_name, pw.photo_name AS workshop_photo_name, p.num_favorites, p.state_id, ft.message_id, fm.message, ft.thread_name, ft2.thread_id, u.user_name, ft.user_id, p.swidth, p.sheight, DATE_FORMAT(ft.create_date, '%Y-%m-%d %k:%i') AS create_date, ft2.photo_id, ft2.workshop_photo_id, ft2.thread_status, t.title_name, tc.camera_name, u.user_id, u.user_score, u.user_critique_score, UNIX_TIMESTAMP(ft.create_date) AS thread_date, u.user_workshop_score, CONCAT(ui.first_name, ' ', ui.last_name) AS full_name, u.user_note_score, u.score_sym, ft2.forum_id, u.acct_status FROM (for_threads AS ft, for_threads2 AS ft2, for_messages AS fm, users AS u, user_intros AS ui) LEFT JOIN photos AS p ON p.photo_id = ft2.photo_id AND p.cur_status = 'Active' LEFT JOIN photos_workshop AS pw ON pw.photo_id = ft2.photo_id LEFT JOIN loc_states AS s ON p.state_id = s.state_id AND s.lang_id = 0 LEFT JOIN loc_regions AS r ON r.region_id = s.region_id AND r.lang_id = 0 LEFT JOIN loc_countries AS ctr ON ctr.country_id = r.country_id LEFT JOIN photo_titles AS t ON t.photo_id = p.photo_id AND t.lang_id = 0 LEFT JOIN tech_cameras AS tc ON p.camera_id = tc.camera_id WHERE ft.thread_id = $thread_id AND u.user_id = ft.user_id AND fm.message_id = ft.message_id AND u.user_id = ui.user_id AND ui.lang_id = 0 AND ft.thread_id = ft2.thread_id AND ft2.thread_status2 = 'Active' AND ft.msg_status = 'active' ORDER BY ft.create_date"; $result = mysql_query($query) or die ('Invalid r_query'); while ($row = mysql_fetch_array($result)) { $reply_id = $row['reply_id']; $thread_id = $row['thread_id']; $thread_name = str_replace('_TO', _TO, $row['thread_name']); $thread_status = $row['thread_status']; $reply_id = $row['reply_id']; $user_id = $row['user_id']; $user_name = $row['user_name']; // $full_name = $row['full_name']; if ($row['acct_status'] == 'Enabled') { $full_name = $row['full_name']; } else { $full_name = ''; } $user_score = $row['user_score']; $user_critique_score = $row['user_critique_score']; $user_workshop_score = $row['user_workshop_score']; $user_note_score = $row['user_note_score']; $score_sym = $row['score_sym']; $message = nl2br($row['message']); $message_id = $row['message_id']; $create_date = $row['create_date']; $photo_id = $row['photo_id']; $country_id = $row['country_id']; $thread_date = $row['thread_date']; $forum_id = $row['forum_id']; $thread_msg_hash = md5($_COOKIE['h'] . $thread_id . $message_id); $new = ' ' . display_new($_COOKIE['lvisit'], $thread_date); echo ''; echo '' . $thread_name . $new . ' '; if ($cookie_user_info_arr['user_disable'] == 'off') { echo '[' . _POST_REPLY . ']'; } echo ''; echo '' . $user_name . ' ' . get_user_score_status($user_id, $user_score, $user_critique_score, $user_workshop_score, $user_note_score, $score_sym) . ''; echo '::'; echo '' . $create_date . ''; echo '' . "\n"; echo '' . $message . '' . "\n"; } } ?>