mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 02:35:12 +00:00
suggestion widget
This commit is contained in:
parent
9354c33839
commit
f45b06ffa0
6 changed files with 60 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
<?php /** @file */
|
||||
|
||||
|
||||
function follow_widget() {
|
||||
$a = get_app();
|
||||
$uid =$a->channel['channel_id'];
|
||||
|
@ -149,4 +150,44 @@ function common_friends_visitor_widget($profile_uid) {
|
|||
'$items' => $r
|
||||
));
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
function suggest_widget() {
|
||||
|
||||
require_once('include/socgraph.php');
|
||||
|
||||
$r = suggestion_query(local_user(),get_observer_hash(),0,2);
|
||||
|
||||
if(! $r) {
|
||||
return;
|
||||
}
|
||||
|
||||
$arr = array();
|
||||
|
||||
foreach($r as $rr) {
|
||||
|
||||
$connlnk = z_root() . '/follow/?url=' . $rr['xchan_addr'];
|
||||
|
||||
$arr[] = array(
|
||||
'url' => chanlink_url($rr['xchan_url']),
|
||||
'name' => $rr['xchan_name'],
|
||||
'photo' => $rr['xchan_photo_m'],
|
||||
'ignlnk' => z_root() . '/suggest?ignore=' . $rr['xchan_hash'],
|
||||
'conntxt' => t('Connect'),
|
||||
'connlnk' => $connlnk,
|
||||
'ignore' => t('Ignore/Hide')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$o = replace_macros(get_markup_template('suggest_widget.tpl'),array(
|
||||
'$title' => t('Suggestions'),
|
||||
'$more' => t('See more...'),
|
||||
'$entries' => $arr
|
||||
));
|
||||
|
||||
return $o;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -287,11 +287,13 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) {
|
|||
and not xlink_link in ( select xchan from xign where uid = %d )
|
||||
and xlink_xchan != ''
|
||||
and not ( xchan_flags & %d )
|
||||
and not ( xchan_flags & %d )
|
||||
group by xchan_hash order by total desc limit %d, %d ",
|
||||
intval($uid),
|
||||
intval($uid),
|
||||
intval($uid),
|
||||
intval(XCHAN_FLAGS_HIDDEN),
|
||||
intval(XCHAN_FLAGS_DELETED),
|
||||
intval($start),
|
||||
intval($limit)
|
||||
);
|
||||
|
@ -305,10 +307,12 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) {
|
|||
and not xlink_link in ( select abook_xchan from abook where abook_channel = %d )
|
||||
and not xlink_link in ( select xchan from xign where uid = %d )
|
||||
and not ( xchan_flags & %d )
|
||||
and not ( xchan_flags & %d )
|
||||
group by xchan_hash order by total desc limit %d, %d ",
|
||||
intval($uid),
|
||||
intval($uid),
|
||||
intval(XCHAN_FLAGS_HIDDEN),
|
||||
intval(XCHAN_FLAGS_DELETED),
|
||||
intval($start),
|
||||
intval($limit)
|
||||
);
|
||||
|
|
|
@ -50,6 +50,7 @@ function network_init(&$a) {
|
|||
|
||||
$a->page['aside'] .= group_side('network','network',true,$_GET['gid']);
|
||||
$a->page['aside'] .= posted_date_widget($a->get_baseurl() . '/network',local_user(),false);
|
||||
$a->page['aside'] .= suggest_widget();
|
||||
|
||||
$a->page['aside'] .= saved_searches($search);
|
||||
$a->page['aside'] .= fileas_widget($a->get_baseurl(true) . '/network',(x($_GET, 'file') ? $_GET['file'] : ''));
|
||||
|
|
|
@ -932,7 +932,7 @@ tr.mceLast {
|
|||
.contact-entry-photo img, .profile-match-photo img, #photo-photo img, .directory-photo-img, .photo-album-photo, .photo-top-photo {
|
||||
border-radius: $radiuspx;
|
||||
-moz-border-radius: $radiuspx;
|
||||
box-shadow: 4px 4px 3px 0 #444444;
|
||||
box-shadow: $shadowpx $shadowpx $shadowpx 0 #444444;
|
||||
}
|
||||
|
||||
#sidebar-page-list .label {
|
||||
|
@ -2979,3 +2979,4 @@ img.mail-list-sender-photo {
|
|||
.comment-edit-text-full {
|
||||
color: black;
|
||||
}
|
||||
.suggest-widget-more { margin-top: 10px; }
|
|
@ -1,5 +1,5 @@
|
|||
<div class="profile-match-wrapper">
|
||||
<a href="{{$entry.ignlnk}}" title="{{$entry.ignore}}" class="icon drophide smalldrop profile-match-ignore" onmouseout="imgdull(this);" onmouseover="imgbright(this);" onclick="return confirmDelete();" ></a>
|
||||
<a href="{{$entry.ignlnk}}" title="{{$entry.ignore}}" class="profile-match-ignore" onclick="return confirmDelete();" ><i class="icon-remove drop-icons"></i></a>
|
||||
<div class="profile-match-photo">
|
||||
<a href="{{$entry.url}}">
|
||||
<img src="{{$entry.photo}}" alt="{{$entry.name}}" width="80" height="80" title="{{$entry.name}} [{{$entry.url}}]" />
|
||||
|
|
10
view/tpl/suggest_widget.tpl
Normal file
10
view/tpl/suggest_widget.tpl
Normal file
|
@ -0,0 +1,10 @@
|
|||
<div class="widget">
|
||||
<h3>{{$title}}</h3>
|
||||
{{if $entries}}
|
||||
{{foreach $entries as $child}}
|
||||
{{include file="suggest_friends.tpl" entry=$child}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
<div class="clear"></div>
|
||||
<div class="suggest-widget-more"><a href="suggest">{{$more}}</a></div>
|
||||
</div>
|
Loading…
Reference in a new issue