本文整理汇总了PHP中ossn_view函数的典型用法代码示例。如果您正苦于以下问题:PHP ossn_view函数的具体用法?PHP ossn_view怎么用?PHP ossn_view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ossn_view函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: chatroom_page
function chatroom_page()
{
$title = 'Chatroom';
$contents = array('content' => ossn_view('components/chatroom/index'));
$content = ossn_set_page_layout('newsfeed', $contents);
echo ossn_view_page($title, $content);
}
示例2: ossn_search_page
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_view('components/OssnSearch/pages/search', $contents));
$content = ossn_set_page_layout('search', $contents);
echo ossn_view_page($title, $content);
break;
default:
ossn_error_page();
break;
}
}
示例3: ossn_plugin_view
/**
* View a plugin
* Plugins are registered using ossn_register_plugins_by_path()
*
* @param string $plugin A valid plugin name;
* @param array|object $vars A valid arrays or object
* @return void|mixed
*/
function ossn_plugin_view($plugin = '', $vars = array())
{
global $Ossn;
if (isset($Ossn->plugins[$plugin])) {
$extended_views = ossn_fetch_extend_views($plugin, $vars);
return ossn_view($Ossn->plugins[$plugin] . $plugin, $vars) . $extended_views;
}
}
示例4: ossn_plugin_view
/**
* View a plugin
* Plugins are registered using ossn_register_plugins_by_path()
*
* @param string $plugin A valid plugin name;
* @param array|object $vars A valid arrays or object
* @return void|mixed
*/
function ossn_plugin_view($plugin = '', $vars = array(), $type = 'default')
{
global $Ossn;
$args = array('plugin' => $plugin);
$plugin_type = ossn_call_hook('plugin', 'view:type', $args, $type);
if (isset($Ossn->plugins[$plugin_type][$plugin])) {
$extended_views = ossn_fetch_extend_views($plugin, $vars);
return ossn_view($Ossn->plugins[$plugin_type][$plugin] . $plugin, $vars) . $extended_views;
}
}
示例5: ossn_view_sections_menu
/**
* View section base menu;
* @params: $type = (frontend or backend(
* @note This will fetch layout from defualt template that how menu should appear; check menu file for more info;
*
* @last edit: $arsalanshah
* @return: mixed data;
*
*/
function ossn_view_sections_menu($menu, $type = 'frontend')
{
global $Ossn;
if (isset($menu) && isset($Ossn->sectionsmenu[$type][$menu])) {
$active_theme = ossn_site_settings('theme');
$params['menu'] = $Ossn->sectionsmenu[$type][$menu];
$params['menuname'] = $menu;
return ossn_view("themes/{$active_theme}/menus/sections/{$menu}", $params);
}
}
示例6: ossn_invite_pagehandler
/**
* 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_view('components/OssnInvite/pages/invite');
$content = ossn_set_page_layout('newsfeed', $contents);
echo ossn_view_page($title, $content);
}
示例7: severpages
function severpages($pages)
{
if (!ossn_isLoggedin()) {
ossn_error_page();
}
$title = ossn_print('com:ossn:severload');
//give a exact path to file <components/serverpages/pages/serverload>
$contents['content'] = ossn_view('components/serverpages/pages/severload');
$content = ossn_set_page_layout('contents', $contents);
echo ossn_view_page($title, $content);
}
示例8: ossn_site_pages
function ossn_site_pages($pages)
{
$page = $pages[0];
if (empty($page)) {
redirect(REF);
}
$OssnSitePages = new OssnSitePages();
switch ($page) {
case 'about':
$OssnSitePages->pagename = 'about';
$OssnSitePages = $OssnSitePages->getPage();
if (isset($OssnSitePages->description)) {
$params['contents'] = html_entity_decode(html_entity_decode($OssnSitePages->description));
}
$params['title'] = ossn_print('site:about');
$title = $params['title'];
$contents = array('content' => ossn_view('components/OssnSitePages/pages/page', $params));
$content = ossn_set_page_layout('contents', $contents);
echo ossn_view_page($title, $content);
break;
case 'terms':
$OssnSitePages->pagename = 'terms';
$OssnSitePages = $OssnSitePages->getPage();
if (isset($OssnSitePages->description)) {
$params['contents'] = html_entity_decode(html_entity_decode($OssnSitePages->description));
}
$params['title'] = ossn_print('site:terms');
$title = $params['title'];
$contents = array('content' => ossn_view('components/OssnSitePages/pages/page', $params));
$content = ossn_set_page_layout('contents', $contents);
echo ossn_view_page($title, $content);
break;
case 'privacy':
$OssnSitePages->pagename = 'privacy';
$OssnSitePages = $OssnSitePages->getPage();
if (isset($OssnSitePages->description)) {
$params['contents'] = html_entity_decode(html_entity_decode($OssnSitePages->description));
}
$params['title'] = ossn_print('site:privacy');
$title = $params['title'];
$contents = array('content' => ossn_view('components/OssnSitePages/pages/page', $params));
$content = ossn_set_page_layout('contents', $contents);
echo ossn_view_page($title, $content);
break;
default:
ossn_error_page();
break;
}
}
示例9: ossn_trigger_js_cache
/**
* Generate js cache
*
* @return false|null
*/
function ossn_trigger_js_cache()
{
global $Ossn;
require_once ossn_route()->libs . 'minify/JSMin.php';
$dir = ossn_route()->cache;
if (!is_dir("{$dir}js/view/")) {
mkdir("{$dir}js/view/", 0755, true);
}
if (!isset($Ossn->js)) {
return false;
}
foreach ($Ossn->js as $name => $file) {
$cache_file = "{$dir}js/view/{$name}.js";
$js = JSMin::minify(ossn_view($file));
$js .= JSMin::minify(ossn_fetch_extend_views("js/{$name}"));
file_put_contents($cache_file, $js);
}
}
示例10: ossn_administrator_login_pagehandler
/**
* Register a page handler for administrator login;
* @pages:
* administrator/login,
* @return mixeddata
*/
function ossn_administrator_login_pagehandler($pages)
{
$page = $pages[0];
if (empty($page)) {
$page = 'login';
}
switch ($page) {
case 'login':
$title = 'Login';
$contents['contents'] = ossn_view("pages/administrator/contents/login");
$contents['title'] = $title;
$content = ossn_set_page_layout('administrator/login', $contents);
echo ossn_view_page($title, $content, 'administrator');
break;
default:
echo 403;
break;
}
}
示例11: ossn_view_template
/**
* View a template
*
* Use a templates from core (image view, url view etc)
*
* @param string $template A name of template
* @param array $params
*
* @return mix data
*/
function ossn_view_template($template = '', array $params)
{
if (!empty($template)) {
return ossn_view("system/templates/{$template}", $params);
}
}
示例12: ossn_notifications_page
/**
* Notifications page
*
* @param (array) $pages Array containg pages
*
* @return mixed data;
* @access public
*/
function ossn_notifications_page($pages)
{
$page = $pages[0];
if (empty($page)) {
return false;
}
switch ($page) {
case 'all':
$title = 'Notifications';
$contents = array('content' => ossn_view('components/OssnNotifications/pages/all'));
$content = ossn_set_page_layout('media', $contents);
echo ossn_view_page($title, $content);
break;
default:
ossn_error_page();
break;
}
}
示例13: ossn_print
<?php
/**
* OpenSource-SocialNetwork
*
* @package (Informatikon.com).ossn
* @author OSSN Core Team <info@opensource-socialnetwork.com>
* @copyright 2014 iNFORMATIKON TECHNOLOGIES
* @license General Public Licence http://opensource-socialnetwork.com/licence
* @link http://www.opensource-socialnetwork.com/licence
*/
$title = ossn_print('site:index');
$content = ossn_set_page_layout('startup', array('content' => ossn_view('pages/contents/index')));
echo ossn_view_page($title, $content);
示例14: ossn_print
?>
<?php
echo ossn_print("ossn:liked:you");
?>
<?php
} elseif ($user_liked == true && $count > 1) {
$count = $count - 1;
$total = 'person';
if ($count > 1) {
$total = 'people';
}
$link['onclick'] = "Ossn.ViewLikes({$object}, 'entity');";
$link['href'] = '#';
$link['text'] = ossn_print("ossn:like:{$total}", array($count));
$link = ossn_view('system/templates/output/url', $link);
echo ossn_print("ossn:like:you:and:this", array($link));
} elseif (!$user_liked) {
$total = 'person';
if ($count > 1) {
$total = 'people';
}
$link['onclick'] = "Ossn.ViewLikes({$object}, 'entity');";
$link['href'] = '#';
$link['text'] = ossn_print("ossn:like:{$total}", array($count));
$link = ossn_view('system/templates/output/url', $link);
echo ossn_print("ossn:like:this", array($link));
}
?>
</div>
<?php
}
示例15: ossn_post_page
function ossn_post_page($pages)
{
$page = $pages[0];
if (empty($page)) {
return false;
}
switch ($page) {
case 'view':
$title = ossn_print('post:view');
$wall = new OssnWall();
$post = $pages[1];
$post = $wall->GetPost($post);
if (empty($post->guid) || empty($pages[1])) {
ossn_error_page();
}
$params['post'] = $post;
$contents = array('content' => ossn_view('components/OssnWall/pages/view', $params));
$content = ossn_set_page_layout('newsfeed', $contents);
echo ossn_view_page($title, $content);
break;
case 'photo':
if (isset($pages[1]) && isset($pages[2])) {
$image = ossn_get_userdata("object/{$pages[1]}/ossnwall/images/{$pages[2]}");
header('Content-Type: image/jpeg');
echo file_get_contents($image);
}
break;
case 'privacy':
if (ossn_is_xhr()) {
$params = array('title' => ossn_print('privacy'), 'contents' => ossn_view('components/OssnWall/wall/privacy'), 'callback' => '#ossn-wall-privacy');
echo ossn_view('system/templates/ossnbox', $params);
}
break;
case 'refresh_home':
echo ossn_view('components/OssnWall/wall/siteactivity');
break;
default:
ossn_error_page();
break;
}
}