Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted January 1, 20178 yr Does anyone know how I could create a recent members or visitors block that shows just the user profile photo in 4.1+? I had something in version 3 like: <php> $stats = $this->cache->getCache('stats'); </php> <ul class='ipsList_withminiphoto'> {parse striping="feed_striping"} <foreach loop="$records as $record"> <if test="$this->registry->output->skin['set_key']=='mobile'"> <if test="$record['member_id']"><a href='{parse url="showuser={$record['member_id']}" seotitle="{$record['members_seo_name']}" template="showuser" base="public"}' title='{$record['members_seo_name']}'> </if><img src='{$record['pp_mini_photo']}' alt="{parse expression="sprintf($this->lang->words['users_photo'],$record['members_display_name'])"}" class='ccsUserPhoto2 ccsUserPhoto_medium'/><if test="$record['member_id']"></a></if> <else /> <if test="$record['member_id']"><a href='{parse url="showuser={$record['member_id']}" seotitle="{$record['members_seo_name']}" template="showuser" base="public"}' title='{$record['members_seo_name']}'> </if><img src='{$record['pp_thumb_photo']}' alt="{parse expression="sprintf($this->lang->words['users_photo'],$record['members_display_name'])"}" class='ccsUserPhoto2 ccsUserPhoto_large'/><if test="$record['member_id']"></a></if> </if> </foreach> </ul> The output was very simple and just showed the last logged in members left to right. I don't see anything with the current feeds available when building blocks.
January 5, 20178 yr There's no block in IPS vanilla that includes the user avatar in the online member list. But ... Good news there's a Marketplace file Profile Photo in Online Lists by @Adriano Faria
January 16, 20178 yr Author I just took a look at the recent member block template and if I create a custom block and use the member feed, I can achieve this but need to switch the member display name to profile photo. <h3 class='ipsType_reset ipsWidget_title'> {$title} </h3> {{if $display === 'csv'}} <div class='ipsWidget_inner {{if $orientation == 'vertical'}}ipsPad{{else}}ipsPad_half{{endif}}'> {{if count( $members )}} <ul class='ipsList_inline ipsList_csv ipsList_noSpacing'> {{foreach $members as $row}} <li>{template="userLinkFromData" group="global" app="core" params="$row->member_id, $row->name, $row->members_seo_name, $row->member_group_id"}</li> {{endforeach}} </ul> {{else}} <p class='ipsType_reset ipsType_medium ipsType_light'>{lang="widget_members_no_results"}</p> {{endif}} </div> {{else}} <div class='ipsWidget_inner {{if $orientation == 'vertical'}}ipsPad{{else}}ipsPad_half{{endif}}'> {{if count( $members ) }} <ul class='ipsList_reset'> {{foreach $members as $member}} <li class='ipsPhotoPanel ipsPhotoPanel_tiny cAnnouncement'> {template="userPhoto" group="global" app="core" params="$member, 'tiny'"} <div> <h4 class='ipsType_large ipsType_reset'>{$member->link()|raw} <a href='{url="app=core&module=members&controller=profile&id={$member->member_id}&do=reputation" seoTemplate="profile_reputation" seoTitle="$member->members_seo_name"}' class='ipsPos_right ipsRepBadge {{if $member->pp_reputation_points > 0}}ipsRepBadge_positive{{elseif $member->pp_reputation_points < 0}}ipsRepBadge_negative{{else}}ipsRepBadge_neutral{{endif}}'><i class='fa {{if $member->pp_reputation_points > 0}}fa-plus-circle{{elseif $member->pp_reputation_points < 0}}fa-minus-circle{{else}}fa-circle-o{{endif}}'></i> {number="$member->pp_reputation_points"}</a></h4> {$member->groupName|raw} <br> <span class='ipsType_light ipsType_small'>{lang="widget_member_joined_date" htmlsprintf="$member->joined->html()"}</span> {{if $member->last_activity}} <br><span class='ipsType_light ipsType_small'>{lang="widget_member_last_active_date" htmlsprintf="\IPS\DateTime::ts( $member->last_activity )->html()"}</span> {{endif}} </div> </li> {{endforeach}} </ul> {{else}} <p class='ipsType_reset'>{lang="widget_members_no_results"}</p> {{endif}} </div> {{endif}}
January 16, 20178 yr Untested in this specific template, but something like: {template="userPhoto" group="global" app="core" params="$row->member_id, 'tiny'"}
Archived
This topic is now archived and is closed to further replies.