Jump to content

Define Member Object


Wayne B

Recommended Posts

Hi

In custom blocks in IP Content I want to use the $member object in an if statement but the $member object is not currently defined in that block so if gives a fatal error.

How could I define the member object to be available in all custom blocks?

Thanks

Link to comment
Share on other sites

Just bumping this to see if anyone can help - whatever I try in the block code it appear that the $member object fails each time.

​.

In PHP it is something like this ..

You can edit a little to fit in that block ..  or use the {{ }} in a way ..

 

<?php
$member = \IPS\Member::loggedIn();
$memName = $member->name;
$memEmail = $member->email;
$memID = $member->member_id;

 

 

.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...