Various modifications for phpBB3Show a 'Topic Subscribers' list in viewtopic

Snippets for phpBB3
Previous topicNext topic
User avatar

Topic Author
dmzx
Founder
Founder
Status: Offline
User theme: Dark
Posts: 6222
Joined: Jan 13th, '14, 20:45
    unknown unknown

Show a 'Topic Subscribers' list in viewtopic

Post by dmzx »

Show a 'Topic Subscribers' list in viewtopic

Open /viewtopic.php and find:
Find This may be a partial find and not the whole line

Code: Select all

 // Update topic view and if necessary attachment view counters ... but only for humans and if this is the first 'page view'

Add before Add these lines on a new blank line before the preceding line(s) to find

Code: Select all

/*** 2014-03-17 BEGIN AmigoJack
        http://www.phpbb.com/community/viewtopic.php?t=2232626 ***/
    $sql= 'SELECT u.user_id, u.username, u.user_colour
        FROM '. TOPICS_WATCH_TABLE. ' tw
        INNER JOIN '. USERS_TABLE. ' u ON tw.user_id= u.user_id
        WHERE tw.topic_id= '. $topic_id. '
        ORDER BY u.username_clean';
    $hResult= $db-> sql_query( $sql );
    while( $aRow= $db-> sql_fetchrow( $hResult ) ) {
        $template-> assign_block_vars
        ( 'subscribers'
        , array
            (    'NAME'=> get_username_string( 'no_profile', $aRow['user_id'], $aRow['username'], $aRow['user_colour'] )
            , 'U_PROFILE'=> append_sid( "{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=". $aRow['user_id'] )
            )
        );
    }
    $db-> sql_freeresult( $hResult );
    /*** 2014-03-17 END ***/
Open /styles/*/template/viewtopic_body.html and find:
Find This may be a partial find and not the whole line

Code: Select all

<!-- IF S_DISPLAY_ONLINE_LIST -->
Add after Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

<!-- IF .subscribers -->
       <h3><a name="subscribers">{L_SUBSCRIBERS}</a></h3>
       <p><!-- BEGIN subscribers --><!-- IF not subscribers.S_FIRST_ROW --> &bull; <!-- ENDIF --> <a href="{subscribers.U_PROFILE}">{subscribers.NAME}</a><!-- END subscribers --></p>
    <!-- ENDIF -->
Open /language/*/viewtopic.php and find:
Find This may be a partial find and not the whole line

Code: Select all

));
Add after Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

/*** 2014-03-17 BEGIN AmigoJack
            http://www.phpbb.com/community/viewtopic.php?t=2232626 ***/
        'SUBSCRIBERS'=> 'Subscribers',
        /*** 2014-03-17 END ***/
I left the credit line in the code as it's from phpbb.com
User avatar

Midway
Translators
Translators
Status: Offline
User theme: Dark
Posts: 115
Joined: Dec 8th, '14, 09:27
    Windows 7 Firefox

Re: Show a 'Topic Subscribers' list in viewtopic

Post by Midway »

Open /language/fr/viewtopic.php and find:

Find This may be a partial find and not the whole line

Code: Select all

));

Add before Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

/*** 2014-03-17 BEGIN AmigoJack
            http://www.phpbb.com/community/viewtopic.php?t=2232626 ***/
        'SUBSCRIBERS'=> 'Membres qui surveille le sujet',
        /*** 2014-03-17 END ***/
Note: If you add after you have white page, I add the French language
User avatar

Topic Author
dmzx
Founder
Founder
Status: Offline
User theme: Dark
Posts: 6222
Joined: Jan 13th, '14, 20:45
    Windows 8 Firefox

Re: Show a 'Topic Subscribers' list in viewtopic

Post by dmzx »

Cerrone wrote:Open /language/fr/viewtopic.php and find:

Find This may be a partial find and not the whole line

Code: Select all

));

Add before Add these lines on a new blank line after the preceding line(s) to find

Code: Select all

/*** 2014-03-17 BEGIN AmigoJack
            http://www.phpbb.com/community/viewtopic.php?t=2232626 ***/
        'SUBSCRIBERS'=> 'Membres qui surveille le sujet',
        /*** 2014-03-17 END ***/
Note: If you add after you have white page, I add the French language
:thumbup:
Previous topicNext topic