more heavy lifting on poco rep

This commit is contained in:
friendica 2015-01-15 19:05:42 -08:00
parent 10960be69d
commit dfe31dc3b7
6 changed files with 51 additions and 24 deletions

View file

@ -119,6 +119,7 @@ function vcard_from_xchan($xchan, $observer = null, $mode = '') {
'$name' => $xchan['xchan_name'],
'$photo' => ((is_array($a->profile) && array_key_exists('photo',$a->profile)) ? $a->profile['photo'] : $xchan['xchan_photo_l']),
'$follow' => $xchan['xchan_addr'],
'$link' => zid($xchan['xchan_url']),
'$connect' => $connect,
'$newwin' => (($mode === 'chanview') ? t('New window') : ''),
'$newtit' => t('Open the selected location in a different window or browser tab'),

View file

@ -1,7 +1,7 @@
<?php
function prep_content(&$a) {
function prep_init(&$a) {
$poco_rating = get_config('system','poco_rating_enable');
// if unset default to enabled
@ -23,19 +23,40 @@ function prep_content(&$a) {
dbesc($hash . '%')
);
if($p)
$a->poi = $p[0];
}
function prep_content(&$a) {
$poco_rating = get_config('system','poco_rating_enable');
// if unset default to enabled
if($poco_rating === false)
$poco_rating = true;
if(! $poco_rating)
return;
if(! $a->poi)
return;
$r = q("select * from xlink left join xchan on xlink_xchan = xchan_hash where xlink_link like '%s' and xlink_rating != 0",
dbesc($hash . '%')
dbesc($a->poi['xchan_hash'])
);
$ret = array();
if($p && $r) {
$ret['poi'] = $p[0];
$ret['raters'] = $r;
if($r) {
$o = replace_macros(get_markup_template('prep.tpl'),array(
'$header' => t('Ratings'),
'$poi' => $p[0],
'$rating_lbl' => t('Rating: ' ),
'$rating_text_lbl' => t('Description: '),
'$raters' => $r
));

8
view/css/mod_prep.css Normal file
View file

@ -0,0 +1,8 @@
.contact-photo-wrapper {
float: left;
width: 120px;
}
.prep-details {
float: left;
}

5
view/pdl/mod_prep.pdl Normal file
View file

@ -0,0 +1,5 @@
[region=aside]
[widget=vcard][/widget]
[widget=suggestions][/widget]
[widget=findpeople][/widget]
[/region]

View file

@ -1,17 +1,5 @@
<h1>{{$header}}</h1>
{{if $poi}}
<div class="directory-item lframe" id="directory-item-{{$poi.xchan_hash}}" >
<div class="contact-photo-wrapper" id="directory-photo-wrapper-{{$poi.xchan_hash}}" >
<div class="contact-photo" id="directory-photo-{{$poi.xchan_hash}}" >
<a href="{{$poi.xchan_url}}" class="directory-profile-link" id="directory-profile-link-{{$poi.xchan_hash}}" ><img class="directory-photo-img" src="{{$poi.xchan_photo_l}}" alt="{{$poi.xchan_addr}}" title="{{$poi.xchan_addr}}" /></a>
<div class="contact-name">{{$poi.xchan_name}}</div>
</div>
</div>
{{/if}}
{{if $raters}}
{{foreach $raters as $r}}
@ -19,14 +7,18 @@
<div class="contact-photo-wrapper" id="directory-photo-wrapper-{{$r.xchan_hash}}" >
<div class="contact-photo" id="directory-photo-{{$r.xchan_hash}}" >
<a href="{{$r.xchan_url}}" class="directory-profile-link" id="directory-profile-link-{{$r.xchan_hash}}" ><img class="directory-photo-img" src="{{$r.xchan_photo_l}}" alt="{{$r.xchan_addr}}" title="{{$r.xchan_addr}}" /></a>
<div class="contact-name">{{$r.xchan_name}}</div>
<a href="{{$r.xchan_url}}" class="directory-profile-link" id="directory-profile-link-{{$r.xchan_hash}}" ><img class="directory-photo-img" src="{{$r.xchan_photo_m}}" alt="{{$r.xchan_addr}}" title="{{$r.xchan_addr}}" /></a>
</div>
Rating: {{$r.xlink_rating}}
</div>
<div class="prep-details">
<a href="{{$r.xchan_url}}" class="directory-profile-link" id="directory-profile-link-{{$r.xchan_hash}}" ><div class="contact-name">{{$r.xchan_name}}</div></a>
{{$rating_lbl}} {{$r.xlink_rating}}
{{if $r.xlink_rating_text}}
Reason: {{$r.xlink_rating_text}}
{{$rating_text_label}} {{$r.xlink_rating_text}}
{{/if}}
</div>
<div class="clear"></div>
</div>
{{/foreach}}
{{/if}}

View file

@ -1,6 +1,6 @@
<div class="vcard">
<div class="fn">{{$name}}</div>
<div id="profile-photo-wrapper"><img class="vcard-photo photo" src="{{$photo}}" alt="{{$name}}" /></div>
<div id="profile-photo-wrapper"><a href="{{$link}}"><img class="vcard-photo photo" src="{{$photo}}" alt="{{$name}}" /></a></div>
</div>