Und gerade bei diesem Teil hatte ich lange zu kämpfen
Okay, das Testboard von Dir habe ich ja noch. Ich werde meine Änderungen nochmal damit testen, vielleicht muss da mehr angepasst werden.
Ergebnis kommt dann hier zurück.
Code: Alles auswählen
#
#-----[ OPEN ]-----
#
#
#-----[ FIND ]-----
#
if ( $search_id == 'newposts' )
{
if ( $userdata['session_logged_in'] )
{
$sql = "SELECT post_id
FROM " . POSTS_TABLE . "
WHERE post_time >= " . $userdata['user_lastvisit'];
#
#-----[ REPLACE WITH ]-----
#
if ( $search_id == 'newposts' )
{
if ( $userdata['session_logged_in'] )
{
$jetzt_vor_einem_monat = time() - $board_config['unread_time'];
$sql = "SELECT p.post_id, p.topic_id, r.visit_time
FROM " . POSTS_TABLE . " AS p LEFT OUTER JOIN " . TOPIC_READ_TABLE . " AS r
ON ( p.topic_id = r.topic_id AND r.user_id = " . $userdata['user_id'] . ")
WHERE ( (r.user_id = " . $userdata['user_id'] . " OR r.user_id IS NULL)
AND (p.post_time > " . $jetzt_vor_einem_monat . " OR p.post_edit_time > " . $jetzt_vor_einem_monat . ")
AND (p.post_time > r.visit_time OR p.post_edit_time > r.visit_time OR r.topic_id IS NULL) )";
#
#-----[ SAVE/CLOSE ALL FILES ]-----
#
# EoM

Code: Alles auswählen
#
#-----[ OPEN ]-----
#
search.php
#
#-----[ FIND ]-----
#
$sql = "SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
#
#-----[ REPLACE WITH ]-----
#
$sql = "SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time, p2.post_edit_time
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
#
#-----[ SAVE/CLOSE ALL FILES ]-----
#
# EoMund in der viewtopic.tpl dieser:*********************************************************** - 6 - ***************************************************************
suche:
*********************************************************************************************************************************
//
// Note! The order used for parsing the message _is_ important, moving things around could break any
// output
//
*********************************************************************************************************************************
füge davor ein:
*********************************************************************************************************************************
// <!--- Tread Read Hack On --->
if( $userdata['session_logged_in'] )
{
$user_id = $userdata[user_id];
$post_id = $postrow[$i]['post_id'];
$post_time = $postrow[$i]['post_time'];
$post_edit_time = $postrow[$i]['post_edit_time'];
$post_new = "";
$zeit_min_monat = time() - $board_config['unread_time'];
$zeit_jetzt = time();
$zeit_monat = $zeit_jetzt - $board_config['unread_time'];
if ($post_time > $zeit_monat || $post_edit_time > $zeit_monat) {
if ($visit_time < $post_time || $visit_time < $post_edit_time) {
$post_new = "bgcolor=" . $board_config['unread_color'];
if ( $post_id == $last_post_id || $visit_time < $post_edit_time) {
$sql = "DELETE FROM " . TOPIC_READ_TABLE . "
WHERE topic_id = $topic_id
AND user_id = $user_id";
if (!$result = $db->sql_query($sql) ) {
message_die(GENERAL_ERROR, "Couldn't remove Topic Read database", "", __LINE__, __FILE__, $sql);
}
$visit_time_new = time();
$sql = "INSERT INTO " . TOPIC_READ_TABLE . " (topic_id, post_id, user_id, visit_time, forum_id) VALUES ('$topic_id' , '$post_id' , '$user_id' , '$visit_time_new', '$forum_id')";
if (!$result = $db->sql_query($sql) ) {
message_die(GENERAL_ERROR, "Couldn't Build Topic Read database", "", __LINE__, __FILE__, $sql);
}
}
}
}
}
Öffne templates\viewtopic_body.tpl und folge den Anweisungen...
*********************************************************** - 1 - ***************************************************************
suche:
*********************************************************************************************************************************
<td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a>
*********************************************************************************************************************************
ersetze mit:
*********************************************************************************************************************************
<td width="100%" {postrow.POST_NEW}><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a>
****************************************** - 2 für phpBB 2.01 / 2.02 / 2.03 / 2.04 - *******************************************
suche:
*********************************************************************************************************************************
<td valign="top" align="right" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
*********************************************************************************************************************************
ersetze mit:
*********************************************************************************************************************************
<td valign="top" align="right" nowrap="nowrap" {postrow.POST_NEW}>{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
************************************************** - 2 für phpBB 2.05 / 2.06 - **************************************************
suche:
*********************************************************************************************************************************
<td valign="top" nowrap="nowrap">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
*********************************************************************************************************************************
ersetze mit:
*********************************************************************************************************************************
<td valign="top" nowrap="nowrap" {postrow.POST_NEW}>{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td>
Code: Alles auswählen
#
#-----[ OPEN ]-----
#
search.php
#
#-----[ FIND ]-----
#
if ( $userdata['session_logged_in'] )
{
if ( !empty($tracking_topics[$topic_id]) && !empty($tracking_forums[$forum_id]) )
#
#-----[ BEFORE, ADD ]-----
#
$post_new = 'row1';
#
#-----[ FIND ]-----
#
if ( $searchset[$i]['post_time'] > $topic_last_read || $searchset[$i]['post_edit_time'] > $topic_last_read )
{
$mini_post_img = $images['icon_minipost_new'];
$mini_post_alt = $lang['New_post'];
#
#-----[ REPLACE WITH ]-----
#
if ( $searchset[$i]['post_time'] > $topic_last_read || $searchset[$i]['post_edit_time'] > $topic_last_read )
{
$post_new = "bgcolor=" . $board_config['unread_color'];
$mini_post_img = $images['icon_minipost_new'];
$mini_post_alt = $lang['New_post'];
#
#-----[ FIND ]-----
#
$template->assign_block_vars("searchresults", array(
'TOPIC_TITLE' => $topic_title,
'FORUM_NAME' => get_object_lang(POST_FORUM_URL . $searchset[$i]['forum_id'], 'name'),
'POST_SUBJECT' => $post_subject,
#
#-----[ AFTER, ADD ]-----
#
$template->assign_block_vars("searchresults", array(
'TOPIC_TITLE' => $topic_title,
'FORUM_NAME' => get_object_lang(POST_FORUM_URL . $searchset[$i]['forum_id'], 'name'),
'POST_SUBJECT' => $post_subject,
'POST_NEW' => $post_new,
#
#-----[ OPEN ]-----
#
templates/subSilver/search_results_posts.tpl
#
#-----[ FIND ]-----
#
<td valign="top" class="row1"><span class="postbody">{searchresults.MESSAGE}</span></td>
#
#-----[ REPLACE WITH ]-----
#
<td valign="top" class="{searchresults.POST_NEW}"><span class="postbody">{searchresults.MESSAGE}</span></td>
#
#-----[ SAVE/CLOSE ALL FILES]-----
#
# EoMCode: Alles auswählen
#
#-----[ FIND ]-----
#
$template->assign_block_vars("searchresults", array(
'TOPIC_TITLE' => $topic_title,
'FORUM_NAME' => get_object_lang(POST_FORUM_URL . $searchset[$i]['forum_id'], 'name'),
'POST_SUBJECT' => $post_subject,
#
#-----[ AFTER, ADD ]-----
#
$template->assign_block_vars("searchresults", array(
'TOPIC_TITLE' => $topic_title,
'FORUM_NAME' => get_object_lang(POST_FORUM_URL . $searchset[$i]['forum_id'], 'name'),
'POST_SUBJECT' => $post_subject,
'POST_NEW' => $post_new, Code: Alles auswählen
#
#-----[ FIND ]-----
#
$template->assign_block_vars("searchresults", array(
'TOPIC_TITLE' => $topic_title,
'FORUM_NAME' => get_object_lang(POST_FORUM_URL . $searchset[$i]['forum_id'], 'name'),
'POST_SUBJECT' => $post_subject,
#
#-----[ REPLACE WITH ]-----
#
$template->assign_block_vars("searchresults", array(
'TOPIC_TITLE' => $topic_title,
'FORUM_NAME' => get_object_lang(POST_FORUM_URL . $searchset[$i]['forum_id'], 'name'),
'POST_SUBJECT' => $post_subject,
'POST_NEW' => $post_new, Code: Alles auswählen
suche:
<td width="100%" valign="top" class="row1"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}: <b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b> {L_POSTED}: {searchresults.POST_DATE} {L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td>
Code: Alles auswählen
<td width="100%" valign="top" {searchresults.POST_NEW}><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}: <b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b> {L_POSTED}: {searchresults.POST_DATE} {L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td>Beides beruht auf der selben Abfrage, also Mini-Icon gelb = Titel farbig.kann es sein das diese dauerhaft gelben Icons auch was damit zu tun haben das die Titelzeile dauerhaft hinterlegt ist?
Code: Alles auswählen
#
#-----[ OPEN ]-----
#
search.php
#
#-----[ FIND ]-----
#
$searchset = array();
while( $row = $db->sql_fetchrow($result) )
{
$searchset[] = $row;
}
$db->sql_freeresult($result);
#
#-----[ REPLACE WITH ]-----
#
$searchset = array();
$topicset = array();
while( $row = $db->sql_fetchrow($result) )
{
$searchset[] = $row;
$topicset[] = $row['topic_id'];
}
$db->sql_freeresult($result);
if ( count($search_ids_visit) == 0 )
{
$topic_set = implode(', ', $topicset);
$search_ids_visit = array();
$sql = "SELECT max(visit_time) as last_time, topic_id FROM " . TOPIC_READ_TABLE . "
WHERE topic_id IN ($topic_set)
AND user_id = ".$userdata['user_id']."
GROUP BY topic_id";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$search_ids_visit[$row['topic_id']] = $row['last_time'];
}
}
#
#-----[ FIND ]-----
#
$topic_last_read = ( !empty($search_ids_visit[$topic_id]) ) ? max($search_ids_visit[$topic_id]) : $topic_last_read;
#
#-----[ REPLACE WITH ]-----
#
$topic_last_read = ( !empty($search_ids_visit[$topic_id]) ) ? $search_ids_visit[$topic_id] : 0;
#
#-----[ SAVE/CLOSE ALL FILES ]-----
#
# EoM