diff options
author | friendica <info@friendica.com> | 2013-09-17 22:27:51 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-09-17 22:27:51 -0700 |
commit | d3aa31be4d84764e4d119343d8bc5eba5a84272b (patch) | |
tree | 68522f122490ecf1971c9f2ebff1c8340466cb7f | |
parent | ff2ada207a7c90f095d1fad1513440eb08d3840a (diff) | |
download | volse-hubzilla-d3aa31be4d84764e4d119343d8bc5eba5a84272b.tar.gz volse-hubzilla-d3aa31be4d84764e4d119343d8bc5eba5a84272b.tar.bz2 volse-hubzilla-d3aa31be4d84764e4d119343d8bc5eba5a84272b.zip |
site sellpage links
-rwxr-xr-x | boot.php | 2 | ||||
-rw-r--r-- | include/zot.php | 12 | ||||
-rw-r--r-- | install/database.sql | 4 | ||||
-rw-r--r-- | install/update.php | 10 | ||||
-rw-r--r-- | mod/dirsearch.php | 2 | ||||
-rw-r--r-- | mod/pubsites.php | 2 | ||||
-rw-r--r-- | mod/zfinger.php | 1 |
7 files changed, 24 insertions, 9 deletions
@@ -44,7 +44,7 @@ require_once('include/taxonomy.php'); define ( 'RED_PLATFORM', 'Red Matrix' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1069 ); +define ( 'DB_UPDATE_VERSION', 1070 ); define ( 'EOL', '<br />' . "\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/include/zot.php b/include/zot.php index 74ac6d015..c416d18f9 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1567,24 +1567,27 @@ 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); if($exists) { if(($siterecord['site_flags'] != $site_directory) || ($siterecord['site_access'] != $access_policy) || ($siterecord['site_directory'] != $directory_url) + || ($siterecord['site_sellpage'] != $sellpage) || ($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' + $r = q("update site set site_flags = %d, site_access = %d, site_directory = '%s', site_register = %d, site_update = '%s', site_sellpage = '%s' where site_url = '%s' limit 1", intval($site_directory), intval($access_policy), dbesc($directory_url), intval($register_policy), dbesc(datetime_convert()), + dbesc($sellpage), dbesc($url) ); if(! $r) { @@ -1594,14 +1597,15 @@ 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 ) - values ( '%s', %d, %d, '%s', '%s', %d )", + $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' )", dbesc($url), intval($site_directory), intval($access_policy), dbesc(datetime_convert()), dbesc($directory_url), - intval($register_policy) + intval($register_policy), + dbesc($sellpage) ); if(! $r) { logger('import_site: record create failed. ' . print_r($arr,true)); diff --git a/install/database.sql b/install/database.sql index 41fb968c8..2e420fcbd 100644 --- a/install/database.sql +++ b/install/database.sql @@ -825,12 +825,14 @@ CREATE TABLE IF NOT EXISTS `site` ( `site_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `site_directory` char(255) NOT NULL DEFAULT '', `site_register` int(11) NOT NULL DEFAULT '0', + `site_sellpage` char(255) NOT NULL DEFAULT '', PRIMARY KEY (`site_url`), KEY `site_access` (`site_access`), KEY `site_flags` (`site_flags`), KEY `site_update` (`site_update`), KEY `site_directory` (`site_directory`), - KEY `site_register` (`site_register`) + KEY `site_register` (`site_register`), + KEY `site_sellpage` (`site_sellpage`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `spam` ( diff --git a/install/update.php b/install/update.php index 24aed374d..3c40ee0c5 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1069 ); +define( 'UPDATE_VERSION' , 1070 ); /** * @@ -789,3 +789,11 @@ function update_r1068(){ return UPDATE_FAILED; } +function update_r1069() { + $r = q("ALTER TABLE `site` ADD `site_sellpage` CHAR( 255 ) NOT NULL DEFAULT '', +ADD INDEX ( `site_sellpage` )"); + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + diff --git a/mod/dirsearch.php b/mod/dirsearch.php index 04d77a298..a285d9b8c 100644 --- a/mod/dirsearch.php +++ b/mod/dirsearch.php @@ -205,7 +205,7 @@ function list_public_sites() { else $register = 'closed'; - $ret['sites'][] = array('url' => $rr['site_url'], 'access' => $access, 'register' => $register); + $ret['sites'][] = array('url' => $rr['site_url'], 'access' => $access, 'register' => $register, 'sellpage' => $rr['site_sellpage']); } } return $ret; diff --git a/mod/pubsites.php b/mod/pubsites.php index d226f5d9f..b9f7510fc 100644 --- a/mod/pubsites.php +++ b/mod/pubsites.php @@ -27,7 +27,7 @@ function pubsites_content(&$a) { if($j) { $o .= '<table border="1"><tr><td>' . t('Site URL') . '</td><td>' . t('Access Type') . '</td><td>' . t('Registration Policy') . '</td></tr>'; foreach($j['sites'] as $jj) { - $o .= '<tr><td>' . '<a href="'. $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></tr>'; } $o .= '</table>'; diff --git a/mod/zfinger.php b/mod/zfinger.php index a06d9f4b5..675b31b1e 100644 --- a/mod/zfinger.php +++ b/mod/zfinger.php @@ -249,6 +249,7 @@ function zfinger_init(&$a) { $ret['site']['plugins'] = $visible_plugins; $ret['site']['sitehash'] = get_config('system','location_hash'); $ret['site']['sitename'] = get_config('system','sitename'); + $ret['site']['sellpage'] = get_config('system','sellpage'); } json_return_and_die($ret); |