Jump to content

Who Read This Topic


-RAW-
 Share

Recommended Posts

  • 2 months later...
  • 4 months later...
  • 5 months later...

donno how you've coded the name display merging but you might consider using php's implode() function, to make it display better, simply add the names to an array and then do

$displaynamestring = implode($NameSeperatorTag, $NameArray);

and then just return the displaynamestring and it'll never show any Separator tag after the last name.

http://www.php.net/manual/en/function.implode.php

Say you have choosen | to separate the names and you have 4 names then it'll make them show like this:

name1 | name2 | name3 | name4

Link to comment
Share on other sites

Just had a look at your code and see you're not doing the member names in the backend of the hook (in the php file) so instead in the template Topic View > hook_who_read_topic

change:

<if test="is_array( $mem ) && count( $mem )">
<foreach loop="$mem as $p => $r">
<a href='{parse url="showuser={$r['member_id']}" template="showuser" seotitle="{$r['members_seo_name']}" base="public"}' title='{$this->lang->words['who_read_topic_last_viewed']} {$this->lang->getDate( $r['read_date'], 'LONG' )}'>{$this->caches['group_cache'][ $r['member_group_id'] ]['prefix']}{$r['members_display_name']}{$this->caches['group_cache'][ $r['member_group_id'] ]['suffix']}</a>{parse template="user_popup" group="global" params="$r['member_id'], $r['members_seo_name']"}{$this->settings['wvT_sep']}
</foreach></if>

into:

<if test="is_array( $mem ) && count( $mem )">
<foreach loop="$mem as $p => $r">
	<if test="$p === count( $mem )-1">
		<a href='{parse url="showuser={$r['member_id']}" template="showuser" seotitle="{$r['members_seo_name']}" base="public"}' title='{$this->lang->words['who_read_topic_last_viewed']} {$this->lang->getDate( $r['read_date'], 'LONG' )}'>{$this->caches['group_cache'][ $r['member_group_id'] ]['prefix']}{$r['members_display_name']}{$this->caches['group_cache'][ $r['member_group_id'] ]['suffix']}</a>{parse template="user_popup" group="global" params="$r['member_id'], $r['members_seo_name']"}
	<else />
		<a href='{parse url="showuser={$r['member_id']}" template="showuser" seotitle="{$r['members_seo_name']}" base="public"}' title='{$this->lang->words['who_read_topic_last_viewed']} {$this->lang->getDate( $r['read_date'], 'LONG' )}'>{$this->caches['group_cache'][ $r['member_group_id'] ]['prefix']}{$r['members_display_name']}{$this->caches['group_cache'][ $r['member_group_id'] ]['suffix']}</a>{parse template="user_popup" group="global" params="$r['member_id'], $r['members_seo_name']"}{$this->settings['wvT_sep']}
	</if>
</foreach></if>

Oh btw. Tschieny it wasn't a solution to your issue it was just a suggestion to the mod auther to get rid of the separator after the very last name.

Link to comment
Share on other sites

Here's the solution to making it show all the names, in the xml find:

                    while( $r = $this->DB->fetch() )
                    {            
                       $mem[] = $r;
 
                       if (in_array( $this->memberData['member_group_id'], explode(',', $this->settings['wvT_g']) ))
                       {
                           $output2 =  $this->registry->output->getTemplate('topic')->hook_who_read_topic($mem,$count);   
                       }                           
                    }

replace with:

                    while( $r = $this->DB->fetch() )
                    {
                        $mem[] = $r;
                    }
                    if (in_array( $this->memberData['member_group_id'], explode(',', $this->settings['wvT_g']) ))
                    {
                        $output2 =  $this->registry->output->getTemplate('topic')->hook_who_read_topic($mem,$count);
                    }

Find:

                  while( $r = $this->DB->fetch() )
	              {
	                  $r	 = IPSMember::buildProfilePhoto( $r );
                      $mem[] = $r;

                      if (in_array( $this->memberData['member_group_id'], explode(',', $this->settings['wvT_g']) ))
					  {                      
                          $output2 =  $this->registry->output->getTemplate('topic')->hook_who_read_topic_new($mem,$count);  
                      }						  
                  }

Replace with:

					while( $r = $this->DB->fetch() )
					{
						$r	 = IPSMember::buildProfilePhoto( $r );
						$mem[] = $r;
					}
					if (in_array( $this->memberData['member_group_id'], explode(',', $this->settings['wvT_g']) ))
					{
						$output2 =  $this->registry->output->getTemplate('topic')->hook_who_read_topic_new($mem,$count);
					}

Then re-import the xml file and everything should be fine. Or if you want it the easy way here's the edited hook file, with the fix above and the template edit I posted earlier too!

hook.xml

Link to comment
Share on other sites

  • 7 months later...
  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...