pubsites ratings (mod/pubsites really really needs to be templatised, this was quick and dirty)
This commit is contained in:
parent
1c4b919980
commit
eb3c5916d7
@ -22,10 +22,13 @@ function pubsites_content(&$a) {
|
|||||||
if($ret['success']) {
|
if($ret['success']) {
|
||||||
$j = json_decode($ret['body'],true);
|
$j = json_decode($ret['body'],true);
|
||||||
if($j) {
|
if($j) {
|
||||||
$o .= '<table border="1"><tr><td>' . t('Site URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td><td>' . t('Location') . '</td></tr>';
|
$rate_meta = ((local_channel()) ? '<td>' . t('Rate this hub') . '</td><td>' . t('View hub ratings') . '</td>' : '');
|
||||||
|
$o .= '<table border="1"><tr><td>' . t('Site URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td><td>' . t('Location') . '</td>' . $rate_meta . '</tr>';
|
||||||
if($j['sites']) {
|
if($j['sites']) {
|
||||||
foreach($j['sites'] as $jj) {
|
foreach($j['sites'] as $jj) {
|
||||||
$o .= '<tr><td>' . '<a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url'] . '/register' ) . '" >' . $jj['url'] . '</a>' . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td><td>' . $jj['location'] . '</td></tr>';
|
$host = strtolower(substr($jj['url'],strpos($jj['url'],'://')+3));
|
||||||
|
$rate_links = ((local_channel()) ? '<td><a href="rate?f=&target=' . $host . '" class="btn-btn-default"><i class="icon-check"></i> ' . t('Rate') . '</a></td><td><a href="ratings/' . $host . '" class="btn-btn-default"><i class="icon-eye-open"></i> ' . t('View ratings') . '</a></td>' : '');
|
||||||
|
$o .= '<tr><td>' . '<a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url'] . '/register' ) . '" >' . $jj['url'] . '</a>' . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td><td>' . $jj['location'] . '</td>' . $rate_links . '</tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,8 +25,10 @@ function rate_init(&$a) {
|
|||||||
$r = q("select * from site where site_url like '%s' ",
|
$r = q("select * from site where site_url like '%s' ",
|
||||||
dbesc('%' . $target)
|
dbesc('%' . $target)
|
||||||
);
|
);
|
||||||
if($r)
|
if($r) {
|
||||||
$a->data['site'] = strtolower($r[0]);
|
$a->data['site'] = $r[0];
|
||||||
|
$a->data['site']['site_url'] = strtolower($r[0]['site_url']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
2015-02-15.945
|
2015-02-16.946
|
||||||
|
Reference in New Issue
Block a user