How to allow user of Wordpress to access his own events only

Discuss everything related to ApPHP Calendar. All versions. Any questions related to the ApPHP Calendar developing or using should be posted to this forum.

Moderator: alexandrleonenko

codewriter
Newbie
Newbie
Posts: 6
Joined: Jul 12th, '20, 09:02

How to allow user of Wordpress to access his own events only

Postby codewriter » Aug 4th, '20, 10:45

To allow user to access his own events only, you have to set user ID:

Code: Select all

// where UID - is user ID in your system.
$user_id = UID;
$objCalendar->SetUserID($user_id);

In Wordpressit it's possible to set the user ID variable using the function like

Code: Select all

 = get_current_user_id();

But this code don't work

Code: Select all

    $user_id = get_current_user_id();
    $objCalendar->SetUserID($user_id);

And this code don't work too

Code: Select all

    $user_id = 105;
    $objCalendar->SetUserID($user_id);

In both cases the calendar is not displayed

administrator
Site Admin
Site Admin
Posts: 6180
Joined: Jan 7th, '09, 23:18
Contact:

Re: How to allow user of Wordpress to access his own events only

Postby administrator » Aug 7th, '20, 08:02

What do you mean "is not displayed"?
Turn on debug mode in calendar, what do you see?

codewriter
Newbie
Newbie
Posts: 6
Joined: Jul 12th, '20, 09:02

Re: How to allow user of Wordpress to access his own events only

Postby codewriter » Aug 7th, '20, 13:31

administrator wrote:What do you mean "is not displayed"?
Turn on debug mode in calendar, what do you see?

"not displayed" - it's means an empty space
Debug mode in calendar is turn on. I see an empty space instead of a calendar

administrator
Site Admin
Site Admin
Posts: 6180
Joined: Jan 7th, '09, 23:18
Contact:

Re: How to allow user of Wordpress to access his own events only

Postby administrator » Aug 14th, '20, 19:59

Use a simple way, called "echo debug":
https://stackoverflow.com/questions/112 ... ebug-echos

Check if your calendar script is called at all


Return to “ApPHP Calendar”