]> git.mxchange.org Git - friendica.git/commitdiff
scrape/noscrape now contains the date the profile was last updated or the last messag...
authorMichael Vogel <icarus@dabo.de>
Wed, 18 Feb 2015 22:40:46 +0000 (23:40 +0100)
committerMichael Vogel <icarus@dabo.de>
Wed, 18 Feb 2015 22:40:46 +0000 (23:40 +0100)
boot.php
mod/noscrape.php
view/templates/profile_vcard.tpl
view/theme/vier/templates/profile_vcard.tpl

index 7ca4865d1461f7eb6de1456dce76c7c81bb42026..54ff94830344dced581f9025087cdf419bddaa46 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1680,6 +1680,11 @@ if(! function_exists('profile_sidebar')) {
                        $contact_block = contact_block();
 
                        if(is_array($a->profile) AND !$a->profile['hide-friends']) {
+                               $r = q("SELECT `gcontact`.`updated` FROM `contact` INNER JOIN `gcontact` WHERE `gcontact`.`nurl` = `contact`.`nurl` AND `self` AND `uid` = %d LIMIT 1",
+                                       intval($a->profile['uid']));
+                               if(count($r))
+                                       $updated =  date("c", strtotime($r[0]['updated']));
+
                                $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0
                                                AND `network` IN ('%s', '%s', '%s', '')",
                                        intval($profile['uid']),
@@ -1716,6 +1721,7 @@ if(! function_exists('profile_sidebar')) {
                        '$about' => $about,
                        '$network' =>  t('Network:'),
                        '$contacts' => $contacts,
+                       '$updated' => $updated,
                        '$diaspora' => $diaspora,
                        '$contact_block' => $contact_block,
                ));
index 170c7377679b279800ef8e038fc8a3577ecac5f5..34d5254fc0efe24eac3f31b25ffcbd324116762c 100644 (file)
@@ -32,6 +32,11 @@ function noscrape_init(&$a) {
        );
 
        if(is_array($a->profile) AND !$a->profile['hide-friends']) {
+               $r = q("SELECT `gcontact`.`updated` FROM `contact` INNER JOIN `gcontact` WHERE `gcontact`.`nurl` = `contact`.`nurl` AND `self` AND `uid` = %d LIMIT 1",
+                       intval($a->profile['uid']));
+               if(count($r))
+                       $json_info["updated"] =  date("c", strtotime($r[0]['updated']));
+
                $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 and `pending` = 0 AND `hidden` = 0 AND `archive` = 0
                                AND `network` IN ('%s', '%s', '%s', '')",
                        intval($a->profile['uid']),
index 08c7a77fb4ee41987edf1dd345c4890ad3f47cb2..056aabc964be098e1da3887694e78266f05b5188 100644 (file)
@@ -33,6 +33,8 @@
 
        {{if $contacts}}<div class="contacts" style="display:none;">{{$contacts}}</div>{{/if}}
 
+       {{if $updated}}<div class="updated" style="display:none;">{{$updated}}</div>{{/if}}
+
        {{if $marital}}<dl class="marital"><dt class="marital-label"><span class="heart">&hearts;</span>{{$marital}}</dt><dd class="marital-text">{{$profile.marital}}</dd></dl>{{/if}}
 
        {{if $homepage}}<dl class="homepage"><dt class="homepage-label">{{$homepage}}</dt><dd class="homepage-url u-url"><a href="{{$profile.homepage}}" rel="me" target="_blank">{{$profile.homepage}}</a></dd></dl>{{/if}}
index e00e68644ede345f14dd6785c515ea028aa00c41..2879c7ccb52335d41b260e4148c9dc3e04ac1b2f 100644 (file)
@@ -42,6 +42,8 @@
 
        {{if $contacts}}<div class="contacts" style="display:none;">{{$contacts}}</div>{{/if}}
 
+       {{if $updated}}<div class="updated" style="display:none;">{{$updated}}</div>{{/if}}
+
        {{if $marital}}<dl class="marital"><dt class="marital-label"><span class="heart">&hearts;</span>{{$marital}}</dt><dd class="marital-text">{{$profile.marital}}</dd></dl>{{/if}}
 
        {{if $homepage}}<dl class="homepage"><dt class="homepage-label">{{$homepage}}</dt><dd class="homepage-url"><a href="{{$profile.homepage}}" class="u-url" rel="me" target="_blank">{{$profile.homepage}}</a></dd></dl>{{/if}}