• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ossn_call_hook函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ossn_call_hook函数的典型用法代码示例。如果您正苦于以下问题:PHP ossn_call_hook函数的具体用法?PHP ossn_call_hook怎么用?PHP ossn_call_hook使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ossn_call_hook函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: 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_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;
    }
}
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:30,代码来源:ossn_com.php


示例2: ossn_register_plugins_by_path

/**
 * Register a plugins by path
 * This will help us to override components files easily.
 * 
 * @param string $path A valid path;
 * @return boolean
 */
function ossn_register_plugins_by_path($path)
{
    global $Ossn;
    if (ossn_site_settings('cache') == 1) {
        return false;
    }
    $type = 'default';
    $type = ossn_call_hook('plugins', 'type', false, $type);
    $path = $path . $type . '/';
    if (!is_dir($path)) {
        //disable error log, will cause a huge log file
        //error_log("Ossn tried to register invalid plugins by path: {$path}");
        return false;
    }
    $path = str_replace("\\", "/", $path);
    $directory = new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS);
    $iterator = new RecursiveIteratorIterator($directory);
    if ($iterator) {
        foreach ($iterator as $file) {
            if (pathinfo($file, PATHINFO_EXTENSION) == "php") {
                $file = str_replace("\\", "/", $file);
                $location = str_replace(dirname(__FILE__) . '/plugins/', '', $file);
                $name = str_replace($path, '', $location);
                $name = substr($name, 0, -4);
                $fpath = substr($file, 0, -4);
                $fpath = str_replace(array($name, ossn_route()->www), '', $fpath);
                $Ossn->plugins[$name] = $fpath;
            }
        }
    }
    return true;
}
开发者ID:sthefanysoares,项目名称:Social-Network,代码行数:39,代码来源:ossn.lib.plugins.php


示例3: ossn_css_pagehandler

/**
 * Add css page handler
 *
 * @return false|null
 */
function ossn_css_pagehandler($css)
{
    if (ossn_site_settings('cache') == 1) {
        return false;
    }
    header("Content-type: text/css");
    $page = $css[0];
    if (empty($css[1])) {
        header('Content-Type: text/html; charset=utf-8');
        ossn_error_page();
    }
    if (empty($page)) {
        $page = 'view';
    }
    switch ($page) {
        case 'view':
            if (ossn_site_settings('cache') == 1) {
                return false;
            }
            if (ossn_is_hook('css', "register")) {
                echo ossn_call_hook('css', "register", $css);
            }
            break;
        default:
            header('Content-Type: text/html; charset=utf-8');
            ossn_error_page();
            break;
    }
}
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:34,代码来源:ossn.lib.css.php


示例4: ossn_css_pagehandler

function ossn_css_pagehandler($css)
{
    if (ossn_site_settings('cache') == 1) {
        return false;
    }
    header("Content-type: text/css");
    $page = $css[0];
    if (empty($css[1])) {
        echo '404 SWITCH ERROR';
    }
    if (empty($page)) {
        $page = 'view';
    }
    switch ($page) {
        case 'view':
            if (ossn_site_settings('cache') == 1) {
                return false;
            }
            if (ossn_is_hook('css', "register")) {
                echo ossn_call_hook('css', "register", $css);
            }
            break;
        default:
            echo '404 SWITCH ERROR';
            break;
    }
}
开发者ID:alibasli,项目名称:Social-Network-PHP-Joomla,代码行数:27,代码来源:ossn.lib.css.php


示例5: 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;
    }
}
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:18,代码来源:ossn.lib.plugins.php


示例6: ossn_view

/**
 * View a file
 *
 * @param string $file valid file name of php file without extension;
 * @param array $params Options;
 * @last edit: $arsalanshah
 * @return mixed data
 */
function ossn_view($path = '', $params = array())
{
    global $VIEW;
    if (isset($path) && !empty($path)) {
        //call hook in case to over ride the view
        if (ossn_is_hook('halt', "view:{$path}")) {
            return ossn_call_hook('halt', "view:{$path}", $params);
        }
        $path = ossn_route()->www . $path;
        $file = ossn_include($path . '.php', $params);
        return $file;
    }
}
开发者ID:aidovoga,项目名称:opensource-socialnetwork,代码行数:21,代码来源:ossn.lib.views.php


示例7: ossn_load_page

function ossn_load_page($handler, $page)
{
    global $Ossn;
    ossn_add_context($handler);
    $page = explode('/', $page);
    if (isset($Ossn->page) && isset($Ossn->page[$handler]) && !empty($handler) && is_callable($Ossn->page[$handler])) {
        ob_start();
        call_user_func($Ossn->page[$handler], $page, $handler);
        $contents = ob_get_clean();
        $params['page'] = $page;
        $params['handler'] = $handler;
        return ossn_call_hook('page', 'load', $params, $contents);
    } else {
        return ossn_error_page();
    }
}
开发者ID:alibasli,项目名称:Social-Network-PHP-Joomla,代码行数:16,代码来源:ossn.lib.page.php


示例8: execute

 /**
  * Execute a mysqli query and store result in memory
  *
  * @return bool;
  */
 public function execute()
 {
     $this->database = $this->Connect();
     if (isset($this->query) && !empty($this->query)) {
         $this->database->set_charset("utf8");
         $this->exe = $this->database->query($this->query);
         $exception = ossn_call_hook('database', 'execution:message', false, true);
         if (!$this->exe && $exception) {
             throw new OssnDatabaseException("{$this->database->error} \n {$this->query} ");
         }
         if (isset($this->database->insert_id)) {
             $this->last_id = $this->database->insert_id;
         }
         unset($this->query);
         $this->database->close();
         return true;
     }
     return false;
 }
开发者ID:aidovoga,项目名称:opensource-socialnetwork,代码行数:24,代码来源:OssnDatabase.php


示例9: NotifiyUser

 /**
  * Send email to user.
  *
  * @param string $email User email address
  * @param string $subject Email subject
  * @param string $body Email body
  *
  * @return boolean
  */
 public function NotifiyUser($email, $subject, $body)
 {
     if (empty($email)) {
         error_log('Can not send email to empty email address', 0);
     }
     $this->setFrom(ossn_site_settings('notification_email'), ossn_site_settings('site_name'));
     $this->addAddress($email);
     $this->Subject = $subject;
     $this->Body = $body;
     $this->CharSet = "UTF-8";
     try {
         $send = ossn_call_hook('email', 'send', $this->send(), $this);
         if ($send) {
             return true;
         }
     } catch (phpmailerException $e) {
         error_log("Cannot send email " . $e->errorMessage(), 0);
     }
     return false;
 }
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:29,代码来源:OssnMail.php


示例10: ossn_load_page

/**
 * Output a page.
 *
 * If page is not registered then user will see a 404 page;
 *
 * @param  (string) $handler Page handler name;
 * @param  (string) $page  handler/page;
 * @last edit: $arsalanshah
 * @Reason: Initial;
 *
 * @return mix|null data
 * @access private
 */
function ossn_load_page($handler, $page)
{
    global $Ossn;
    $context = $handler;
    if (isset($page) && !empty($page)) {
        $context = "{$handler}/{$page}";
    }
    //set context
    ossn_add_context($context);
    $page = explode('/', $page);
    if (isset($Ossn->page) && isset($Ossn->page[$handler]) && !empty($handler) && is_callable($Ossn->page[$handler])) {
        //get page contents
        ob_start();
        call_user_func($Ossn->page[$handler], $page, $handler);
        $contents = ob_get_clean();
        //supply params to hook
        $params['page'] = $page;
        $params['handler'] = $handler;
        return ossn_call_hook('page', 'load', $params, $contents);
    } else {
        return ossn_error_page();
    }
}
开发者ID:ntmtri23,项目名称:lienminh365,代码行数:36,代码来源:ossn.lib.page.php


示例11: mimeTypes

 /**
  * MIME types.
  *
  * This function contains most commonly used MIME types in Ossn
  * 
  * You can find mimtypes on the url below:
  * http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/conf/mime.types?view=markup
  *
  * Extra mimetypes has been removed in Ossn v3.1. You can add a hook to extends mimetypes
  *
  * @return array 
  */
 public static function mimeTypes()
 {
     $mimetypes = array('doc' => array('application/msword'), 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document'), 'gif' => array('image/gif'), 'jpeg' => array('image/jpeg'), 'jpg' => array('image/jpeg'), 'mp3' => array('audio/mpeg'), 'mp4' => array('video/mp4'), 'pdf' => array('application/pdf'), 'png' => array('image/png'), 'zip' => array('application/zip'));
     return ossn_call_hook('file', 'mimetypes', false, $mimetypes);
 }
开发者ID:emnaborgi,项目名称:RS,代码行数:17,代码来源:OssnFile.php


示例12: ossn_call_hook

                    <?php 
    }
    ?>
                <?php 
}
?>
            </div>

        </div>
    </div>
    <!-- End of Header -->
    <div class="group-body">
        <?php 
if (isset($params['subpage']) && !empty($params['subpage']) && ossn_is_group_subapge($params['subpage'])) {
    if (ossn_is_hook('group', 'subpage')) {
        echo ossn_call_hook('group', 'subpage', $params);
    }
} else {
    ?>
            <div class="group-wall">
                <?php 
    //#113 make contents of public groups visible.
    //send ismember, and member ship param to group wall
    echo ossn_plugin_view('wall/group', array('group' => $params, 'ismember' => $ismember, 'membership' => $params['group']->membership));
    if ($params['group']->membership == OSSN_PRIVATE && $ismember !== 1) {
        ?>
                    <div class="group-closed-container">
                        <div class="title-h3"><?php 
        echo ossn_print('closed:group');
        ?>
</div>
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:31,代码来源:profile.php


示例13: ossn_wall_templates

/**
 * 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);
}
开发者ID:sthefanysoares,项目名称:Social-Network,代码行数:16,代码来源:ossn_com.php


示例14: ossn_call_hook

 * @author    OSSN Core Team <[email protected]>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://opensource-socialnetwork.com/licence
 * @link      http://www.opensource-socialnetwork.com/licence
 */
?>
<style> body {
        background: #FDFDFD;
    } </style>
<div class="ossn-layout-newsfeed">
    <div class="ossn-inner">
        <div class="coloum-left">
            &nbsp;
            <?php 
if (ossn_is_hook('search', "left")) {
    $searchleft = ossn_call_hook('search', "left", NULL, array());
    echo implode('', $searchleft);
}
?>

        </div>
        <div class="coloum-middle">
            <?php 
echo $params['content'];
?>

        </div>
        <div class="coloum-right">
            <div style="padding:12px;min-height:300px;">
                <?php 
if (com_is_active('OssnAds')) {
开发者ID:aidovoga,项目名称:opensource-socialnetwork,代码行数:31,代码来源:search.php


示例15: ossn_site_url

  </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>
开发者ID:emnaborgi,项目名称:RS,代码行数:31,代码来源:view.php


示例16: SendResetLogin

 /**
  * Send user reset password link
  *
  * @return bool;
  */
 public function SendResetLogin()
 {
     self::initAttributes();
     $this->old_code = $this->getParam('login:reset:code');
     $this->type = 'user';
     $this->subtype = 'login:reset:code';
     $this->owner_guid = $this->guid;
     if (!isset($this->{'login:reset:code'}) && empty($this->old_code)) {
         $this->value = md5(time() . $this->guid);
         $this->add();
     } else {
         $this->value = md5(time() . $this->guid);
         $this->data->{'login:reset:code'} = $this->value;
         $this->save();
     }
     $emailreset_url = ossn_site_url("resetlogin?user={$this->username}&c={$this->value}");
     $emailreset_url = ossn_call_hook('user', 'icon:urls', $this, $emailreset_url);
     $sitename = ossn_site_settings('site_name');
     $emailmessage = ossn_print('ossn:reset:password:body', array($this->first_name, $emailreset_url, $sitename));
     $emailsubject = ossn_print('ossn:reset:password:subject');
     if (!empty($this->value)) {
         return true;
     }
     return false;
 }
开发者ID:alibasli,项目名称:Social-Network-PHP-Joomla,代码行数:30,代码来源:OssnUser.php


示例17: ossn_call_hook

<?php

/**
 * Open Source Social Network
 *
 * @package   (Informatikon.com).ossn
 * @author    OSSN Core Team <[email protected]>
 * @copyright 2014 iNFORMATIKON TECHNOLOGIES
 * @license   General Public Licence http://www.opensource-socialnetwork.org/licence
 * @link      http://www.opensource-socialnetwork.org/licence
 */
//unused pagebar skeleton when ads are disabled #628
if (ossn_is_hook('newsfeed', "sidebar:right")) {
    $newsfeed_right = ossn_call_hook('newsfeed', "sidebar:right", NULL, array());
    $sidebar = implode('', $newsfeed_right);
    $isempty = trim($sidebar);
}
?>
<div class="container">
	<div class="row">
       	<?php 
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>
开发者ID:atlantidaformacion,项目名称:nestheme,代码行数:31,代码来源:newsfeed.php


示例18: searchObject

 /**
  * Search object by its title, description etc
  *
  * @param array $params A valid options in format:
  * 	  'search_type' => true(default) to performs matching on a per-character basis 
  * 					  false for performs matching on exact value.
  * 	  'subtype' 	=> Valid object subtype
  *	  'type' 		=> Valid object type
  *	  'title'		=> Valid object title
  *	  'description'		=> Valid object description
  *    'owner_guid'  => A valid owner guid, which results integer value
  *    'limit'		=> Result limit default, Default is 20 values
  *	  'order_by'    => To show result in sepcific order. There is no default order.
  * 
  * reutrn array|false;
  *
  */
 public function searchObject(array $params = array())
 {
     self::initAttributes();
     if (empty($params)) {
         return false;
     }
     //prepare default attributes
     $default = array('search_type' => true, 'subtype' => false, 'type' => false, 'owner_guid' => false, 'limit' => false, 'order_by' => false, 'offset' => input('offset', '', 1), 'page_limit' => ossn_call_hook('pagination', 'page_limit', false, 10), 'count' => false);
     $options = array_merge($default, $params);
     $wheres = array();
     //validate offset values
     if ($options['limit'] !== false && $options['limit'] != 0 && $options['page_limit'] != 0) {
         $offset_vals = ceil($options['limit'] / $options['page_limit']);
         $offset_vals = abs($offset_vals);
         $offset_vals = range(1, $offset_vals);
         if (!in_array($options['offset'], $offset_vals)) {
             return false;
         }
     }
     //get only required result, don't bust your server memory
     $getlimit = $this->generateLimit($options['limit'], $options['page_limit'], $options['offset']);
     if ($getlimit) {
         $options['limit'] = $getlimit;
     }
     if (!empty($options['object_guid'])) {
         $wheres[] = "o.guid='{$options['object_guid']}'";
     }
     if (!empty($options['subtype'])) {
         $wheres[] = "o.subtype='{$options['subtype']}'";
     }
     if (!empty($params['type'])) {
         $wheres[] = "o.type='{$options['type']}'";
     }
     if (!empty($params['owner_guid'])) {
         $wheres[] = "o.owner_guid ='{$options['owner_guid']}'";
     }
     //check if developer want to search title or description
     if ($options['search_type'] === true) {
         if (!empty($params['title'])) {
             $wheres[] = "o.title LIKE '%{$options['title']}%'";
         }
         if (!empty($params['description'])) {
             $wheres[] = "o.description LIKE '%{$options['description']}%'";
         }
     } elseif ($options['search_type'] === false) {
         if (!empty($params['title'])) {
             $wheres[] = "o.title = '{$options['title']}'";
         }
         if (!empty($params['description'])) {
             $wheres[] = "o.description = '{$options['description']}'";
         }
     }
     //prepare search
     $params = array();
     $params['from'] = 'ossn_object as o';
     $params['params'] = array('o.guid', 'o.time_created', 'o.owner_guid', 'o.description', 'o.title', 'o.subtype');
     $params['wheres'] = array($this->constructWheres($wheres));
     $params['order_by'] = $options['order_by'];
     $params['limit'] = $options['limit'];
     if (!$options['order_by']) {
         $params['order_by'] = "o.guid ASC";
     }
     $this->get = $this->select($params, true);
     //prepare count data;
     if ($options['count'] === true) {
         unset($params['params']);
         unset($params['limit']);
         $count = array();
         $count['params'] = array("count(*) as total");
         $count = array_merge($params, $count);
         return $this->select($count)->total;
     }
     if ($this->get) {
         foreach ($this->get as $object) {
             $this->object_guid = $object->guid;
             $objects[] = $this->getObjectById();
         }
         return $objects;
     }
     return false;
 }
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:98,代码来源:OssnObject.php


示例19: ossn_comment_view

/**
 * 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);
}
开发者ID:emnaborgi,项目名称:RS,代码行数:12,代码来源:ossn_com.php


示例20: getFriendsPosts

 /**
  * Get user group posts guids
  *
  * @param integer $userguid Guid of user
  *
  * @return array;
  */
 public function getFriendsPosts($params = array())
 {
     $user = ossn_loggedin_user();
     if (isset($user->guid) && !empty($user->guid)) {
         $friends = $user->getFriends();
         $friend_guids = '';
         if ($friends) {
             foreach ($friends as $friend) {
                 $friend_guids[] = $friend->guid;
             }
         }
         // add all users posts;
         // (if user has 0 friends, show at least his own postings if wall access type = friends only)
         $friend_guids[] = $user->guid;
         $friend_guids = implode(',', $friend_guids);
         //prepare default attributes
         $default = array('limit' => false, 'offset' => input('offset', '', 1), 'page_limit' => ossn_call_hook('pagination', 'page_limit', false, 10), 'count' => false);
         $options = array_merge($default, $params);
         //get only required result, don't bust your server memory
         $getlimit = $this->generateLimit($options['limit'], $options['page_limit'], $options['offset']);
         if ($getlimit) {
             $options['limit'] = $getlimit;
         }
         $wheres = array("md.guid = e.guid", "e.subtype='poster_guid'", "e.type = 'object'", "md.value IN ({$friend_guids})", "o.guid = e.owner_guid");
         $vars = array();
         $vars['from'] = 'ossn_entities as e, ossn_entities_metadata as md, ossn_object as o';
         $vars['params'] = array("o.*");
         $vars['wheres'] = array($this->constructWheres($wheres));
         $vars['order_by'] = "o.guid DESC";
         $vars['limit'] = $options['limit'];
         //prepare count data;
         if ($options['count'] === true) {
             unset($vars['params']);
             unset($vars['limit']);
             $count = array();
             $count['params'] = array("count(*) as total");
             $count = array_merge($vars, $count);
             return $this->select($count)->total;
         }
         $data = $this->select($vars, true);
         if ($data) {
             return $data;
         }
     }
     return false;
 }
开发者ID:nongdanit-nongdanit,项目名称:ossn,代码行数:53,代码来源:OssnWall.php



注:本文中的ossn_call_hook函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ossn_error_page函数代码示例发布时间:2022-05-15
下一篇:
PHP ossn_add_hook函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap