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; } }
function ossn_search_page($pages) { $page = $pages[0]; if (empty($page)) { $page = 'search'; } ossn_trigger_callback('page', 'load:search'); switch ($page) { case 'search': $query = input('q'); $type = input('type'); $title = ossn_print("search:result", array($query)); if (empty($type)) { $params['type'] = 'users'; } else { $params['type'] = $type; } $type = $params['type']; if (ossn_is_hook('search', "type:{$type}")) { $contents['contents'] = ossn_call_hook('search', "type:{$type}", array('q' => input('q'))); } $contents = array('content' => ossn_plugin_view('search/pages/search', $contents)); $content = ossn_set_page_layout('search', $contents); echo ossn_view_page($title, $content); break; default: ossn_error_page(); break; } }
/** * Register user about page * * @return string */ function profile_about_user_page($hook, $type, $return, $params) { $page = $params['subpage']; if ($page == 'about') { $content = ossn_plugin_view('profile/about', $params); echo ossn_set_page_layout('module', array('title' => ossn_print('aboutuser'), 'content' => $content)); } }
/** * Invite page handler * * @note Please don't call this function directly in your code. * * @return mixed * @access private */ function ossn_invite_pagehandler() { if (!ossn_isLoggedin()) { ossn_error_page(); } $title = ossn_print('com:ossn:invite:friends'); $contents['content'] = ossn_plugin_view('invites/pages/invite'); $content = ossn_set_page_layout('newsfeed', $contents); echo ossn_view_page($title, $content); }
function ossn_messages_page($pages) { if (!ossn_isLoggedin()) { ossn_error_page(); } $OssnMessages = new OssnMessages(); $page = $pages[0]; if (empty($page)) { $page = 'messages'; } switch ($page) { case 'message': $username = $pages[1]; if (!empty($username)) { $user = ossn_user_by_username($username); if (empty($user->guid)) { ossn_error_page(); } $title = ossn_print('ossn:message:between', array($user->fullname)); $OssnMessages->markViewed($user->guid, ossn_loggedin_user()->guid); $params['data'] = $OssnMessages->get(ossn_loggedin_user()->guid, $user->guid); $params['user'] = $user; $params['recent'] = $OssnMessages->recentChat(ossn_loggedin_user()->guid); $contents = array('content' => ossn_plugin_view('messages/pages/view', $params)); $content = ossn_set_page_layout('media', $contents); echo ossn_view_page($title, $content); } else { ossn_error_page(); } break; case 'all': $params['recent'] = $OssnMessages->recentChat(ossn_loggedin_user()->guid); $active = $params['recent'][0]; if (isset($active->message_to) && $active->message_to == ossn_loggedin_user()->guid) { $getuser = $active->message_from; } if (isset($active->message_from) && $active->message_from == ossn_loggedin_user()->guid) { $getuser = $active->message_to; } if (isset($getuser)) { $user = ossn_user_by_guid($getuser); $OssnMessages->markViewed($getuser, ossn_loggedin_user()->guid); $params['data'] = $OssnMessages->get(ossn_loggedin_user()->guid, $getuser); $params['user'] = $user; } $contents = array('content' => ossn_plugin_view('messages/pages/messages', $params)); if (!isset($getuser)) { $contents = array('content' => ossn_plugin_view('messages/pages/messages-none')); } $title = ossn_print('messages'); $content = ossn_set_page_layout('media', $contents); echo ossn_view_page($title, $content); break; case 'getnew': $username = $pages[1]; $guid = ossn_user_by_username($username)->guid; $messages = $OssnMessages->getNew($guid, ossn_loggedin_user()->guid); if ($messages) { foreach ($messages as $message) { $user = ossn_user_by_guid($message->message_from); $message = $message->message; $params['user'] = $user; $params['message'] = $message; echo ossn_plugin_view('messages/templates/message-send', $params); } $OssnMessages->markViewed($guid, ossn_loggedin_user()->guid); echo '<script>Ossn.playSound();</script>'; } break; case 'getrecent': $params['recent'] = $OssnMessages->recentChat(ossn_loggedin_user()->guid); echo ossn_plugin_view('messages/templates/message-with', $params); break; default: ossn_error_page(); break; } }
/** * Comment view * * @param array $vars Options * @param string $template Template name * @return mixed data */ function ossn_comment_view($params, $template = 'comment') { $vars = ossn_call_hook('comment:view', 'template:params', $params, $params); return ossn_plugin_view("comments/templates/{$template}", $vars); }
<?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 */ ?> <div class="ossn-layout-admin"> <?php echo ossn_plugin_view('theme/page/elements/system_messages', array('admin' => true)); ?> <div class="row"> <div class="col-md-12 contents"> <?php echo $params['contents']; ?> </div> </div> </div>
/** * Wall template view * Depends on wall post type * * @param string $callback Name of callback * @param string $type Callback type * @param array $params Arrays or Objects * * @return mixed data * @access private */ function ossn_wall_templates($hook, $type, $return, $params) { $params = ossn_call_hook('wall', 'templates:item', $params, $params); return ossn_plugin_view("wall/templates/wall/{$type}/item", $params); }
<option value="male" <?php echo $male; ?> ><?php echo ossn_print('male'); ?> </option> <option value="female" <?php echo $female; ?> ><?php echo ossn_print('female'); ?> </option> </select> <label><?php echo ossn_print('language'); ?> </label> <?php echo ossn_plugin_view('input/dropdown', array('name' => 'language', 'value' => $user->language, 'options' => ossn_get_installed_translations(false))); ?> <input type="hidden" value="<?php echo $user->username; ?> " name="username"/> <input type="submit" class="ossn-button ossn-button-submit" value="<?php echo ossn_print('save'); ?> "/>
<div class="ossn-topbar-dropdown-menu"> <label class="ossn-topbar-dropdown-menu-button"><span class="arrow"></span></label> <ul class="ossn-topbar-dropdown-menu-content"> <li> <a href="<?php echo ossn_site_url("u/" . ossn_loggedin_user()->username . "/edit"); ?> "><?php echo ossn_print('acount:settings'); ?> </a> </li> <li> <?php echo ossn_plugin_view('output/url', array('href' => ossn_site_url('action/user/logout'), 'text' => ossn_print('logout'), 'action' => true)); ?> </li> </ul> </div> </div> <!-- notification box --> <div class="ossn-notifications-box" style="height: 140px;"> <div class="selected"></div> <div class="type-name"> <?php echo ossn_print('notifications'); ?> </div> <div class="metadata"> <div style="height: 66px;">
$posts = $wall->getFriendsPosts(); } if ($posts) { foreach ($posts as $post) { 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); if ($post->access == OSSN_FRIENDS) { if (ossn_user_is_friend(ossn_loggedin_user()->guid, $post->owner_guid) || ossn_loggedin_user()->guid == $post->owner_guid) { echo ossn_plugin_view('wall/templates/activity-item', array('post' => $post, 'friends' => explode(',', $data->friend), 'text' => $text, 'location' => $location, 'user' => $user, 'image' => $image)); } } if ($post->access == OSSN_PUBLIC) { echo ossn_plugin_view('wall/templates/activity-item', array('post' => $post, 'friends' => explode(',', $data->friend), 'text' => $text, 'location' => $location, 'user' => $user, 'image' => $image)); } unset($data->friend); } } echo ossn_view_pagination($count);
</script> </head> <body> <div class="ossn-halt ossn-light"></div> <div class="ossn-message-box"></div> <div class="ossn-viewer" style="display:none"></div> <div class="opensource-socalnetwork"> <?php echo ossn_plugin_view('theme/page/elements/sidebar'); ?> <div class="ossn-page-container"> <?php echo ossn_plugin_view('theme/page/elements/topbar'); ?> <div class="ossn-inner-page"> <?php echo $contents; ?> </div> </div> </div> <?php echo ossn_fetch_extend_views('ossn/page/footer'); ?> </body> </html>
if (empty($settings)) { $settings = 'list'; } switch ($settings) { case 'list': echo ossn_plugin_view('ads/pages/list'); break; case 'add': echo ossn_plugin_view('ads/pages/add'); break; case 'edit': $id = input('id'); if (!empty($id)) { $ads = new OssnAds(); $params['entity'] = $ads->getAd($id); echo ossn_plugin_view('ads/pages/edit', $params); } break; //missing 'view' case - 'Browse' didn't work #233 //missing 'view' case - 'Browse' didn't work #233 case 'view': $id = input('id'); if (!empty($id)) { $ads = new OssnAds(); $params['entity'] = $ads->getAd($id); echo ossn_plugin_view('ads/pages/view', $params); } break; default: break; }
<?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 */ echo '<div class="ossn-viewer-comments">'; echo ossn_plugin_view('comments/base', array('entity_guid' => $params['entity_guid'])); echo '</div>';
<?php if (isset($params['subpage']) && !empty($params['subpage']) && ossn_is_profile_subapge($params['subpage'])) { if (ossn_is_hook('profile', 'subpage')) { echo ossn_call_hook('profile', 'subpage', $params); } } else { ?> <div class="ossn-profile-modules"> <?php if (ossn_is_hook('profile', 'modules')) { $params['user'] = $user; $modules = ossn_call_hook('profile', 'modules', $params); echo implode('', $modules); } ?> </div> <div class="ossn-profile-wall"> <?php if (com_is_active('OssnWall')) { $params['user'] = $user; echo ossn_plugin_view('wall/user/wall', $params); } ?> </div> <?php } ?> </div>
* * @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 */ // load active chats $active_sessions = OssnChat::GetActiveSessions(); if ($active_sessions) { foreach ($active_sessions as $user) { $user = ossn_user_by_guid($user); $friend['user'] = $user; echo ossn_plugin_view('chat/selectfriend', $friend); } } ?> </div> </div> <audio id="ossn-chat-sound" src="<?php echo ossn_site_url("components/OssnChat/sound/pling.mp3"); ?> " preload="auto"></audio> <div class="ossn-chat-windows-long"> <div class="inner"> <?php echo ossn_plugin_view('chat/friends/status'); ?> </div> </div>
/** * View post likes modal box * * @return mix data; * @access public; */ function ossn_likesview_page_handler() { echo ossn_plugin_view('output/ossnbox', array('title' => ossn_print('people:like:this'), 'contents' => ossn_plugin_view('likes/pages/view'), 'control' => false)); }
</div> <div class="admin-dashboard-contents center admin-dashboard-fixed-height"> <div class="text center"> <a href="<?php echo $flush_cache; ?> " class="btn btn-primary"><?php echo ossn_print('admin:flush:cache'); ?> </a> </div> <canvas id="users-classified-graph"></canvas> <div id="userclassified-lineLegend"></div> </div> </div> </div> </div> </div> <!-- <div class="ossn-message-developers"> <h2> News from Developers</h2> Hi this is mesage from our site </div> --> <?php echo ossn_plugin_view('javascripts/dynamic/admin/dashboard/users/users'); echo ossn_plugin_view('javascripts/dynamic/admin/dashboard/users/classfied', array('total' => $total)); echo ossn_plugin_view('javascripts/dynamic/admin/dashboard/users/online/classfied', array('total' => $online));
* * @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 */ if (!isset($params['params'])) { $params['params'] = array(); } if ($params['type'] == false) { $body = ossn_plugin_view("forms/{$params['component']}/{$params['name']}", $params['params']); } if ($params['type'] == 'core') { $body = ossn_plugin_view('forms/' . $params['name'], $params['params']); } if (isset($params['class'])) { $params['class'] = "ossn-form {$params['class']}"; } else { $params['class'] = 'ossn-form'; } unset($params['name']); unset($params['type']); unset($params['params']); unset($params['component']); if (!isset($params['method'])) { $params['method'] = 'post'; } $token = ossn_plugin_view('input/security_token'); $attributes = ossn_args($params); echo "<form {$attributes} enctype='multipart/form-data'><fieldset>{$token} {$body}</fieldset></form>";
/** * Group member requests page * * Page: * group/<guid>/requests * * @return mixdata; * @access private */ function group_requests_page($hook, $type, $return, $params) { $page = $params['subpage']; $group = ossn_get_group_by_guid(ossn_get_page_owner_guid()); if ($page == 'requests') { if ($group->owner_guid !== ossn_loggedin_user()->guid) { redirect("group/{$group->guid}"); } $mod_content = ossn_plugin_view('groups/pages/requests', array('group' => $group)); $mod = array('title' => ossn_print('requests'), 'content' => $mod_content); echo ossn_set_page_layout('module', $mod); } }
foreach ($menu as $name => $link) { $class = "menu-user-timeline-" . $link['name']; if (isset($link['class'])) { $link['class'] = $class . ' ' . $link['class']; } else { $link['class'] = $class; } unset($link['name']); $link['text'] = ossn_print($link['text']); $link = ossn_plugin_view('output/url', $link); echo "<li>{$link}</li>"; } } else { echo "<li class='dropdown'><a href='javascript:void(0);' data-toggle='dropdown' class='dropdown-toggle'>" . ossn_print('more') . "<i class='fa fa-caret-down'></i></a>\r\n\t\t <ul class='dropdown-menu'>"; foreach ($menu as $name => $link) { $class = "menu-user-timeline-" . $link['name']; if (isset($link['class'])) { $link['class'] = $class . ' ' . $link['class']; } else { $link['class'] = $class; } unset($link['name']); $link['text'] = ossn_print($link['text']); $link = ossn_plugin_view('output/url', $link); echo "<li>{$link}</li>"; } echo "</ul>\r\n\t\t </li>"; } $i++; } echo '</ul>';
/** * Check if the requested js is registered then load js * * @return bool */ function ossn_js_trigger($hook, $type, $value, $params) { global $Ossn; if (isset($params[1]) && substr($params[1], '-3') == '.js') { $params[1] = str_replace('.js', '', $params[1]); if (isset($Ossn->js[$params[1]])) { $file = ossn_plugin_view($Ossn->js[$params[1]]); $extended = ossn_fetch_extend_views("js/{$params[1]}"); $data = array($file, $extended); return implode('', $data); } } return false; }
</a> <br/> <table border="0" class="ossn-photo-viewer"> <tr> <td class="image-block" style="text-align: center;width:465px;min-height:200px;"> <img src="<?php echo ossn_site_url("album/getphoto/") . $image->owner_guid; ?> /<?php echo $img; ?> ?type=1"/> </td> </tr> </table> </div> <br/> <br/> <?php $vars['entity'] = $image; echo ossn_plugin_view('entity/comment/like/share/view', $vars); ?> <div class="ossn-photo-view-controls"> <?php if (ossn_is_hook('photo:view', 'profile:controls')) { echo ossn_call_hook('photo:view', 'profile:controls', $image); } ?> </div>
<?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 */ $title = ossn_print('site:index'); $content = ossn_set_page_layout('startup', array('content' => ossn_plugin_view('pages/contents/index'))); echo ossn_view_page($title, $content);
?> <div class="group-about" style="margin-top: 10px;"> <div class='heading'> <?php echo ossn_print('member:requests', array($params['group']->countRequests())); ?> </div> <div class="members-count"><a href="<?php echo ossn_group_url($params['group']->guid); ?> requests"> <?php echo ossn_print('view:all'); ?> </a></div> </div> <?php } if (com_is_active('OssnAds')) { echo ossn_plugin_view('ads/page/view'); } ?> </div> <?php } ?> </div> </div>
} elseif ($group->membership == OSSN_PRIVATE) { $close = 'selected'; $open = ''; } ?> <option value='2' <?php echo $open; ?> > <?php echo ossn_print('public'); ?> </option> <option value='1' <?php echo $close; ?> > <?php echo ossn_print('close'); ?> </option> </select> <input type="hidden" name="group" value="<?php echo $group->guid; ?> "/> <input type="submit" value="<?php echo ossn_print('save'); ?> " class="ossn-button ossn-button-submit"/> <?php echo ossn_plugin_view('output/url', array('text' => ossn_print('delete'), 'href' => ossn_site_url("action/group/delete?guid={$group->guid}"), 'class' => 'button-grey delete-group ossn-make-sure', 'action' => true));
} elseif ($comment->type == 'comments:post') { echo ' ' . $comment->getParam('comments:post'); } $image = $comment->getParam('file:comment:photo'); if (!empty($image)) { $image = str_replace('comment/photo/', '', $image); $image = ossn_site_url("comment/image/{$comment->id}/{$image}"); echo "<img src='{$image}' />"; } ?> </p> <div class="comment-metadata"> <?php echo ossn_user_friendly_time($comment->time_created); ?> <?php if (ossn_isLoggedIn()) { if (!$OssnLikes->isLiked($comment->id, ossn_loggedin_user()->guid, $type)) { echo ossn_plugin_view('output/url', array('href' => ossn_site_url("action/annotation/like?annotation={$comment->id}"), 'text' => ossn_print('like'), 'class' => 'ossn-like-comment', 'data-type' => 'Like', 'action' => true)); } else { echo ossn_plugin_view('output/url', array('href' => ossn_site_url("action/annotation/unlike?annotation={$comment->id}"), 'text' => ossn_print('unlike'), 'class' => 'ossn-like-comment', 'data-type' => 'Unlike', 'action' => true)); } } // Likes only for loggedin users end // Show total likes echo ossn_plugin_view('output/url', array('href' => 'javascript::;', 'text' => $likes_total, 'class' => "ossn-total-likes-{$comment->id}", 'data-likes' => $datalikes)); ?> </div> </div> </div>
echo ossn_plugin_view('theme/page/elements/system_messages'); ?> <div class="ossn-layout-newsfeed"> <div class="col-md-7"> <div class="newsfeed-middle"> <?php echo $params['content']; ?> </div> </div> <div class="col-md-4"> <?php if (!empty($isempty)) { ?> <div class="newsfeed-right"> <?php echo $sidebar; ?> </div> <?php } ?> </div> </div> </div> <?php echo ossn_plugin_view('theme/page/elements/footer'); ?> </div>
* @copyright 2014 iNFORMATIKON TECHNOLOGIES * @license General Public Licence http://www.opensource-socialnetwork.org/licence * @link http://www.opensource-socialnetwork.org/licence */ $OssnComment = new OssnComments(); $image = input('comment-attachment'); //comment image check if is attached or not if (!empty($image)) { $OssnComment->comment_image = $image; } //post on which comment is going to be posted $post = input('post'); //comment text $comment = input('comment'); if ($OssnComment->PostComment($post, ossn_loggedin_user()->guid, $comment)) { $data['comment'] = ossn_get_comment($OssnComment->getCommentId()); $data = ossn_plugin_view('comments/templates/comment', $data); if (!ossn_is_xhr()) { redirect(REF); } else { header('Content-Type: application/json'); echo json_encode(array('comment' => $data, 'process' => 1)); } } else { if (!ossn_is_xhr()) { redirect(REF); } else { header('Content-Type: application/json'); echo json_encode(array('process' => 0)); } }
/** * Register site index page * @pages: * index or home, * * @return boolean|null */ function ossn_index_pagehandler($index) { if (ossn_isLoggedin()) { redirect('home'); } $page = $index[0]; if (empty($page)) { $page = 'home'; } switch ($page) { case 'home': echo ossn_plugin_view('pages/index'); break; default: ossn_error_page(); break; } }