当前位置: 首页>>代码示例>>PHP>>正文


PHP ossn_call_hook函数代码示例

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


在下文中一共展示了ossn_call_hook函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 <info@opensource-socialnetwork.com>
 * @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


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