コード例 #1
0
ファイル: iframe.php プロジェクト: ASDAFF/myprofile
 */
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'";
            $result = mysql_query($query);
            if (!$result) {
                $ret .= error('Database error while trying to update message status!');
            } else {
                if ($result !== true) {
                    mysql_free_result($result);
                }
            }