示例#1
0
/***********************************************
* This file is part of PeoplePods
* (c) xoxco, inc  
* http://peoplepods.net http://xoxco.com
*
* core_api_simple/index.php
* Handles simple requests to /api
*
* Documentation for this pod can be found here:
* http://peoplepods.net/readme
/**********************************************/
include_once "../../PeoplePods.php";
$POD = new PeoplePod(array('authSecret' => @$_COOKIE['pp_auth'], 'debug' => 2));
if ($POD->libOptions('enable_core_api_simple')) {
    $method = $_GET['method'];
    $POD->tolog("API CALL METHOD: {$method}");
    if ($method == "alert.markAsRead") {
        if ($POD->isAuthenticated()) {
            $alert = $POD->getAlert(array('id' => $_GET['id']));
            $alert->markAsRead();
            if ($alert->success()) {
                echo json_encode($alert->asArray());
            } else {
                echo json_encode(array('error' => $alert->error(), 'id' => $_GET['id']));
            }
        } else {
            echo json_encode(array('error' => 'PERMISSION DENIED', 'id' => $_GET['docId']));
        }
    }
    if ($method == "markAsRead") {
        if ($POD->isAuthenticated()) {
示例#2
0
*
* 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_search')) {
    header("Location: " . $POD->siteRoot(false));
    exit;
}
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();