more heavy lifting on poco rep
This commit is contained in:
parent
10960be69d
commit
dfe31dc3b7
@ -119,6 +119,7 @@ function vcard_from_xchan($xchan, $observer = null, $mode = '') {
|
|||||||
'$name' => $xchan['xchan_name'],
|
'$name' => $xchan['xchan_name'],
|
||||||
'$photo' => ((is_array($a->profile) && array_key_exists('photo',$a->profile)) ? $a->profile['photo'] : $xchan['xchan_photo_l']),
|
'$photo' => ((is_array($a->profile) && array_key_exists('photo',$a->profile)) ? $a->profile['photo'] : $xchan['xchan_photo_l']),
|
||||||
'$follow' => $xchan['xchan_addr'],
|
'$follow' => $xchan['xchan_addr'],
|
||||||
|
'$link' => zid($xchan['xchan_url']),
|
||||||
'$connect' => $connect,
|
'$connect' => $connect,
|
||||||
'$newwin' => (($mode === 'chanview') ? t('New window') : ''),
|
'$newwin' => (($mode === 'chanview') ? t('New window') : ''),
|
||||||
'$newtit' => t('Open the selected location in a different window or browser tab'),
|
'$newtit' => t('Open the selected location in a different window or browser tab'),
|
||||||
|
35
mod/prep.php
35
mod/prep.php
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function prep_content(&$a) {
|
|
||||||
|
|
||||||
|
function prep_init(&$a) {
|
||||||
|
|
||||||
$poco_rating = get_config('system','poco_rating_enable');
|
$poco_rating = get_config('system','poco_rating_enable');
|
||||||
// if unset default to enabled
|
// if unset default to enabled
|
||||||
@ -23,19 +23,40 @@ function prep_content(&$a) {
|
|||||||
dbesc($hash . '%')
|
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",
|
$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();
|
$ret = array();
|
||||||
|
|
||||||
if($p && $r) {
|
if($r) {
|
||||||
$ret['poi'] = $p[0];
|
|
||||||
$ret['raters'] = $r;
|
|
||||||
|
|
||||||
$o = replace_macros(get_markup_template('prep.tpl'),array(
|
$o = replace_macros(get_markup_template('prep.tpl'),array(
|
||||||
'$header' => t('Ratings'),
|
'$header' => t('Ratings'),
|
||||||
'$poi' => $p[0],
|
'$rating_lbl' => t('Rating: ' ),
|
||||||
|
'$rating_text_lbl' => t('Description: '),
|
||||||
'$raters' => $r
|
'$raters' => $r
|
||||||
));
|
));
|
||||||
|
|
||||||
|
8
view/css/mod_prep.css
Normal file
8
view/css/mod_prep.css
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
.contact-photo-wrapper {
|
||||||
|
float: left;
|
||||||
|
width: 120px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prep-details {
|
||||||
|
float: left;
|
||||||
|
}
|
5
view/pdl/mod_prep.pdl
Normal file
5
view/pdl/mod_prep.pdl
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[region=aside]
|
||||||
|
[widget=vcard][/widget]
|
||||||
|
[widget=suggestions][/widget]
|
||||||
|
[widget=findpeople][/widget]
|
||||||
|
[/region]
|
@ -1,17 +1,5 @@
|
|||||||
<h1>{{$header}}</h1>
|
<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}}
|
{{if $raters}}
|
||||||
{{foreach $raters as $r}}
|
{{foreach $raters as $r}}
|
||||||
|
|
||||||
@ -19,14 +7,18 @@
|
|||||||
|
|
||||||
<div class="contact-photo-wrapper" id="directory-photo-wrapper-{{$r.xchan_hash}}" >
|
<div class="contact-photo-wrapper" id="directory-photo-wrapper-{{$r.xchan_hash}}" >
|
||||||
<div class="contact-photo" id="directory-photo-{{$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>
|
<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 class="contact-name">{{$r.xchan_name}}</div>
|
|
||||||
</div>
|
</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}}
|
{{if $r.xlink_rating_text}}
|
||||||
Reason: {{$r.xlink_rating_text}}
|
{{$rating_text_label}} {{$r.xlink_rating_text}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="clear"></div>
|
||||||
|
</div>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div class="vcard">
|
<div class="vcard">
|
||||||
<div class="fn">{{$name}}</div>
|
<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>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user