Forum Discussion

LainieH's avatar
LainieH
Expert
10 years ago

Custom Welcome New Member Widget and SSO

Would you happen to know if it is possible to remove abandoned users from our "welcome new members" and "registered users" widgets?

 

As you can see in this image, we are collecting users who are not "really registered" in this custom widget. The user below circled does is someone who got to the registration screen and abandoned it. See code for this custom content widget to see if there is anything I can tweak. What I am wanting is to not display them in this widget AND not count them in our "member statistics" that we have in our top have (similar to what Lithium does).

 

We have SSO so we understand these folks are people who abandoned regist. But we do not want them to show as "new members.". (these people are not showing in our "who is online" custom component).

 

 

 

Code for this widget:

<#assign users = restadmin("/users/registered?page_size=14").users />

<#if users.user?has_content>
<div class="users-online-wrapper">
	<div class="inner">
		<h2>Please Welcome our Newest Community Members</h2>
		<#assign totalUsers = restadmin("/users/count").value />
		<#assign totalUsersOnlineWithAnon = restadmin("/users/online/count").value?number />
		<#assign totalUsersWithoutAnon = restadmin("/users/online") />
		<#assign guestUsers = totalUsersOnlineWithAnon - (totalUsersWithoutAnon.users.user?size) />
                <#assign totalMembersOnline = rest("/users/online/registered/count").value />
		<#assign totalGuestsOnline = rest("/users/online/anonymous/count").value />				
		<ul class="user-online-list">
		<#assign thisRow = 1>
		<#list users.user as onlineUser>
			<#assign avatar = rest(onlineUser.@href+"/profiles/avatar/size/message").image /> 
			<li class="user-${thisRow}">
				<a href="${onlineUser.@view_href}"><img src="${avatar.url}" title="${onlineUser.login}"><br /><span class="userlogin">${onlineUser.login}</span></a>
				
			</li>
<#if thisRow == 7>
				<div class="clearboth"></div>
			</#if>
			
			<#assign thisRow = thisRow + 1>
		</#list> 
		<div class="clearboth"></div>
		</ul>
		<a href="/t5/forums/usersonlinepage" class="more-link capsLock">View All Members Online</a>
	</div>
</div>
</#if>

 

 

This widget is also mistakeningly counting "members" who are abandoned:

and here is that code:

<div class="lia-component-community-statistics">  
<div class="short-container">
	<div class="short">
		<div class="inner">
		<p>MEMBERS</p>
		<#assign members_count = restadmin("/users/count").value?number />
		<h2>${members_count?string(",##0")}</h2>
		</div>
	</div>
	<div class="short">
		<div class="inner">
		<p>ONLINE</p>
		<#assign online_count = restadmin("/users/online/registered/count").value?number />		
		<h2>${online_count?string(",##0")}</h2>
		</div>
	</div>
	<div class="short last">
		<div class="inner">
		<p>POSTS</p>
		<#assign posts_count = restadmin("/posts/count").value?number />
		<h2>${posts_count?string(",##0")}</h2>
		</div>
	</div>
</div>
<div class="clearboth"></div>
</div>

 

Thank you very much for any assistance. I very much want to learn this formally and plan to take some advanced studio training.

 

Lainie

 

cc: cjdinger

  • Hi LainieH - yes they do, more information in the PDF I linked above. Kind Regards,

  • LainieH - You concern is valid and could have been resolved by LiQL. If you go to this article and look for the registration status, there are 3 types of users, Anonymous, Partially_registered and Fully_registered. You are looking for the Fully registered users. Unfortunately the LiQL doesn't allow you to query on this constraint to pull out only the fully registered users alone. There is an idea already posted for this to use anything as constraint, please add your support to this.

     

    As of now, there could be a workaround for your first case where you want to display the fully registered users but would not be effiecient. You could query a bunch of users and filter the fully registered ones, but as I mentioned, that would not be an efficient way because you might end up calling first 100 or 200 users and still not sure if 14 of those would be fully registered ones or not.

    • PaoloT's avatar
      PaoloT
      Lithium Alumni (Retired)

      Hi LainieH

       

      for the counts - you can look at pulling the metrics

      http://community/restapi/vc/metrics/name/completed_registrations

      See this KB as well for more info. Hope it helps!

      • LainieH's avatar
        LainieH
        Expert

        Thank you both very much for these replies -

        Would you know PaoloT if completed_registrations excludes the "abandoned" ones. I'm assuming so.