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


PHP StatusNet::getActivePlugins方法代码示例

本文整理汇总了PHP中StatusNet::getActivePlugins方法的典型用法代码示例。如果您正苦于以下问题:PHP StatusNet::getActivePlugins方法的具体用法?PHP StatusNet::getActivePlugins怎么用?PHP StatusNet::getActivePlugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StatusNet的用法示例。


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

示例1: onEndHandleFeedEntry

 /**
  * Checks for deleted remote notices and deleted the locally
  * A local qvitter-delete-notice is outputted in the onNoticeDeleteRelated event above
  *
  * @return boolean hook flag
  */
 public function onEndHandleFeedEntry($activity)
 {
     if ($activity->verb == 'qvitter-delete-notice' && class_exists('StatusNet') && !array_key_exists('ActivityModeration', StatusNet::getActivePlugins())) {
         $deleter_profile_uri = $activity->actor->id;
         $deleted_notice_uri = $activity->objects[0]->objects[0]->content;
         $deleted_notice_uri = substr($deleted_notice_uri, strpos($deleted_notice_uri, '{{') + 2);
         $deleted_notice_uri = substr($deleted_notice_uri, 0, strpos($deleted_notice_uri, '}}'));
         $deleter_ostatus_profile = Ostatus_profile::getKV('uri', $deleter_profile_uri);
         if (!$deleter_ostatus_profile instanceof Ostatus_profile) {
             return true;
         }
         $deleter_profile = Profile::getKV('id', $deleter_ostatus_profile->profile_id);
         $deleted_notice = Notice::getKV('uri', $deleted_notice_uri);
         if (!$deleter_profile instanceof Profile || !$deleted_notice instanceof Notice) {
             return true;
         }
         if ($deleter_profile->id != $deleted_notice->profile_id) {
             return true;
         }
         $deleted_notice->delete();
     }
     return true;
 }
开发者ID:GreenLunar,项目名称:qvitter,代码行数:29,代码来源:QvitterPlugin.php

示例2: showQvitter

    function showQvitter()
    {
        $logged_in_user_nickname = '';
        $logged_in_user_obj = false;
        $logged_in_user = common_current_user();
        if ($logged_in_user) {
            $logged_in_user_nickname = $logged_in_user->nickname;
            $logged_in_user_obj = ApiAction::twitterUserArray($logged_in_user->getProfile());
        }
        $registrationsclosed = false;
        if (common_config('site', 'closed') == 1 || common_config('site', 'inviteonly') == 1) {
            $registrationsclosed = true;
        }
        // check if the client's ip address is blocked for registration
        if (is_array(QvitterPlugin::settings("blocked_ips"))) {
            $client_ip_is_blocked = in_array($_SERVER['REMOTE_ADDR'], QvitterPlugin::settings("blocked_ips"));
        }
        $sitetitle = common_config('site', 'name');
        $siterootdomain = common_config('site', 'server');
        $qvitterpath = Plugin::staticPath('Qvitter', '');
        $apiroot = common_path('api/', StatusNet::isHTTPS());
        $attachmentroot = common_path('attachment/', StatusNet::isHTTPS());
        $instanceurl = common_path('', StatusNet::isHTTPS());
        // user's browser's language setting
        $user_browser_language = 'en';
        // use english if we can't find the browser language
        if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
            $user_browser_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
        }
        common_set_returnto('');
        // forget this
        // if this is a profile we add a link header for LRDD Discovery (see WebfingerPlugin.php)
        if (substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
            $nickname = substr($_SERVER['REQUEST_URI'], 1);
            if (preg_match("/^[a-zA-Z0-9]+\$/", $nickname) == 1) {
                $acct = 'acct:' . $nickname . '@' . common_config('site', 'server');
                $url = common_local_url('webfinger') . '?resource=' . $acct;
                foreach (array(Discovery::JRD_MIMETYPE, Discovery::XRD_MIMETYPE) as $type) {
                    header('Link: <' . $url . '>; rel="' . Discovery::LRDD_REL . '"; type="' . $type . '"');
                }
            }
        }
        ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
		"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
		<html xmlns="http://www.w3.org/1999/xhtml">
			<head>
				<title><?php 
        print $sitetitle;
        ?>
</title>
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
				<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
				<link rel="stylesheet" type="text/css" href="<?php 
        print $qvitterpath;
        ?>
css/qvitter.css?changed=<?php 
        print date('YmdHis', filemtime(QVITTERDIR . '/css/qvitter.css'));
        ?>
" />
				<link rel="stylesheet" type="text/css" href="<?php 
        print $qvitterpath;
        ?>
css/jquery.minicolors.css" />
				<link rel="shortcut icon" type="image/x-icon" href="<?php 
        print $qvitterpath;
        print QvitterPlugin::settings("favicon");
        ?>
">
				<?php 
        // if qvitter is a webapp and this is a users url we add feeds
        if (substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
            $nickname = substr($_SERVER['REQUEST_URI'], 1);
            if (preg_match("/^[a-zA-Z0-9]+\$/", $nickname) == 1) {
                $user = User::getKV('nickname', $nickname);
                if (!isset($user->id)) {
                    //error_log("QVITTER: Could not get user id for user with nickname: $nickname – REQUEST_URI: ".$_SERVER['REQUEST_URI']);
                } else {
                    print '<link title="Notice feed for ' . $nickname . ' (Activity Streams JSON)" type="application/stream+json" href="' . $instanceurl . 'api/statuses/user_timeline/' . $user->id . '.as" rel="alternate">' . "\n";
                    print '				<link title="Notice feed for ' . $nickname . ' (RSS 1.0)" type="application/rdf+xml" href="' . $instanceurl . $nickname . '/rss" rel="alternate">' . "\n";
                    print '				<link title="Notice feed for ' . $nickname . ' (RSS 2.0)" type="application/rss+xml" href="' . $instanceurl . 'api/statuses/user_timeline/' . $user->id . '.rss" rel="alternate">' . "\n";
                    print '				<link title="Notice feed for ' . $nickname . ' (Atom)" type="application/atom+xml" href="' . $instanceurl . 'api/statuses/user_timeline/' . $user->id . '.atom" rel="alternate">' . "\n";
                    print '				<link title="FOAF for ' . $nickname . '" type="application/rdf+xml" href="' . $instanceurl . $nickname . '/foaf" rel="meta">' . "\n";
                    print '				<link href="' . $instanceurl . $nickname . '/microsummary" rel="microsummary">' . "\n";
                    // maybe openid
                    if (array_key_exists('OpenID', StatusNet::getActivePlugins())) {
                        print '				<link rel="openid2.provider" href="' . common_local_url('openidserver') . '"/>' . "\n";
                        print '				<link rel="openid2.local_id" href="' . $user->getProfile()->profileurl . '"/>' . "\n";
                        print '				<link rel="openid2.server" href="' . common_local_url('openidserver') . '"/>' . "\n";
                        print '				<link rel="openid2.delegate" href="' . $user->getProfile()->profileurl . '"/>' . "\n";
                    }
                }
            }
        } elseif (substr($_SERVER['REQUEST_URI'], 0, 7) == '/group/') {
            $group_id_or_name = substr($_SERVER['REQUEST_URI'], 7);
            if (stristr($group_id_or_name, '/id')) {
                $group_id_or_name = substr($group_id_or_name, 0, strpos($group_id_or_name, '/id'));
                $group = User_group::getKV('id', $group_id_or_name);
                if ($group instanceof User_group) {
                    $group_name = $group->nickname;
//.........这里部分代码省略.........
开发者ID:bashrc,项目名称:gnusocial-qvitter-debian,代码行数:101,代码来源:qvitter.php

示例3: define

 * Copyright (C) 2010, StatusNet, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
require_once INSTALLDIR . '/scripts/commandline.inc';
foreach (StatusNet::getActivePlugins() as $data) {
    list($plugin, $args) = $data;
    echo "{$plugin}: ";
    if ($args === null) {
        echo "(no args)\n";
    } else {
        foreach ($args as $arg => $val) {
            echo "\n  {$arg}: ";
            var_export($val);
        }
        echo "\n";
    }
    echo "\n";
}
开发者ID:microcosmx,项目名称:experiments,代码行数:31,代码来源:showplugins.php

示例4: define

 * StatusNet - a distributed open-source microblogging tool
 * Copyright (C) 2010, StatusNet, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
require_once INSTALLDIR . '/scripts/commandline.inc';
foreach (StatusNet::getActivePlugins() as $plugin => $args) {
    echo "{$plugin}: ";
    if (empty($args)) {
        echo "(no args)\n";
    } else {
        foreach ($args as $arg => $val) {
            echo "\n  {$arg}: ";
            var_export($val);
        }
        echo "\n";
    }
    echo "\n";
}
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:31,代码来源:showplugins.php

示例5: codeKey

 /**
  * Create a cache key for data dependent on code
  *
  * For cache elements that are dependent on changes in code, this creates
  * a more-or-less fingerprint of the current running code and adds it to
  * the cache key. In the case of an upgrade of core, or addition or
  * removal of plugins, a new unique fingerprint is generated and used.
  * 
  * There can still be problems with a) differences in versions of the 
  * plugins and b) people running code between official versions. This is
  * usually a problem only for experienced users like developers, who know
  * how to clear their cache.
  *
  * For sites that run code between versions (like the status.net cloud),
  * there's an additional build number configuration setting.
  * 
  * @param string $extra the real part of the key
  *
  * @return string full key
  */
 static function codeKey($extra)
 {
     static $prefix = null;
     if (empty($prefix)) {
         $plugins = StatusNet::getActivePlugins();
         $names = array();
         foreach ($plugins as $plugin) {
             $names[] = $plugin[0];
         }
         $names = array_unique($names);
         asort($names);
         // Unique enough.
         $uniq = crc32(implode(',', $names));
         $build = common_config('site', 'build');
         $prefix = STATUSNET_VERSION . ':' . $build . ':' . $uniq;
     }
     return Cache::key($prefix . ':' . $extra);
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:38,代码来源:cache.php


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