From 9afecaaffee60250f141527eff9d279ff48b4140 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 5 Jun 2016 20:16:33 -0700 Subject: We need a laugh icon more than we need a cry icon. --- Zotlabs/Lib/ThreadItem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index e55931f40..f724ac95d 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -15,7 +15,7 @@ class ThreadItem { private $comment_box_template = 'comment_item.tpl'; private $commentable = false; // list of supported reaction emojis - a site can over-ride this via config system.reactions - private $reactions = ['1f60a','1f44f','1f37e','1f48b','1f61e','2665','1f622','1f62e','1f634','1f61c','1f607','1f608']; + private $reactions = ['1f60a','1f44f','1f37e','1f48b','1f61e','2665','1f606','1f62e','1f634','1f61c','1f607','1f608']; private $toplevel = false; private $children = array(); private $parent = null; -- cgit v1.2.3 From adecd2960e2b7cdca8a23e5c4e8d80645407b513 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 5 Jun 2016 22:18:17 -0700 Subject: move pconfig to static class --- Zotlabs/Lib/PConfig.php | 189 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 Zotlabs/Lib/PConfig.php (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php new file mode 100644 index 000000000..0cd65392e --- /dev/null +++ b/Zotlabs/Lib/PConfig.php @@ -0,0 +1,189 @@ + Date: Tue, 7 Jun 2016 18:17:39 -0700 Subject: Finish the config family --- Zotlabs/Lib/AConfig.php | 25 +++++++ Zotlabs/Lib/AbConfig.php | 73 +++++++++++++++++++++ Zotlabs/Lib/IConfig.php | 165 +++++++++++++++++++++++++++++++++++++++++++++++ Zotlabs/Lib/PConfig.php | 2 +- Zotlabs/Lib/XConfig.php | 160 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 424 insertions(+), 1 deletion(-) create mode 100644 Zotlabs/Lib/AConfig.php create mode 100644 Zotlabs/Lib/AbConfig.php create mode 100644 Zotlabs/Lib/IConfig.php create mode 100644 Zotlabs/Lib/XConfig.php (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/AConfig.php b/Zotlabs/Lib/AConfig.php new file mode 100644 index 000000000..24ec97dfa --- /dev/null +++ b/Zotlabs/Lib/AConfig.php @@ -0,0 +1,25 @@ + $family, 'k' => $key, 'v' => $value, 'sharing' => $sharing); + + if(is_null($idx)) + $item['iconfig'][] = $entry; + else + $item['iconfig'][$idx] = $entry; + return $value; + } + + if(intval($item)) + $iid = intval($item); + + if(! $iid) + return false; + + if(self::Get($item, $family, $key) === false) { + $r = q("insert into iconfig( iid, cat, k, v, sharing ) values ( %d, '%s', '%s', '%s', %d ) ", + intval($iid), + dbesc($family), + dbesc($key), + dbesc($dbvalue), + intval($sharing) + ); + } + else { + $r = q("update iconfig set v = '%s', sharing = %d where iid = %d and cat = '%s' and k = '%s' ", + dbesc($dbvalue), + intval($sharing), + intval($iid), + dbesc($family), + dbesc($key) + ); + } + + if(! $r) + return false; + + return $value; + } + + + + static public function Delete(&$item, $family, $key) { + + + $is_item = false; + $idx = null; + + if(is_array($item)) { + $is_item = true; + if(is_array($item['iconfig'])) { + for($x = 0; $x < count($item['iconfig']); $x ++) { + if($item['iconfig'][$x]['cat'] == $family && $item['iconfig'][$x]['k'] == $key) { + unset($item['iconfig'][$x]); + } + } + } + return true; + } + + if(intval($item)) + $iid = intval($item); + + if(! $iid) + return false; + + return q("delete from iconfig where iid = %d and cat = '%s' and k = '%s' ", + intval($iid), + dbesc($family), + dbesc($key) + ); + + } + +} \ No newline at end of file diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php index 0cd65392e..195321375 100644 --- a/Zotlabs/Lib/PConfig.php +++ b/Zotlabs/Lib/PConfig.php @@ -65,7 +65,7 @@ class PConfig { return false; if(! array_key_exists($uid, \App::$config)) - load_pconfig($uid); + self::Load($uid); if((! array_key_exists($family, \App::$config[$uid])) || (! array_key_exists($key, \App::$config[$uid][$family]))) return false; diff --git a/Zotlabs/Lib/XConfig.php b/Zotlabs/Lib/XConfig.php new file mode 100644 index 000000000..e28dcf559 --- /dev/null +++ b/Zotlabs/Lib/XConfig.php @@ -0,0 +1,160 @@ +