mirror of https://github.com/acanas/swad-core.git
Version18.81.5
This commit is contained in:
parent
033766858f
commit
db0921ab18
|
@ -459,10 +459,11 @@ En OpenSWAD:
|
|||
ps2pdf source.ps destination.pdf
|
||||
*/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 18.81.4 (2019-03-19)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 18.81.5 (2019-03-19)"
|
||||
#define CSS_FILE "swad18.80.css"
|
||||
#define JS_FILE "swad18.80.js"
|
||||
/*
|
||||
Version 18.81.5: Mar 19, 2019 Code refactoring related to media. (240594 lines)
|
||||
Version 18.81.4: Mar 19, 2019 Code refactoring related to media. (240586 lines)
|
||||
Version 18.81.3: Mar 19, 2019 Remove unused fields MediaName,MediaType,MediaTitle,MediaURL,Media from tables. (240657 lines)
|
||||
8 changes necessary in database:
|
||||
|
|
|
@ -8498,8 +8498,7 @@ void Tst_RemoveCrsTests (long CrsCod)
|
|||
" AND tst_questions.QstCod=tst_answers.QstCod",
|
||||
CrsCod);
|
||||
|
||||
/***** Remove files with images associated
|
||||
to test questions in the course *****/
|
||||
/***** Remove media associated to test questions in the course *****/
|
||||
Tst_RemoveAllMedFilesFromAnsOfAllQstsInCrs (CrsCod);
|
||||
Tst_RemoveAllMedFilesFromStemOfAllQstsInCrs (CrsCod);
|
||||
|
||||
|
|
|
@ -3858,7 +3858,7 @@ static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *SocNot)
|
|||
long PubCod;
|
||||
unsigned long NumComments;
|
||||
unsigned long NumCom;
|
||||
unsigned NumMedia;
|
||||
long MedCod;
|
||||
|
||||
/***** Remove comments associated to this note *****/
|
||||
/* Get comments of this note */
|
||||
|
@ -3889,16 +3889,20 @@ static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *SocNot)
|
|||
/***** Remove media associated to post *****/
|
||||
if (SocNot->NoteType == TL_NOTE_POST)
|
||||
{
|
||||
/* Get name of media associated to a post from database */
|
||||
NumMedia =
|
||||
(unsigned) DB_QuerySELECT (&mysql_res,"can not get media",
|
||||
/* Remove media associated to a post from database */
|
||||
if (DB_QuerySELECT (&mysql_res,"can not get media",
|
||||
"SELECT MedCod" // row[0]
|
||||
" FROM social_posts"
|
||||
" WHERE PstCod=%ld",
|
||||
SocNot->Cod);
|
||||
SocNot->Cod) == 1) // Result should have a unique row
|
||||
{
|
||||
/* Get media code */
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
MedCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||
|
||||
/* Remove media */
|
||||
Med_RemoveMediaFromAllRows (NumMedia,mysql_res);
|
||||
/* Remove media */
|
||||
Med_RemoveMedia (MedCod);
|
||||
}
|
||||
|
||||
/* Free structure that stores the query result */
|
||||
DB_FreeMySQLResult (&mysql_res);
|
||||
|
@ -4170,19 +4174,23 @@ static void TL_RemoveComment (void)
|
|||
static void TL_RemoveCommentMediaAndDBEntries (long PubCod)
|
||||
{
|
||||
MYSQL_RES *mysql_res;
|
||||
unsigned NumMedia;
|
||||
MYSQL_ROW row;
|
||||
long MedCod;;
|
||||
|
||||
/***** Remove media associated to comment *****/
|
||||
/* Get name of media associated to a comment from database */
|
||||
NumMedia =
|
||||
(unsigned) DB_QuerySELECT (&mysql_res,"can not get media",
|
||||
"SELECT MedCod" // row[0]
|
||||
" FROM social_comments"
|
||||
" WHERE PubCod=%ld",
|
||||
PubCod);
|
||||
if (DB_QuerySELECT (&mysql_res,"can not get media",
|
||||
"SELECT MedCod" // row[0]
|
||||
" FROM social_comments"
|
||||
" WHERE PubCod=%ld",
|
||||
PubCod) == 1) // Result should have a unique row
|
||||
{
|
||||
/* Get media code */
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
MedCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||
|
||||
/* Remove media */
|
||||
Med_RemoveMediaFromAllRows (NumMedia,mysql_res);
|
||||
/* Remove media */
|
||||
Med_RemoveMedia (MedCod);
|
||||
}
|
||||
|
||||
/* Free structure that stores the query result */
|
||||
DB_FreeMySQLResult (&mysql_res);
|
||||
|
|
Loading…
Reference in New Issue