Browse Source

Remove some useless checks

pull/277/head
Timothée Jaussoin 9 years ago
parent
commit
ae728e295f
  1. 5
      app/models/postn/Postn.php
  2. 1
      app/widgets/Menu/Menu.php
  3. 10
      app/widgets/Menu/_menu_list.tpl
  4. 23
      app/widgets/Post/_post_empty.tpl

5
app/models/postn/Postn.php

@ -491,6 +491,11 @@ class Postn extends Model {
return (strlen($this->contentcleaned) < 700);
}
public function isNSFW()
{
return (current(explode('.', $this->origin)) == 'nsfw');
}
public function isReply()
{
return isset($this->reply);

1
app/widgets/Menu/Menu.php

@ -142,7 +142,6 @@ class Menu extends \Movim\Widget\Base
$view = $this->tpl();
$pd = new \Modl\PostnDAO;
$count = $pd->getCountSince(Cache::c('since'));
// getting newer, not older
if($page == 0 || $page == ""){
$count = 0;

10
app/widgets/Menu/_menu_list.tpl

@ -30,7 +30,6 @@
{/if}
{loop="$items"}
{$attachments = $value->getAttachments()}
<li
tabindex="{$page*$paging+$key+1}"
class="block large"
@ -43,19 +42,18 @@
title="{$c->__('menu.contact_post')}"
{/if}
>
{$picture = $value->getPicture()}
{if="current(explode('.', $value->origin)) == 'nsfw'"}
{if="$value->isNSFW()"}
<span class="primary icon thumb color red tiny">
+18
</span>
{elseif="$picture != null"}
<span class="primary icon thumb color white" style="background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%), url({$picture});">
{elseif="$value->picture != null"}
<span class="primary icon thumb color white" style="background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%), url({$value->picture});">
{if="$value->isPublic()"}
<i title="{$c->__('menu.public')}" class="zmdi zmdi-portable-wifi"></i>
{/if}
</span>
{elseif="$value->isMicroblog()"}
{$url = $value->getContact()->getPhoto('l')}
{$url = $value->getContact()->getPhoto('m')}
{if="$url"}
<span class="primary icon thumb color white" style="background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%), url({$url});">
{if="$value->isPublic()"}

23
app/widgets/Post/_post_empty.tpl

@ -60,16 +60,15 @@
data-id="{$value->nodeid}"
data-server="{$value->origin}"
data-node="{$value->node}">
{$picture = $value->getPicture()}
{if="$picture != null"}
<span class="icon top" style="background-image: url({$picture});"></span>
{if="$value->picture != null"}
<span class="icon top" style="background-image: url({$value->picture});"></span>
{else}
<span class="icon top color dark">
<i class="zmdi zmdi-edit"></i>
</span>
{/if}
{$url = $value->getContact()->getPhoto('l')}
{$url = $value->getContact()->getPhoto('m')}
{if="$url"}
<span class="primary icon bubble" style="background-image: url({$url});">
</span>
@ -133,19 +132,13 @@
<ul class="list flex card shadow active">
{loop="$posts"}
{if="!filter_var($value->origin, FILTER_VALIDATE_EMAIL)"}
{$attachments = $value->getAttachments()}
<li
class="block condensed"
data-id="{$value->nodeid}"
data-server="{$value->origin}"
data-node="{$value->node}">
{$picture = $value->getPicture()}
{if="current(explode('.', $value->origin)) == 'nsfw'"}
<span class="icon top color red tiny">
+18
</span>
{elseif="$picture != null"}
<span class="icon top" style="background-image: url({$picture});"></span>
{if="$value->picture != null"}
<span class="icon top" style="background-image: url({$value->picture});"></span>
{else}
<span class="icon top color dark">
{$value->node|firstLetterCapitalize}
@ -170,13 +163,11 @@
{/if}
</p>
<p>
{if="current(explode('.', $value->origin)) != 'nsfw'"}
{$value->contentcleaned|strip_tags}
{/if}
{$value->contentcleaned|strip_tags}
</p>
<p>
{$value->origin} /
<a href="{$c->route('group', array($value->origin, $value->node))}">
<a href="{$c->route('group', [$value->origin, $value->node])}">
<i class="zmdi zmdi-pages"></i> {$value->node}
</a>
<span class="info">

Loading…
Cancel
Save