Pop Up based on Username

Permalink
Hi all!

I am wanting to have a popup that pops up only for those who are not signed into my site. It would let them know that there are more features accessible if they sign up. I am assuming that I would need to use some code like this to get the username.
<?php
$u = new User();  
$username = $u->getUserName();
?>

What would be the best way to do this? Thanks in advance!!!

Blenderite
 
shahroq replied on at Permalink Reply
shahroq
you should just check if visitor is logged in visitor or not, and then load modal or something to notify him.
$u = new User();
if($u->isLoggedIn()) {
  //open an modal:
  //....
}
?>
JohntheFish replied on at Permalink Reply
JohntheFish