Пример #1
0
 *  The above copyright notice and this permission notice shall be included in all 
 *  copies or substantial portions of the Software.
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
 *  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
 *  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 *  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
 *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
 *  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
require 'include.php';
$ret = '';
$notification = '';
// fetch the WebID of the wall's owner
if (isset($_REQUEST['user']) && (strlen($_REQUEST['user']) > 0 && $_REQUEST['user'] != 'local')) {
    check_auth(IDP, $page_uri);
    $owner_webid = get_webid_by_hash(trim($_REQUEST['user']));
    // fetch owner's profile
    $profile = new MyProfile($owner_webid, $base_uri, SPARQL_ENDPOINT);
    $profile->load();
    $owner_name = $profile->get_name();
    $feed_hash = get_feed_by_hash($_REQUEST['user']);
    $owner_hash = $_REQUEST['user'];
    // display private wall only if the requesting user is a friend or the wall owner
    if ($profile->is_friend($_SESSION['webid']) || $_SESSION['user_hash'] == $_REQUEST['user']) {
        $feed_hash = get_feed_by_hash($_REQUEST['user']);
        $owner_hash = $_REQUEST['user'];
        // mark all wall messages as read when the user checks his personal wall
        if ($_SESSION['webid'] == $owner_webid) {
            $query = "UPDATE pingback_messages SET new='0' WHERE ";
            $query .= "to_hash='" . mysql_real_escape_string($_SESSION['user_hash']) . "' ";
            $query .= "AND wall='1'";
Пример #2
0
 *  copies of the Software, and to permit persons to whom the Software is furnished 
 *  to do so, subject to the following conditions:
 *  The above copyright notice and this permission notice shall be included in all 
 *  copies or substantial portions of the Software.
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
 *  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
 *  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 *  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
 *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
 *  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
include 'include.php';
$user_hash = trim($_REQUEST['id']);
// Get the corresponding webid for the hash
if ($_REQUEST['id'] != 'local') {
    $webid = get_webid_by_hash($user_hash);
    // complain if the feed ID is not valid
    if (!$webid) {
        echo "<font style=\"font-size: 1.3em;\">There is no feed associated to this ID!</font>\n";
        exit;
    }
} else {
    $webid = $user_hash;
}
// IMPORTANT : No need to add id for feed or channel. It will be automatically created from link.
//Creating an instance of FeedWriter class.
//The constant ATOM is passed to mention the version
$Feed = new FeedWriter(ATOM);
//Setting the channel elements
if ($user_hash != 'local') {
    $Feed->setTitle('MyProfile Pingbacks/Notifications Feed');