PeoplePods Objects
PeoplePods is an object-oriented framework - all one must do to access the entire power of PeoplePods is include the PeoplePods library file into a PHP script and boot up a PeoplePod object.
require_once("peoplepods/PeoplePods.php");
$POD = new PeoplePod($params);
In almost all cases, the constructor will take one or more parameters. These parameters tell PeoplePods about the identity of the current "acting" user and what sort of permission is required to view the content offered by $POD.
| authSecret |
An encrypted string that identifies a single user in the database. Typically, this will be kept in a cookie named 'pp_auth' If a valid authSecret is passed in, $POD->isAuthenticated() will return true, and $POD->currentUser() will return a Person Object that represents, you may have guessed, the current user. |
| lockdown |
Tells PeoplePods who can access the page. The authentication status of the current user, should there be one, will be evaluated against the specified test. If the test fails, the user will be redirected to the appropriate page. Valid values for this parameter are: login - a valid user was passed into the authSecret parameter. verified - a valid user was passed into the authSecret parameter, and that user has verified the email address attached to the account. adminUser - a valid user was passed into the authSecret parameter, and the adminUser flag has been added to the account. |
|
debug |
Tells PeoplePods to turn on debug messaging. Debug messages appear in the normal web error_log. Valid values are: 0 - no debug messages 1 - trace debug messages. functions will announce what they are doing. 2 - sql debug messages. all sql statements that are executed will be logged. |
Errors
If an error occurs during the creation of a PeoplePods object, $POD->success() will return false. The last error message can be found by accessing $POD->error(). An error code may also be generated, which can be found by accessing $POD->errorCode().
101 - unable to connect to db
100 - PeoplePods can't find its configuration
These errors represent a catastrophic failure of PeoplePods to start, and the resulting $POD object will be essentially non-functioning.
Examples:
To create an authenticated PeoplePods object, include the following code. Note that if the cookie is not set, the PeoplePod will be unauthenticated, but will otherwise be completely functional. This represent the "logged out" state.
require_once("peoplepods/PeoplePods.php");
$POD = new PeoplePod(array(
'authSecret'=>$_COOKIE['pp_auth']
));
To create a page that requires a user to be logged in, include the following code. Note that if the cookie is not set, the page will halt execution and redirect to the default PeoplePods login page.
require_once("peoplepods/PeoplePods.php");
$POD = new PeoplePod(array(
'authSecret'=>$_COOKIE['pp_auth'],
'lockdown'=>'login'
));
More about this function and it's related functions:
- $POD->currentUser()
- $POD->getPerson()
- $POD->getPeople()
- $POD->changeActor()
- $POD->getContent()
- $POD->getContents()
- $POD->getGroup()
- $POD->getGroups()
- $POD->getComment()
- $POD->getComments()
- $POD->header()
- $POD->footer()
- $POD->output()
- $POD->siteName()
- $POD->siteRoot()
- $POD->podRoot()
- $POD->currentTheme()
- $POD->templateDir()
- $POD->getFiles()
- $POD->getFile()
Download the latest version of PeoplePods!
0.7
Latest Version:
Release Notes
Recent Posts from Our Blog
Version 0.7 Now Available
Last night, I uploaded a new release of PeoplePods: version 0.7. The most exciting new features in this version are: new dynamic image resizing options, a faster comment polling system, new ways...
Developer Preview Launch!
I am very excited to announce the launch of PeoplePods version 0.666, THE DEVELOPER PREVIEW! After tons of hacking, I have tweaked the last line of code, and I am finally ready for a wider audience...
Recently Updated Documentation
Recent Posts from The Forum
When the stable version will be realesed?
0 comments | 42 days ago
Can I help anyone with anything specific?
5 comments | 88 days ago
What I'm working on:
6 comments | 88 days ago
Have you downloaded 0.7? Questions? Comments? Problems?
7 comments | 97 days ago
Why do I get this Error when I try to do the People Search on my PeoplePods installation?
2 comments | 97 days ago


No comments have been posted yet.