$POD = new PeoplePod(array('lockdown' => 'verified', 'authSecret' => @$_COOKIE['pp_auth'])); if (!$POD->libOptions('enable_core_invite')) { header("Location: " . $POD->siteRoot(false)); exit; } $max_allowed_invites = 5; if ($_POST) { // send invites. for ($i = 1; $i <= $max_allowed_invites; $i++) { if (isset($_POST["email{$i}"]) && $_POST["email{$i}"] != '') { $POD->currentUser()->sendInvite($_POST["email{$i}"], $_POST['message'], @$_POST['group']); $POD->addMessage("Invites sent!"); } } } $POD->header('Send Invites'); ?> <form method="post" action="<?php $POD->siteRoot(); ?> /invite" class="valid" id="invite"> <div class="column_6"> <h1>Send Invites</h1> <p class="normal_input"><label for="email1">Email:</label><input name="email1" id="email1" class="text required validate-email" /></p> <p class="normal_input"><label for="email2">Email:</label><input name="email2" id="email2" class="text validate-email" /></p> <p class="normal_input"><label for="email3">Email:</label><input name="email3" id="email3" class="text validate-email" /></p> <p class="normal_input"><label for="email4">Email:</label><input name="email4" id="email4" class="text validate-email" /></p>
<?php // include the peoplepods library and instantiate a pod object require_once "../../PeoplePods.php"; $POD = new PeoplePod(array('authSecret' => @$_COOKIE['pp_auth'], 'debug' => 2)); // create an empty piece of content $doc = $POD->getContent(); if (isset($_GET['q'])) { $doc->headline = 'Sample pod with parameter = ' . $_GET['q']; } else { $doc->headline = 'Sample pod with no parameters'; } // print the header $POD->header($doc->headline); // output the sample content using a custom template that is included with the pod. $doc->output('custom.template', dirname(__FILE__)); // print the footer. $POD->footer();
if (!$POD->currentUser()->success()) { $POD->addMessage($POD->currentUser()->error()); } else { $POD->addMessage("Your email has been changed."); } $days = 15; setcookie('pp_auth', $POD->currentUser()->get('authSecret'), time() + 86400 * $days, "/"); } } if (@$_POST['newpassword'] != '') { if ($POD->currentUser()->get('authSecret') != md5($POD->currentUser()->get('email') . @$_POST['oldpassword'])) { $POD->addMessage("Your Current Pass is wrong."); } else { if (@$_POST['newpassword'] != @$_POST['conpassword']) { $POD->addMessage("Your New Pass does not match Confirm."); } else { $POD->currentUser()->set('password', $_POST['newpassword']); $POD->currentUser()->save(); if (!$POD->currentUser()->success()) { $POD->addMessage($POD->currentUser()->error()); } else { $POD->addMessage("Your password has been changed."); } $days = 15; setcookie('pp_auth', $POD->currentUser()->get('authSecret'), time() + 86400 * $days, "/"); } } } $POD->header('Edit Profile'); $POD->currentUser()->output('editprofile'); $POD->footer();
/*********************************************** * This file is part of PeoplePods * (c) xoxco, inc * http://peoplepods.net http://xoxco.com * * core_profiles/profile.php * Handles requests to user profiles * * Documentation for this pod can be found here: * http://peoplepods.net/readme/messaging /**********************************************/ include_once "../../PeoplePods.php"; $POD = new PeoplePod(array('debug' => 0, 'authSecret' => @$_COOKIE['pp_auth'])); if (!$POD->libOptions('enable_core_profiles')) { header("Location: " . $POD->siteRoot(false)); exit; } $profile_username = $_GET['username']; $PROFILE_PERSON = $POD->getPerson(array('stub' => $profile_username)); if ($POD->isAuthenticated()) { $POD->currentUser()->expireAlertsAbout($PROFILE_PERSON); } if ($PROFILE_PERSON->success()) { $POD->header($PROFILE_PERSON->get('nick'), $POD->siteRoot(false) . '/feeds/person/' . $PROFILE_PERSON->get('stub')); $PROFILE_PERSON->output(); $POD->footer(); } else { header("Status: 404 Not Found"); echo "404 Not Found"; }
if ($invite_deets['groupId']) { $p->set('invited_to_group', $POD->getGroup(array('id' => $invite_deets['groupId'])), false); } } else { $POD->addMessage("Sorry, but the invite code you used has expired."); } } if ($redir) { // if we logged in correctly, we redirect to the homepage of the site, or to any url passed in as a parameter if ($redirect) { print header("Location: " . $redirect); } else { print header("Location: " . $POD->siteRoot(false)); } } $POD->header("Create an account"); $p->output('join'); $POD->footer(); function generatePassword($length = 9, $strength = 8) { $vowels = 'aeuy'; $consonants = 'bdghjmnpqrstvz'; if ($strength & 1) { $consonants .= 'BDGHJLMNPQRSTVWXZ'; } if ($strength & 2) { $vowels .= "AEUY"; } if ($strength & 4) { $consonants .= '23456789'; }
$POD->setLibOptions('peopleImageMaxWidth', $_POST['peopleImageMaxWidth']); $POD->setLibOptions('peopleIconSquare', $_POST['peopleIconSquare']); $POD->setLibOptions('peopleIconMaxWidth', $_POST['peopleIconMaxWidth']); $POD->setLibOptions('documentImageResize', $_POST['documentImageResize']); $POD->setLibOptions('documentImageMaxWidth', $_POST['documentImageMaxWidth']); $POD->setLibOptions('documentIconSquare', $_POST['documentIconSquare']); $POD->setLibOptions('documentIconMaxWidth', $_POST['documentIconMaxWidth']); $POD->saveLibOptions(); if ($POD->success()) { $message = "Config updated."; } else { $message = $POD->error(); } } $POD->changeTheme('admin'); $POD->header(); $current_tab = "images"; ?> <?php include_once "option_nav.php"; ?> <?php if (isset($message)) { ?> <div class="info"> <?php echo $message; ?>
* http://peoplepods.net/readme/new-content-type /**********************************************/ include_once "content_type.php"; // this defines some variables for use within this pod include_once "../../PeoplePods.php"; $POD = new PeoplePod(array('authSecret' => @$_COOKIE['pp_auth'], 'debug' => 0)); if (!$POD->libOptions("enable_contenttype_{$content_type}_list")) { header("Location: " . $POD->siteRoot(false)); exit; } $offset = 0; if (isset($_GET['offset'])) { $offset = $_GET['offset']; } $docs = $POD->getContents(array('type' => $content_type, 'status:!=' => 'friends_only'), null, 30, $offset); $POD->header('What\'s New?'); ?> <div class="column_8"> <?php $docs->output('short', 'header', 'pager', 'What\'s New?', 'Nothing has been posted on this site yet. Wow, it must be brand new!'); ?> </div> <div class="column_4 structure_only"> <?php $POD->output('sidebars/search'); ?> <?php $POD->output('sidebars/ad_unit');
$POD->addMessage("ERROR! " . $group->error()); } } //socialwiki if ($_GET['command'] == "addwiki") { $template = "edit_group"; $wiki = $POD->getContent(array('id'=>$_POST['selected_wiki'])); $wiki->addFlag('track', $group); } if ($_GET['command'] == "removewiki") { $template = "edit_group"; $wiki = $POD->getContent(array('id'=>$_POST['selected_wiki'])); $wiki->write('headline'); $wiki->removeFlag('track', $group); } } $POD->header($group->get('groupname')); if (isset($_GET['offset'])) { $group->content()->getOtherPage($_GET['offset']); } $group->output($template); $POD->footer(); ?>
/**********************************************/ include_once "../../PeoplePods.php"; $POD = new PeoplePod(array('debug' => 0, 'lockdown' => 'verified', 'authSecret' => @$_COOKIE['pp_auth'])); if (!$POD->libOptions('enable_core_private_messaging')) { header("Location: " . $POD->siteRoot(false)); exit; } $inbox = $POD->getInbox(); $username = $_GET['username']; $user = $POD->getPerson(array('stub' => $username)); if (!$user->success()) { header("Status: 404 Not Found"); echo "404 Not Found"; exit; } $thread = $inbox->newThread($user->get('id')); if (isset($_POST['message'])) { $thread->reply(strip_tags($_POST['message'])); } if (isset($_GET['clear'])) { $thread->clear(); if (!$thread->success()) { $POD->addMessage("Conversation could not be cleared! " . $thread->error()); } else { $POD->addMessage("Conversation cleared."); } } $POD->header('Conversation with ' . $user->get('nick')); $thread->output(); $thread->markAsRead(); $POD->footer();
* http://peoplepods.net/readme /**********************************************/ include_once "../../lib/Core.php"; $POD = new PeoplePod(array('lockdown' => 'login', 'authSecret' => @$_COOKIE['pp_auth'])); if (!$POD->libOptions('enable_core_authentication_creation')) { header("Location: " . $POD->siteRoot(false)); exit; } if (@$_GET['key'] != '') { // we've got a key to verify. // user does not have to be logged in - we match by key and set cookies for login. $POD->currentUser()->verify($_GET['key']); if ($POD->currentUser()->success()) { $status = 'ok'; } else { $status = 'bad_key'; } } else { if (@$_GET['resend']) { $POD->currentUser()->welcomeEmail(); $status = 'key_resent'; } else { // no key specified. user may need a reminder mail, or may need to enter key manually. $status = 'no_key'; } } $POD->header('Verify Your Account'); $POD->currentUser()->set('verify_status', $status, false); // set temporary status field $POD->currentUser()->output('verify'); $POD->footer();
$POD = new PeoplePod(array('debug' => 0, 'authSecret' => @$_COOKIE['pp_auth'])); $key = $POD->libOptions('fb_connect_api'); $secret = $POD->libOptions('fb_connect_secret'); // we need to make sure sessions are on so we can store the twitter codes session_start(); if (isset($_GET['rfb'])) { $POD->currentUser()->removeMeta('facebook_token'); $POD->currentUser()->removeMeta('fbuid'); $POD->addMessage("Your Facebook account has been removed."); } $display = 'page'; if (strpos($_SERVER['HTTP_USER_AGENT'], "iPhone") || strpos($_SERVER['HTTP_USER_AGENT'], "Android")) { // $display='touch'; } if (!($key && $secret)) { $POD->header('Configuration Required'); echo '<div class="info">Configuration required!</div>'; echo '<p>To enable Facebook login, please set the Facebook API key and secret via the PeoplePods command center.</p>'; echo '<P>To obtain the necessary details from Facebook, <a href="http://www.facebook.com/developers/">register your app</a>.</p>'; $POD->footer(); exit; } $user = null; if (isset($_GET['code'])) { $code = $_GET['code']; $oauth_token = file_get_contents("https://graph.facebook.com/oauth/access_token?client_id=" . $key . "&redirect_uri=" . $POD->siteRoot(false) . "/facebook&client_secret=" . urlencode($secret) . "&code=" . urlencode($code)); list($junk, $oauth_token) = explode("=", $oauth_token); // if authenticated, add to user // if not, new user time! if ($POD->isAuthenticated() && !$POD->currentUser()->facebook_token) { $user = $POD->currentUser();
<?php include_once "../../PeoplePods.php"; $POD = new PeoplePod(array('debug' => 0, 'authSecret' => @$_COOKIE['pp_auth'])); // this page is only available to facebook users. if (!$POD->isAuthenticated() || !$POD->currentUser()->twitter_token) { header("Location: /twitter"); exit; } $POD->header("Twitter Friends"); $friends = $POD->currentUser()->getTwitterFriends(); $friends->output('short', 'header', 'footer', 'Twitter Friends', 'None of your Twitter friends are members of this site.'); $POD->footer();
} if (@$_POST['password'] && @$_POST['resetCode']) { $user = $POD->getPerson(array('passwordResetCode' => $_POST['resetCode'])); if ($user->success()) { $user->set('password', $_POST['password']); $user->set('passwordResetCode', ''); $user->save(); $days = 1; setcookie('pp_auth', $user->get('authSecret'), time() + 86400 * $days, "/"); header("Location: /"); exit; } else { // nothing. the user submitted a password reset attempt without a valid reset code, which means they are probably lying! } } $POD->header('Reset Password'); // get a blank person for the output. $p = $POD->getPerson(); if (@$_POST['email']) { $user = $POD->getPerson(array('email' => $_POST['email'])); if ($user->success()) { $user->set('passwordResetCode', md5($user->get('nick') . getmypid())); $user->save(); $user->sendPasswordReset(); $p->set('msg', 'Check your email! A message has been sent to the address you used to sign up that contains a link that will allow you to reset your password.', false); } else { $p->set('msg', 'The email address you specified could not be found in the database.', false); } } else { if (@$_GET['resetCode']) { $p->set('resetCode', $_GET['resetCode'], false);
* http://peoplepods.net/readme/new-content-type /**********************************************/ include_once "content_type.php"; // this defines some variables for use within this pod include_once "../../PeoplePods.php"; $POD = new PeoplePod(array('authSecret' => @$_COOKIE['pp_auth'], 'debug' => 0)); if (!$POD->libOptions("enable_contenttype_{$content_type}_list")) { header("Location: " . $POD->siteRoot(false)); exit; } $offset = 0; if (isset($_GET['offset'])) { $offset = $_GET['offset']; } $wikis = $POD->getContents(array('type' => $content_type)); $POD->header('List of supported wikis!'); ?> <div class="column_8"> <? if ($POD->libOptions("enable_contenttype_wiki_add")) if($POD->isAuthenticated() && $POD->currentUser()->get('adminUser')){ ?> <p>Add a new wiki now! <a href="<? $POD->siteRoot(); echo $edit_pattern; ?>">Click here!</a></p> <? } else { ?><p>This software is under developement. Adding new wikis by users will be enabled in coming releases inshalla!</p><? } ?><p>To connect your account on one of the wikis below, please add it <a href="wikiman">here</a></p><?
<?php include_once "../../PeoplePods.php"; $POD = new PeoplePod(array('debug' => 0, 'authSecret' => @$_COOKIE['pp_auth'])); // this page is only available to facebook users. if (!$POD->isAuthenticated() || !$POD->currentUser()->facebook_token) { header("Location: /facebook"); exit; } $POD->header("Facebook Friends"); $friends = $POD->currentUser()->getFacebookFriends(); $friends->output('short', 'header', 'footer', 'Facebook Friends', 'None of your Facebook friends are members of this site.'); $POD->footer();
} else { $msg = $comment->error(); } } $types = array(); $sql = "SELECT DISTINCT type FROM comments"; $res = mysql_query($sql, $POD->DATABASE); if (mysql_num_rows($res) > 0) { while ($type = mysql_fetch_row($res)) { if ($type[0] == '') { $type[0] = 'comment'; } array_push($types, $type[0]); } } $POD->header('Comments'); include_once 'tools.php'; if (isset($_GET['id'])) { // edit this comment $comment = $POD->getComment(array('id' => $_GET['id'])); if ($comment->success()) { $comment->output('comment.edit'); } else { ?> <div class="info"> <?php echo $comment->error(); ?> </div> <?php }
<?php /*********************************************** * This file is part of PeoplePods * (c) xoxco, inc * http://peoplepods.net http://xoxco.com * * core_private_messaging/inbox.php * Handles requests to /inbox * * Documentation for this pod can be found here: * http://peoplepods.net/readme/messaging /**********************************************/ include_once "../../PeoplePods.php"; $POD = new PeoplePod(array('debug' => 2, 'lockdown' => 'verified', 'authSecret' => @$_COOKIE['pp_auth'])); if (!$POD->libOptions('enable_core_private_messaging')) { header("Location: " . $POD->siteRoot(false)); exit; } $offset = 0; if (isset($_GET['offset'])) { $offset = $_GET['offset']; } $inbox = $POD->getInbox(20, $offset); $POD->header("Conversations"); $inbox->output('thread_short', 'header', 'pager', 'Conversations', 'You don\'t have any messages. :('); $POD->footer();
$POD = new PeoplePod(array('authSecret' => md5($_POST['email'] . $_POST['password']))); if (!$POD->success()) { $POD->addMessage($POD->error()); } if (!$POD->isAuthenticated()) { $POD->addMessage("Oops! We could not log you in using that email address and password."); } else { $days = 15; if ($_POST['remember_me']) { $days = 100; } setcookie('pp_auth', $POD->currentUser()->get('authSecret'), time() + 86400 * $days, "/"); $redirect_after_login = true; } } } if ($redirect_after_login) { // if we logged in correctly, we redirect to the homepage of the site, or to any url passed in as a parameter if ($_POST['redirect']) { header("Location: " . $_POST['redirect']); } else { header("Location: " . $POD->siteRoot(false)); } } else { $POD->header("Login"); $p = $POD->getPerson(); // create an empty person record $p->set('redirect', @$_GET['redirect']); $p->output('login'); $POD->footer(); }
} if (isset($_GET['offset'])) { $offset = $_GET['offset']; } else { $offset = 0; } $POD->tolog("DOING SEARCH"); if ($keyword = @$_GET['q']) { $docs = $POD->getContents(array('or' => array('headline:like' => "%{$keyword}%", 'body:like' => "%{$keyword}%")), null, 20, $offset); } else { if ($keyword = @$_GET['p']) { $people = $POD->getPeople(array('or' => array('nick:like' => "%{$keyword}%", 'email:like' => "%{$keyword}%")), null, 20, $offset); } } $POD->tolog("DONE"); $POD->header('Search results for "' . $keyword . '"', '/feeds/search/' . $keyword); ?> <div class="column_8"> <form method="get" action="<?php $POD->siteRoot(); ?> /search"> <p> <label for="q">Search:</label> <input name="q" id="q" value="<?php echo htmlspecialchars(@$_GET['q']); ?> " /> <input type="submit" class="button" value="Search" />
<?php include_once "../../PeoplePods.php"; $POD = new PeoplePod(array('debug' => 0, 'authSecret' => @$_COOKIE['pp_auth'])); $request = 'http://twitter.com/oauth/request_token'; $access = 'http://twitter.com/oauth/access_token'; $auth = 'http://twitter.com/oauth/authorize'; $key = $POD->libOptions('twitter_api'); $secret = $POD->libOptions('twitter_secret'); if (!($key && $secret)) { $POD->header('Configuration Required'); echo '<div class="info">Configuration required!</div>'; echo '<p>To enable Twitter login, please set the Twitter API key and secret via the PeoplePods command center.</p>'; echo '<P>To obtain the necessary details from Twitter, <a href="https://dev.twitter.com/apps">register your app</a>.</p>'; $POD->footer(); exit; } // we need to make sure sessions are on so we can store the twitter codes session_start(); if (isset($_GET['remove'])) { $POD->currentUser()->addMeta('twitter_name', null); $POD->currentUser()->addMeta('twitter_secret', null); $POD->currentUser()->addMeta('twitter_token', null); $POD->currentUser()->addMeta('twitter_id', null); $POD->addMessage("Your Twitter account has been removed."); } $access_token_info = array(); if (@$_GET['mode'] == 'verify') { if ($_SESSION['twitter_state'] == 1 && !isset($_GET['oauth_token'])) { $_SESSION['twitter_state'] = 0; }
} } $content->files()->fill(); } else { $POD->addMessage("Error! " . $content->error()); } $msg = implode("\n", $POD->messages()); if (isset($_POST['redirect'])) { if ($_POST['redirect'] == "permalink") { $redirect = $content->get('permalink'); } else { $redirect = $_POST['redirect']; } } header("Location: {$redirect}?msg=" . urlencode($msg)); } else { if ($_GET['id']) { $content = $POD->getContent(array('id' => $_GET['id'])); if (!$content->isEditable()) { header("Location: {$redirect}?msg=" . urlencode("Access Denied")); } else { $POD->header("Edit " . $content->get('headline')); $content->output($input_template); $POD->footer(); } } else { $POD->header("Add Something"); $POD->getContent(array('type' => $content_type))->output($input_template); $POD->footer(); } }
if ($POD->isAuthenticated()) { $header = "My Groups"; $groups = $POD->getGroups(array('mem.userId' => $POD->currentUser()->get('id')), 'mem.date DESC', $max, $offset); if ($groups->totalCount() == 0) { $header = "Newish Groups"; $groups = $POD->getGroups(array('type' => 'public'), 'g.date DESC', $max, $offset); } } else { $header = "Newish Groups"; $groups = $POD->getGroups(array('type' => 'public'), 'g.date DESC', $max, $offset); } } if (!$groups->success()) { $POD->addMessage($groups->error()); } $POD->header('My Groups'); ?> <div class="column_8"> <?php $groups->output('short', 'header', 'pager', $header, 'No groups have been created'); ?> </div> <div class="column_4 structure_only"> <?php $POD->output('sidebars/group_search'); ?> <?php $POD->output('sidebars/create_group'); ?>
} } } else { // no parameters were specified, we should send this person back to the homepage header("Location: " . $POD->siteRoot(false)); exit; } $count = 20; $offset = 0; if (isset($_GET['offset'])) { $offset = $_GET['offset']; } $docs = $POD->getContents($params, null, $count, $offset); $description = "{$scope} {$type} " . implode(" and ", $conditions); $feedurl = $POD->siteRoot(false) . '/feeds/' . $_GET['args']; $POD->header($description, $feedurl); ?> <div class="column_8"> <?php $docs->output('short', 'header', 'pager', $description); ?> </div> <div class="column_4 structure_only"> <?php $POD->output('sidebars/search'); ?> <?php $POD->output('sidebars/ad_unit'); ?>
if (isset($_POST['id'])) { $doc = $POD->getContent(array('id' => $_POST['id'])); } } } if (!$doc->success()) { header("Status: 404 Not Found"); echo "404 Not Found"; exit; } if (isset($_POST['comment'])) { // this is a request to post a comment $comment = $doc->addComment($_POST['comment']); if (!$comment || !$comment->success()) { $POD->addMessage("Couldn't add comment! " . $doc->error()); } else { header("Location: " . $doc->get('permalink') . "#" . $comment->get('id')); exit; } } if (isset($_GET['vote'])) { // this is a request to vote if ($POD->isAuthenticated()) { if (!$POD->currentUser()->getVote($doc)) { $doc->vote($_GET['vote']); } } } $POD->header($doc->get('headline')); $doc->output($output_template); $POD->footer();
if ($mode == "friends") { $people = $POD->currentUser()->friends($max_friends, $offset); $title = "My Friends"; $header = "You have " . $people->totalCount() . " " . $POD->pluralize($people->totalCount(), 'friend', 'friends'); } if ($mode == "followers") { $people = $POD->currentUser()->followers($max_friends, $offset); $title = "My Followers"; $header = "You have " . $people->totalCount() . " " . $POD->pluralize($people->totalCount(), 'follower', 'followers'); } if ($mode == "recommended") { $people = $POD->currentUser()->recommendFriends(2); $title = "Recommended Friends"; $header = "You might like these folks"; } $POD->header($header); ?> <div id="friends_actions"> <h1><?php echo $header; ?> </h1> <ul> <li <?php if ($mode == "friends") { ?> class="active"<?php } ?> ><a href="<?php