mirror of
https://github.com/friendica/friendica
synced 2024-12-22 22:00:16 +00:00
db prepare for enhanced magic profiles and remote privacy indicators, fixed $lang setting to use system config var, some other syntax issues
This commit is contained in:
parent
8b086a76e5
commit
5763d31b4f
5 changed files with 19 additions and 8 deletions
2
boot.php
2
boot.php
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
|
|
||||||
define ( 'BUILD_ID', 1021 );
|
define ( 'BUILD_ID', 1022 );
|
||||||
define ( 'DFRN_PROTOCOL_VERSION', '2.0' );
|
define ( 'DFRN_PROTOCOL_VERSION', '2.0' );
|
||||||
|
|
||||||
define ( 'EOL', "<br />\r\n" );
|
define ( 'EOL', "<br />\r\n" );
|
||||||
|
|
|
@ -187,6 +187,7 @@ CREATE TABLE IF NOT EXISTS `item` (
|
||||||
`allow_gid` mediumtext NOT NULL,
|
`allow_gid` mediumtext NOT NULL,
|
||||||
`deny_cid` mediumtext NOT NULL,
|
`deny_cid` mediumtext NOT NULL,
|
||||||
`deny_gid` mediumtext NOT NULL,
|
`deny_gid` mediumtext NOT NULL,
|
||||||
|
`private` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`visible` tinyint(1) NOT NULL DEFAULT '0',
|
`visible` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
`unseen` tinyint(1) NOT NULL DEFAULT '1',
|
`unseen` tinyint(1) NOT NULL DEFAULT '1',
|
||||||
`deleted` tinyint(1) NOT NULL DEFAULT '0',
|
`deleted` tinyint(1) NOT NULL DEFAULT '0',
|
||||||
|
@ -319,7 +320,9 @@ CREATE TABLE IF NOT EXISTS `profile` (
|
||||||
CREATE TABLE IF NOT EXISTS `profile_check` (
|
CREATE TABLE IF NOT EXISTS `profile_check` (
|
||||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`uid` int(10) unsigned NOT NULL,
|
`uid` int(10) unsigned NOT NULL,
|
||||||
|
`cid` int(10) unsigned NOT NULL,
|
||||||
`dfrn_id` char(255) NOT NULL,
|
`dfrn_id` char(255) NOT NULL,
|
||||||
|
`sec` char(255) NOT NULL,
|
||||||
`expire` int(11) NOT NULL,
|
`expire` int(11) NOT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
13
index.php
13
index.php
|
@ -12,8 +12,12 @@ $install = ((file_exists('.htconfig.php')) ? false : true);
|
||||||
|
|
||||||
@include(".htconfig.php");
|
@include(".htconfig.php");
|
||||||
|
|
||||||
if(isset($lang) && strlen($lang))
|
// get language setting directly from system variables, bypassing get_config()
|
||||||
load_translation_table($lang);
|
// as database may not yet be configured.
|
||||||
|
|
||||||
|
$lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en');
|
||||||
|
|
||||||
|
load_translation_table($lang);
|
||||||
|
|
||||||
require_once("dba.php");
|
require_once("dba.php");
|
||||||
$db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
|
$db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
|
||||||
|
@ -111,7 +115,7 @@ if($a->module != 'install')
|
||||||
|
|
||||||
// make sure the desired theme exists, though if the default theme doesn't exist we're stuffed.
|
// make sure the desired theme exists, though if the default theme doesn't exist we're stuffed.
|
||||||
|
|
||||||
if((x($_SESSION,'theme')) && (! file_exists('/view/theme/' . $_SESSION['theme'] . '/style.css')))
|
if((x($_SESSION,'theme')) && (! file_exists('view/theme/' . $_SESSION['theme'] . '/style.css')))
|
||||||
unset($_SESSION['theme']);
|
unset($_SESSION['theme']);
|
||||||
|
|
||||||
$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array(
|
$a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array(
|
||||||
|
@ -122,9 +126,6 @@ $a->page['htmlhead'] = replace_macros($a->page['htmlhead'], array(
|
||||||
|
|
||||||
$page = $a->page;
|
$page = $a->page;
|
||||||
$profile = $a->profile;
|
$profile = $a->profile;
|
||||||
$lang = get_config('system','language');
|
|
||||||
if($lang === false)
|
|
||||||
$lang = 'en';
|
|
||||||
|
|
||||||
header("Content-type: text/html; charset=utf-8");
|
header("Content-type: text/html; charset=utf-8");
|
||||||
|
|
||||||
|
|
|
@ -186,3 +186,10 @@ function update_1020() {
|
||||||
q("ALTER TABLE `profile` DROP `showwith`");
|
q("ALTER TABLE `profile` DROP `showwith`");
|
||||||
q("ALTER TABLE `item` ADD `thr-parent` CHAR( 255 ) NOT NULL AFTER `parent-uri` ");
|
q("ALTER TABLE `item` ADD `thr-parent` CHAR( 255 ) NOT NULL AFTER `parent-uri` ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function update_1021() {
|
||||||
|
q("ALTER TABLE `profile_check` ADD `sec` CHAR( 255 ) NOT NULL AFTER `dfrn_id` ");
|
||||||
|
q("ALTER TABLE `profile_check` ADD `cid` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `uid`");
|
||||||
|
q("ALTER TABLE `item` ADD `private` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `deny_gid` ");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<?php if(strlen($profile['pubkey'])) { ?>
|
<?php if(strlen($profile['pubkey'])) { ?>
|
||||||
<div class="key" style="display: none"><?php echo $profile['pubkey']; ?></div>
|
<div class="key" style="display: none;"><?php echo $profile['pubkey']; ?></div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
Loading…
Reference in a new issue