本文整理汇总了PHP中ossn_user_by_guid函数的典型用法代码示例。如果您正苦于以下问题:PHP ossn_user_by_guid函数的具体用法?PHP ossn_user_by_guid怎么用?PHP ossn_user_by_guid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ossn_user_by_guid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ossn_js_page_handler
function ossn_js_page_handler($pages)
{
switch ($pages[0]) {
case 'boot':
if (!ossn_isLoggedIn()) {
ossn_error_page();
}
if (isset($pages[1]) && $pages[1] == 'ossn.boot.chat.js') {
header('Content-Type: application/javascript');
echo ossn_plugin_view('js/OssnChat.Boot');
}
break;
case 'selectfriend':
$user = input('user');
if (!empty($user)) {
$user = ossn_user_by_guid($user);
OssnChat::setUserChatSession($user);
$friend['user'] = $user;
echo ossn_plugin_view('chat/selectfriend', $friend);
}
break;
default:
ossn_error_page();
break;
}
}
示例2: ossn_like_annotation
/**
* Notification View for liking annotation
*
* @return voud;
* @access private
*/
function ossn_like_annotation($hook, $type, $return, $params)
{
$notif = $params;
$baseurl = ossn_site_url();
$user = ossn_user_by_guid($notif->poster_guid);
$user->fullname = "<strong>{$user->fullname}</strong>";
$img = "<div class='notification-image'><img src='{$baseurl}/avatar/{$user->username}/small' /></div>";
if (preg_match('/like/i', $notif->type)) {
$type = 'like';
$database = new OssnDatabase();
$database->statement("SELECT * FROM kullaniciveriler WHERE(guid='{$notif->subject_guid}')");
$database->execute();
$result = $database->fetch();
$url = ossn_site_url("post/view/{$notif->subject_guid}#comments-item-{$notif->item_guid}");
if ($result->subtype == 'file:ossn:aphoto') {
$url = ossn_site_url("photos/view/{$notif->subject_guid}#comments-item-{$notif->item_guid}");
}
}
$type = "<div class='ossn-notification-icon-{$type}'></div>";
if ($notif->viewed !== NULL) {
$viewed = '';
} elseif ($notif->viewed == NULL) {
$viewed = 'class="ossn-notification-unviewed"';
}
$notification_read = "{$baseurl}notification/read/{$notif->guid}?notification=" . urlencode($url);
return "<a href='{$notification_read}'>\n\t <li {$viewed}> {$img} \n\t\t <div class='notfi-meta'> {$type}\n\t\t <div class='data'>" . ossn_print("ossn:notifications:{$notif->type}", array($user->fullname)) . '</div>
</div></li>';
}
示例3: Post
/**
* Post on wall
*
* @params $post: Post text
* $friends: Friend guids
* $location: Post location
* $access: (OSSN_PUBLIC, OSSN_PRIVATE, OSSN_FRIENDS)
* @param string $post
*
* @return bool;
*/
public function Post($post, $friends = '', $location = '', $access = '')
{
self::initAttributes();
if (empty($access)) {
$access = OSSN_PUBLIC;
}
if ($this->owner_guid < 1 || $this->poster_guid < 1 || empty($post)) {
return false;
}
if (isset($this->item_type) && !empty($this->item_type)) {
$this->data->item_type = $this->item_type;
}
if (isset($this->item_guid) && !empty($this->item_guid)) {
$this->data->item_guid = $this->item_guid;
}
$this->data->poster_guid = $this->poster_guid;
$this->data->access = $access;
$this->subtype = 'wall';
$this->title = '';
$post = preg_replace('/\\t/', ' ', $post);
$wallpost['post'] = htmlspecialchars($post, ENT_QUOTES, 'UTF-8');
//wall tag a friend , GUID issue #566
if (!empty($friends)) {
$friend_guids = explode(',', $friends);
//reset friends guids
$friends = array();
foreach ($friend_guids as $guid) {
if (ossn_user_by_guid($guid)) {
$friends[] = $guid;
}
}
$wallpost['friend'] = implode(',', $friends);
}
if (!empty($location)) {
$wallpost['location'] = $location;
}
//Encode multibyte Unicode characters literally (default is to escape as \uXXXX)
$this->description = json_encode($wallpost, JSON_UNESCAPED_UNICODE);
if ($this->addObject()) {
$this->wallguid = $this->getObjectId();
if (isset($_FILES['ossn_photo'])) {
$this->OssnFile->owner_guid = $this->wallguid;
$this->OssnFile->type = 'object';
$this->OssnFile->subtype = 'wallphoto';
$this->OssnFile->setFile('ossn_photo');
$this->OssnFile->setPath('ossnwall/images/');
$this->OssnFile->setExtension(array('jpg', 'png', 'jpeg', 'gif'));
$this->OssnFile->addFile();
}
$params['subject_guid'] = $this->wallguid;
$params['poster_guid'] = $this->poster_guid;
if (isset($wallpost['friend'])) {
$params['friends'] = explode(',', $wallpost['friend']);
}
ossn_trigger_callback('wall', 'post:created', $params);
return true;
}
return true;
}
示例4: coverParameters
/**
* Get cover parameters
*
* @params $guid: User guid
*
* @return array;
*/
public function coverParameters($guid)
{
$user = ossn_user_by_guid($guid);
if (isset($user->cover_position)) {
$parameters = $user->cover_position;
return json_decode($parameters);
}
return false;
}
示例5: ossn_users
/**
* Initialize library
*
* @return bool
*/
function ossn_users()
{
ossn_register_page('uservalidate', 'ossn_uservalidate_pagehandler');
/**
* Logout outuser if user didn't exists
*/
if (ossn_isLoggedin()) {
$user = ossn_user_by_guid(ossn_loggedin_user()->guid);
if (!$user) {
ossn_logout();
redirect();
}
}
}
示例6: ossn_users
/**
* Initialize library
*
* @return bool
*/
function ossn_users()
{
ossn_register_page('uservalidate', 'ossn_uservalidate_pagehandler');
/**
* Logout outuser if user didn't exists
*/
if (ossn_isLoggedin()) {
$user = ossn_user_by_guid(ossn_loggedin_user()->guid);
if (!$user) {
ossn_logout();
redirect();
}
//register menu item for logout, in topbar dropdown menu
ossn_register_menu_item('topbar_dropdown', array('name' => 'logout', 'text' => ossn_print('logout'), 'href' => ossn_site_url('action/user/logout'), 'action' => true));
}
}
示例7: ossn_poke_notification
/**
* User notification menu item
*
* @return void;
* @access private;
*/
function ossn_poke_notification($name, $type, $return, $params)
{
$notif = $params;
$baseurl = ossn_site_url();
$user = ossn_user_by_guid($notif->poster_guid);
$user->fullname = "<strong>{$user->fullname}</strong>";
$img = "<div class='notification-image'><img src='{$baseurl}avatar/{$user->username}/small' /></div>";
$type = 'poke';
$type = "<div class='ossn-notification-icon-poke'></div>";
if ($notif->viewed !== NULL) {
$viewed = '';
} elseif ($notif->viewed == NULL) {
$viewed = 'class="ossn-notification-unviewed"';
}
$url = $user->profileURL();
$notification_read = "{$baseurl}notification/read/{$notif->guid}?notification=" . urlencode($url);
return "<a href='{$notification_read}'>\n\t <li {$viewed}> {$img} \n\t\t <div class='notfi-meta'> {$type}\n\t\t <div class='data'>" . ossn_print("ossn:notifications:{$notif->type}", array($user->fullname)) . '</div>
</div></li>';
}
示例8: addPoke
/**
* Add poke
*
* @params $poker guid of user who is trying to poke
* $owner guid of user who is going to be poked
*
* @return bool;
* @access public;
*/
public function addPoke($poker, $owner)
{
/*
* Check if user is blocked or not
*/
if (com_is_active('OssnBlock')) {
$user = ossn_user_by_guid($owner);
if (OssnBlock::UserBlockCheck($user)) {
return false;
}
}
/*
* Send notification
*/
$type = 'ossnpoke:poke';
$params['into'] = 'bildirimler';
$params['names'] = array('type', 'poster_guid', 'owner_guid', 'subject_guid', 'item_guid', 'time_created');
$params['values'] = array($type, $poker, $owner, NULL, NULL, time());
if ($this->insert($params)) {
return true;
}
return false;
}
示例9: OssnPagination
$posts = $posts->GetPostByOwner($params['group']['group']->guid, 'group');
$Pagination = new OssnPagination();
$Pagination->setItem($posts);
$posts = false;
if ($params['ismember'] === 1 || $params['membership'] == OSSN_PUBLIC) {
$posts = $Pagination->getItem();
}
if ($posts) {
foreach ($posts as $post) {
$data = json_decode(html_entity_decode($post->description));
$text = ossn_restore_new_lines($data->post, true);
$location = '';
if (isset($data->location)) {
$location = '- ' . $data->location;
}
if (!isset($data->friend)) {
$data->friend = '';
}
if (isset($post->{'file:wallphoto'})) {
$image = str_replace('ossnwall/images/', '', $post->{'file:wallphoto'});
} else {
$image = '';
}
//lastchage: Group admins are unable to delete member posting on group wall #171
$post->owner_guid = $params['group']['group']->owner_guid;
$user = ossn_user_by_guid($post->poster_guid);
echo ossn_wall_view_template(array('post' => $post, 'friends' => explode(',', $data->friend), 'text' => $text, 'location' => $location, 'user' => $user, 'image' => $image, 'ismember' => $params['ismember']));
}
}
echo $Pagination->pagination();
echo '</div>';
示例10: ossn_call_hook
echo $params['user']->iconURL()->small;
?>
" width="40" height="40"/>
</div>
<div class="post-controls">
<?php
if (ossn_is_hook('wall', 'post:menu') && ossn_isLoggedIn()) {
$menu['post'] = $params['post'];
echo ossn_call_hook('wall', 'post:menu', $menu);
}
?>
</div>
<div class="subject">
<?php
$owner = ossn_user_by_guid($params['post']->owner_guid);
?>
<a class="owner-link"
href="<?php
echo $params['user']->profileURL();
?>
"> <?php
echo $params['user']->fullname;
?>
</a>
<?php
if ($params['show_group'] == true) {
$group = ossn_get_group_by_guid($params['post']->owner_guid);
?>
<div class="ossn-wall-on ossn-posted-on"></div>
<a class="owner-link"
示例11: ossn_wallpost_to_item
/**
* Convert wallobject to wall post item
*
* @param object $post A wall object
*
* @return array|false
*/
function ossn_wallpost_to_item($post)
{
if ($post && $post instanceof OssnWall) {
if (!isset($post->poster_guid)) {
$post = ossn_get_object($post->guid);
}
$data = json_decode(html_entity_decode($post->description));
$text = ossn_restore_new_lines($data->post, true);
$location = '';
if (isset($data->location)) {
$location = '- ' . $data->location;
}
if (isset($post->{'file:wallphoto'})) {
$image = str_replace('ossnwall/images/', '', $post->{'file:wallphoto'});
} else {
$image = '';
}
$user = ossn_user_by_guid($post->poster_guid);
return array('post' => $post, 'friends' => explode(',', $data->friend), 'text' => $text, 'location' => $location, 'user' => $user, 'image' => $image);
}
return false;
}
示例12: getOnlineFriends
/**
* Get online user friends
*
* @params = $intervals => seconds
* $user User guid
*
* @return object;
*/
public function getOnlineFriends($user, $intervals = 100)
{
if (empty($user->guid)) {
$user = ossn_loggedin_user();
} else {
$user = ossn_user_by_guid($user);
}
$friends = $user->getFriends();
$friend_guids = '';
if ($friends) {
foreach ($friends as $friend) {
$friend_guids[] = $friend->guid;
}
}
if (!is_array($friend_guids) && empty($friend_guids)) {
return false;
}
$friend_guids = implode(',', $friend_guids);
$time = time();
$params['from'] = 'kullanicilar';
$params['wheres'] = array("last_activity > {$time} - {$intervals} AND guid IN ({$friend_guids})");
$friends = $this->select($params, true);
return $friends;
}
示例13: OssnPoke
<?php
/**
* Open Source Social Network
*
* @packageOpen Source Social Network
* @author Open Social Website Core Team <info@informatikon.com>
* @copyright 2014 iNFORMATIKON TECHNOLOGIES
* @license General Public Licence http://www.opensource-socialnetwork.org/licence
* @link http://www.opensource-socialnetwork.org/licence
*/
$poke = new OssnPoke();
$user = input('user');
if ($poke->addPoke(ossn_loggedin_user()->guid, $user)) {
$user = ossn_user_by_guid($user);
ossn_trigger_message(ossn_print('user:poked', array($user->fullname)), 'success');
redirect(REF);
} else {
ossn_trigger_message(ossn_print('user:poke:error'), 'error');
redirect(REF);
}
示例14: ossn_album_page_handler
//.........这里部分代码省略.........
$name = str_replace(array('.jpg', '.jpeg', 'gif'), '', $picture);
$etag = $size . $name . $guid;
if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) == "\"{$etag}\"") {
header("HTTP/1.1 304 Not Modified");
exit;
}
// get image size
$datadir = ossn_get_userdata("user/{$guid}/profile/cover/{$picture}");
if (empty($type)) {
$image = file_get_contents($datadir);
} elseif ($type == 1) {
$image = ossn_resize_image($datadir, 170, 170, true);
}
//get image file else show error page
if (is_file($datadir)) {
$filesize = filesize($datadir);
header("Content-type: image/jpeg");
header('Expires: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', strtotime("+6 months")), true);
header("Pragma: public");
header("Cache-Control: public");
header("Content-Length: {$filesize}");
header("ETag: \"{$etag}\"");
readfile($datadir);
return;
} else {
ossn_error_page();
}
break;
case 'view':
if (isset($album[1])) {
$title = ossn_print('photos');
$user['album'] = $album[1];
$albumget = ossn_albums();
$owner = $albumget->GetAlbum($album[1])->album;
if (empty($owner)) {
ossn_error_page();
}
//throw 404 page if there is no album access
if ($owner->access == 3) {
if (!ossn_validate_access_friends($owner->owner_guid)) {
ossn_error_page();
}
}
//shows add photos if owner is loggedin user
if (ossn_loggedin_user()->guid == $owner->owner_guid) {
$addphotos = array('text' => ossn_print('add:photos'), 'href' => 'javascript::void(0);', 'id' => 'ossn-add-photos', 'data-url' => '?album=' . $album[1], 'class' => 'button-grey');
$delete_action = ossn_site_url("action/ossn/album/delete?guid={$album[1]}", true);
$delete_album = array('text' => ossn_print('delete:album'), 'href' => $delete_action, 'class' => 'button-grey');
$control = ossn_plugin_view('output/url', $addphotos);
$control .= ossn_plugin_view('output/url', $delete_album);
} else {
$control = false;
}
//set photos in module
$contents = array('title' => ossn_print('photos'), 'content' => ossn_plugin_view('photos/pages/albums', $user), 'controls' => $control, 'module_width' => '850px');
//set page layout
$module['content'] = ossn_set_page_layout('module', $contents);
$content = ossn_set_page_layout('contents', $module);
echo ossn_view_page($title, $content);
}
break;
case 'profile':
if (isset($album[1])) {
$title = ossn_print('profile:photos');
$user['user'] = ossn_user_by_guid($album[1]);
if (empty($user['user']->guid)) {
ossn_error_page();
}
//view profile photos in module layout
$contents = array('title' => ossn_print('photos'), 'content' => ossn_plugin_view('photos/pages/profile/photos/all', $user), 'controls' => false, 'module_width' => '850px');
$module['content'] = ossn_set_page_layout('module', $contents);
//set page layout
$content = ossn_set_page_layout('contents', $module);
echo ossn_view_page($title, $content);
}
break;
case 'covers':
if (isset($album[2]) && $album[1] == 'profile') {
$title = ossn_print('profile:covers');
$user['user'] = ossn_user_by_guid($album[2]);
if (empty($user['user']->guid)) {
ossn_error_page();
}
//view profile photos in module layout
$contents = array('title' => ossn_print('covers'), 'content' => ossn_plugin_view('photos/pages/profile/covers/all', $user), 'controls' => false, 'module_width' => '850px');
$module['content'] = ossn_set_page_layout('module', $contents);
//set page layout
$content = ossn_set_page_layout('contents', $module);
echo ossn_view_page($title, $content);
}
break;
case 'add':
//add photos (ajax)
echo ossn_plugin_view('output/ossnbox', array('title' => ossn_print('add:album'), 'contents' => ossn_plugin_view('photos/pages/album/add'), 'success_id' => 'aga', 'callback' => '#ossn-album-submit'));
break;
default:
ossn_error_page();
break;
}
}
示例15: ossn_group_comment_post
function ossn_group_comment_post($hook, $type, $return, $params)
{
$notif = $params;
$baseurl = ossn_site_url();
$user = ossn_user_by_guid($notif->poster_guid);
$user->fullname = "<strong>{$user->fullname}</strong>";
$img = "<div class='notification-image'><img src='{$baseurl}/avatar/{$user->username}/small' /></div>";
$url = ossn_site_url("post/view/{$notif->subject_guid}");
if (preg_match('/like/i', $notif->type)) {
$type = 'like';
}
if (preg_match('/comments/i', $notif->type)) {
$type = 'comment';
$url = ossn_site_url("post/view/{$notif->subject_guid}#comments-item-{$notif->item_guid}");
}
$type = "<div class='ossn-notification-icon-{$type}'></div>";
if ($notif->viewed !== NULL) {
$viewed = '';
} elseif ($notif->viewed == NULL) {
$viewed = 'class="ossn-notification-unviewed"';
}
$notification_read = "{$baseurl}notification/read/{$notif->guid}?notification=" . urlencode($url);
return "<a href='{$notification_read}'>\n\t <li {$viewed}> {$img} \n\t\t <div class='notfi-meta'> {$type}\n\t\t <div class='data'>" . ossn_print("ossn:notifications:{$notif->type}", array($user->fullname)) . '</div>
</div></li>';
}