From 085b589468adcbc94d0866b68c96b3ce87f4c011 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 11 Jul 2012 21:04:08 -0700 Subject: [PATCH] add some sparkle to plinks --- include/conversation.php | 12 +++++++++++- view/theme/diabook/wall_item.tpl | 2 +- view/theme/diabook/wallwall_item.tpl | 2 +- view/theme/dispy/wall_item.tpl | 2 +- view/theme/dispy/wallwall_item.tpl | 2 +- view/theme/quattro/wall_item.tpl | 4 ++-- view/theme/quattro/wallwall_item.tpl | 4 ++-- view/wall_item.tpl | 2 +- view/wallwall_item.tpl | 2 +- 9 files changed, 21 insertions(+), 11 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 240cd374f3..7162791818 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -73,7 +73,6 @@ function item_redir_and_replace_images($body, $images, $cid) { $newbody = str_replace('[!#saved_image' . $cnt . '#!]', '[img]' . $image . '[/img]', $newbody); $cnt++; } - return $newbody; }} @@ -242,6 +241,17 @@ function localize_item(&$item){ } } + // add sparkle links to appropriate permalinks + + $x = stristr($item['plink'],'/display/'); + if($x) { + $sparkle = false; + $y = best_link_url($item,$sparkle,true); + if(strstr($y,'/redir/')) + $item['plink'] = $y . '?f=&url=' . $item['plink']; + } + + } diff --git a/view/theme/diabook/wall_item.tpl b/view/theme/diabook/wall_item.tpl index 1238340647..5b9de29689 100644 --- a/view/theme/diabook/wall_item.tpl +++ b/view/theme/diabook/wall_item.tpl @@ -22,7 +22,7 @@
$item.name - - {{ if $item.plink }}$item.ago{{ else }} $item.ago {{ endif }} + {{ if $item.plink }}$item.ago{{ else }} $item.ago {{ endif }} {{ if $item.lock }} - $item.lock {{ endif }}
diff --git a/view/theme/diabook/wallwall_item.tpl b/view/theme/diabook/wallwall_item.tpl index bee75ad99a..b2c980c78d 100644 --- a/view/theme/diabook/wallwall_item.tpl +++ b/view/theme/diabook/wallwall_item.tpl @@ -28,7 +28,7 @@ $item.name $item.to $item.owner_name $item.vwall -   - {{ if $item.plink }}$item.ago{{ else }} $item.ago {{ endif }} + {{ if $item.plink }}$item.ago{{ else }} $item.ago {{ endif }} {{ if $item.lock }} - $item.lock {{ endif }} diff --git a/view/theme/dispy/wall_item.tpl b/view/theme/dispy/wall_item.tpl index 8ffae04037..8d6f258e6e 100644 --- a/view/theme/dispy/wall_item.tpl +++ b/view/theme/dispy/wall_item.tpl @@ -52,7 +52,7 @@
  • {{ endif }} {{ if $item.plink }} - + {{ endif }} {{ if $item.edpost }}
  • diff --git a/view/theme/dispy/wallwall_item.tpl b/view/theme/dispy/wallwall_item.tpl index 84da598cd6..f5187b710f 100644 --- a/view/theme/dispy/wallwall_item.tpl +++ b/view/theme/dispy/wallwall_item.tpl @@ -59,7 +59,7 @@ class="icon recycle wall-item-share-buttons" title="$item.vote.share.0" onclick
  • {{ endif }} {{ if $item.plink }} - + {{ endif }} {{ if $item.edpost }}
  • diff --git a/view/theme/quattro/wall_item.tpl b/view/theme/quattro/wall_item.tpl index e771db0682..2b12ce6324 100644 --- a/view/theme/quattro/wall_item.tpl +++ b/view/theme/quattro/wall_item.tpl @@ -23,7 +23,7 @@
    $item.location
    - {{ if $item.title }}

    $item.title

    {{ endif }} + {{ if $item.title }}

    $item.title

    {{ endif }} $item.body
    @@ -38,7 +38,7 @@
    - {{ if $item.plink }}$item.plink.title{{ endif }} + {{ if $item.plink }}$item.plink.title{{ endif }}
    diff --git a/view/theme/quattro/wallwall_item.tpl b/view/theme/quattro/wallwall_item.tpl index 693ebaba6f..a1d92773b6 100644 --- a/view/theme/quattro/wallwall_item.tpl +++ b/view/theme/quattro/wallwall_item.tpl @@ -27,7 +27,7 @@
    $item.location
    - {{ if $item.title }}

    $item.title

    {{ endif }} + {{ if $item.title }}

    $item.title

    {{ endif }} $item.body
    @@ -42,7 +42,7 @@
    diff --git a/view/wall_item.tpl b/view/wall_item.tpl index dae33b3f75..60dde76000 100644 --- a/view/wall_item.tpl +++ b/view/wall_item.tpl @@ -48,7 +48,7 @@
    {{ endif }} {{ if $item.plink }} - + {{ endif }} {{ if $item.edpost }} diff --git a/view/wallwall_item.tpl b/view/wallwall_item.tpl index a48acfec5b..b7cca3fab9 100644 --- a/view/wallwall_item.tpl +++ b/view/wallwall_item.tpl @@ -52,7 +52,7 @@
    {{ endif }} {{ if $item.plink }} - + {{ endif }} {{ if $item.edpost }} -- 2.39.5