1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-22 06:21:28 +00:00

sharepopup: implement assigning labels while sharing

This commit is contained in:
Andrew Dolgov
2012-10-31 12:55:24 +04:00
parent 4021d61ada
commit 1b4d1a6b44
6 changed files with 91 additions and 6 deletions

View File

@@ -5545,10 +5545,18 @@
}
function create_published_article($link, $title, $url, $content, $owner_uid) {
$guid = sha1($url);
function create_published_article($link, $title, $url, $content, $labels_str,
$owner_uid) {
$guid = sha1($url . $owner_uid); // include owner_uid to prevent global GUID clash
$content_hash = sha1($content);
if ($labels_str != "") {
$labels = explode(",", $labels_str);
} else {
$labels = array();
}
$rc = false;
if (!$title) $title = $url;
@@ -5584,6 +5592,12 @@
('$ref_id', '', NULL, NULL, $owner_uid, true, '', '', NOW(), '', false)");
}
if (count($labels) != 0) {
foreach ($labels as $label) {
label_add_article($link, $ref_id, trim($label), $owner_uid);
}
}
$rc = true;
} else {
@@ -5602,6 +5616,12 @@
VALUES
('$ref_id', '', NULL, NULL, $owner_uid, true, '', '', NOW(), '', false)");
if (count($labels) != 0) {
foreach ($labels as $label) {
label_add_article($link, $ref_id, trim($label), $owner_uid);
}
}
$rc = true;
}
}