From a6f3b582939022fae0834e4f62b435f18551c968 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 19 Dec 2011 18:01:38 +0100 Subject: config: set/get arrays with pconfig --- include/config.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/config.php b/include/config.php index f565ab117..92694f519 100644 --- a/include/config.php +++ b/include/config.php @@ -145,8 +145,9 @@ function get_pconfig($uid,$family, $key, $instore = false) { ); if(count($ret)) { - $a->config[$uid][$family][$key] = $ret[0]['v']; - return $ret[0]['v']; + $val = (preg_match("|^a:[0-9]+:{.*}$|", $ret[0]['v'])?unserialize( $ret[0]['v']):$ret[0]['v']); + $a->config[$uid][$family][$key] = $val; + return $val; } else { $a->config[$uid][$family][$key] = '!!'; @@ -177,20 +178,23 @@ function set_pconfig($uid,$family,$key,$value) { global $a; + // manage array value + $dbvalue = (is_array($value)?serialize($value):$value); + if(get_pconfig($uid,$family,$key,true) === false) { $a->config[$uid][$family][$key] = $value; $ret = q("INSERT INTO `pconfig` ( `uid`, `cat`, `k`, `v` ) VALUES ( %d, '%s', '%s', '%s' ) ", intval($uid), dbesc($family), dbesc($key), - dbesc($value) + dbesc($dbvalue) ); if($ret) return $value; return $ret; } $ret = q("UPDATE `pconfig` SET `v` = '%s' WHERE `uid` = %d AND `cat` = '%s' AND `k` = '%s' LIMIT 1", - dbesc($value), + dbesc($dbvalue), intval($uid), dbesc($family), dbesc($key) -- cgit v1.2.3 From f3b499f1192a3cc2386aa639d2f0d2fa147e911a Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Tue, 20 Dec 2011 17:17:17 +0100 Subject: quattro: more on editor --- include/conversation.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/conversation.php b/include/conversation.php index deced3cb8..0c319e802 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -862,7 +862,8 @@ function status_editor($a,$x, $notes_cid = 0) { '$audio' => t('Insert audio link'), '$setloc' => t('Set your location'), '$noloc' => t('Clear browser location'), - '$title' => t('Set title'), + '$title' => "", + '$placeholdertitle' => t('Set title'), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), '$ptyp' => (($notes_cid) ? 'note' : 'wall'), -- cgit v1.2.3 From 0b4535e6daacaf7eea67e3c4404b9ac889dbddf0 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 22 Dec 2011 11:24:34 +0100 Subject: quattro: more on editor --- include/conversation.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/conversation.php b/include/conversation.php index 9cc5c258b..f4dd01dde 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -856,12 +856,19 @@ function status_editor($a,$x, $notes_cid = 0) { '$action' => 'item', '$share' => (($x['button']) ? $x['button'] : t('Share')), '$upload' => t('Upload photo'), + '$shortupload' => t('upload photo'), '$attach' => t('Attach file'), + '$shortattach' => t('attach file'), '$weblink' => t('Insert web link'), + '$shortweblink' => t('web link'), '$video' => t('Insert video link'), + '$shortvideo' => t('video link'), '$audio' => t('Insert audio link'), + '$shortaudio' => t('audio link'), '$setloc' => t('Set your location'), + '$shortsetloc' => t('set location'), '$noloc' => t('Clear browser location'), + '$shortnoloc' => t('clear location'), '$title' => "", '$placeholdertitle' => t('Set title'), '$wait' => t('Please wait'), -- cgit v1.2.3 From efe308b5ac9ac7e8d399fb880f31b6967de8fec1 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Fri, 6 Jan 2012 09:11:25 +0100 Subject: Use html5 placeholder for title text input --- include/conversation.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/conversation.php b/include/conversation.php index 37fe32de1..2803d14e4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -873,6 +873,7 @@ function status_editor($a,$x, $notes_cid = 0) { '$placeholdertitle' => t('Set title'), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), + '$shortpermset' => t('permissions'), '$ptyp' => (($notes_cid) ? 'note' : 'wall'), '$content' => '', '$post_id' => '', @@ -962,4 +963,4 @@ function find_thread_parent_index($arr,$x) { if($v['id'] == $x['parent']) return $k; return false; -} \ No newline at end of file +} -- cgit v1.2.3