]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote-tracking branch 'friendika/master'
authorFabio Comuni <fabrix.xm@gmail.com>
Wed, 26 Oct 2011 10:15:38 +0000 (12:15 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Wed, 26 Oct 2011 10:15:38 +0000 (12:15 +0200)
boot.php
images/content-types.png
include/bb2diaspora.php
include/bbcode.php
include/diaspora.php
include/items.php
include/network.php
include/text.php
view/theme/duepuntozero/style.css

index 636062136cc12d4220bb9e7536b9e1b12cdae12f..b60411625a8819c816e47e03e1d20308ed476275 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
 require_once('include/cache.php');
 
 define ( 'FRIENDIKA_PLATFORM',     'Free Friendika');
-define ( 'FRIENDIKA_VERSION',      '2.3.1144' );
+define ( 'FRIENDIKA_VERSION',      '2.3.1145' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1098      );
 
@@ -989,7 +989,7 @@ function get_birthdays() {
        $r = q("SELECT `event`.*, `event`.`id` AS `eid`, `contact`.* FROM `event` 
                LEFT JOIN `contact` ON `contact`.`id` = `event`.`cid` 
                WHERE `event`.`uid` = %d AND `type` = 'birthday' AND `start` < '%s' AND `finish` > '%s' 
-               ORDER BY `start` DESC ",
+               ORDER BY `start` ASC ",
                intval(local_user()),
                dbesc(datetime_convert('UTC','UTC','now + 6 days')),
                dbesc(datetime_convert('UTC','UTC','now'))
@@ -997,20 +997,23 @@ function get_birthdays() {
 
        if($r && count($r)) {
                $total = 0;
-               foreach($r as $rr)
+               $now = strtotime('now');
+               $istoday = false;
+               foreach($r as $rr) {
                        if(strlen($rr['name']))
                                $total ++;
-
+                               if((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now))
+                                       $istoday = true;
+               }
+               $classtoday = $istoday ? ' birthday-today ' : '';
                if($total) {
-                       $o .= '<div id="birthday-notice" class="birthday-notice fakelink" onclick=openClose(\'birthday-wrapper\'); >' . t('Birthday Reminders') . ' ' . '(' . $total . ')' . '</div>'; 
+                       $o .= '<div id="birthday-notice" class="birthday-notice fakelink' . $classtoday . '" onclick=openClose(\'birthday-wrapper\'); >' . t('Birthday Reminders') . ' ' . '(' . $total . ')' . '</div>'; 
                        $o .= '<div id="birthday-wrapper" style="display: none;" ><div id="birthday-title">' . t('Birthdays this week:') . '</div>'; 
-//                     $o .= '<div id="birthday-adjust">' . t("\x28Adjusted for local time\x29") . '</div>';
                        $o .= '<div id="birthday-title-end"></div>';
 
                        foreach($r as $rr) {
                                if(! strlen($rr['name']))
                                        continue;
-                               $now = strtotime('now');
                                $today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false); 
                                $sparkle = '';
                                $url = $rr['url'];
@@ -1046,15 +1049,27 @@ function get_events() {
        $bd_short = t('F d');
 
        $r = q("SELECT `event`.* FROM `event` 
-               WHERE `event`.`uid` = %d AND `type` != 'birthday' AND `start` < '%s' AND `finish` > '%s' 
-               ORDER BY `start` DESC ",
+               WHERE `event`.`uid` = %d AND `type` != 'birthday' AND `start` < '%s' AND `start` > '%s'
+               ORDER BY `start` ASC ",
                intval(local_user()),
                dbesc(datetime_convert('UTC','UTC','now + 6 days')),
-               dbesc(datetime_convert('UTC','UTC','now'))
+               dbesc(datetime_convert('UTC','UTC','now - 1 days'))
        );
 
        if($r && count($r)) {
-               $o .= '<div id="event-notice" class="birthday-notice fakelink" onclick=openClose(\'event-wrapper\'); >' . t('Event Reminders') . ' ' . '(' . count($r) . ')' . '</div>'; 
+               $now = strtotime('now');
+               $istoday = false;
+               foreach($r as $rr) {
+                       if(strlen($rr['name']))
+                               $total ++;
+
+                       $strt = datetime_convert('UTC',$rr['convert'] ? $a->timezone : 'UTC',$rr['start'],'Y-m-d');
+                       if($strt === datetime_convert('UTC',$a->timezone,'now','Y-m-d'))
+                               $istoday = true;
+               }
+               $classtoday = (($istoday) ? ' event-today ' : '');
+
+               $o .= '<div id="event-notice" class="birthday-notice fakelink' . $classtoday . '" onclick=openClose(\'event-wrapper\'); >' . t('Event Reminders') . ' ' . '(' . count($r) . ')' . '</div>'; 
                $o .= '<div id="event-wrapper" style="display: none;" ><div id="event-title">' . t('Events this week:') . '</div>'; 
                $o .= '<div id="event-title-end"></div>';
 
@@ -1068,8 +1083,9 @@ function get_events() {
                        $title = substr(strip_tags(bbcode($rr['desc'])),0,32) . '... ';
                        if(! $title)
                                $title = t('[No description]');
-                       $now = strtotime('now');
-                       $today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false); 
+
+                       $strt = datetime_convert('UTC',$rr['convert'] ? $a->timezone : 'UTC',$rr['start']);
+                       $today = ((substr($strt,0,10) === datetime_convert('UTC',$a->timezone,'now','Y-m-d')) ? true : false);  
 
                        $o .= '<div class="event-list" id="event-' . $rr['eid'] . '"></a> <a href="events/' . $md . '">' . $title . '</a>' 
                        . day_translate(datetime_convert('UTC', $rr['adjust'] ? $a->timezone : 'UTC', $rr['start'], $bd_format)) . (($today) ?  ' ' . t('[today]') : '')
index be2ccbf01191ab56bb6b7d4edf3f816207cf56a2..e46eba610f56217e5fdb660f4cea080decab6fa5 100644 (file)
Binary files a/images/content-types.png and b/images/content-types.png differ
index e2711755b77e1c26b2fb7ea770e3adf7881476fd..f7398067b9f0f2527e584bc7c1c56b1e680e73a6 100644 (file)
@@ -11,8 +11,12 @@ function diaspora2bb($s) {
        $s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s);
        $s = Markdown($s);
        $s = html2bbcode($s);
+       $s = str_replace('&#42;','*',$s);
     $s = preg_replace("/\[url\=?(.*?)\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/url\]/ism",'[youtube]$2[/youtube]',$s); 
+    $s = preg_replace("/\[url\=https?:\/\/www.youtube.com\/watch\?v\=(.*?)\].*?\[\/url\]/ism",'[youtube]$1[/youtube]',$s); 
        $s = preg_replace("/\[url\=?(.*?)\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/url\]/ism",'[vimeo]$2[/vimeo]',$s); 
+       $s = preg_replace("/\[url\=https?:\/\/vimeo.com\/([0-9]+)\](.*?)\[\/url\]/ism",'[vimeo]$1[/vimeo]',$s); 
+       $s = preg_replace("/([^\]\=]|^)(https?\:\/\/)(vimeo|youtu|www\.youtube|soundcloud)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url]$2$3$4[/url]',$s);
 
        return $s;
 }
index d7b64c0cf1babba270d28d5330017489f3caf8c9..4d6eafafa5f28acccef5f7285c28e7d0211aefba 100644 (file)
@@ -57,6 +57,7 @@ function bbcode($Text,$preserve_nl = false) {
 
 
        // Perform URL Search
+
        $Text = preg_replace("/([^\]\=]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1<a href="$2" target="external-link">$2</a>', $Text);
        
        $Text = preg_replace_callback("/\[bookmark\=([^\]]*)\].*?\[\/bookmark\]/ism",'tryoembed',$Text);
index 2379ae8e3ec5a262afe7cd129555c6fa8e3b85dc..ad5e2adb2a4d10f601111875348e30af64178c13 100644 (file)
@@ -92,12 +92,14 @@ function find_diaspora_person_by_handle($handle) {
                dbesc($handle)
        );
        if(count($r)) {
+               logger('find_diaspora_person_by handle: in cache ' . print_r($r,true), LOGGER_DEBUG);
                // update record occasionally so it doesn't get stale
                $d = strtotime($r[0]['updated'] . ' +00:00');
                if($d > strtotime('now - 14 days'))
                        return $r[0];
                $update = true;
        }
+       logger('find_diaspora_person_by_handle: refresh',LOGGER_DEBUG);
        require_once('include/Scrape.php');
        $r = probe_url($handle, PROBE_DIASPORA);
        if((count($r)) && ($r['network'] === NETWORK_DIASPORA)) {
@@ -947,7 +949,10 @@ function diaspora_comment($importer,$xml,$msg) {
        $datarray['author-avatar'] = ((x($person,'thumb')) ? $person['thumb'] : $person['photo']);
        $datarray['body'] = $body;
        $datarray['tag'] = $str_tags;
-       $datarray['app']  = 'Diaspora';
+
+       // We can't be certain what the original app is if the message is relayed.
+       if(($parent_item['origin']) && (! $parent_author_signature)) 
+               $datarray['app']  = 'Diaspora';
 
        $message_id = item_store($datarray);
 
index 4e7674a2e958da35caae9722da9a7cd018834b54..1b4b52491106e934f018b6657b23753ac0ce17e3 100644 (file)
@@ -1264,7 +1264,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
                        }
                        if($deleted && is_array($contact)) {
                                $r = q("SELECT `item`.*, `contact`.`self` FROM `item` left join `contact` on `item`.`contact-id` = `contact`.id` 
-                                       WHERE `uri` = '%s' AND `uid` = %d AND `contact-id` = %d LIMIT 1",
+                                       WHERE `uri` = '%s' AND `item`.`uid` = %d AND `contact-id` = %d LIMIT 1",
                                        dbesc($uri),
                                        intval($importer['uid']),
                                        intval($contact['id'])
index c6f5fd909fa2004157a64ba08f4add5579145d7d..a9ee3f0a54deece8d4624e337c8569a758a0a448 100644 (file)
@@ -732,7 +732,6 @@ function add_fcontact($arr,$update = false) {
                        dbesc($arr['notify']),
                        dbesc($arr['poll']),
                        dbesc($arr['confirm']),
-                       dbesc($arr['network']),
                        dbesc($arr['alias']),
                        dbesc($arr['pubkey']),
                        dbesc(datetime_convert()),
@@ -760,5 +759,6 @@ function add_fcontact($arr,$update = false) {
                        dbesc(datetime_convert())
                );
        }
+
        return $r;
 }
index a9763fd2112e212bea547ca441d871309b978224..e0f38a3a0d4b8bf9ec53610459d7e0ca797f28b8 100644 (file)
@@ -481,7 +481,7 @@ function get_tags($s) {
        // Otherwise pull out single word tags. These can be @nickname, @first_last
        // and #hash tags.
 
-       if(preg_match_all('/([@#][^ \x0D\x0A,:?]+)([ \x0D\x0A,:?]|$)/',$s,$match)) {
+       if(preg_match_all('/([@#][^ \x0D\x0A,;:?]+)([ \x0D\x0A,;:?]|$)/',$s,$match)) {
                foreach($match[1] as $mtch) {
                        if(strstr($mtch,"]")) {
                                // we might be inside a bbcode color tag - leave it alone
index 378e0da1e97be99e4e214b023c628897f0ff92ec..b870f6bd5b7ef11705694e7a1d53917defb3085c 100644 (file)
@@ -228,6 +228,9 @@ footer {
 
 }
 
+.birthday-today, .event-today {
+       font-weight: bold;
+}
 
 div.wall-item-content-wrapper.shiny {
   background-image: url('shiny.png');
@@ -2539,6 +2542,16 @@ a.mail-list-link {
        margin-top: 10px;
 }
 
+.body-tag {
+       opacity: 0.5;
+       filter:alpha(opacity=50);
+}
+
+.body-tag:hover {
+       opacity: 1.0 !important;
+       filter:alpha(opacity=100) !important;
+}
+
 .item-select {
        opacity: 0.1;
        filter:alpha(opacity=10);