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

PHP findpeople_widget函数代码示例

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

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



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

示例1: suggest_content

function suggest_content(&$a)
{
    require_once "mod/proxy.php";
    $o = '';
    if (!local_user()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
    $a->page['aside'] .= findpeople_widget();
    $a->page['aside'] .= follow_widget();
    $r = suggestion_query(local_user());
    if (!count($r)) {
        $o .= t('No suggestions available. If this is a new site, please try again in 24 hours.');
        return $o;
    }
    require_once 'include/contact_selectors.php';
    foreach ($r as $rr) {
        $connlnk = $a->get_baseurl() . '/follow/?url=' . ($rr['connect'] ? $rr['connect'] : $rr['url']);
        $ignlnk = $a->get_baseurl() . '/suggest?ignore=' . $rr['id'];
        $photo_menu = array(array(t("View Profile"), zrl($rr["url"])));
        $photo_menu[] = array(t("Connect/Follow"), $connlnk);
        $photo_menu[] = array(t('Ignore/Hide'), $ignlnk);
        $contact_details = get_contact_details_by_url($rr["url"], local_user());
        $entry = array('url' => zrl($rr['url']), 'itemurl' => $contact_details['addr'] != "" ? $contact_details['addr'] : $rr['url'], 'img_hover' => $rr['url'], 'name' => $rr['name'], 'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB), 'details' => $contact_details['location'], 'tags' => $contact_details['keywords'], 'about' => $contact_details['about'], 'account_type' => $contact_details['community'] ? t('Forum') : '', 'ignlnk' => $ignlnk, 'ignid' => $rr['id'], 'conntxt' => t('Connect'), 'connlnk' => $connlnk, 'photo_menu' => $photo_menu, 'ignore' => t('Ignore/Hide'), 'network' => network_to_name($rr['network'], $rr['url']), 'id' => ++$id);
        $entries[] = $entry;
    }
    $tpl = get_markup_template('viewcontact_template.tpl');
    $o .= replace_macros($tpl, array('$title' => t('Friend Suggestions'), '$contacts' => $entries));
    return $o;
}
开发者ID:vinzv,项目名称:friendica,代码行数:31,代码来源:suggest.php


示例2: suggest_content

function suggest_content(&$a)
{
    $o = '';
    if (!local_user()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
    $a->page['aside'] .= follow_widget();
    $a->page['aside'] .= findpeople_widget();
    $o .= '<h2>' . t('Friend Suggestions') . '</h2>';
    $r = suggestion_query(local_user());
    if (!count($r)) {
        $o .= t('No suggestions available. If this is a new site, please try again in 24 hours.');
        return $o;
    }
    $tpl = get_markup_template('suggest_friends.tpl');
    foreach ($r as $rr) {
        $connlnk = $a->get_baseurl() . '/follow/?url=' . ($rr['connect'] ? $rr['connect'] : $rr['url']);
        $o .= replace_macros($tpl, array('$url' => zrl($rr['url']), '$name' => $rr['name'], '$photo' => $rr['photo'], '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'], '$ignid' => $rr['id'], '$conntxt' => t('Connect'), '$connlnk' => $connlnk, '$ignore' => t('Ignore/Hide')));
    }
    $o .= cleardiv();
    //	$o .= paginate($a);
    return $o;
}
开发者ID:jzacman,项目名称:friendica,代码行数:25,代码来源:suggest.php


示例3: contacts_init

function contacts_init(&$a)
{
    if (!local_user()) {
        return;
    }
    $contact_id = 0;
    if ($a->argc == 2 && intval($a->argv[1])) {
        $contact_id = intval($a->argv[1]);
        $r = q("SELECT * FROM `contact` WHERE `uid` = %d and `id` = %d LIMIT 1", intval(local_user()), intval($contact_id));
        if (!count($r)) {
            $contact_id = 0;
        }
    }
    require_once 'include/group.php';
    require_once 'include/contact_widgets.php';
    if (!x($a->page, 'aside')) {
        $a->page['aside'] = '';
    }
    if ($contact_id) {
        $a->data['contact'] = $r[0];
        $o .= '<div class="vcard">';
        $o .= '<div class="fn">' . $a->data['contact']['name'] . '</div>';
        $o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->data['contact']['photo'] . '" alt="' . $a->data['contact']['name'] . '" /></div>';
        $o .= '</div>';
        $a->page['aside'] .= $o;
    } else {
        $a->page['aside'] .= follow_widget();
    }
    $a->page['aside'] .= group_side('contacts', 'group', false, 0, $contact_id);
    $a->page['aside'] .= findpeople_widget();
    $a->page['aside'] .= networks_widget('contacts', $_GET['nets']);
}
开发者ID:nextgensh,项目名称:friendica,代码行数:32,代码来源:contacts.php


示例4: dirfind_init

function dirfind_init(&$a)
{
    if (!x($a->page, 'aside')) {
        $a->page['aside'] = '';
    }
    $a->page['aside'] .= follow_widget();
    $a->page['aside'] .= findpeople_widget();
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:8,代码来源:dirfind.php


示例5: dirfind_init

function dirfind_init(&$a)
{
    require_once 'include/contact_widgets.php';
    if (!x($a->page, 'aside')) {
        $a->page['aside'] = '';
    }
    $a->page['aside'] .= follow_widget();
    $a->page['aside'] .= findpeople_widget();
}
开发者ID:jzacman,项目名称:friendica,代码行数:9,代码来源:dirfind.php


示例6: match_content

/**
 * @brief Controller for /match.
 *
 * It takes keywords from your profile and queries the directory server for
 * matching keywords from other profiles.
 *
 * @param App &$a
 * @return void|string
 */
function match_content(&$a)
{
    $o = '';
    if (!local_user()) {
        return;
    }
    $a->page['aside'] .= findpeople_widget();
    $a->page['aside'] .= follow_widget();
    $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
    $r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1", intval(local_user()));
    if (!count($r)) {
        return;
    }
    if (!$r[0]['pub_keywords'] && !$r[0]['prv_keywords']) {
        notice(t('No keywords to match. Please add keywords to your default profile.') . EOL);
        return;
    }
    $params = array();
    $tags = trim($r[0]['pub_keywords'] . ' ' . $r[0]['prv_keywords']);
    if ($tags) {
        $params['s'] = $tags;
        if ($a->pager['page'] != 1) {
            $params['p'] = $a->pager['page'];
        }
        if (strlen(get_config('system', 'directory'))) {
            $x = post_url(get_server() . '/msearch', $params);
        } else {
            $x = post_url($a->get_baseurl() . '/msearch', $params);
        }
        $j = json_decode($x);
        if ($j->total) {
            $a->set_pager_total($j->total);
            $a->set_pager_itemspage($j->items_page);
        }
        if (count($j->results)) {
            $id = 0;
            foreach ($j->results as $jj) {
                $match_nurl = normalise_link($jj->url);
                $match = q("SELECT `nurl` FROM `contact` WHERE `uid` = '%d' AND nurl='%s' LIMIT 1", intval(local_user()), dbesc($match_nurl));
                if (!count($match)) {
                    $jj->photo = str_replace("http:///photo/", get_server() . "/photo/", $jj->photo);
                    $connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url;
                    $photo_menu = array(array(t("View Profile"), zrl($jj->url)));
                    $photo_menu[] = array(t("Connect/Follow"), $connlnk);
                    $contact_details = get_contact_details_by_url($jj->url, local_user());
                    $entry = array('url' => zrl($jj->url), 'itemurl' => $contact_details['addr'] != "" ? $contact_details['addr'] : $jj->url, 'name' => $jj->name, 'details' => $contact_details['location'], 'tags' => $contact_details['keywords'], 'about' => $contact_details['about'], 'account_type' => $contact_details['community'] ? t('Forum') : '', 'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB), 'inttxt' => ' ' . t('is interested in:'), 'conntxt' => t('Connect'), 'connlnk' => $connlnk, 'img_hover' => $jj->tags, 'photo_menu' => $photo_menu, 'id' => ++$id);
                    $entries[] = $entry;
                }
            }
            $tpl = get_markup_template('viewcontact_template.tpl');
            $o .= replace_macros($tpl, array('$title' => t('Profile Match'), '$contacts' => $entries, '$paginate' => paginate($a)));
        } else {
            info(t('No matches') . EOL);
        }
    }
    return $o;
}
开发者ID:vinzv,项目名称:friendica,代码行数:66,代码来源:match.php


示例7: directory_init

function directory_init(&$a)
{
    $a->set_pager_itemspage(60);
    if (local_user()) {
        require_once 'include/contact_widgets.php';
        $a->page['aside'] .= findpeople_widget();
    } else {
        unset($_SESSION['theme']);
    }
}
开发者ID:nextgensh,项目名称:friendica,代码行数:10,代码来源:directory.php


示例8: forumdirectory_init

function forumdirectory_init(&$a)
{
    $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/forumdirectory/forumdirectory.css" media="all" />';
    $a->set_pager_itemspage(60);
    if (local_user()) {
        require_once 'include/contact_widgets.php';
        $a->page['aside'] .= findpeople_widget();
    } else {
        unset($_SESSION['theme']);
    }
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:11,代码来源:forumdirectory.php


示例9: match_content

function match_content(&$a)
{
    $o = '';
    if (!local_user()) {
        return;
    }
    $a->page['aside'] .= follow_widget();
    $a->page['aside'] .= findpeople_widget();
    $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
    $o .= replace_macros(get_markup_template("section_title.tpl"), array('$title' => t('Profile Match')));
    $r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1", intval(local_user()));
    if (!count($r)) {
        return;
    }
    if (!$r[0]['pub_keywords'] && !$r[0]['prv_keywords']) {
        notice(t('No keywords to match. Please add keywords to your default profile.') . EOL);
        return;
    }
    $params = array();
    $tags = trim($r[0]['pub_keywords'] . ' ' . $r[0]['prv_keywords']);
    if ($tags) {
        $params['s'] = $tags;
        if ($a->pager['page'] != 1) {
            $params['p'] = $a->pager['page'];
        }
        if (strlen(get_config('system', 'directory'))) {
            $x = post_url(get_server() . '/msearch', $params);
        } else {
            $x = post_url($a->get_baseurl() . '/msearch', $params);
        }
        $j = json_decode($x);
        if ($j->total) {
            $a->set_pager_total($j->total);
            $a->set_pager_itemspage($j->items_page);
        }
        if (count($j->results)) {
            $tpl = get_markup_template('match.tpl');
            foreach ($j->results as $jj) {
                $match_nurl = normalise_link($jj->url);
                $match = q("SELECT `nurl` FROM `contact` WHERE `uid` = '%d' AND nurl='%s' LIMIT 1", intval(local_user()), dbesc($match_nurl));
                if (!count($match)) {
                    $jj->photo = str_replace("http:///photo/", get_server() . "/photo/", $jj->photo);
                    $connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url;
                    $o .= replace_macros($tpl, array('$url' => zrl($jj->url), '$name' => $jj->name, '$photo' => proxy_url($jj->photo), '$inttxt' => ' ' . t('is interested in:'), '$conntxt' => t('Connect'), '$connlnk' => $connlnk, '$tags' => $jj->tags));
                }
            }
        } else {
            info(t('No matches') . EOL);
        }
    }
    $o .= cleardiv();
    $o .= paginate($a);
    return $o;
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:54,代码来源:match.php


示例10: dirfind_init

function dirfind_init(&$a)
{
    if (!local_user()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    if (!x($a->page, 'aside')) {
        $a->page['aside'] = '';
    }
    $a->page['aside'] .= findpeople_widget();
    $a->page['aside'] .= follow_widget();
}
开发者ID:vinzv,项目名称:friendica,代码行数:12,代码来源:dirfind.php


示例11: contacts_init

function contacts_init(&$a)
{
    if (!local_user()) {
        return;
    }
    $contact_id = 0;
    if ($a->argc == 2 && intval($a->argv[1]) or $a->argc == 3 && intval($a->argv[1]) && $a->argv[2] == "posts") {
        $contact_id = intval($a->argv[1]);
        $r = q("SELECT * FROM `contact` WHERE `uid` = %d and `id` = %d LIMIT 1", intval(local_user()), intval($contact_id));
        if (!count($r)) {
            $contact_id = 0;
        }
    }
    require_once 'include/group.php';
    require_once 'include/contact_widgets.php';
    if ($_GET['nets'] == "all") {
        $_GET['nets'] = "";
    }
    if (!x($a->page, 'aside')) {
        $a->page['aside'] = '';
    }
    if ($contact_id) {
        $a->data['contact'] = $r[0];
        if ($a->data['contact']['network'] != "" and $a->data['contact']['network'] != NETWORK_DFRN) {
            $networkname = format_network_name($a->data['contact']['network'], $a->data['contact']['url']);
        } else {
            $networkname = '';
        }
        $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), array('$name' => htmlentities($a->data['contact']['name']), '$photo' => $a->data['contact']['photo'], '$url' => $a->data['contact']['network'] == NETWORK_DFRN ? z_root() . "/redir/" . $a->data['contact']['id'] : $a->data['contact']['url'], '$addr' => $a->data['contact']['addr'] != "" ? $a->data['contact']['addr'] : "", '$network_name' => $networkname, '$network' => t('Network:'), 'account_type' => $a->data['contact']['forum'] || $a->data['contact']['prv'] ? t('Forum') : ''));
        $finpeople_widget = '';
        $follow_widget = '';
        $networks_widget = '';
    } else {
        $vcard_widget = '';
        $networks_widget .= networks_widget('contacts', $_GET['nets']);
        if (isset($_GET['add'])) {
            $follow_widget = follow_widget($_GET['add']);
        } else {
            $follow_widget = follow_widget();
        }
        $findpeople_widget .= findpeople_widget();
    }
    $groups_widget .= group_side('contacts', 'group', 'full', 0, $contact_id);
    $a->page['aside'] .= replace_macros(get_markup_template("contacts-widget-sidebar.tpl"), array('$vcard_widget' => $vcard_widget, '$findpeople_widget' => $findpeople_widget, '$follow_widget' => $follow_widget, '$groups_widget' => $groups_widget, '$networks_widget' => $networks_widget));
    $base = z_root();
    $tpl = get_markup_template("contacts-head.tpl");
    $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(true), '$base' => $base));
    $tpl = get_markup_template("contacts-end.tpl");
    $a->page['end'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(true), '$base' => $base));
}
开发者ID:vinzv,项目名称:friendica,代码行数:50,代码来源:contacts.php


示例12: contacts_init

function contacts_init(&$a)
{
    if (!local_user()) {
        return;
    }
    $contact_id = 0;
    if ($a->argc == 2 && intval($a->argv[1])) {
        $contact_id = intval($a->argv[1]);
        $r = q("SELECT * FROM `contact` WHERE `uid` = %d and `id` = %d LIMIT 1", intval(local_user()), intval($contact_id));
        if (!count($r)) {
            $contact_id = 0;
        }
    }
    require_once 'include/group.php';
    require_once 'include/contact_widgets.php';
    if (!x($a->page, 'aside')) {
        $a->page['aside'] = '';
    }
    if ($contact_id) {
        $a->data['contact'] = $r[0];
        $o .= '<div class="vcard">';
        $o .= '<div class="fn">' . $a->data['contact']['name'] . '</div>';
        $o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->data['contact']['photo'] . '" alt="' . $a->data['contact']['name'] . '" /></div>';
        $o .= '</div>';
        $a->page['aside'] .= $o;
    } else {
        $a->page['aside'] .= follow_widget();
    }
    $a->page['aside'] .= group_side('contacts', 'group', false, 0, $contact_id);
    $a->page['aside'] .= findpeople_widget();
    $a->page['aside'] .= networks_widget('contacts', $_GET['nets']);
    $base = $a->get_baseurl();
    $a->page['htmlhead'] .= '<script src="' . $a->get_baseurl(true) . '/library/jquery_ac/friendica.complete.js" ></script>';
    $a->page['htmlhead'] .= <<<EOT

<script>\$(document).ready(function() { 
\tvar a; 
\ta = \$("#contacts-search").autocomplete({ 
\t\tserviceUrl: '{$base}/acl',
\t\tminChars: 2,
\t\twidth: 350,
\t});
\ta.setOptions({ params: { type: 'a' }});

}); 

</script>
EOT;
}
开发者ID:robhell,项目名称:friendica,代码行数:49,代码来源:contacts.php


示例13: contacts_init

function contacts_init(&$a)
{
    if (!local_user()) {
        return;
    }
    $contact_id = 0;
    if ($a->argc == 2 && intval($a->argv[1])) {
        $contact_id = intval($a->argv[1]);
        $r = q("SELECT * FROM `contact` WHERE `uid` = %d and `id` = %d LIMIT 1", intval(local_user()), intval($contact_id));
        if (!count($r)) {
            $contact_id = 0;
        }
    }
    require_once 'include/group.php';
    require_once 'include/contact_widgets.php';
    if (!x($a->page, 'aside')) {
        $a->page['aside'] = '';
    }
    if ($contact_id) {
        $a->data['contact'] = $r[0];
        $vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"), array('$name' => $a->data['contact']['name'], '$photo' => $a->data['contact']['photo'], '$url' => $a->data['contact']['network'] == NETWORK_DFRN ? $a->get_baseurl() . "/redir/" . $a->data['contact']['id'] : $a->data['contact']['url']));
        $follow_widget = '';
    } else {
        $vcard_widget = '';
        if (isset($_GET['add'])) {
            $follow_widget = follow_widget($_GET['add']);
        } else {
            $follow_widget = follow_widget();
        }
    }
    if ($_GET['nets'] == "all") {
        $_GET['nets'] = "";
    }
    $groups_widget .= group_side('contacts', 'group', false, 0, $contact_id);
    $findpeople_widget .= findpeople_widget();
    $networks_widget .= networks_widget('contacts', $_GET['nets']);
    $a->page['aside'] .= replace_macros(get_markup_template("contacts-widget-sidebar.tpl"), array('$vcard_widget' => $vcard_widget, '$follow_widget' => $follow_widget, '$groups_widget' => $groups_widget, '$findpeople_widget' => $findpeople_widget, '$networks_widget' => $networks_widget));
    $base = $a->get_baseurl();
    $tpl = get_markup_template("contacts-head.tpl");
    $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(true), '$base' => $base));
    $tpl = get_markup_template("contacts-end.tpl");
    $a->page['end'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(true), '$base' => $base));
}
开发者ID:rahmiyildiz,项目名称:friendica,代码行数:43,代码来源:contacts.php


示例14: suggest_content

function suggest_content(&$a)
{
    $o = '';
    if (!local_user()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $a->page['aside'] .= follow_widget();
    $a->page['aside'] .= findpeople_widget();
    $o .= '<h2>' . t('Friend Suggestions') . '</h2>';
    $r = suggestion_query(local_user());
    if (!count($r)) {
        $o .= t('No suggestions. This works best when you have more than one contact/friend.');
        return $o;
    }
    $tpl = get_markup_template('suggest_friends.tpl');
    foreach ($r as $rr) {
        $o .= replace_macros($tpl, array('$url' => $rr['url'], '$name' => $rr['name'], '$photo' => $rr['photo'], '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'], '$ignore' => t('Ignore/Hide')));
    }
    $o .= cleardiv();
    //	$o .= paginate($a);
    return $o;
}
开发者ID:ryivhnn,项目名称:friendica,代码行数:23,代码来源:suggest.php


示例15: widget_findpeople

function widget_findpeople($arr)
{
    return findpeople_widget();
}
开发者ID:Mauru,项目名称:red,代码行数:4,代码来源:widgets.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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