Example #1
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
$user = $params['user'];
$cover = new OssnProfile();
$coverp = $cover->coverParameters($user->guid);
$cover_top = $coverp[0];
$cover_left = $coverp[1];
if (ossn_isLoggedIn()) {
    $class = 'ossn-profile';
} else {
    $class = 'ossn-profile ossn-profile-tn';
}
?>
<div class="<?php 
echo $class;
?>
">
    <div class="top-container">
        <div id="container" class="profile-cover" style="overflow:hidden;">
            <?php 
if (ossn_loggedin_user()->guid == $user->guid) {
    ?>
Example #2
0
/**
 * Delete wall post if profile photo is deleted
 *
 * @return void;
 */
function ossn_profile_delete_photo_wallpost($callback, $type, $params)
{
    $params['photo'] = arrayObject($params['photo']);
    if (isset($params['photo']->guid) && !empty($params['photo']->guid)) {
        $profile = new OssnProfile();
        $profile->deletePhotoWallPost($params['photo']->guid);
    }
}
<?php

/**
 *    OpenSource-SocialNetwork
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://opensource-socialnetwork.com/licence
 * @link      http://www.opensource-socialnetwork.com/licence
 */
$file = new OssnFile();
$file->owner_guid = ossn_loggedin_user()->guid;
$file->type = 'user';
$file->subtype = 'profile:cover';
$file->setFile('coverphoto');
$file->setPath('profile/cover/');
if ($file->addFile()) {
    $ossnprofile = new OssnProfile();
    $ossnprofile->ResetCoverPostition($file->owner_guid);
    echo 1;
} else {
    echo 0;
}
Example #4
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
$profile = new OssnProfile();
$file = new OssnFile();
$user = ossn_loggedin_user();
$file->owner_guid = $user->guid;
$file->type = 'user';
$file->subtype = 'profile:photo';
$file->setFile('userphoto');
$file->setPath('profile/photo/');
$file->setExtension(array('jpg', 'png', 'jpeg', 'gif'));
if ($file->addFile()) {
    //update user icon time, this time has nothing to do with photo entity time
    $user->data->icon_time = time();
    $user->save();
    //get a all user photo files
    $resize = $file->getFiles();
    //add a wall post for photo update
    $profile->addPhotoWallPost($file->owner_guid, $resize->{0}->guid);
    if (isset($resize->{0}->value)) {
        $guid = $user->guid;
        $datadir = ossn_get_userdata("user/{$guid}/{$resize->{0}->value}");
<?php

/**
 *    OpenSource-SocialNetwork
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://opensource-socialnetwork.com/licence
 * @link      http://www.opensource-socialnetwork.com/licence
 */
header('Content-Type: application/json');
$pos = new OssnProfile();
if ($pos->repositionCOVER(ossn_loggedin_user()->guid, input('top'), input('left'))) {
    $params = $pos->coverParameters(ossn_loggedin_user()->guid);
    echo json_encode(array('top' => $params[0], 'left' => $params[1]));
}
Example #6
0
<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <*****@*****.**>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
$file = new OssnFile();
$file->owner_guid = ossn_loggedin_user()->guid;
$file->type = 'user';
$file->subtype = 'profile:cover';
$file->setFile('coverphoto');
$file->setPath('profile/cover/');
$file->setExtension(array('jpg', 'png', 'jpeg', 'gif'));
if ($file->addFile()) {
    $newcover = $file->getFiles();
    $ossnprofile = new OssnProfile();
    $ossnprofile->ResetCoverPostition($file->owner_guid);
    $ossnprofile->addPhotoWallPost($file->owner_guid, $newcover->{0}->guid, 'cover:photo');
    echo 1;
} else {
    echo 0;
}