diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/functions.php | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/include/functions.php b/include/functions.php index 2695b1cb9..a81a2c0cd 100644 --- a/include/functions.php +++ b/include/functions.php @@ -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; } } |