Jump to content
InvisionCommunity.de - Der Deutsche Invision Community Support
Sign in to follow this  
|ArCtoZz|

Forum Read-Icon (Fix?!)

Recommended Posts

Hat es euch auch schon immer gestört, dass das Forum Icon immer noch den "ungelesen" Status hatte nachdem ihr ein ungelesenes Thema gelesen hattet und von dort sofort auf die Index Seite gesprungen seid?

Hier ist die Lösung:

Code by CoLdFoRcE (arctics.net)

- sources/topics.php öffnen

        //-----------------------------------------

        // Update the topic read cookie / counters

        //-----------------------------------------

        

        if ( ( $ibforums->member['id'] ) and ( $ibforums->input['view'] == "" ) )

        {

 	 $this->read_array[$this->topic['tid']] = time();

 	 

 	 $std->my_setcookie('topicsread', serialize($this->read_array), -1 );

 	 

 	 if ( $ibforums->vars['db_topic_read_cutoff'] and $ibforums->input['view'] != 'getnewpost' )

 	 {

    $DB->cache_add_query( 'topics_replace_topic_read', array( 'tid' => $this->topic['tid'], 'mid' => $ibforums->member['id'], 'date' => time() ) );

    $DB->cache_shutdown_exec();

 	 }
suchen und unmittelbar danach folgendes einfügen
       //-----------------------------------------

       // Should the forum marked as read too?

       //-----------------------------------------

       

 	 $DB->simple_construct( array ( 'select' => '*', 'from' => 'topics', 'where' => 'forum_id = '.$this->topic['forum_id'] ) );

 	 $DB->simple_exec();

 	 

 	 while ($row = $DB->fetch_row()) 

 	 {

    $c_topics[$row['tid']] = $row;

 	 }

 	 

 	 $DB->simple_construct( array ( 'select' => '*', 'from' => 'topics_read', 'where' => 'read_mid = '.$ibforums->member['id'] ) );

 	 $DB->simple_exec();

 	 

 	 while ($row = $DB->fetch_row()) 

 	 {

    $c_read_topics[$row['read_tid']] = $row['read_date'];

 	 }

 	 

 	 $c_unread = 0;

 	 

 	 foreach ($c_topics as $tid => $row)

 	 {

    if ($row['last_post'] > $c_read_topics[ $tid ] && $tid != $this->topic['tid'])

    {

   	 $c_unread++;

   	 break;

    }

 	 }

 	 

 	 if ( ! $c_unread ) 

 	 {

    $ibforums->forum_read[ $this->topic['forum_id'] ] = time();


    $std->hdl_forum_read_cookie('set');

 	 }

Viele Dank noch einmal an Coldforce der sich dafür die Zeit genommen hat :)

greetz arc

Share this post


Link to post

Kurze Frage: Ist dies auch bei 1.3 möglich ;)?

Greetz

Frog

möglich sicher, aber fraglich ob mit diesem code..

ich weiß nicht in welchen zügen sich solche elementaren funktionen bzw die read-topic-verarbeitung in der neuen version geändert haben.

Edited by |ArCtoZz|

Share this post


Link to post
Sign in to follow this  

×