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


PHP profile_load函数代码示例

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


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

示例1: profile_photo_init

function profile_photo_init(&$a)
{
    if (!local_user()) {
        return;
    }
    profile_load($a, $a->user['nickname']);
}
开发者ID:vinzv,项目名称:friendica,代码行数:7,代码来源:profile_photo.php

示例2: settings_init

function settings_init(&$a)
{
    if (local_user()) {
        profile_load($a, $a->user['nickname']);
    }
    // These lines provide the javascript needed by the acl selector
    $a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "';";
    $a->page['htmlhead'] .= <<<EOT

\t\$(document).ready(function() {

\t\t\$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
\t\t\tvar selstr;
\t\t\t\$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
\t\t\t\tselstr = \$(this).text();
\t\t\t\t\$('#jot-perms-icon').removeClass('unlock').addClass('lock');
\t\t\t\t\$('#jot-public').hide();
\t\t\t});
\t\t\tif(selstr == null) { 
\t\t\t\t\$('#jot-perms-icon').removeClass('lock').addClass('unlock');
\t\t\t\t\$('#jot-public').show();
\t\t\t}

\t\t}).trigger('change');

\t});

\t</script>
EOT;
}
开发者ID:ryivhnn,项目名称:friendica,代码行数:30,代码来源:settings.php

示例3: init

 function init()
 {
     $which = null;
     if (argc() > 1) {
         $which = argv(1);
     }
     if (!$which) {
         if (local_channel()) {
             $channel = \App::get_channel();
             if ($channel && $channel['channel_address']) {
                 $which = $channel['channel_address'];
             }
         }
     }
     if (!$which) {
         notice(t('You must be logged in to see this page.') . EOL);
         return;
     }
     $profile = 0;
     $channel = \App::get_channel();
     if (local_channel() && argc() > 2 && argv(2) === 'view') {
         $which = $channel['channel_address'];
         $profile = argv(1);
     }
     \App::$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" title="' . t('Posts and comments') . '" href="' . z_root() . '/feed/' . $which . '" />' . "\r\n";
     \App::$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" title="' . t('Only posts') . '" href="' . z_root() . '/feed/' . $which . '?top=1" />' . "\r\n";
     // Not yet ready for prime time
     //	\App::$page['htmlhead'] .= '<link rel="openid.server" href="' . z_root() . '/id/' . $which .'?f=" />' . "\r\n" ;
     //	\App::$page['htmlhead'] .= '<link rel="openid.delegate" href="' . z_root() . '/channel/' . $which .'" />' . "\r\n" ;
     // Run profile_load() here to make sure the theme is set before
     // we start loading content
     profile_load($a, $which, $profile);
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:33,代码来源:Channel.php

示例4: settings_init

function settings_init(&$a)
{
    if (local_user()) {
        require_once "mod/profile.php";
        profile_load($a, $a->user['nickname']);
    }
}
开发者ID:vishalp,项目名称:MistparkPE-Remix,代码行数:7,代码来源:settings.php

示例5: chat_init

function chat_init(&$a)
{
    $which = null;
    if (argc() > 1) {
        $which = argv(1);
    }
    if (!$which) {
        if (local_channel()) {
            $channel = $a->get_channel();
            if ($channel && $channel['channel_address']) {
                $which = $channel['channel_address'];
            }
        }
    }
    if (!$which) {
        notice(t('You must be logged in to see this page.') . EOL);
        return;
    }
    $profile = 0;
    $channel = $a->get_channel();
    if (local_channel() && argc() > 2 && argv(2) === 'view') {
        $which = $channel['channel_address'];
        $profile = argv(1);
    }
    $a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which . '" />' . "\r\n";
    // Run profile_load() here to make sure the theme is set before
    // we start loading content
    profile_load($a, $which, $profile);
}
开发者ID:msooon,项目名称:hubzilla,代码行数:29,代码来源:chat.php

示例6: viewcontacts_init

function viewcontacts_init(&$a)
{
    if (get_config('system', 'block_public') && !local_user() && !remote_user()) {
        return;
    }
    profile_load($a, $a->argv[1]);
}
开发者ID:jzacman,项目名称:friendica,代码行数:7,代码来源:viewcontacts.php

示例7: init

 function init()
 {
     if (argc() > 1) {
         $which = argv(1);
     } else {
         notice(t('Requested profile is not available.') . EOL);
         \App::$error = 404;
         return;
     }
     $profile = '';
     $channel = \App::get_channel();
     if (local_channel() && argc() > 2 && argv(2) === 'view') {
         $which = $channel['channel_address'];
         $profile = argv(1);
         $r = q("select profile_guid from profile where id = %d and uid = %d limit 1", intval($profile), intval(local_channel()));
         if (!$r) {
             $profile = '';
         }
         $profile = $r[0]['profile_guid'];
     }
     \App::$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . z_root() . '/feed/' . $which . '" />' . "\r\n";
     if (!$profile) {
         $x = q("select channel_id as profile_uid from channel where channel_address = '%s' limit 1", dbesc(argv(1)));
         if ($x) {
             \App::$profile = $x[0];
         }
     }
     profile_load($a, $which, $profile);
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:29,代码来源:Profile.php

示例8: achievements_content

function achievements_content(&$a)
{
    // This doesn't work, so
    if (!is_developer()) {
        return;
    }
    if (argc() > 1) {
        $which = argv(1);
    } else {
        notice(t('Requested profile is not available.') . EOL);
        return;
    }
    $profile = 0;
    $profile = argv(1);
    profile_load($a, $which, $profile);
    $r = q("select channel_id from channel where channel_address = '%s'", dbesc($which));
    if ($r) {
        $owner = intval($r[0]['channel_id']);
    }
    $observer = $a->get_observer();
    $ob_hash = $observer ? $observer['xchan_hash'] : '';
    $perms = get_all_perms($owner, $ob_hash);
    if (!$perms['view_profile']) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $newmembertext = t('Some blurb about what to do when you\'re new here');
    //	By default, all badges are false
    $contactbadge = false;
    $profilebadge = false;
    $keywordsbadge = false;
    // Check number of contacts.  Award a badge if over 10
    // We'll figure these out on each page load instead of
    // writing them to the DB because that will mean one needs
    // to retain their achievements - eg, you can't add
    // a bunch of channels just to get your badge, and then
    // delete them all again.  If these become popular or
    // used in profiles or something, we may need to reconsider
    // and add a table for this - because this won't scale.
    $r = q("select * from abook where abook_channel = %d", intval($owner));
    if (count($r)) {
        $contacts = count($r);
    }
    // We're checking for 11 to adjust for the abook record for self
    if ($contacts >= 11) {
        $contactbadge = true;
    }
    //	Check if an about field in the profile has been created.
    $r = q("select * from profile where uid = %d and about <> ''", intval($owner));
    if ($r) {
        $profilebadge = 1;
    }
    // Check if keywords have been set
    $r = q("select * from profile where uid = %d and keywords <> ''", intval($owner));
    if ($r) {
        $keywordsbadge = 1;
    }
    return replace_macros(get_markup_template("achievements.tpl"), array('$newmembertext' => $newmembertext, '$profilebadge' => $profilebadge, '$contactbadge' => $contactbadge, '$keywordsbadge' => $keywordsbadge, '$channelsbadge' => $channelsbadge));
}
开发者ID:TamirAl,项目名称:hubzilla,代码行数:59,代码来源:achievements.php

示例9: init

 function init()
 {
     if (!is_dir('store')) {
         os_mkdir('store', STORAGE_DEFAULT_PERMISSIONS, false);
     }
     $which = null;
     if (argc() > 1) {
         $which = argv(1);
     }
     $profile = 0;
     \App::$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . z_root() . '/feed/' . $which . '" />' . "\r\n";
     if ($which) {
         profile_load($which, $profile);
     }
     $auth = new \Zotlabs\Storage\BasicAuth();
     $ob_hash = get_observer_hash();
     if ($ob_hash) {
         if (local_channel()) {
             $channel = \App::get_channel();
             $auth->setCurrentUser($channel['channel_address']);
             $auth->channel_id = $channel['channel_id'];
             $auth->channel_hash = $channel['channel_hash'];
             $auth->channel_account_id = $channel['channel_account_id'];
             if ($channel['channel_timezone']) {
                 $auth->setTimezone($channel['channel_timezone']);
             }
         }
         $auth->observer = $ob_hash;
     }
     if ($_GET['davguest']) {
         $_SESSION['davguest'] = true;
     }
     $_SERVER['QUERY_STRING'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['QUERY_STRING']);
     $_SERVER['QUERY_STRING'] = strip_zids($_SERVER['QUERY_STRING']);
     $_SERVER['QUERY_STRING'] = preg_replace('/[\\?&]davguest=(.*?)([\\?&]|$)/ism', '', $_SERVER['QUERY_STRING']);
     $_SERVER['REQUEST_URI'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['REQUEST_URI']);
     $_SERVER['REQUEST_URI'] = strip_zids($_SERVER['REQUEST_URI']);
     $_SERVER['REQUEST_URI'] = preg_replace('/[\\?&]davguest=(.*?)([\\?&]|$)/ism', '', $_SERVER['REQUEST_URI']);
     $rootDirectory = new \Zotlabs\Storage\Directory('/', $auth);
     // A SabreDAV server-object
     $server = new SDAV\Server($rootDirectory);
     // prevent overwriting changes each other with a lock backend
     $lockBackend = new SDAV\Locks\Backend\File('store/[data]/locks');
     $lockPlugin = new SDAV\Locks\Plugin($lockBackend);
     $server->addPlugin($lockPlugin);
     $is_readable = false;
     // provide a directory view for the cloud in Hubzilla
     $browser = new \Zotlabs\Storage\Browser($auth);
     $auth->setBrowserPlugin($browser);
     $server->addPlugin($browser);
     // Experimental QuotaPlugin
     //	require_once('\Zotlabs\Storage/QuotaPlugin.php');
     //	$server->addPlugin(new \Zotlabs\Storage\\QuotaPlugin($auth));
     ob_start();
     // All we need to do now, is to fire up the server
     $server->exec();
     ob_end_flush();
     killme();
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:59,代码来源:Cloud.php

示例10: profile_photo_init

function profile_photo_init(&$a)
{
    if (!local_channel()) {
        return;
    }
    $channel = App::get_channel();
    profile_load($a, $channel['channel_address']);
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:8,代码来源:profile_photo.php

示例11: init

 function init()
 {
     if (!local_channel()) {
         return;
     }
     $channel = \App::get_channel();
     profile_load($a, $channel['channel_address']);
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:8,代码来源:Cover_photo.php

示例12: profile_photo_init

function profile_photo_init(&$a)
{
    if (!local_user()) {
        return;
    }
    require_once "mod/profile.php";
    profile_load($a, $a->user['nickname']);
}
开发者ID:vishalp,项目名称:MistparkPE-Remix,代码行数:8,代码来源:profile_photo.php

示例13: dfrn_request_init

 function dfrn_request_init(&$a)
 {
     if ($a->argc > 1) {
         $which = $a->argv[1];
     }
     profile_load($a, $which);
     return;
 }
开发者ID:nextgensh,项目名称:friendica,代码行数:8,代码来源:dfrn_request.php

示例14: display_init

function display_init(&$a)
{
    if (get_config('system', 'block_public') && !local_user() && !remote_user()) {
        return;
    }
    $nick = $a->argc > 1 ? $a->argv[1] : '';
    profile_load($a, $nick);
}
开发者ID:ridcully,项目名称:friendica,代码行数:8,代码来源:display.php

示例15: display_init

function display_init(&$a)
{
    if (get_config('system', 'block_public') && !local_user() && !remote_user()) {
        return;
    }
    $nick = $a->argc > 1 ? $a->argv[1] : '';
    $profiledata = array();
    // If there is only one parameter, then check if this parameter could be a guid
    if ($a->argc == 2) {
        $nick = "";
        $itemuid = 0;
        // Does the local user have this item?
        if (local_user()) {
            $r = q("SELECT `id`, `parent`, `author-name`, `author-link`, `author-avatar`, `network`, `body`, `uid` FROM `item`\n\t\t\t\tWHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0\n\t\t\t\t\tAND `guid` = '%s' AND `uid` = %d", $a->argv[1], local_user());
            if (count($r)) {
                $nick = $a->user["nickname"];
                $itemuid = local_user();
            }
        }
        // Or is it anywhere on the server?
        if ($nick == "") {
            $r = q("SELECT `user`.`nickname`, `item`.`id`, `item`.`parent`, `item`.`author-name`,\n\t\t\t\t`item`.`author-link`, `item`.`author-avatar`, `item`.`network`, `item`.`uid`, `item`.`body`\n\t\t\t\tFROM `item` INNER JOIN `user` ON `user`.`uid` = `item`.`uid`\n\t\t\t\tWHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0\n\t\t\t\t\tAND `item`.`allow_cid` = ''  AND `item`.`allow_gid` = ''\n\t\t\t\t\tAND `item`.`deny_cid`  = '' AND `item`.`deny_gid`  = ''\n\t\t\t\t\tAND `item`.`private` = 0 AND NOT `user`.`hidewall`\n\t\t\t\t\tAND `item`.`guid` = '%s'", $a->argv[1]);
            //	AND `item`.`private` = 0 AND `item`.`wall` = 1
            if (count($r)) {
                $nick = $r[0]["nickname"];
                $itemuid = $r[0]["uid"];
            }
        }
        // Is it an item with uid=0?
        if ($nick == "") {
            $r = q("SELECT `item`.`id`, `item`.`parent`, `item`.`author-name`,\n\t\t\t\t`item`.`author-link`, `item`.`author-avatar`, `item`.`network`, `item`.`uid`, `item`.`body`\n\t\t\t\tFROM `item` WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0\n\t\t\t\t\tAND `item`.`allow_cid` = ''  AND `item`.`allow_gid` = ''\n\t\t\t\t\tAND `item`.`deny_cid`  = '' AND `item`.`deny_gid`  = ''\n\t\t\t\t\tAND `item`.`private` = 0 AND `item`.`uid` = 0\n\t\t\t\t\tAND `item`.`guid` = '%s'", $a->argv[1]);
            //	AND `item`.`private` = 0 AND `item`.`wall` = 1
        }
        if (count($r)) {
            if ($r[0]["id"] != $r[0]["parent"]) {
                $r = q("SELECT `id`, `author-name`, `author-link`, `author-avatar`, `network`, `body`, `uid` FROM `item`\n\t\t\t\t\tWHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0\n\t\t\t\t\t\tAND `id` = %d", $r[0]["parent"]);
            }
            $profiledata = display_fetchauthor($a, $r[0]);
            if (strstr(normalise_link($profiledata["url"]), normalise_link($a->get_baseurl()))) {
                $nickname = str_replace(normalise_link($a->get_baseurl()) . "/profile/", "", normalise_link($profiledata["url"]));
                if ($nickname != $a->user["nickname"]) {
                    $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile`\n\t\t\t\t\t\tINNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid`\n\t\t\t\t\t\tWHERE `user`.`nickname` = '%s' AND `profile`.`is-default` = 1 and `contact`.`self` = 1 LIMIT 1", dbesc($nickname));
                    if (count($r)) {
                        $profiledata = $r[0];
                    }
                    $profiledata["network"] = NETWORK_DFRN;
                } else {
                    $profiledata = array();
                }
            }
        } else {
            $a->error = 404;
            notice(t('Item not found.') . EOL);
            return;
        }
    }
    profile_load($a, $nick, 0, $profiledata);
}
开发者ID:strk,项目名称:friendica,代码行数:58,代码来源:display.php


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