Related Records Field: Current User?

5 posts by 2 authors in: Forums > CMS Builder
Last Post: May 24, 2011   (RSS)

Re: [Perchpole] Related Records Field: Current User?

By zip222 - May 24, 2011

I know when using the membership plugin, that variable is...
$CURRENT_USER['num']

Re: [zip222] Related Records Field: Current User?

By Perchpole - May 24, 2011

Hi, zip222 -

I thought the same - but I also assumed I should be able to define the current user without first needing to install the membership plugin...

I hoped my call could be made to work without it.

:0/

Perch

Re: [Perchpole] Related Records Field: Current User?

By zip222 - May 24, 2011

Are you trying to do this within the CMS? or on the public site? I have used this variable with the CMS without enabling the membership plugin. Here is a snippet of the code

$where="WHERE num='".$CURRENT_USER['num']."'";

Re: [zip222] Related Records Field: Current User?

By Perchpole - May 24, 2011

Hi, Zip222 -

The code I came up with is this...

createdByUserNum=<?php echo htmlspecialchars(@$CURRENT_USER['num']) ?>

It seems to do what I want!

:0)

Perch