like_visible still being set to 0 > Invisionize.eu - IP.Board (IPB) News
Kanał Rss Kanał Rss
Kanał Atom Kanał Atom

like_visible still being set to 0

wersja drukowalna wersja Microsoft Word wersja HTML

Found a second cause of this.. If you like a topic.. Then a spammer comes along and posts in that topic.. That spammer is flagged as a spammer, AND the "Flag as spammer" options are set to unapprove their posts.. It knocks everyone's like_visible to 0 on the topic.

Basically, it seems that once you get into the modLibrary, into toggleApproveMemberContent, if you have both set..

        if ( $topicFind )
        {
            $this->DB->build( array( 'select' => $this->DB->buildDistinct( 'forum_id' ) . ',tid',
                                       'from'   => 'topics',
                                     'where'  => $topicFind ) );
            $this->DB->execute();
           
            while( $row = $this->DB->fetch() )
            {
                $forumIDs[ $row['forum_id'] ]    = $row['forum_id'];
                $topicIDs[ $row['tid'] ]        = $row['tid'];
            }
        }
       
        if ( $postFind )
        {
            $this->DB->build( array( 'select'   => $this->DB->buildDistinct( 't.forum_id' ) . ',t.tid',
                                       'from'	 => array( 'posts' => 'p' ),
                                     'where'    => $postFind,
                                     'add_join' => array( array( 'select' => '',
                                                                 'from'   => array( 'topics' => 't' ),
                                                                 'where'  => 'p.topic_id=t.tid' ) ) ) );
            $this->DB->execute();
           
            while( $row = $this->DB->fetch() )
            {
                $forumIDs[ $row['forum_id'] ]    = $row['forum_id'];
                $topicIDs[ $row['tid'] ]        = $row['tid'];
            }
        }
       
        //-----------------------------------------
        // Run...
        //-----------------------------------------
       
        if ( $topicFind AND count($topicIDs) )
        {
            $this->DB->update( 'topics', array( 'approved' => ( $approve === TRUE ) ? 1 : 0 ), $topicFind );
           
            /* Tagging */
            $this->registry->tags->updateVisibilityByMetaId( $topicFind, ( $approve === TRUE ? 1 : 0 ) );
           
            /* Likes */
            require_once( IPS_ROOT_PATH . 'sources/classes/like/composite.php' );/*noLibHook*/
            $_like    = classes_like::bootstrap( 'forums', 'topics' );
            $_like->toggleVisibility( $topicIDs, $approve );
        }

You have a $topicFind and a $postFind set.. And both are pulling the forum and topic IDs.

Best I can tell.. This

		    while( $row = $this->DB->fetch() )
		    {
			    $forumIDs[ $row['forum_id'] ]    = $row['forum_id'];
			    $topicIDs[ $row['tid'] ]	    = $row['tid'];
		    }

Doesn't need to be there on $postFind, and is causing the problem. Agreed that the visibility should be 0 on topics that the spammer started.. however.. It shouldn't be on topics that they participated in.

pon, 20 luty 2012

Komentarze:

Brak komentarzy

Imię/Nick:

Adres email:

Strona WWW:

Treść Komentarza: