public static function AddFileToArticle($p_attachmentId, $p_articleNumber) { global $g_ado_db; $queryStr = 'INSERT IGNORE INTO ArticleAttachments(fk_article_number, fk_attachment_id)' . ' VALUES(' . $p_articleNumber . ', ' . $p_attachmentId . ')'; $g_ado_db->Execute($queryStr); }
window.opener.location.reload(); </script> <?php exit; } $f_language_selected = Input::Get('f_language_selected', 'int', 0); $f_article_number = Input::Get('f_article_number', 'int', 0); $articleObj = new Article($f_language_selected, $f_article_number); if (!$articleObj->exists()) { camp_html_display_error(getGS("Article does not exist."), null, true); exit; } foreach ((array) $_POST['item'] as $attachmentId) { ArticleAttachment::AddFileToArticle((int) $attachmentId, $articleObj->getArticleNumber()); } $logtext = getGS('$1 file/s attached to article', sizeof($_POST['item'])); Log::ArticleMessage($articleObj, $logtext, null, 38, TRUE); ?> <script type="text/javascript"> try { parent.$.fancybox.reload = true; parent.$.fancybox.message = '<?php putGS('Files attached.'); ?>'; parent.$.fancybox.close(); } catch (e) {} </script> <?php exit; ?>