aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2018-03-10 15:10:09 -0500
committerAndrew Manning <tamanning@zoho.com>2018-03-10 15:10:09 -0500
commita4de63ca923583b77cf2a4ad60f4893e006f90e4 (patch)
tree31406e7dffabc54d2b49879272598236949793c7 /Zotlabs
parent9b13db1c4896e6a8b0a55195530f5449999e811d (diff)
parent78040330b6be3681dd0d6fdd1d3d0960fd88bc06 (diff)
downloadvolse-hubzilla-a4de63ca923583b77cf2a4ad60f4893e006f90e4.tar.gz
volse-hubzilla-a4de63ca923583b77cf2a4ad60f4893e006f90e4.tar.bz2
volse-hubzilla-a4de63ca923583b77cf2a4ad60f4893e006f90e4.zip
Merge branch 'dev' into oauth2
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Admin/Site.php14
-rw-r--r--Zotlabs/Module/Cover_photo.php8
-rw-r--r--Zotlabs/Module/Hashtags.php27
-rw-r--r--Zotlabs/Module/Profile_photo.php6
-rw-r--r--Zotlabs/Update/_1204.php6
-rw-r--r--Zotlabs/Update/_1208.php26
-rw-r--r--Zotlabs/Update/_1209.php26
7 files changed, 102 insertions, 11 deletions
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index 880dbbe4b..015c6535c 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -24,7 +24,7 @@ class Site {
$siteinfo = ((x($_POST,'siteinfo')) ? trim($_POST['siteinfo']) : '');
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : '');
- $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
+// $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
// $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : '');
$maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0);
@@ -122,11 +122,11 @@ class Site {
set_config('system','siteinfo',$siteinfo);
set_config('system', 'language', $language);
set_config('system', 'theme', $theme);
- if ( $theme_mobile === '---' ) {
- del_config('system', 'mobile_theme');
- } else {
- set_config('system', 'mobile_theme', $theme_mobile);
- }
+// if ( $theme_mobile === '---' ) {
+// del_config('system', 'mobile_theme');
+// } else {
+// set_config('system', 'mobile_theme', $theme_mobile);
+// }
// set_config('system','site_channel', $site_channel);
set_config('system','maximagesize', $maximagesize);
@@ -305,7 +305,7 @@ class Site {
'$siteinfo' => array('siteinfo', t('Site Information'), get_config('system','siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. BBCode can be used here")),
'$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
'$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
- '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile),
+// '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile),
// '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")),
'$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')),
'$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php
index 047bcf3d4..56e35f912 100644
--- a/Zotlabs/Module/Cover_photo.php
+++ b/Zotlabs/Module/Cover_photo.php
@@ -207,7 +207,7 @@ class Cover_photo extends \Zotlabs\Web\Controller {
}
}
- $imagedata = (($os_storage) ? @file_get_contents($imagedata) : $imagedata);
+ $imagedata = (($os_storage) ? @file_get_contents(dbunescbin($imagedata)) : dbunescbin($imagedata));
$ph = photo_factory($imagedata, $filetype);
if(! $ph->is_valid()) {
@@ -364,6 +364,12 @@ class Cover_photo extends \Zotlabs\Web\Controller {
'$embedPhotosModalTitle' => t('Use a photo from your albums'),
'$embedPhotosModalCancel' => t('Cancel'),
'$embedPhotosModalOK' => t('OK'),
+ '$modalchooseimages' => t('Choose images to embed'),
+ '$modalchoosealbum' => t('Choose an album'),
+ '$modaldiffalbum' => t('Choose a different album'),
+ '$modalerrorlist' => t('Error getting album list'),
+ '$modalerrorlink' => t('Error getting photo link'),
+ '$modalerroralbum' => t('Error getting album'),
'$form_security_token' => get_form_security_token("cover_photo"),
/// @FIXME - yuk
'$select' => t('Select existing photo'),
diff --git a/Zotlabs/Module/Hashtags.php b/Zotlabs/Module/Hashtags.php
new file mode 100644
index 000000000..edb631871
--- /dev/null
+++ b/Zotlabs/Module/Hashtags.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Zotlabs\Module;
+
+
+class Hashtags extends \Zotlabs\Web\Controller {
+
+ function init() {
+ $result = [];
+
+ $t = escape_tags($_REQUEST['t']);
+ if(! $t)
+ json_return_and_die($result);
+
+ $r = q("select distinct(term) from term where term like '%s' and ttype = %d order by term",
+ dbesc($t . '%'),
+ intval(TERM_HASHTAG)
+ );
+ if($r) {
+ foreach($r as $rv) {
+ $result[] = [ 'text' => strtolower($rv['term']) ];
+ }
+ }
+
+ json_return_and_die($result);
+ }
+} \ No newline at end of file
diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php
index 44b7c18c6..2ce8686b9 100644
--- a/Zotlabs/Module/Profile_photo.php
+++ b/Zotlabs/Module/Profile_photo.php
@@ -463,6 +463,12 @@ class Profile_photo extends \Zotlabs\Web\Controller {
'$embedPhotosModalTitle' => t('Use a photo from your albums'),
'$embedPhotosModalCancel' => t('Cancel'),
'$embedPhotosModalOK' => t('OK'),
+ '$modalchooseimages' => t('Choose images to embed'),
+ '$modalchoosealbum' => t('Choose an album'),
+ '$modaldiffalbum' => t('Choose a different album'),
+ '$modalerrorlist' => t('Error getting album list'),
+ '$modalerrorlink' => t('Error getting photo link'),
+ '$modalerroralbum' => t('Error getting album'),
'$form_security_token' => get_form_security_token("profile_photo"),
'$select' => t('Select existing photo'),
));
diff --git a/Zotlabs/Update/_1204.php b/Zotlabs/Update/_1204.php
index 93c2e4e3f..0b9204b9b 100644
--- a/Zotlabs/Update/_1204.php
+++ b/Zotlabs/Update/_1204.php
@@ -8,11 +8,11 @@ class _1204 {
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
$r1 = q("ALTER TABLE poll ADD poll_guid text NOT NULL");
- $r2 = q("create index \"poll_guid_idx\" on poll \"poll_guid\"");
+ $r2 = q("create index \"poll_guid_idx\" on poll (\"poll_guid\")");
$r3 = q("ALTER TABLE poll_elm ADD pelm_guid text NOT NULL");
- $r4 = q("create index \"pelm_guid_idx\" on poll_elm \"pelm_guid\"");
+ $r4 = q("create index \"pelm_guid_idx\" on poll_elm (\"pelm_guid\")");
$r5 = q("ALTER TABLE vote ADD vote_guid text NOT NULL");
- $r6 = q("create index \"vote_guid_idx\" on vote \"vote_guid\"");
+ $r6 = q("create index \"vote_guid_idx\" on vote (\"vote_guid\")");
$r = ($r1 && $r2 && $r3 && $r4 && $r5 && $r6);
}
diff --git a/Zotlabs/Update/_1208.php b/Zotlabs/Update/_1208.php
new file mode 100644
index 000000000..4cbcf4322
--- /dev/null
+++ b/Zotlabs/Update/_1208.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1208 {
+
+ function run() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("ALTER TABLE poll ADD poll_author text NOT NULL");
+ $r2 = q("create index \"poll_author_idx\" on poll \"poll_author\"");
+
+ $r = ($r1 && $r2);
+ }
+ else {
+ $r = q("ALTER TABLE `poll` ADD `poll_author` VARCHAR(191) NOT NULL AFTER `poll_votes`,
+ ADD INDEX `poll_author` (`poll_author`)");
+ }
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+ }
+
+}
diff --git a/Zotlabs/Update/_1209.php b/Zotlabs/Update/_1209.php
new file mode 100644
index 000000000..5ec449395
--- /dev/null
+++ b/Zotlabs/Update/_1209.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1209 {
+
+ function run() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("ALTER TABLE poll_elm ADD pelm_order numeric(6) NOT NULL DEFAULT '0' ");
+ $r2 = q("create index \"pelm_order_idx\" on poll_elm \"pelm_order\"");
+
+ $r = ($r1 && $r2);
+ }
+ else {
+ $r = q("ALTER TABLE `poll_elm` ADD `pelm_order` int(11) NOT NULL DEFAULT 0,
+ ADD INDEX `pelm_order` (`pelm_order`)");
+ }
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+ }
+
+}