items: new property 'shiny'.

separate 'indent' (''|'comment') from 'shiny' (''|'shiny')
This commit is contained in:
Fabrixxm 2012-11-09 11:13:59 -05:00
parent b01ca0e345
commit 41dfc7f29e
2 changed files with 8 additions and 3 deletions

View File

@ -784,8 +784,9 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
$indent = (($toplevelpost) ? '' : ' comment'); $indent = (($toplevelpost) ? '' : ' comment');
$shiny = "";
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0) if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
$indent .= ' shiny'; $shiny = 'shiny';
// //
localize_item($item); localize_item($item);
@ -829,6 +830,7 @@ function render_content(&$a, $items, $mode, $update, $preview = false) {
'lock' => $lock, 'lock' => $lock,
'location' => template_escape($location), 'location' => template_escape($location),
'indent' => $indent, 'indent' => $indent,
'shiny' => $shiny,
'owner_url' => $owner_url, 'owner_url' => $owner_url,
'owner_photo' => $owner_photo, 'owner_photo' => $owner_photo,
'owner_name' => template_escape($owner_name), 'owner_name' => template_escape($owner_name),

View File

@ -93,6 +93,7 @@ class Item extends BaseObject {
$star = false; $star = false;
$isstarred = "unstarred"; $isstarred = "unstarred";
$indent = ''; $indent = '';
$shiny = '';
$osparkle = ''; $osparkle = '';
$total_children = $this->count_descendants(); $total_children = $this->count_descendants();
@ -199,8 +200,9 @@ class Item extends BaseObject {
if ($shareable) $buttons['share'] = array( t('Share this'), t('share')); if ($shareable) $buttons['share'] = array( t('Share this'), t('share'));
} }
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0) if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0){
$indent .= ' shiny'; $shiny = 'shiny';
}
localize_item($item); localize_item($item);
@ -241,6 +243,7 @@ class Item extends BaseObject {
'lock' => $lock, 'lock' => $lock,
'location' => template_escape($location), 'location' => template_escape($location),
'indent' => $indent, 'indent' => $indent,
'shiny' => $shiny,
'owner_url' => $this->get_owner_url(), 'owner_url' => $this->get_owner_url(),
'owner_photo' => $this->get_owner_photo(), 'owner_photo' => $this->get_owner_photo(),
'owner_name' => template_escape($this->get_owner_name()), 'owner_name' => template_escape($this->get_owner_name()),