Browse Source

- Add "recycling" in posts elements

pull/5/head
Jaussoin Timothée 14 years ago
parent
commit
fb13caa4bc
  1. 9
      system/Message.php
  2. 4
      system/Widget/WidgetCommon.php
  3. 2
      system/Widget/widgets/Feed/Feed.php
  4. 12
      themes/movim/css/posts.css
  5. BIN
      themes/movim/img/icons/recycle.png

9
system/Message.php

@ -4,6 +4,8 @@ class Message extends DatajarBase {
protected $key;
protected $jid;
protected $name;
protected $uri;
protected $nodeid;
protected $parentid;
protected $title;
@ -26,6 +28,8 @@ class Message extends DatajarBase {
$this->key = DatajarType::varchar(128);
$this->jid = DatajarType::varchar(128);
$this->name = DatajarType::varchar(128);
$this->uri = DatajarType::varchar(128);
$this->nodeid = DatajarType::varchar(128);
$this->parentid = DatajarType::varchar(128);
$this->title = DatajarType::varchar(128);
@ -75,6 +79,9 @@ class MessageHandler {
$message = new Message();
$message->key = $jid;
$message->jid = $from;
$message->name = $array['entry']['source']['author']['name'];
$message->uri = substr($array['entry']['source']['author']['uri'], 5);
$message->nodeid = $array['@attributes']['id'];
$message->parentid = $parent;
$message->content = $array['entry']['content'];
@ -108,6 +115,8 @@ class MessageHandler {
$sdb->load($message, array('key' => $jid,
'jid' => $from,
'nodeid' => $array['@attributes']['id']));
$message->name = $array['entry']['source']['author']['name'];
$message->uri = substr($array['entry']['source']['author']['uri'], 5);
$message->parentid = $parent;
$message->content = $array['entry']['content'];
$message->published = date('Y-m-d H:i:s', strtotime($array['entry']['published']));

4
system/Widget/WidgetCommon.php

@ -43,6 +43,7 @@ class WidgetCommon {
$tmp .= '</div>';
}
if($message->getPlace() != false)
$tmp .= '<span class="place">
<a
@ -50,6 +51,9 @@ class WidgetCommon {
href="http://www.openstreetmap.org/?lat='.$message->getData('lat').'&lon='.$message->getData('lon').'&zoom=10"
>'.$message->getPlace().'</a>
</span>';
if($message->getData('jid') != $message->getData('uri'))
$tmp .= '<span class="recycle"><a href="?q=friend&f='.$message->getData('uri').'">'.$message->getData('name').'</a></span>';
$tmp .= '<div class="comments" id="'.$message->getData('nodeid').'comments">';

2
system/Widget/widgets/Feed/Feed.php

@ -72,7 +72,7 @@ class Feed extends WidgetBase {
$i = 0;
$query = Contact::query()
->where(array('key' => $user->getLogin(), 'jid' => $this->user->getLogin()));
->where(array('key' => $this->user->getLogin(), 'jid' => $this->user->getLogin()));
$contact = Contact::run_query($query);
if(isset($contact[0]))

12
themes/movim/css/posts.css

@ -22,20 +22,28 @@
color: #777;
}
.post span.place {
.post span.place, .post span.recycle {
display: inline-block;
background: url(../img/icons/place.png) 0px 2px no-repeat;
padding-left: 14px;
font-weight: normal;
margin-top: 5px;
float: right;
margin-left: 10px;
}
.post span.place {
max-width: 350px;
background: url(../img/icons/place.png) 0px 4px no-repeat;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding-bottom: 0.7em;
}
.post span.recycle {
background: url(../img/icons/recycle.png) 0px 4px no-repeat;
}
.post .comments {
clear: both;
background-color: #F3F3F3;

BIN
themes/movim/img/icons/recycle.png

After

Width: 10  |  Height: 10  |  Size: 351 B

Loading…
Cancel
Save