Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

Przeróbka widoku hooka Secondary Groups Indicator 4.0.0


AndzioK
Przejdź do rozwiązania Rozwiązane przez aXen,

Rekomendowane odpowiedzi

Witam, prosił bym o przerobienie tego hooka: Secondary Groups Indicator 4.0.0 (http://forum.invisionize.pl/files/file/538-sos32-secondary-groups-indicator/)

Tak aby w temacie nie było napisu Inne grupy: tylko żeby była jedna pod drugą. Oraz prosił bym co zostało zmienione, bo chciał bym się nauczyć.

Pozdrawiam

Odnośnik do komentarza
Udostępnij na innych stronach

  • Manager

Szukasz i usuwasz:

<span class='row_title'>{$this->lang->words['others']}</span>

A potem importujesz ponownie.

  • Lubię to 1

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Odnośnik do komentarza
Udostępnij na innych stronach

public function userInfoPane( $author, $contentid, $options )
    {
        if ( !$this->settings['sos32_othersgroups_on'] )
        {
            return parent::userInfoPane( $author, $contentid, $options );
        }

        $grupos = array();
       
          if ( $author['mgroup_others'] )
          {
            $grupos = explode( ",", IPSText::cleanPermString( $author['mgroup_others'] ) );

            $grupo = ipsRegistry::cache()->getCache( 'group_cache' );
            
            foreach ( $grupos as $sec_group )
            {
                if ( !in_array( $sec_group, explode( ',', $this->settings['sos32_othersgroups_grupos'] ) ) )
                {
                    if ( $sec_group != $author['member_group_id'] )
                    {
                        $g_others[] = $grupo[ $sec_group ]['prefix'].$grupo[ $sec_group ]['g_title'].$grupo[ $sec_group ]['suffix'];
                    }
                }
            }
            
            if ( count( $g_others ) )
            {
                $author['other_groups'] = implode( ", ", $g_others );
            }
        }

        if ( count( $g_others ) )
        {
            $this->registry->class_localization->loadLanguageFile( array( 'public_global' ), 'core' );
            
            $text1 = "<br>";
        
            $author['_group_formatted'] .= $text1.$author['other_groups'];
        }
        
        return parent::userInfoPane( $author, $contentid, $options );
    }   

 

Zrobiłem tak, tylko że zamiast następną grupę dodawać pod spód to daje obok oraz dodaje też przecinek.

Odnośnik do komentarza
Udostępnij na innych stronach

  • Rozwiązanie
public function userInfoPane( $author, $contentid, $options )
    {
        if ( !$this->settings['sos32_othersgroups_on'] )
        {
            return parent::userInfoPane( $author, $contentid, $options );
        }
 
        $grupos = array();
       
          if ( $author['mgroup_others'] )
          {
            $grupos = explode( ",", IPSText::cleanPermString( $author['mgroup_others'] ) );
 
            $grupo = ipsRegistry::cache()->getCache( 'group_cache' );
            
            foreach ( $grupos as $sec_group )
            {
                if ( !in_array( $sec_group, explode( ',', $this->settings['sos32_othersgroups_grupos'] ) ) )
                {
                    if ( $sec_group != $author['member_group_id'] )
                    {
                        $g_others[] = $grupo[ $sec_group ]['prefix'].$grupo[ $sec_group ]['g_title'].$grupo[ $sec_group ]['suffix'];
                    }
                }
            }
            
            if ( count( $g_others ) )
            {
                $author['other_groups'] = implode( "<br>", $g_others );
            }
        }
 
        if ( count( $g_others ) )
        {
            $this->registry->class_localization->loadLanguageFile( array( 'public_global' ), 'core' );
            
            $text1 = "<br>";
        
            $author['_group_formatted'] .= $text1.$author['other_groups'];
        }
        
        return parent::userInfoPane( $author, $contentid, $options );
    }

 

Ja przerobiłem kod kolegi wyżej na ten co chciałeś.

 

Zmieniłem kod z:

$author['other_groups'] = implode( ", ", $g_others );

 

Na:

$author['other_groups'] = implode( "<br>", $g_others );
  • Lubię to 1

See me on GitHub or aXenDev.net!

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.