diff options
-rw-r--r-- | include/Contact.php | 1 | ||||
-rw-r--r-- | mod/prep.php | 35 | ||||
-rw-r--r-- | view/css/mod_prep.css | 8 | ||||
-rw-r--r-- | view/pdl/mod_prep.pdl | 5 | ||||
-rw-r--r-- | view/tpl/prep.tpl | 24 | ||||
-rwxr-xr-x | view/tpl/xchan_vcard.tpl | 2 |
6 files changed, 51 insertions, 24 deletions
diff --git a/include/Contact.php b/include/Contact.php index 4f7a2a19f..4c80f5d6a 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -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'), diff --git a/mod/prep.php b/mod/prep.php index 7cff34bfc..45cdddad6 100644 --- a/mod/prep.php +++ b/mod/prep.php @@ -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 )); diff --git a/view/css/mod_prep.css b/view/css/mod_prep.css new file mode 100644 index 000000000..3701cbdff --- /dev/null +++ b/view/css/mod_prep.css @@ -0,0 +1,8 @@ +.contact-photo-wrapper { + float: left; + width: 120px; +} + +.prep-details { + float: left; +}
\ No newline at end of file diff --git a/view/pdl/mod_prep.pdl b/view/pdl/mod_prep.pdl new file mode 100644 index 000000000..3d40386cd --- /dev/null +++ b/view/pdl/mod_prep.pdl @@ -0,0 +1,5 @@ +[region=aside] +[widget=vcard][/widget] +[widget=suggestions][/widget] +[widget=findpeople][/widget] +[/region] diff --git a/view/tpl/prep.tpl b/view/tpl/prep.tpl index d0c1e5ec6..49dea7d72 100644 --- a/view/tpl/prep.tpl +++ b/view/tpl/prep.tpl @@ -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}} diff --git a/view/tpl/xchan_vcard.tpl b/view/tpl/xchan_vcard.tpl index 929965727..b72250bec 100755 --- a/view/tpl/xchan_vcard.tpl +++ b/view/tpl/xchan_vcard.tpl @@ -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> |