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

PHP killme函数代码示例

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

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



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

示例1: search_ac_init

function search_ac_init(&$a)
{
    if (!local_channel()) {
        killme();
    }
    $start = x($_REQUEST, 'start') ? $_REQUEST['start'] : 0;
    $count = x($_REQUEST, 'count') ? $_REQUEST['count'] : 100;
    $search = x($_REQUEST, 'search') ? $_REQUEST['search'] : "";
    if (x($_REQUEST, 'query') && strlen($_REQUEST['query'])) {
        $search = $_REQUEST['query'];
    }
    // Priority to people searches
    if ($search) {
        $people_sql_extra = protect_sprintf(" AND `xchan_name` LIKE '%" . dbesc($search) . "%' ");
        $tag_sql_extra = protect_sprintf(" AND term LIKE '%" . dbesc($search) . "%' ");
    }
    $r = q("SELECT `abook_id`, `xchan_name`, `xchan_photo_s`, `xchan_url`, `xchan_addr` FROM `abook` left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d \n\t\t{$people_sql_extra}\n\t\tORDER BY `xchan_name` ASC ", intval(local_channel()));
    $results = array();
    if ($r) {
        foreach ($r as $g) {
            $results[] = array("photo" => $g['xchan_photo_s'], "name" => '@' . $g['xchan_name'], "id" => $g['abook_id'], "link" => $g['xchan_url'], "label" => '', "nick" => '');
        }
    }
    $r = q("select distinct term, tid, url from term where type in ( %d, %d ) {$tag_sql_extra} group by term order by term asc", intval(TERM_HASHTAG), intval(TERM_COMMUNITYTAG));
    if (count($r)) {
        foreach ($r as $g) {
            $results[] = array("photo" => $a->get_baseurl() . '/images/hashtag.png', "name" => '#' . $g['term'], "id" => $g['tid'], "link" => $g['url'], "label" => '', "nick" => '');
        }
    }
    header("content-type: application/json");
    $o = array('start' => $start, 'count' => $count, 'items' => $results);
    echo json_encode($o);
    logger('search_ac: ' . print_r($x, true));
    killme();
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:35,代码来源:search_ac.php


示例2: regmod_content

function regmod_content(&$a)
{
    global $lang;
    $_SESSION['return_url'] = $a->cmd;
    if (!local_user()) {
        info(t('Please login.') . EOL);
        $o .= '<br /><br />' . login($a->config['register_policy'] == REGISTER_CLOSED ? 0 : 1);
        return $o;
    }
    if (!is_site_admin()) {
        notice(t('Permission denied.') . EOL);
        return '';
    }
    if ($a->argc != 3) {
        killme();
    }
    $cmd = $a->argv[1];
    $hash = $a->argv[2];
    if ($cmd === 'deny') {
        if (!user_deny($hash)) {
            killme();
        }
    }
    if ($cmd === 'allow') {
        if (!user_allow($hash)) {
            killme();
        }
    }
}
开发者ID:nextgensh,项目名称:friendica,代码行数:29,代码来源:regmod.php


示例3: filer_content

function filer_content(&$a)
{
    if (!local_channel()) {
        killme();
    }
    $term = unxmlify(trim($_GET['term']));
    $item_id = $a->argc > 1 ? intval($a->argv[1]) : 0;
    logger('filer: tag ' . $term . ' item ' . $item_id);
    if ($item_id && strlen($term)) {
        // file item
        store_item_tag(local_channel(), $item_id, TERM_OBJ_POST, TERM_FILE, $term, '');
        // protect the entire conversation from periodic expiration
        $r = q("select parent from item where id = %d and uid = %d limit 1", intval($item_id), intval(local_channel()));
        if ($r) {
            $x = q("update item set item_retained = 1 where id = %d and uid = %d", intval($r[0]['parent']), intval(local_channel()));
        }
    } else {
        $filetags = array();
        $r = q("select distinct(term) from term where uid = %d and type = %d order by term asc", intval(local_channel()), intval(TERM_FILE));
        if (count($r)) {
            foreach ($r as $rr) {
                $filetags[] = $rr['term'];
            }
        }
        $tpl = get_markup_template("filer_dialog.tpl");
        $o = replace_macros($tpl, array('$field' => array('term', t("Save to Folder:"), '', '', $filetags, t('- select -')), '$submit' => t('Save')));
        echo $o;
    }
    killme();
}
开发者ID:msooon,项目名称:hubzilla,代码行数:30,代码来源:filer.php


示例4: siteinfo_init

function siteinfo_init(&$a)
{
    if ($a->argv[1] == "json") {
        $register_policy = array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
        $sql_extra = '';
        if (x($a->config, 'admin_nickname')) {
            $sql_extra = sprintf(" AND nickname = '%s' ", dbesc($a->config['admin_nickname']));
        }
        if (isset($a->config['admin_email']) && $a->config['admin_email'] != '') {
            $r = q("SELECT username, nickname FROM user WHERE email='%s' {$sql_extra}", dbesc($a->config['admin_email']));
            $admin = array('name' => $r[0]['username'], 'profile' => $a->get_baseurl() . '/channel/' . $r[0]['nickname']);
        } else {
            $admin = false;
        }
        $visible_plugins = array();
        if (is_array($a->plugins) && count($a->plugins)) {
            $r = q("select * from addon where hidden = 0");
            if (count($r)) {
                foreach ($r as $rr) {
                    $visible_plugins[] = $rr['name'];
                }
            }
        }
        if (@is_dir('.git') && function_exists('shell_exec')) {
            $commit = @shell_exec('git log -1 --format="%h"');
        }
        if (!isset($commit) || strlen($commit) > 16) {
            $commit = '';
        }
        $data = array('version' => RED_VERSION, 'commit' => $commit, 'url' => z_root(), 'plugins' => $visible_plugins, 'register_policy' => $register_policy[$a->config['system']['register_policy']], 'admin' => $admin, 'site_name' => $a->config['sitename'], 'platform' => RED_PLATFORM, 'info' => x($a->config, 'info') ? $a->config['info'] : '');
        echo json_encode($data);
        killme();
    }
}
开发者ID:Mauru,项目名称:red,代码行数:34,代码来源:siteinfo.php


示例5: xrd_init

function xrd_init(&$a)
{
    $uri = urldecode(notags(trim($_GET['uri'])));
    if (substr($uri, 0, 4) === 'http') {
        $name = basename($uri);
    } else {
        $local = str_replace('acct:', '', $uri);
        if (substr($local, 0, 2) == '//') {
            $local = substr($local, 2);
        }
        $name = substr($local, 0, strpos($local, '@'));
    }
    $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1", dbesc($name));
    if (!count($r)) {
        killme();
    }
    $salmon_key = salmon_key($r[0]['spubkey']);
    header('Access-Control-Allow-Origin: *');
    header("Content-type: text/xml");
    if (get_config('system', 'diaspora_enabled')) {
        //$tpl = file_get_contents('view/xrd_diaspora.tpl');
        $tpl = get_markup_template('xrd_diaspora.tpl');
        $dspr = replace_macros($tpl, array('$baseurl' => $a->get_baseurl(), '$dspr_guid' => $r[0]['guid'], '$dspr_key' => base64_encode(pemtorsa($r[0]['pubkey']))));
    } else {
        $dspr = '';
    }
    //$tpl = file_get_contents('view/xrd_person.tpl');
    $tpl = get_markup_template('xrd_person.tpl');
    $o = replace_macros($tpl, array('$nick' => $r[0]['nickname'], '$accturi' => $uri, '$profile_url' => $a->get_baseurl() . '/profile/' . $r[0]['nickname'], '$hcard_url' => $a->get_baseurl() . '/hcard/' . $r[0]['nickname'], '$atom' => $a->get_baseurl() . '/dfrn_poll/' . $r[0]['nickname'], '$zot_post' => $a->get_baseurl() . '/post/' . $r[0]['nickname'], '$poco_url' => $a->get_baseurl() . '/poco/' . $r[0]['nickname'], '$photo' => $a->get_baseurl() . '/photo/profile/' . $r[0]['uid'] . '.jpg', '$dspr' => $dspr, '$salmon' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'], '$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'] . '/mention', '$subscribe' => $a->get_baseurl() . '/follow?url={uri}', '$modexp' => 'data:application/magic-public-key,' . $salmon_key, '$bigkey' => salmon_key($r[0]['pubkey'])));
    $arr = array('user' => $r[0], 'xml' => $o);
    call_hooks('personal_xrd', $arr);
    echo $arr['xml'];
    killme();
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:34,代码来源:xrd.php


示例6: update_public_content

function update_public_content(&$a)
{
    $profile_uid = intval($_GET['p']) ? intval($_GET['p']) : -1;
    $load = argc() > 1 && argv(1) == 'load' ? 1 : 0;
    header("Content-type: text/html");
    echo "<!DOCTYPE html><html><body>\r\n";
    echo array_key_exists('msie', $_GET) && $_GET['msie'] == 1 ? '<div>' : '<section>';
    $text = public_content($a, $profile_uid, $load);
    $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
    $replace = "<img\${1} dst=\"\${2}\"";
    //        $text = preg_replace($pattern, $replace, $text);
    /*
    		if(! $load) {
    			$replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
        	    $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
            	$text = preg_replace($pattern, $replace, $text);
    	        $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
        	    $text = preg_replace($pattern, $replace, $text);
            	$pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
    	        $text = preg_replace($pattern, $replace, $text);
        	    $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
            	$text = preg_replace($pattern, $replace, $text);
    		}
    */
    echo str_replace("\t", '       ', $text);
    echo array_key_exists('msie', $_GET) && $_GET['msie'] == 1 ? '</div>' : '</section>';
    echo "</body></html>\r\n";
    killme();
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:29,代码来源:update_public.php


示例7: retry_basic_auth

function retry_basic_auth()
{
    header('WWW-Authenticate: Basic realm="Hubzilla"');
    header('HTTP/1.0 401 Unauthorized');
    echo 'This api requires login';
    killme();
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:7,代码来源:api_auth.php


示例8: starred_init

function starred_init(&$a)
{
    $starred = 0;
    if (!local_user()) {
        killme();
    }
    if ($a->argc > 1) {
        $message_id = intval($a->argv[1]);
    }
    if (!$message_id) {
        killme();
    }
    $r = q("SELECT starred FROM item WHERE uid = %d AND id = %d LIMIT 1", intval(local_user()), intval($message_id));
    if (!count($r)) {
        killme();
    }
    if (!intval($r[0]['starred'])) {
        $starred = 1;
    }
    $r = q("UPDATE item SET starred = %d WHERE uid = %d and id = %d LIMIT 1", intval($starred), intval(local_user()), intval($message_id));
    // See if we've been passed a return path to redirect to
    $return_path = x($_REQUEST, 'return') ? $_REQUEST['return'] : '';
    if ($return_path) {
        $rand = '_=' . time();
        if (strpos($return_path, '?')) {
            $rand = "&{$rand}";
        } else {
            $rand = "?{$rand}";
        }
        goaway($a->get_baseurl() . "/" . $return_path . $rand);
    }
    // the json doesn't really matter, it will either be 0 or 1
    echo json_encode($starred);
    killme();
}
开发者ID:ridcully,项目名称:friendica,代码行数:35,代码来源:starred.php


示例9: feed_init

function feed_init(&$a)
{
    $params = array();
    $params['begin'] = x($_REQUEST, 'date_begin') ? $_REQUEST['date_begin'] : NULL_DATE;
    $params['end'] = x($_REQUEST, 'date_end') ? $_REQUEST['date_end'] : '';
    $params['type'] = stristr(argv(0), 'json') ? 'json' : 'xml';
    $params['pages'] = x($_REQUEST, 'pages') ? intval($_REQUEST['pages']) : 0;
    $params['top'] = x($_REQUEST, 'top') ? intval($_REQUEST['top']) : 0;
    $params['start'] = x($params, 'start') ? intval($params['start']) : 0;
    $params['records'] = x($params, 'records') ? intval($params['records']) : 40;
    $params['direction'] = x($params, 'direction') ? dbesc($params['direction']) : 'desc';
    $params['cat'] = x($_REQUEST, 'cat') ? escape_tags($_REQUEST['cat']) : '';
    $channel = '';
    if (argc() > 1) {
        $r = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_address = '%s' limit 1", dbesc(argv(1)));
        if (!($r && count($r))) {
            killme();
        }
        $channel = $r[0];
        if (intval(get_config('system', 'block_public')) && !get_account_id()) {
            killme();
        }
        logger('mod_feed: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $channel['channel_address']);
        echo get_public_feed($channel, $params);
        killme();
    }
}
开发者ID:royalterra,项目名称:hubzilla,代码行数:27,代码来源:feed.php


示例10: wfinger_init

function wfinger_init(&$a)
{
    $result = array();
    $scheme = '';
    if (x($_SERVER, 'HTTPS') && $_SERVER['HTTPS']) {
        $scheme = 'https';
    } elseif (x($_SERVER, 'SERVER_PORT') && intval($_SERVER['SERVER_PORT']) == 443) {
        $scheme = 'https';
    }
    // Don't complain to me - I'm just implementing the spec.
    if ($scheme !== 'https') {
        header($_SERVER["SERVER_PROTOCOL"] . ' ' . 500 . ' ' . 'Webfinger requires HTTPS');
        killme();
    }
    $resource = $_REQUEST['resource'];
    $r = null;
    if ($resource) {
        if (strpos($resource, 'acct:') === 0) {
            $channel = str_replace('acct:', '', $resource);
            if (strpos($channel, '@') !== false) {
                $host = substr($channel, strpos($channel, '@') + 1);
                if (strcasecmp($host, get_app()->get_hostname())) {
                    goaway('https://' . $host . '/.well-known/webfinger?resource=' . $resource);
                }
                $channel = substr($channel, 0, strpos($channel, '@'));
            }
        }
        if (strpos($resource, 'http') === 0) {
            $channel = str_replace('~', '', basename($resource));
        }
        $r = q("select * from channel left join xchan on channel_hash = xchan_hash \n\t\t\twhere channel_address = '%s' limit 1", dbesc($channel));
    }
    header('Access-Control-Allow-Origin: *');
    header('Content-type: application/jrd+json');
    if ($resource && $r) {
        $h = q("select hubloc_addr from hubloc where hubloc_hash = '%s'", dbesc($r[0]['channel_hash']));
        $result['subject'] = $resource;
        $aliases = array(z_root() . '/channel/' . $r[0]['channel_address'], z_root() . '/~' . $r[0]['channel_address']);
        if ($h) {
            foreach ($h as $hh) {
                $aliases[] = 'acct:' . $hh['hubloc_addr'];
            }
        }
        $result['aliases'] = array();
        $result['properties'] = array('http://webfinger.net/ns/name' => $r[0]['channel_name']);
        foreach ($aliases as $alias) {
            if ($alias != $resource) {
                $result['aliases'][] = $alias;
            }
        }
        $result['links'] = array(array('rel' => 'http://webfinger.net/rel/avatar', 'type' => $r[0]['xchan_photo_mimetype'], 'href' => $r[0]['xchan_photo_l']), array('rel' => 'http://webfinger.net/rel/profile-page', 'href' => z_root() . '/profile/' . $r[0]['channel_address']), array('rel' => 'http://webfinger.net/rel/blog', 'href' => z_root() . '/channel/' . $r[0]['channel_address']), array('rel' => 'http://purl.org/zot/protocol', 'href' => z_root() . '/.well-known/zot-info' . '?address=' . $r[0]['xchan_addr']));
    } else {
        header($_SERVER["SERVER_PROTOCOL"] . ' ' . 400 . ' ' . 'Bad Request');
        killme();
    }
    $arr = array('channel' => $r[0], 'request' => $_REQUEST, 'result' => $result);
    call_hooks('webfinger', $arr);
    echo json_encode($arr['result']);
    killme();
}
开发者ID:HaakonME,项目名称:redmatrix,代码行数:60,代码来源:wfinger.php


示例11: get

 function get()
 {
     $profile_uid = intval($_GET['p']);
     if (!$profile_uid) {
         $profile_uid = -1;
     }
     $load = argc() > 1 && argv(1) == 'load' ? 1 : 0;
     header("Content-type: text/html");
     echo "<!DOCTYPE html><html><body>\r\n";
     echo $_GET['msie'] == 1 ? '<div>' : '<section>';
     $mod = new Display();
     $text = $mod->get($profile_uid, $load);
     $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
     $replace = "<img\${1} dst=\"\${2}\"";
     //	$text = preg_replace($pattern, $replace, $text);
     /*
     	if(! $load) {
     		$replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
             $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
             $text = preg_replace($pattern, $replace, $text);
             $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
             $text = preg_replace($pattern, $replace, $text);
             $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
             $text = preg_replace($pattern, $replace, $text);
             $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
             $text = preg_replace($pattern, $replace, $text);
     	}
     */
     echo str_replace("\t", '       ', $text);
     echo $_GET['msie'] == 1 ? '</div>' : '</section>';
     echo "</body></html>\r\n";
     //	logger('update_display: ' . $text);
     killme();
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:34,代码来源:Update_display.php


示例12: update_network_content

function update_network_content(&$a)
{
    $profile_uid = intval($_GET['p']);
    header("Content-type: text/html");
    echo "<!DOCTYPE html><html><body>\r\n";
    echo "<section>";
    if (!get_pconfig($profile_uid, "system", "no_auto_update") or $_GET['force'] == 1) {
        $text = network_content($a, $profile_uid);
    } else {
        $text = "";
    }
    $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
    $replace = "<img\${1} dst=\"\${2}\"";
    $text = preg_replace($pattern, $replace, $text);
    $replace = '<br />' . t('[Embedded content - reload page to view]') . '<br />';
    $pattern = "/<\\s*audio[^>]*>(.*?)<\\s*\\/\\s*audio>/i";
    $text = preg_replace($pattern, $replace, $text);
    $pattern = "/<\\s*video[^>]*>(.*?)<\\s*\\/\\s*video>/i";
    $text = preg_replace($pattern, $replace, $text);
    $pattern = "/<\\s*embed[^>]*>(.*?)<\\s*\\/\\s*embed>/i";
    $text = preg_replace($pattern, $replace, $text);
    $pattern = "/<\\s*iframe[^>]*>(.*?)<\\s*\\/\\s*iframe>/i";
    $text = preg_replace($pattern, $replace, $text);
    echo str_replace("\t", '       ', $text);
    echo "</section>";
    echo "</body></html>\r\n";
    killme();
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:28,代码来源:update_network.php


示例13: post

 function post()
 {
     // logger('file upload: ' . print_r($_REQUEST,true));
     $channel = $_REQUEST['channick'] ? get_channel_by_nick($_REQUEST['channick']) : null;
     if (!$channel) {
         logger('channel not found');
         killme();
     }
     $_REQUEST['source'] = 'file_upload';
     if ($channel['channel_id'] != local_channel()) {
         $_REQUEST['contact_allow'] = expand_acl($channel['channel_allow_cid']);
         $_REQUEST['group_allow'] = expand_acl($channel['channel_allow_gid']);
         $_REQUEST['contact_deny'] = expand_acl($channel['channel_deny_cid']);
         $_REQUEST['group_deny'] = expand_acl($channel['channel_deny_gid']);
     }
     if ($_REQUEST['filename']) {
         $_REQUEST['allow_cid'] = perms2str($_REQUEST['contact_allow']);
         $_REQUEST['allow_gid'] = perms2str($_REQUEST['group_allow']);
         $_REQUEST['deny_cid'] = perms2str($_REQUEST['contact_deny']);
         $_REQUEST['deny_gid'] = perms2str($_REQUEST['group_deny']);
         $r = attach_mkdir($channel, get_observer_hash(), $_REQUEST);
     } else {
         $r = attach_store($channel, get_observer_hash(), '', $_REQUEST);
     }
     goaway(z_root() . '/' . $_REQUEST['return_url']);
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:26,代码来源:File_upload.php


示例14: privacy_image_cache_init

function privacy_image_cache_init()
{
    $urlhash = 'pic:' . sha1($_REQUEST['url']);
    $r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' LIMIT 1", $urlhash);
    if (count($r)) {
        $img_str = $r[0]['data'];
        $mime = $r[0]["desc"];
        if ($mime == "") {
            $mime = "image/jpeg";
        }
    } else {
        require_once "Photo.php";
        $img_str = fetch_url($_REQUEST['url'], true);
        if (substr($img_str, 0, 6) == "GIF89a") {
            $mime = "image/gif";
            $image = @imagecreatefromstring($img_str);
            if ($image === FALSE) {
                die;
            }
            q("INSERT INTO `photo`\n\t\t\t( `uid`, `contact-id`, `guid`, `resource-id`, `created`, `edited`, `filename`, `album`, `height`, `width`, `desc`, `data`, `scale`, `profile`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` )\n\t\t\tVALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', %d, %d, '%s', '%s', '%s', '%s' )", 0, 0, get_guid(), dbesc($urlhash), dbesc(datetime_convert()), dbesc(datetime_convert()), dbesc(basename(dbesc($_REQUEST["url"]))), dbesc(''), intval(imagesy($image)), intval(imagesx($image)), 'image/gif', dbesc($img_str), 100, intval(0), dbesc(''), dbesc(''), dbesc(''), dbesc(''));
        } else {
            $img = new Photo($img_str);
            if ($img->is_valid()) {
                $img->store(0, 0, $urlhash, $_REQUEST['url'], '', 100);
                $img_str = $img->imageString();
            }
            $mime = "image/jpeg";
        }
    }
    header("Content-type: {$mime}");
    header("Expires: " . gmdate("D, d M Y H:i:s", time() + 3600 * 24) . " GMT");
    header("Cache-Control: max-age=" . 3600 * 24);
    echo $img_str;
    killme();
}
开发者ID:robhell,项目名称:friendica-addons,代码行数:35,代码来源:privacy_image_cache.php


示例15: friendica_init

function friendica_init(&$a)
{
    if ($a->argv[1] == "json") {
        $register_policy = array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
        $sql_extra = '';
        if (x($a->config, 'admin_nickname')) {
            $sql_extra = sprintf(" AND nickname = '%s' ", dbesc($a->config['admin_nickname']));
        }
        if (isset($a->config['admin_email']) && $a->config['admin_email'] != '') {
            $adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
            //$r = q("SELECT username, nickname FROM user WHERE email='%s' $sql_extra", dbesc($a->config['admin_email']));
            $r = q("SELECT username, nickname FROM user WHERE email='%s' {$sql_extra}", dbesc($adminlist[0]));
            $admin = array('name' => $r[0]['username'], 'profile' => $a->get_baseurl() . '/profile/' . $r[0]['nickname']);
        } else {
            $admin = false;
        }
        $visible_plugins = array();
        if (is_array($a->plugins) && count($a->plugins)) {
            $r = q("select * from addon where hidden = 0");
            if (count($r)) {
                foreach ($r as $rr) {
                    $visible_plugins[] = $rr['name'];
                }
            }
        }
        $data = array('version' => FRIENDICA_VERSION, 'url' => z_root(), 'plugins' => $visible_plugins, 'register_policy' => $register_policy[$a->config['register_policy']], 'admin' => $admin, 'site_name' => $a->config['sitename'], 'platform' => FRIENDICA_PLATFORM, 'info' => x($a->config, 'info') ? $a->config['info'] : '', 'no_scrape_url' => $a->get_baseurl() . '/noscrape');
        echo json_encode($data);
        killme();
    }
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:30,代码来源:friendica.php


示例16: __construct

 public function __construct()
 {
     if (!is_writable('view/smarty3/')) {
         echo "<b>ERROR:</b> folder <tt>view/smarty3/</tt> must be writable by webserver.";
         killme();
     }
 }
开发者ID:ZerGabriel,项目名称:friendica,代码行数:7,代码来源:friendica_smarty.php


示例17: xrd_init

function xrd_init(&$a)
{
    $uri = urldecode(notags(trim($_GET['uri'])));
    if (substr($uri, 0, 4) === 'http') {
        $name = basename($uri);
    } else {
        $local = str_replace('acct:', '', $uri);
        if (substr($local, 0, 2) == '//') {
            $local = substr($local, 2);
        }
        $name = substr($local, 0, strpos($local, '@'));
    }
    $r = q("SELECT * FROM channel WHERE channel_address = '%s' LIMIT 1", dbesc($name));
    if (!$r) {
        killme();
    }
    $dspr = replace_macros(get_markup_template('xrd_diaspora.tpl'), array('$baseurl' => $a->get_baseurl(), '$dspr_guid' => $r[0]['channel_guid'], '$dspr_key' => base64_encode(pemtorsa($r[0]['channel_pubkey']))));
    $salmon_key = salmon_key($r[0]['channel_pubkey']);
    header('Access-Control-Allow-Origin: *');
    header("Content-type: text/xml");
    $tpl = get_markup_template('view/xrd_person.tpl');
    $o = replace_macros(get_markup_template('xrd_person.tpl'), array('$nick' => $r[0]['channel_address'], '$accturi' => $uri, '$profile_url' => $a->get_baseurl() . '/channel/' . $r[0]['channel_address'], '$hcard_url' => $a->get_baseurl() . '/hcard/' . $r[0]['channel_address'], '$atom' => $a->get_baseurl() . '/feed/' . $r[0]['channel_address'], '$zot_post' => $a->get_baseurl() . '/post/' . $r[0]['channel_address'], '$poco_url' => $a->get_baseurl() . '/poco/' . $r[0]['channel_address'], '$photo' => $a->get_baseurl() . '/photo/profile/l/' . $r[0]['channel_id'], '$dspr' => $dspr, '$modexp' => 'data:application/magic-public-key,' . $salmon_key));
    $arr = array('user' => $r[0], 'xml' => $o);
    call_hooks('personal_xrd', $arr);
    echo $arr['xml'];
    killme();
}
开发者ID:redmatrix,项目名称:red,代码行数:27,代码来源:xrd.php


示例18: uexport_content

function uexport_content(&$a)
{
    if ($a->argc > 1) {
        header("Content-type: application/json");
        header('Content-Disposition: attachment; filename="' . $a->user['nickname'] . '.' . $a->argv[1] . '"');
        switch ($a->argv[1]) {
            case "backup":
                uexport_all($a);
                killme();
                break;
            case "account":
                uexport_account($a);
                killme();
                break;
            default:
                killme();
        }
    }
    /**
     * options shown on "Export personal data" page
     * list of array( 'link url', 'link text', 'help text' )
     */
    $options = array(array('/uexport/account', t('Export account'), t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')), array('/uexport/backup', t('Export all'), t('Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account (photos are not exported)')));
    call_hooks('uexport_options', $options);
    $tpl = get_markup_template("uexport.tpl");
    return replace_macros($tpl, array('$baseurl' => $a->get_baseurl(), '$title' => t('Export personal data'), '$options' => $options));
}
开发者ID:ridcully,项目名称:friendica,代码行数:27,代码来源:uexport.php


示例19: init

 function init()
 {
     $uri = urldecode(notags(trim($_GET['uri'])));
     logger('xrd: ' . $uri, LOGGER_DEBUG);
     $resource = $uri;
     if (substr($uri, 0, 4) === 'http') {
         $uri = str_replace('~', '', $uri);
         $name = basename($uri);
     } else {
         $local = str_replace('acct:', '', $uri);
         if (substr($local, 0, 2) == '//') {
             $local = substr($local, 2);
         }
         $name = substr($local, 0, strpos($local, '@'));
     }
     $r = q("SELECT * FROM channel WHERE channel_address = '%s' LIMIT 1", dbesc($name));
     if (!$r) {
         killme();
     }
     $dspr = replace_macros(get_markup_template('xrd_diaspora.tpl'), array('$baseurl' => z_root(), '$dspr_guid' => $r[0]['channel_guid'] . str_replace('.', '', \App::get_hostname()), '$dspr_key' => base64_encode(pemtorsa($r[0]['channel_pubkey']))));
     $salmon_key = salmon_key($r[0]['channel_pubkey']);
     header('Access-Control-Allow-Origin: *');
     header("Content-type: application/xrd+xml");
     $aliases = array('acct:' . channel_reddress($r[0]), z_root() . '/channel/' . $r[0]['channel_address'], z_root() . '/~' . $r[0]['channel_address']);
     for ($x = 0; $x < count($aliases); $x++) {
         if ($aliases[$x] === $resource) {
             unset($aliases[$x]);
         }
     }
     $o = replace_macros(get_markup_template('xrd_person.tpl'), array('$nick' => $r[0]['channel_address'], '$accturi' => $resource, '$aliases' => $aliases, '$profile_url' => z_root() . '/channel/' . $r[0]['channel_address'], '$hcard_url' => z_root() . '/hcard/' . $r[0]['channel_address'], '$atom' => z_root() . '/feed/' . $r[0]['channel_address'], '$zot_post' => z_root() . '/post/' . $r[0]['channel_address'], '$poco_url' => z_root() . '/poco/' . $r[0]['channel_address'], '$photo' => z_root() . '/photo/profile/l/' . $r[0]['channel_id'], '$dspr' => $dspr, '$modexp' => 'data:application/magic-public-key,' . $salmon_key, '$subscribe' => z_root() . '/follow?url={uri}', '$bigkey' => salmon_key($r[0]['channel_pubkey'])));
     $arr = array('user' => $r[0], 'xml' => $o);
     call_hooks('personal_xrd', $arr);
     echo $arr['xml'];
     killme();
 }
开发者ID:phellmes,项目名称:hubzilla,代码行数:35,代码来源:Xrd.php


示例20: viewsrc_content

function viewsrc_content(&$a)
{
    $o = '';
    $sys = get_sys_channel();
    $item_id = argc() > 1 ? intval(argv(1)) : 0;
    $json = argc() > 2 && argv(2) === 'json' ? true : false;
    if (!local_channel()) {
        notice(t('Permission denied.') . EOL);
    }
    if (!$item_id) {
        App::$error = 404;
        notice(t('Item not found.') . EOL);
    }
    $item_normal = item_normal();
    if (local_channel() && $item_id) {
        $r = q("select id, item_flags, item_obscured, body from item where uid in (%d , %d) and id = %d {$item_normal} limit 1", intval(local_channel()), intval($sys['channel_id']), intval($item_id));
        if ($r) {
            if (intval($r[0]['item_obscured'])) {
                $r[0]['body'] = crypto_unencapsulate(json_decode($r[0]['body'], true), get_config('system', 'prvkey'));
            }
            $o = $json ? json_encode($r[0]['body']) : str_replace("\n", '<br />', $r[0]['body']);
        }
    }
    if (is_ajax()) {
        print '<div><i class="icon-pencil"> ' . t('Source of Item') . ' ' . $r[0]['id'] . '</i></div>';
        echo $o;
        killme();
    }
    return $o;
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:30,代码来源:viewsrc.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP kimport函数代码示例发布时间:2022-05-15
下一篇:
PHP killbypid函数代码示例发布时间: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