aboutsummaryrefslogtreecommitdiffstats
path: root/include/help.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-06-13 19:58:24 -0700
committerredmatrix <git@macgirvin.com>2016-06-13 19:58:24 -0700
commit1e68d4fb75b9831ed763328b7982e44d1d4cdc5b (patch)
tree5379f5803f4aa3ec8b5bced6b3151cd08cf89d0f /include/help.php
parent6d4188f05e2a8e92508b1d38e4b7ef5156ba6c42 (diff)
downloadvolse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.tar.gz
volse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.tar.bz2
volse-hubzilla-1e68d4fb75b9831ed763328b7982e44d1d4cdc5b.zip
deprecate the item_id table - replace with iconfig. A possibly useful function in the iconfig class would be a search which takes a service id and type and uid, matches against an item and returns the iid. That could save a bit of code duplication.
Diffstat (limited to 'include/help.php')
-rw-r--r--include/help.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/include/help.php b/include/help.php
index 5518eeb70..7f57f3334 100644
--- a/include/help.php
+++ b/include/help.php
@@ -30,7 +30,8 @@ function search_doc_files($s) {
$regexop = db_getfunc('REGEXP');
- $r = q("select item_id.sid, item.* from item left join item_id on item.id = item_id.iid where service = 'docfile' and
+ $r = q("select iconfig.v, item.* from item left join iconfig on item.id = iconfig.iid
+ where iconfig.cat = 'system' and iconfig.k = 'docfile' and
body $regexop '%s' and item_type = %d $pager_sql",
dbesc($s),
intval(ITEM_TYPE_DOC)
@@ -50,7 +51,7 @@ function search_doc_files($s) {
}
}
}
- if(stristr($r[$x]['sid'],$s))
+ if(stristr($r[$x]['v'],$s))
$r[$x]['rank'] ++;
$r[$x]['rank'] += substr_count(strtolower($r[$x]['text']),strtolower($s));
// bias the results to the observer's native language
@@ -123,12 +124,15 @@ function store_doc_file($s) {
$item['owner_xchan'] = $item['author_xchan'] = $sys['channel_hash'];
$item['item_type'] = ITEM_TYPE_DOC;
- $r = q("select item.* from item left join item_id on item.id = item_id.iid where service = 'docfile' and
- sid = '%s' and item_type = %d limit 1",
+ $r = q("select item.* from item left join iconfig on item.id = iconfig.iid
+ where iconfig.cat = 'system' and iconfig.k = 'docfile' and
+ iconfig.v = '%s' and item_type = %d limit 1",
dbesc($s),
intval(ITEM_TYPE_DOC)
);
+ \Zotlabs\Lib\IConfig::Set($item,'system','docfile',$s);
+
if($r) {
$item['id'] = $r[0]['id'];
$item['mid'] = $item['parent_mid'] = $r[0]['mid'];
@@ -139,10 +143,7 @@ function store_doc_file($s) {
$x = item_store($item);
}
- if($x['success']) {
- update_remote_id($sys,$x['item_id'],ITEM_TYPE_DOC,$s,'docfile',0,$item['mid']);
- }
-
+ return $x;
}