aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/notifier.php14
-rw-r--r--include/ratenotif.php124
-rw-r--r--include/zot.php39
-rw-r--r--mod/connedit.php21
-rw-r--r--mod/directory.php6
-rw-r--r--mod/dirsearch.php18
-rw-r--r--mod/prate.php20
-rw-r--r--mod/prep.php75
-rw-r--r--mod/ratings.php87
-rw-r--r--mod/ratingsearch.php58
-rw-r--r--view/css/mod_directory.css8
-rw-r--r--view/css/mod_ratings.css (renamed from view/css/mod_prep.css)4
-rw-r--r--view/pdl/mod_ratings.pdl (renamed from view/pdl/mod_prep.pdl)0
-rwxr-xr-xview/tpl/direntry.tpl15
-rw-r--r--view/tpl/prep.tpl5
-rwxr-xr-xview/tpl/xchan_vcard.tpl11
16 files changed, 369 insertions, 136 deletions
diff --git a/include/notifier.php b/include/notifier.php
index edb2f1946..fe6ac33c0 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -297,15 +297,6 @@ function notifier_run($argv, $argc){
$private = false;
$packet_type = 'purge';
}
- elseif($cmd === 'rating') {
- $r = q("select * from xlink where xlink_id = %d and xlink_static = 1 limit 1",
- intval($item_id)
- );
- if($r) {
- logger('rating message: ' . print_r($r[0],true));
- return;
- }
- }
else {
// Normal items
@@ -483,11 +474,6 @@ function notifier_run($argv, $argc){
// Now we have collected recipients (except for external mentions, FIXME)
// Let's reduce this to a set of hubs.
-
- // for public posts always include our own hub
-// this shouldn't be needed any more. collect_recipients should take care of it.
-// $sql_extra = (($private) ? "" : " or hubloc_url = '" . dbesc(z_root()) . "' ");
-
logger('notifier: hub choice: ' . intval($relay_to_owner) . ' ' . intval($private) . ' ' . $cmd, LOGGER_DEBUG);
if($relay_to_owner && (! $private) && ($cmd !== 'relay')) {
diff --git a/include/ratenotif.php b/include/ratenotif.php
new file mode 100644
index 000000000..4fa0077a6
--- /dev/null
+++ b/include/ratenotif.php
@@ -0,0 +1,124 @@
+<?php
+
+require_once('include/cli_startup.php');
+require_once('include/zot.php');
+require_once('include/queue_fn.php');
+
+
+function ratenotif_run($argv, $argc){
+
+ cli_startup();
+
+ $a = get_app();
+
+ require_once("session.php");
+ require_once("datetime.php");
+ require_once('include/items.php');
+ require_once('include/Contact.php');
+
+ if($argc < 3)
+ return;
+
+
+ logger('ratenotif: invoked: ' . print_r($argv,true), LOGGER_DEBUG);
+
+ $cmd = $argv[1];
+
+ $item_id = $argv[2];
+
+
+ if($cmd === 'rating') {
+ $r = q("select * from xlink where xlink_id = %d and xlink_static = 1 limit 1",
+ intval($item_id)
+ );
+ if(! $r) {
+ logger('rating not found');
+ return;
+ }
+
+ $encoded_item = array(
+ 'type' => 'rating',
+ 'encoding' => 'zot',
+ 'target' => $r[0]['xlink_link'],
+ 'rating' => intval($r[0]['xlink_rating']),
+ 'rating_text' => $r[0]['xlink_rating_text'],
+ 'signature' => $r[0]['xlink_sig'],
+ 'edited' => $r[0]['xlink_updated']
+ );
+ }
+
+ $channel = channelx_by_hash($r[0]['xlink_xchan']);
+ if(! $channel) {
+ logger('no channel');
+ return;
+ }
+
+
+ $primary = get_directory_primary();
+
+ if(! $primary)
+ return;
+
+
+ $interval = ((get_config('system','delivery_interval') !== false)
+ ? intval(get_config('system','delivery_interval')) : 2 );
+
+ $deliveries_per_process = intval(get_config('system','delivery_batch_count'));
+
+ if($deliveries_per_process <= 0)
+ $deliveries_per_process = 1;
+
+ $deliver = array();
+
+ $x = z_fetch_url($primary . '/regdir');
+ if($x['success']) {
+ $j = json_decode($x['body'],true);
+ if($j && $j['success'] && is_array($j['directories'])) {
+
+ foreach($j['directories'] as $h) {
+// if($h == z_root())
+// continue;
+
+ $hash = random_string();
+ $n = zot_build_packet($channel,'notify',null,null,$hash);
+
+ q("insert into outq ( outq_hash, outq_account, outq_channel, outq_driver, outq_posturl, outq_async, outq_created, outq_updated, outq_notify, outq_msg ) values ( '%s', %d, %d, '%s', '%s', %d, '%s', '%s', '%s', '%s' )",
+ dbesc($hash),
+ intval($channel['channel_account_id']),
+ intval($channel['channel_id']),
+ dbesc('zot'),
+ dbesc($h . '/post'),
+ intval(1),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc($n),
+ dbesc(json_encode($encoded_item))
+ );
+ }
+ $deliver[] = $hash;
+
+ if(count($deliver) >= $deliveries_per_process) {
+ proc_run('php','include/deliver.php',$deliver);
+ $deliver = array();
+ if($interval)
+ @time_sleep_until(microtime(true) + (float) $interval);
+ }
+
+
+ // catch any stragglers
+
+ if(count($deliver)) {
+ proc_run('php','include/deliver.php',$deliver);
+ }
+ }
+ }
+
+ logger('ratenotif: complete.');
+ return;
+
+}
+
+if (array_search(__file__,get_included_files())===0){
+ ratenotif_run($argv,$argc);
+ killme();
+}
diff --git a/include/zot.php b/include/zot.php
index 7002fee0a..0e1c5165a 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1113,7 +1113,8 @@ function zot_import($arr, $sender_url) {
if(array_key_exists('message',$i) && array_key_exists('type',$i['message']) && $i['message']['type'] === 'rating') {
// rating messages are processed only by directory servers
logger('Rating received: ' . print_r($arr,true), LOGGER_DATA);
- $result = process_rating_delivery($i['notify']['sender'],$arr);
+ $result = process_rating_delivery($i['notify']['sender'],$i['message']);
+ continue;
}
if(array_key_exists('recipients',$i['notify']) && count($i['notify']['recipients'])) {
@@ -1818,34 +1819,52 @@ function process_mail_delivery($sender,$arr,$deliveries) {
function process_rating_delivery($sender,$arr) {
- $dirmode = intval(get_config('system','directory_mode'));
- if($dirmode == DIRECTORY_MODE_NORMAL)
- return;
+ logger('process_rating_delivery: ' . print_r($arr,true));
if(! $arr['target'])
return;
- $r = q("select * from xlink where xlink_xchan = '%s' and xlink_target = '%s' limit 1",
+ $z = q("select xchan_pubkey from xchan where xchan_hash = '%s' limit 1",
+ dbesc($sender['hash'])
+ );
+
+
+ if((! $z) || (! rsa_verify($arr['target'] . '.' . $arr['rating'] . '.' . $arr['rating_text'], base64url_decode($arr['signature']),$z[0]['xchan_pubkey']))) {
+ logger('failed to verify rating');
+ return;
+ }
+
+ $r = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1 limit 1",
dbesc($sender['hash']),
dbesc($arr['target'])
- );
+ );
+
if($r) {
- $x = q("update xlink set xlink_rating = %d, xlink_rating_text = '%s', xlink_updated = '%s' where xlink_id = %d",
+ if($r[0]['xlink_updated'] >= $arr['edited']) {
+ logger('rating message duplicate');
+ return;
+ }
+
+ $x = q("update xlink set xlink_rating = %d, xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s' where xlink_id = %d",
intval($arr['rating']),
- intval($arr['rating_text']),
+ dbesc($arr['rating_text']),
+ dbesc($arr['signature']),
dbesc(datetime_convert()),
intval($r[0]['xlink_id'])
);
+ logger('rating updated');
}
else {
- $x = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_updated, xlink_static )
+ $x = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static )
values( '%s', '%s', %d, '%s', '%s', 1 ) ",
dbesc($sender['hash']),
dbesc($arr['target']),
intval($arr['rating']),
- intval($arr['rating_text']),
+ dbesc($arr['rating_text']),
+ dbesc($arr['signature']),
dbesc(datetime_convert())
);
+ logger('rating created');
}
return;
}
diff --git a/mod/connedit.php b/mod/connedit.php
index 8c0212afe..79c7e6a4f 100644
--- a/mod/connedit.php
+++ b/mod/connedit.php
@@ -117,7 +117,7 @@ function connedit_post(&$a) {
if($rating > 10)
$rating = 10;
- $rating_text = escape_tags($_REQUEST['rating_text']);
+ $rating_text = trim(escape_tags($_REQUEST['rating_text']));
$abook_my_perms = 0;
@@ -131,26 +131,35 @@ function connedit_post(&$a) {
$new_friend = false;
if(! $is_self) {
- $z = q("select * from xlink where xlink_xchan = '%s' and xlink_xlink = '%s' and xlink_static = 1 limit 1",
+
+ $signed = $orig_record[0]['abook_xchan'] . '.' . $rating . '.' . $rating_text;
+
+ $sig = base64url_encode(rsa_sign($signed,$channel['channel_prvkey']));
+
+ $z = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1 limit 1",
dbesc($channel['channel_hash']),
dbesc($orig_record[0]['abook_xchan'])
);
+
+
if($z) {
$record = $z[0]['xlink_id'];
- $w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_updated = '%s'
+ $w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s'
where xlink_id = %d",
intval($rating),
dbesc($rating_text),
+ dbesc($sig),
dbesc(datetime_convert()),
intval($record)
);
}
else {
- $w = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', 1 ) ",
+ $w = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', '%s', 1 ) ",
dbesc($channel['channel_hash']),
dbesc($orig_record[0]['abook_xchan']),
intval($rating),
dbesc($rating_text),
+ dbesc($sig),
dbesc(datetime_convert())
);
$z = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1 limit 1",
@@ -161,7 +170,7 @@ function connedit_post(&$a) {
$record = $z[0]['xlink_id'];
}
if($record) {
- proc_run('php','include/notifier.php','rating',$record);
+ proc_run('php','include/ratenotif.php','rating',$record);
}
}
@@ -564,7 +573,7 @@ function connedit_content(&$a) {
}
$poco_rating = get_config('system','poco_rating_enable');
- $poco_rating = 0;
+
// if unset default to enabled
if($poco_rating === false)
$poco_rating = true;
diff --git a/mod/directory.php b/mod/directory.php
index 21940d57b..d9316ef67 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -190,6 +190,11 @@ function directory_content(&$a) {
$page_type = '';
+ if($rr['total_ratings'])
+ $total_ratings = sprintf( tt("%d rating", "%d ratings", $rr['total_ratings']), $rr['total_ratings']);
+ else
+ $total_ratings = '';
+
$profile = $rr;
if ((x($profile,'locale') == 1)
@@ -255,6 +260,7 @@ function directory_content(&$a) {
'nickname' => substr($rr['address'],0,strpos($rr['address'],'@')),
'location' => $location,
'gender' => $gender,
+ 'total_ratings' => $total_ratings,
'pdesc' => $pdesc,
'marital' => $marital,
'homepage' => $homepage,
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 52a3d02cf..69b7e2eac 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -12,7 +12,6 @@ function dirsearch_content(&$a) {
$ret = array('success' => false);
- // If you've got a public directory server, you probably shouldn't block public access
$dirmode = intval(get_config('system','directory_mode'));
@@ -210,6 +209,23 @@ function dirsearch_content(&$a) {
);
}
}
+ $r = q("select * from xlink where xlink_static = 1 and xlink_updated >= '%s' ",
+ dbesc($sync)
+ );
+ if($r) {
+ $spkt['rating'] = array();
+ foreach($r as $rr) {
+ $spkt['rating'][] = array(
+ 'type' => 'rating',
+ 'encoding' => 'zot',
+ 'target' => $rr['xlink_link'],
+ 'rating' => intval($rr['xlink_rating']),
+ 'rating_text' => $rr['xlink_rating_text'],
+ 'signature' => $rr['xlink_sig'],
+ 'edited' => $rr['xlink_updated']
+ );
+ }
+ }
json_return_and_die($spkt);
}
else {
diff --git a/mod/prate.php b/mod/prate.php
index 28703d414..30de97927 100644
--- a/mod/prate.php
+++ b/mod/prate.php
@@ -2,12 +2,13 @@
function prate_post(&$a) {
+
if(! local_channel())
return;
$channel = $a->get_channel();
- $target = $_REQUEST['target'];
+ $target = trim($_REQUEST['target']);
if(! $target)
return;
@@ -20,28 +21,35 @@ function prate_post(&$a) {
if($rating > 10)
$rating = 10;
- $rating_text = escape_tags($_REQUEST['rating_text']);
+ $rating_text = trim(escape_tags($_REQUEST['rating_text']));
+
+ $signed = $target . '.' . $rating . '.' . $rating_text;
+
+ $sig = base64url_encode(rsa_sign($signed,$channel['channel_prvkey']));
+
- $z = q("select * from xlink where xlink_xchan = '%s' and xlink_xlink = '%s' and xlink_static = 1 limit 1",
+ $z = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1 limit 1",
dbesc($channel['channel_hash']),
dbesc($target)
);
if($z) {
$record = $z[0]['xlink_id'];
- $w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_updated = '%s'
+ $w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s'
where xlink_id = %d",
intval($rating),
dbesc($rating_text),
+ dbesc($sig),
dbesc(datetime_convert()),
intval($record)
);
}
else {
- $w = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', 1 ) ",
+ $w = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', '%s', 1 ) ",
dbesc($channel['channel_hash']),
dbesc($target),
intval($rating),
dbesc($rating_text),
+ dbesc($sig),
dbesc(datetime_convert())
);
$z = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1 limit 1",
@@ -52,7 +60,7 @@ function prate_post(&$a) {
$record = $z[0]['xlink_id'];
}
if($record) {
- proc_run('php','include/notifier.php','rating',$record);
+ proc_run('php','include/ratenotif.php','rating',$record);
}
$x = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
diff --git a/mod/prep.php b/mod/prep.php
deleted file mode 100644
index 896717826..000000000
--- a/mod/prep.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-
-
-function prep_init(&$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(argc() > 1)
- $hash = argv(1);
-
- if(! $hash) {
- notice('Must supply a channel identififier.');
- return;
- }
-
- if(strpos($hash,'@')) {
- $r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
- dbesc($hash)
- );
- if($r)
- $hash = $r[0]['hubloc_hash'];
- }
-
- $p = q("select * from xchan where xchan_hash like '%s'",
- 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($a->poi['xchan_hash'])
- );
-
- if(! $r)
- notice( t('No ratings available') . EOL);
-
-
- $o = replace_macros(get_markup_template('prep.tpl'),array(
- '$header' => t('Ratings'),
- '$rating_lbl' => t('Rating: ' ),
- '$rating_text_lbl' => t('Description: '),
- '$raters' => $r
- ));
-
- return $o;
-}
-
- \ No newline at end of file
diff --git a/mod/ratings.php b/mod/ratings.php
new file mode 100644
index 000000000..4b94f0e52
--- /dev/null
+++ b/mod/ratings.php
@@ -0,0 +1,87 @@
+<?php
+
+require_once('include/dir_fns.php');
+
+function ratings_init(&$a) {
+
+ if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
+ return;
+ }
+
+ $dirmode = intval(get_config('system','directory_mode'));
+
+ $x = find_upstream_directory($dirmode);
+ if($x)
+ $url = $x['url'];
+
+ $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(argc() > 1)
+ $hash = argv(1);
+
+ if(! $hash) {
+ notice('Must supply a channel identififier.');
+ return;
+ }
+
+ $results = false;
+
+ $x = z_fetch_url($url . '/ratingsearch/' . $hash);
+
+
+ if($x['success'])
+ $results = json_decode($x['body'],true);
+
+
+ if((! $results) || (! $results['success'])) {
+
+ notice('No results.');
+ return;
+ }
+
+ $a->poi = $results['target'];
+ $a->data = $results['ratings'];
+
+ if(! $a->data) {
+ notice( t('No ratings') . EOL);
+ }
+
+ return;
+}
+
+
+
+
+
+function ratings_content(&$a) {
+
+ if((get_config('system','block_public')) && (! local_channel()) && (! remote_channel())) {
+ notice( t('Public access denied.') . EOL);
+ return;
+ }
+
+ $poco_rating = get_config('system','poco_rating_enable');
+ // if unset default to enabled
+ if($poco_rating === false)
+ $poco_rating = true;
+
+ if(! $poco_rating)
+ return;
+
+ $o = replace_macros(get_markup_template('prep.tpl'),array(
+ '$header' => t('Ratings'),
+ '$rating_lbl' => t('Rating: ' ),
+ '$rating_text_lbl' => t('Description: '),
+ '$raters' => $a->data
+ ));
+
+ return $o;
+}
+
+ \ No newline at end of file
diff --git a/mod/ratingsearch.php b/mod/ratingsearch.php
new file mode 100644
index 000000000..9a537bf97
--- /dev/null
+++ b/mod/ratingsearch.php
@@ -0,0 +1,58 @@
+<?php
+
+
+function ratingsearch_init(&$a) {
+
+ $ret = array('success' => false);
+
+ $dirmode = intval(get_config('system','directory_mode'));
+
+ if($dirmode == DIRECTORY_MODE_NORMAL) {
+ $ret['message'] = 'This site is not a directory server.';
+ json_return_and_die($ret);
+ }
+
+ if(argc() > 1)
+ $hash = argv(1);
+
+ if(! $hash) {
+ $ret['message'] = 'No channel identifier';
+ json_return_and_die($ret);
+ }
+
+ if(strpos($hash,'@')) {
+ $r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
+ dbesc($hash)
+ );
+ if($r)
+ $hash = $r[0]['hubloc_hash'];
+ }
+
+ $p = q("select * from xchan where xchan_hash like '%s'",
+ dbesc($hash . '%')
+ );
+
+ if($p)
+ $ret['target'] = $p[0];
+ else {
+ $ret['message'] = 'channel not found';
+ json_return_and_die($ret);
+ }
+
+ $ret['success'] = true;
+
+ $r = q("select * from xlink left join xchan on xlink_xchan = xchan_hash
+ where xlink_link = '%s' and xlink_rating != 0 and xlink_static = 1",
+ dbesc($p[0]['xchan_hash'])
+ );
+
+ if($r) {
+ $ret['ratings'] = $r;
+ }
+ else
+ $ret['ratings'] = array();
+
+ json_return_and_die($ret);
+
+}
+
diff --git a/view/css/mod_directory.css b/view/css/mod_directory.css
index 20facbaf8..1e140d933 100644
--- a/view/css/mod_directory.css
+++ b/view/css/mod_directory.css
@@ -3,8 +3,14 @@
clear: both;
}
.directory-name {
- text-align: center;
+ float: left;
+ width: 250px;
}
+.directory-rating {
+ float: right;
+ margin-right: 5px;
+}
+
.directory-photo {
margin-left: 25px;
}
diff --git a/view/css/mod_prep.css b/view/css/mod_ratings.css
index bb29086da..86d6f5ed3 100644
--- a/view/css/mod_prep.css
+++ b/view/css/mod_ratings.css
@@ -9,4 +9,8 @@
.directory-item {
margin: 10px;
+}
+
+.rating-value {
+ margin-top: 10px;
} \ No newline at end of file
diff --git a/view/pdl/mod_prep.pdl b/view/pdl/mod_ratings.pdl
index 3d40386cd..3d40386cd 100644
--- a/view/pdl/mod_prep.pdl
+++ b/view/pdl/mod_ratings.pdl
diff --git a/view/tpl/direntry.tpl b/view/tpl/direntry.tpl
index 6ba86a085..1761ed12d 100755
--- a/view/tpl/direntry.tpl
+++ b/view/tpl/direntry.tpl
@@ -15,18 +15,11 @@
<div class='contact-info'>
<div class="contact-name" id="directory-name-{{$entry.id}}" ><a href='{{$entry.profile_link}}' >{{$entry.name}}</a>{{if $entry.online}} <i class="icon-asterisk online-now" title="{{$entry.online}}"></i>{{/if}}</div>
-{{if $entry.rateme}}
-<div id="dir-rating-wrapper-{{$entry.id}}" style="float:right; width: 20%;">
-62 ratings<br />
-<div id="dir-rating-slider-{{$entry.id}}" class="dir-slider" style="height: 32px; margin-right:10px;">
-<input id="dir-rating-range-{{$entry.id}}" type="text" value="0" name="fake-rating-{{$entry.id}}" style="display: none;">
+{{*if $entry.rateme*}}
+<div id="dir-rating-wrapper-{{$entry.id}}" class="directory-rating" >{{if $entry.total_ratings}}<a href="ratings/{{$entry.hash}}"><button class="btn btn-default">{{$entry.total_ratings}}</button></a>{{/if}}
+<button class="btn btn-default"><i class="icon-pencil"></i></button>
</div>
-</div>
-<div class="clear"></div>
-<script>
-$("#dir-rating-range-{{$entry.id}}").jRange({ from: -10, to: 10, step: 1, width:'100%', showLabels: false, showScale: true, scale : [ '-10','-5','0','5','10' ], onstatechange: function(v) { $("#contact-rating-mirror").val(v); } });
-</script>
-{{/if}}
+{{*/if*}}
{{if $entry.public_forum}}
<div class="contact-forum">
{{$entry.forum_label}} @{{$entry.nickname}}+
diff --git a/view/tpl/prep.tpl b/view/tpl/prep.tpl
index 49dea7d72..924bea252 100644
--- a/view/tpl/prep.tpl
+++ b/view/tpl/prep.tpl
@@ -12,9 +12,10 @@
</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}}
+<div class="rating-value">{{$rating_lbl}} {{$r.xlink_rating}}</div>
{{if $r.xlink_rating_text}}
-{{$rating_text_label}} {{$r.xlink_rating_text}}
+<div class="rating-text">{{$rating_text_label}} {{$r.xlink_rating_text}}
+</div>
{{/if}}
</div>
<div class="clear"></div>
diff --git a/view/tpl/xchan_vcard.tpl b/view/tpl/xchan_vcard.tpl
index b72250bec..ca0fe76be 100755
--- a/view/tpl/xchan_vcard.tpl
+++ b/view/tpl/xchan_vcard.tpl
@@ -5,16 +5,7 @@
{{if $mode != 'mail'}}
-<div id="profile-extra-links">
-<ul>
{{if $connect}}
- <li><a id="follow-link" href="follow?f=&url={{$follow}}">{{$connect}}</a></li>
+ <a href="follow?f=&url={{$follow}}" class="rconnect"><i class="icon-plus connect-icon"></i> {{$connect}}</a>
{{/if}}
-{{if $newwin}}
- <li><a id="visit-chan-link" href="{{$url}}" title="{{$newtit}}" target="_blank" >{{$newwin}}</a></li>
-{{/if}}
-</ul>
-
-
-</div>
{{/if}}