$Obj->addFlag()
$Obj->addFlag($flag,$person,$value=true);
Causes $person to add a flag named $flag to $Obj, with an optional value of $value. If no value is specified, it defaults to true.
To be clear, $person is the person object who is adding the flag. This is important to remember when adding flags to other person objects. The VAST majority of the time, the second parameter should be $POD->currentUser()
Some examples:
// flag a document as 'awesome'
$content->addFlag('awesome',$POD->currentUser());
// set a rating of 5 on a document
$content->addFlag('rating',$POD->currentUser(),5);
// set a 'block' flag on a person
$person->addFlag('block',$POD->currentUser());
Once a flag has been added, it can be referenced in your stack parameters:
// load all content with the awesome flag $awesome = $POD->getContents(array( 'flag.name'=>'awesome' )); // load all content with a rating of 5 $top_rated = $POD->getContents(array( 'flag.name'=>'rating', 'flag.value'=>'5' )); // load all people with the block flag $blocked = $POD->getPeople(array( 'flag.name'=>'block' ));
At this point, you can only refer to one flag at a time in your stack parameters. In some future version of PeoplePods, this may change.
Several flag names are reserved by PeoplePods for use in pre-defined stacks: friend, favorite, watching, and vote. You can use any other flag name to define your own functionality.
Download the latest version of PeoplePods!
0.9
Latest Version:
Release Notes
Recent Posts from Our Blog
Version 0.9 is here!
The latest version of PeoplePods is now available for download! This version features a drastically revamped theme which is now valid HTML5, a completely rewritten JSON-powered API, many...
Ben Brown on how running a community is like throwing a giant, never-ending party
An interview I did with OpenSource.com is now online! Read it here. In it, I discuss how running an online community is like throwing a giant, never-ending party, how open source techniques...
Recently Updated Documentation
Recent Posts from The Forum
I can't verify my account :(
1 comment | 20 hours ago
Jquery UI problem. I having an issue for implementing UI on my theme, all reference are ok (304) on net console. http://un1v.altervista.org/ I have...
0 comments | 5 days ago
Can anybody tell me which hosting using for PP and it working good? I tryed to much (i think good) hoster and still have no site on PP :( Tell me...
0 comments | 8 days ago


No comments have been posted yet.