} else { // Article has not been published before $blnFirstPublish = true; } } else { // Article is not yet published $blnFirstPublish = false; } $CMS->ART->Edit($intContentID, $intAuthorID, $strContTitle, $strContBody, $dteArticleCreated, $intAreaID, $strTagList, $strContURL, $strContStatus, $strGroupList, $strExcerpt, $intCustomOrder); $CMS->ART->ClearUserlist($intContentID); } // Create file if ($blnHasAttachment) { if ($blnExistingAttachment) { $strGroups = ""; $CMS->FL->EditAttachment($intFileID, $FU->GetDBFilePath(), $intUserID, $dteArticleCreated, $strContTitle, $FU->GetDBThumbSmall(), $FU->GetDBThumbMedium(), $FU->GetDBThumbLarge(), $intContentID); } else { $intFileID = $CMS->FL->CreateAttachment($FU->GetDBFilePath(), $intUserID, $dteArticleCreated, $strContTitle, $FU->GetDBThumbSmall(), $FU->GetDBThumbMedium(), $FU->GetDBThumbLarge(), $intContentID); } } // Notify admin if ($strContStatus == C_CONT_REVIEW) { $CMS->MSG->ReviewArticleNotification($intContentID, $arrCurrentData); } if ($blnFirstPublish) { $CMS->MSG->NewArticleNotification($intContentID, $arrCurrentData); } // Build confirmation page $strAddAnother = ""; if ($strContStatus == C_CONT_PUBLISHED) { $strItemMsg = "Article published.";
if ($FU->IsError()) { $CMS->Err_MFail($FU->GetErrorDesc(), $FU->GetErrorInfo()); } } // Make thumbnails if ($blnCreate) { $FU->DoThumbs(""); } elseif ($blnEdit) { $FU->DoThumbs($intFileID); } $strWarnings .= $FU->GetWarnings(); // ** DATABASE WRITE ** // // Write to DB if ($blnCreate) { $dteFileCreated = $CMS->SYS->GetCurrentDateAndTime(); $intFileID = $CMS->FL->Create($FU->GetDBFilePath(), $intUserID, $dteFileCreated, $strTitle, $FU->GetDBThumbSmall(), "N", "Y", $FU->GetDBThumbMedium(), $FU->GetDBThumbLarge()); $strDidWhat = "uploaded"; $strUploadAnother = "<br /><a href=\"{FN_ADM_FILES_SITE_UPLOAD}?action=create\">Upload another file</a> |"; } elseif ($blnEdit) { $arrFile = $CMS->FL->GetFile($intFileID); $dteFileCreated = $arrFile['create_date_raw']; $CMS->FL->Edit($intFileID, $FU->GetDBFilePath(), $strTitle, $dteFileCreated, $FU->GetDBThumbSmall(), $FU->GetDBThumbMedium(), $FU->GetDBThumbLarge()); $strDidWhat = "updated"; $strUploadAnother = ""; } // Confirmation page $strHTML = "<h1>{$strPageTitle}</h1>\n\n{$strWarnings}<p>The file was successfully {$strDidWhat}.{$strUploadAnother} <a href=\"{FN_ADM_FILES}?type=site\">View Site Files</a></p>"; $CMS->AP->SetTitle($strPageTitle . " - Results"); $CMS->AP->Display($strHTML); } }