if logged in: show this and that in frontend

snark

solved it ...


I made two droplets one called "downloadcountstart"   the other one called "downloadcountend"

global $database, $wb;
if ($wb->is_authenticated() ) {                   
return 'downloads: ';
}
else {
return '<!--';
}


global $database, $wb;
if ($wb->is_authenticated() ) {                   
return '|';
}
else {
return '-->';
}




after that I made a change to the loop in the downloadmodule settings-tab

I changed "downloads: [DL] |" to: "[[downloadcountstart]] [DL] [[downloadcountend]]"


this way it only is shown to a user that is logged in, for all regular visitors it is not shown


Stefek

Have you considered to hide this part with CSS?

Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

snark

yeah, but now I have to put it into the loop of the downloadmodule ...

I guess it has to be a droplet because I cannot put php code into the loop


Stefek

Try this:


<?php
// check if user is logged in
  
if ($wb->is_authenticated()){
    
$groups $wb->get_groups_name();
    
//check if user is part of _Usergroupname_
    
if(in_array('_Usergroupname_'$groups)) {
        
        echo 
"I'm logged in, and I am member of group _Usergroupname_";
       
    }else{
        
        echo 
""//nothing
        
    
}
  }


should work.

Let me know.

Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

snark

is there a way to hide certain things on the fronend and only show them when a user is logged in

eason:

I want to hide the downloadcounts from the download module but make em visible to the logged in user(s)