How to extract active users from template

Author Message

christian bencivenni

Wednesday 18 April 2007 1:14:28 am

Hi.
I have the need to extract in a template the list of active users (the users who complete the registration clicking on the email link).
I'm serching through documentation to finde something but it seems that there isn't anyway to extract this kind of information by a template fetch.
is it correct?
Any suggestions?

Egil Fujikawa Nes

Wednesday 18 April 2007 10:02:00 am

Hi Christian,

I needed a function like that for some time ago, what I ended up with were a loop trough the whole usergroup where my users are located (node 162). This is a bad way to write template code, but at that time I couldn't find any other possibilities.

My code looks like this:

{def $allusers=fetch( 'content', 'list', hash( 'parent_node_id', 162, 'depth', 1 ) )}
{section var=user loop=$allusers}		
     {if $user.object.data_map.user_account.content.is_enabled}			
         User enabled					
    {else}			
        User not enabled			
    {/if}			
{/section}

Hope this will help you :)

BuildCMS - Av. Paulista 777, 15° Andar - CEP: 01311-100 - São Paulo
URL: http://www.buildcms.com

christian bencivenni

Friday 20 April 2007 10:19:21 pm

It works perfectly.
Thank you a lot.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:32:53
Script start
Timing: Jan 18 2025 19:32:53
Module start 'layout'
Timing: Jan 18 2025 19:32:53
Module start 'content'
Timing: Jan 18 2025 19:32:53
Module end 'content'
Timing: Jan 18 2025 19:32:53
Script end

Main resources:

Total runtime0.0193 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.0469152.6406
Module start 'layout' 0.00510.0043 740.687539.4766
Module start 'content' 0.00950.0077 780.164189.4922
Module end 'content' 0.01710.0022 869.656330.3047
Script end 0.0193  899.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002613.2175140.0002
Check MTime0.00115.7281140.0001
Mysql Total
Database connection0.00084.198410.0008
Mysqli_queries0.003618.458730.0012
Looping result0.00000.139310.0000
Template Total0.00178.810.0017
Template load0.00094.782610.0009
Template processing0.00083.960510.0008
Override
Cache load0.00073.453810.0007
General
dbfile0.00031.429980.0000
String conversion0.00000.056740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs