aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xboot.php2
-rw-r--r--include/ItemObject.php1
-rw-r--r--include/conversation.php1
-rw-r--r--include/zot.php10
-rw-r--r--install/database.sql1
-rw-r--r--install/update.php9
-rw-r--r--js/main.js11
-rw-r--r--mod/dirsearch.php2
-rw-r--r--mod/pubsites.php7
-rw-r--r--mod/zfinger.php1
-rwxr-xr-xview/tpl/conv_item.tpl2
-rwxr-xr-xview/tpl/search_item.tpl3
12 files changed, 39 insertions, 11 deletions
diff --git a/boot.php b/boot.php
index 709877472..c7af5147e 100755
--- a/boot.php
+++ b/boot.php
@@ -45,7 +45,7 @@ define ( 'RED_PLATFORM', 'Red Matrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1079 );
+define ( 'DB_UPDATE_VERSION', 1080 );
define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 59b4538df..818f8c0b2 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -216,6 +216,7 @@ class Item extends BaseObject {
'str_app' => sprintf( t(' from %s'), $item['app']),
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
+ 'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''),
'lock' => $lock,
'verified' => $verified,
'unverified' => $unverified,
diff --git a/include/conversation.php b/include/conversation.php
index 831a00519..e8b41e775 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -685,6 +685,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
'str_app' => sprintf( t(' from %s'), $item['app']),
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
+ 'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''),
'location' => $location,
'indent' => '',
'owner_name' => $owner_name,
diff --git a/include/zot.php b/include/zot.php
index ae34beebc..c4dce5ceb 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1640,20 +1640,23 @@ function import_site($arr,$pubkey) {
$directory_url = htmlentities($arr['directory_url'],ENT_COMPAT,'UTF-8',false);
$url = htmlentities($arr['url'],ENT_COMPAT,'UTF-8',false);
$sellpage = htmlentities($arr['sellpage'],ENT_COMPAT,'UTF-8',false);
+ $site_location = htmlentities($arr['location'],ENT_COMPAT,'UTF-8',false);
if($exists) {
if(($siterecord['site_flags'] != $site_directory)
|| ($siterecord['site_access'] != $access_policy)
|| ($siterecord['site_directory'] != $directory_url)
|| ($siterecord['site_sellpage'] != $sellpage)
+ || ($siterecord['site_location'] != $site_location)
|| ($siterecord['site_register'] != $register_policy)) {
$update = true;
// logger('import_site: input: ' . print_r($arr,true));
// logger('import_site: stored: ' . print_r($siterecord,true));
- $r = q("update site set site_flags = %d, site_access = %d, site_directory = '%s', site_register = %d, site_update = '%s', site_sellpage = '%s'
+ $r = q("update site set site_location = '%s', site_flags = %d, site_access = %d, site_directory = '%s', site_register = %d, site_update = '%s', site_sellpage = '%s'
where site_url = '%s' limit 1",
+ dbesc($site_location),
intval($site_directory),
intval($access_policy),
dbesc($directory_url),
@@ -1669,8 +1672,9 @@ function import_site($arr,$pubkey) {
}
else {
$update = true;
- $r = q("insert into site ( site_url, site_access, site_flags, site_update, site_directory, site_register, site_sellpage )
- values ( '%s', %d, %d, '%s', '%s', %d, '%s' )",
+ $r = q("insert into site ( site_location, site_url, site_access, site_flags, site_update, site_directory, site_register, site_sellpage )
+ values ( '%s', '%s', %d, %d, '%s', '%s', %d, '%s' )",
+ dbesc($site_location),
dbesc($url),
intval($access_policy),
intval($site_directory),
diff --git a/install/database.sql b/install/database.sql
index b482c3376..879c7f132 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -832,6 +832,7 @@ CREATE TABLE IF NOT EXISTS `site` (
`site_directory` char(255) NOT NULL DEFAULT '',
`site_register` int(11) NOT NULL DEFAULT '0',
`site_sellpage` char(255) NOT NULL DEFAULT '',
+ `site_location` char(255 NOT NULL DEFAULT '',
PRIMARY KEY (`site_url`),
KEY `site_access` (`site_access`),
KEY `site_flags` (`site_flags`),
diff --git a/install/update.php b/install/update.php
index 07a773f68..53d487f91 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1079 );
+define( 'UPDATE_VERSION' , 1080 );
/**
*
@@ -881,3 +881,10 @@ function update_r1078() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1079() {
+ $r = q("ALTER TABLE `site` ADD `site_location` CHAR( 255 ) NOT NULL DEFAULT ''");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
diff --git a/js/main.js b/js/main.js
index f4599e20c..a9e670da5 100644
--- a/js/main.js
+++ b/js/main.js
@@ -580,6 +580,17 @@ function updateConvItems(mode,data) {
updateConvItems(update_mode,data);
$("#page-spinner").spin(false);
$("#profile-jot-text-loading").spin(false);
+
+ // FIXME - the following lines were added so that almost
+ // immediately after we update the posts on the page, we
+ // re-check and update the notification counts.
+ // As it turns out this causes a bit of an inefficiency
+ // as we're pinging twice for every update, once before
+ // and once after. A btter way to do this is to rewrite
+ // NavUpdate and perhpas LiveUpdate so that we check for
+ // post updates first and only call the notification ping
+ // once.
+
updateCountsOnly = true;
if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,10);
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 115bc2235..66f9a6f4c 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -242,7 +242,7 @@ function list_public_sites() {
else
$register = 'closed';
- $ret['sites'][] = array('url' => $rr['site_url'], 'access' => $access, 'register' => $register, 'sellpage' => $rr['site_sellpage']);
+ $ret['sites'][] = array('url' => $rr['site_url'], 'access' => $access, 'register' => $register, 'sellpage' => $rr['site_sellpage'], 'location' => $rr['site_location']);
}
}
return $ret;
diff --git a/mod/pubsites.php b/mod/pubsites.php
index 9728d0704..78b107229 100644
--- a/mod/pubsites.php
+++ b/mod/pubsites.php
@@ -21,13 +21,16 @@ function pubsites_content(&$a) {
$o .= '<h1>' . t('Public Sites') . '</h1>';
+ $o .= '<div class="descriptive-text">' .
+ t('The listed sites allow public registration. Some may require subscription or provide tiered service plans. The provider links may provide additional details.') . '</div>' . EOL;
+
$ret = z_fetch_url($url);
if($ret['success']) {
$j = json_decode($ret['body'],true);
if($j) {
- $o .= '<table border="1"><tr><td>' . t('Site URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td></tr>';
+ $o .= '<table border="1"><tr><td>' . t('Site URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td><td>' . t('Location') . '</td></tr>';
foreach($j['sites'] as $jj) {
- $o .= '<tr><td>' . '<a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url']) . '" >' . $jj['url'] . '</a>' . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td></tr>';
+ $o .= '<tr><td>' . '<a href="'. (($jj['sellpage']) ? $jj['sellpage'] : $jj['url']) . '" >' . $jj['url'] . '</a>' . '</td><td>' . $jj['access'] . '</td><td>' . $jj['register'] . '</td><td>' . $jj['location'] . '</td></tr>';
}
$o .= '</table>';
diff --git a/mod/zfinger.php b/mod/zfinger.php
index 3671da56e..59cef5549 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -248,6 +248,7 @@ function zfinger_init(&$a) {
$ret['site']['sitehash'] = get_config('system','location_hash');
$ret['site']['sitename'] = get_config('system','sitename');
$ret['site']['sellpage'] = get_config('system','sellpage');
+ $ret['site']['location'] = get_config('system','site_location');
}
json_return_and_die($ret);
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index 095bd0df3..6927eb9e4 100755
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -39,7 +39,7 @@
<div class="wall-item-author">
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}} {{$item.via}} <a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}<br />
- <div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">{{if $item.verified}}<i class="icon-ok" title="{{$item.verified}}"></i>&nbsp;{{/if}}<span class="autotime" title="{{$item.isotime}}">{{$item.localtime}}</span>{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}}</div>
+ <div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">{{if $item.verified}}<i class="icon-ok" title="{{$item.verified}}"></i>&nbsp;{{/if}}<span class="autotime" title="{{$item.isotime}}">{{$item.localtime}}{{if $item.editedtime}} {{$item.editedtime}}{{/if}}</span>{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}}</div>
</div>
<div class="wall-item-content" id="wall-item-content-{{$item.id}}" >
<div class="wall-item-title" id="wall-item-title-{{$item.id}}">{{$item.title}}</div>
diff --git a/view/tpl/search_item.tpl b/view/tpl/search_item.tpl
index 5953522dc..853bbfdcd 100755
--- a/view/tpl/search_item.tpl
+++ b/view/tpl/search_item.tpl
@@ -24,8 +24,7 @@
</div>
<div class="wall-item-author">
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a><br />
- <div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">{{if $item.verified}}<i class="icon-ok" title="{{$item.verified}}"></i>&nbsp;{{/if}}<span class="autotime" title="{{$item.isotime}}">{{$item.localtime}}</span>{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}}</div>
-
+ <div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">{{if $item.verified}}<i class="icon-ok" title="{{$item.verified}}"></i>&nbsp;{{/if}}<span class="autotime" title="{{$item.isotime}}">{{$item.localtime}}{{if $item.editedtime}} {{$item.editedtime}}{{/if}}</span>{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}}</div>
</div>
<div class="wall-item-content" id="wall-item-content-{{$item.id}}" >
<div class="wall-item-title" id="wall-item-title-{{$item.id}}">{{$item.title}}</div>