Lines 250-269
Link Here
|
250 |
// TODO: create a new function 'changeColumn()' that only modifies the column spec if the new column spec is different from the old one |
250 |
// TODO: create a new function 'changeColumn()' that only modifies the column spec if the new column spec is different from the old one |
251 |
$query = "ALTER table " . $tableDeleted . " MODIFY edition varchar(50) default NULL"; |
251 |
$query = "ALTER table " . $tableDeleted . " MODIFY edition varchar(50) default NULL"; |
252 |
$result = queryMySQLDatabase($query); |
252 |
$result = queryMySQLDatabase($query); |
253 |
$resultArray["Table 'deleted': altered table specification. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); // get the number of rows that were modified (or return 0 if an error occurred) |
253 |
$resultArray["Table 'deleted': altered table specification. Affected rows"] = ($result ? $connection->affected_rows : 0); // get the number of rows that were modified (or return 0 if an error occurred) |
254 |
|
254 |
|
255 |
$query = "ALTER table " . $tableDeleted . " MODIFY thesis enum('Bachelor''s thesis','Honours thesis','Master''s thesis','Ph.D. thesis','Diploma thesis','Doctoral thesis','Habilitation thesis') default NULL"; |
255 |
$query = "ALTER table " . $tableDeleted . " MODIFY thesis enum('Bachelor''s thesis','Honours thesis','Master''s thesis','Ph.D. thesis','Diploma thesis','Doctoral thesis','Habilitation thesis') default NULL"; |
256 |
$result = queryMySQLDatabase($query); |
256 |
$result = queryMySQLDatabase($query); |
257 |
$resultArray["Table 'deleted': altered table specification. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
257 |
$resultArray["Table 'deleted': altered table specification. Affected rows"] = ($result ? $connection->affected_rows : 0); |
258 |
|
258 |
|
259 |
// Alter table specification for table 'refs' |
259 |
// Alter table specification for table 'refs' |
260 |
$query = "ALTER table " . $tableRefs . " MODIFY edition varchar(50) default NULL"; |
260 |
$query = "ALTER table " . $tableRefs . " MODIFY edition varchar(50) default NULL"; |
261 |
$result = queryMySQLDatabase($query); |
261 |
$result = queryMySQLDatabase($query); |
262 |
$resultArray["Table 'refs': altered table specification. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
262 |
$resultArray["Table 'refs': altered table specification. Affected rows"] = ($result ? $connection->affected_rows : 0); |
263 |
|
263 |
|
264 |
$query = "ALTER table " . $tableRefs . " MODIFY thesis enum('Bachelor''s thesis','Honours thesis','Master''s thesis','Ph.D. thesis','Diploma thesis','Doctoral thesis','Habilitation thesis') default NULL"; |
264 |
$query = "ALTER table " . $tableRefs . " MODIFY thesis enum('Bachelor''s thesis','Honours thesis','Master''s thesis','Ph.D. thesis','Diploma thesis','Doctoral thesis','Habilitation thesis') default NULL"; |
265 |
$result = queryMySQLDatabase($query); |
265 |
$result = queryMySQLDatabase($query); |
266 |
$resultArray["Table 'refs': altered table specification. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
266 |
$resultArray["Table 'refs': altered table specification. Affected rows"] = ($result ? $connection->affected_rows : 0); |
267 |
|
267 |
|
268 |
// Add field 'version' to table 'deleted' |
268 |
// Add field 'version' to table 'deleted' |
269 |
$properties = "MEDIUMINT(8) UNSIGNED DEFAULT 1 AFTER modified_by"; |
269 |
$properties = "MEDIUMINT(8) UNSIGNED DEFAULT 1 AFTER modified_by"; |
Lines 276-302
Link Here
|
276 |
// Update table 'refs' |
276 |
// Update table 'refs' |
277 |
$query = "UPDATE " . $tableRefs . " SET thesis = NULL WHERE thesis = ''"; // this fix is required to ensure correct sorting when outputting citations with '$citeOrder="type"' or '$citeOrder="type-year"' |
277 |
$query = "UPDATE " . $tableRefs . " SET thesis = NULL WHERE thesis = ''"; // this fix is required to ensure correct sorting when outputting citations with '$citeOrder="type"' or '$citeOrder="type-year"' |
278 |
$result = queryMySQLDatabase($query); |
278 |
$result = queryMySQLDatabase($query); |
279 |
$resultArray["Table 'refs': updated 'thesis' field (replaced empty string with NULL). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
279 |
$resultArray["Table 'refs': updated 'thesis' field (replaced empty string with NULL). Affected rows"] = ($result ? $connection->affected_rows : 0); |
280 |
|
280 |
|
281 |
$query = "UPDATE " . $tableRefs . " SET type = 'Conference Article' WHERE type RLIKE '^(Unsupported: )?Conference Proceeding$'"; // this may not be perfect since some items of type "Conference Proceeding" may be actually a "Conference Volume" |
281 |
$query = "UPDATE " . $tableRefs . " SET type = 'Conference Article' WHERE type RLIKE '^(Unsupported: )?Conference Proceeding$'"; // this may not be perfect since some items of type "Conference Proceeding" may be actually a "Conference Volume" |
282 |
$result = queryMySQLDatabase($query); |
282 |
$result = queryMySQLDatabase($query); |
283 |
$resultArray["Table 'refs': updated 'type' field ('Conference Proceeding' => 'Conference Article'). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
283 |
$resultArray["Table 'refs': updated 'type' field ('Conference Proceeding' => 'Conference Article'). Affected rows"] = ($result ? $connection->affected_rows : 0); |
284 |
|
284 |
|
285 |
$query = "UPDATE " . $tableRefs . " SET type = 'Miscellaneous' WHERE type RLIKE '^(Unsupported: )?Generic$'"; |
285 |
$query = "UPDATE " . $tableRefs . " SET type = 'Miscellaneous' WHERE type RLIKE '^(Unsupported: )?Generic$'"; |
286 |
$result = queryMySQLDatabase($query); |
286 |
$result = queryMySQLDatabase($query); |
287 |
$resultArray["Table 'refs': updated 'type' field ('Generic' => 'Miscellaneous'). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
287 |
$resultArray["Table 'refs': updated 'type' field ('Generic' => 'Miscellaneous'). Affected rows"] = ($result ? $connection->affected_rows : 0); |
288 |
|
288 |
|
289 |
$query = "UPDATE " . $tableRefs . " SET type = 'Newspaper Article' WHERE type RLIKE '^(Unsupported: )?Newspaper$'"; // this may not be perfect since some items of type "Newspaper" may be actually a "Newspaper Volume" |
289 |
$query = "UPDATE " . $tableRefs . " SET type = 'Newspaper Article' WHERE type RLIKE '^(Unsupported: )?Newspaper$'"; // this may not be perfect since some items of type "Newspaper" may be actually a "Newspaper Volume" |
290 |
$result = queryMySQLDatabase($query); |
290 |
$result = queryMySQLDatabase($query); |
291 |
$resultArray["Table 'refs': updated 'type' field ('Newspaper' => 'Newspaper Article'). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
291 |
$resultArray["Table 'refs': updated 'type' field ('Newspaper' => 'Newspaper Article'). Affected rows"] = ($result ? $connection->affected_rows : 0); |
292 |
|
292 |
|
293 |
$query = "UPDATE " . $tableRefs . " SET type = 'Software' WHERE type RLIKE '^(Unsupported: )?Computer Program$'"; |
293 |
$query = "UPDATE " . $tableRefs . " SET type = 'Software' WHERE type RLIKE '^(Unsupported: )?Computer Program$'"; |
294 |
$result = queryMySQLDatabase($query); |
294 |
$result = queryMySQLDatabase($query); |
295 |
$resultArray["Table 'refs': updated 'type' field ('Computer Program' => 'Software'). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
295 |
$resultArray["Table 'refs': updated 'type' field ('Computer Program' => 'Software'). Affected rows"] = ($result ? $connection->affected_rows : 0); |
296 |
|
296 |
|
297 |
$query = "UPDATE " . $tableRefs . " SET type = REPLACE(type,'Unsupported: ','') WHERE type RLIKE '^Unsupported: (Abstract|Conference (Article|Volume)|Magazine Article|Manual|Miscellaneous|Newspaper Article|Patent|Report|Software)$'"; |
297 |
$query = "UPDATE " . $tableRefs . " SET type = REPLACE(type,'Unsupported: ','') WHERE type RLIKE '^Unsupported: (Abstract|Conference (Article|Volume)|Magazine Article|Manual|Miscellaneous|Newspaper Article|Patent|Report|Software)$'"; |
298 |
$result = queryMySQLDatabase($query); |
298 |
$result = queryMySQLDatabase($query); |
299 |
$resultArray["Table 'refs': updated 'type' field (removed 'Unsupported' label for all newly supported types). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
299 |
$resultArray["Table 'refs': updated 'type' field (removed 'Unsupported' label for all newly supported types). Affected rows"] = ($result ? $connection->affected_rows : 0); |
300 |
|
300 |
|
301 |
// Add new utilities to table 'depends' |
301 |
// Add new utilities to table 'depends' |
302 |
$values = "(NULL, 'pdftotext', 'true', NULL)"; |
302 |
$values = "(NULL, 'pdftotext', 'true', NULL)"; |
Lines 329-338
Link Here
|
329 |
// First, check how many users are contained in table 'users': |
329 |
// First, check how many users are contained in table 'users': |
330 |
$query = "SELECT user_id, first_name, last_name FROM " . $tableUsers; |
330 |
$query = "SELECT user_id, first_name, last_name FROM " . $tableUsers; |
331 |
$result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' |
331 |
$result = queryMySQLDatabase($query); // function 'queryMySQLDatabase()' is defined in 'include.inc.php' |
332 |
$rowsFound = @ mysql_num_rows($result); |
332 |
$rowsFound = @ $result->num_rows; |
333 |
if ($rowsFound > 0) // If there were rows (= user IDs) found ... |
333 |
if ($rowsFound > 0) // If there were rows (= user IDs) found ... |
334 |
{ |
334 |
{ |
335 |
while ($row = @ mysql_fetch_array($result)) |
335 |
while ($row = @ $result->fetch_array()) |
336 |
{ |
336 |
{ |
337 |
$values = "(NULL, " . $row['user_id'] . ", 'yes', 'yes', 'no', 'yes', '<:authors[2|+|++]:><:year:>', 'yes', 'transliterate', 'no', '<:authors[2| & | et al.]:>< :year:>< {:recordIdentifier:}>', NULL, 'author, title, publication, keywords, abstract')"; |
337 |
$values = "(NULL, " . $row['user_id'] . ", 'yes', 'yes', 'no', 'yes', '<:authors[2|+|++]:><:year:>', 'yes', 'transliterate', 'no', '<:authors[2| & | et al.]:>< :year:>< {:recordIdentifier:}>', NULL, 'author, title, publication, keywords, abstract')"; |
338 |
$resultArray["Table 'user_options': inserted default options for user " . $row['user_id'] . " (" . $row['first_name'] . " " . $row['last_name'] . ")"] = insertIfNotExists(array("user_id" => $row['user_id']), $tableUserOptions, $values); |
338 |
$resultArray["Table 'user_options': inserted default options for user " . $row['user_id'] . " (" . $row['first_name'] . " " . $row['last_name'] . ")"] = insertIfNotExists(array("user_id" => $row['user_id']), $tableUserOptions, $values); |
Lines 362-378
Link Here
|
362 |
// Disable the Browse view feature (which isn't done yet) for all users |
362 |
// Disable the Browse view feature (which isn't done yet) for all users |
363 |
$query= "UPDATE " . $tableUserPermissions . " SET allow_browse_view = 'no'"; |
363 |
$query= "UPDATE " . $tableUserPermissions . " SET allow_browse_view = 'no'"; |
364 |
$result = queryMySQLDatabase($query); |
364 |
$result = queryMySQLDatabase($query); |
365 |
$resultArray["Table 'user_permissions': disabled the Browse view feature (which isn't done yet). Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
365 |
$resultArray["Table 'user_permissions': disabled the Browse view feature (which isn't done yet). Affected rows"] = ($result ? $connection->affected_rows : 0); |
366 |
|
366 |
|
367 |
// Enable the Export feature for anyone who's not logged in ('$userID = 0'): |
367 |
// Enable the Export feature for anyone who's not logged in ('$userID = 0'): |
368 |
$query= "UPDATE " . $tableUserPermissions . " SET allow_export = 'yes', allow_batch_export = 'yes' WHERE user_id = 0"; |
368 |
$query= "UPDATE " . $tableUserPermissions . " SET allow_export = 'yes', allow_batch_export = 'yes' WHERE user_id = 0"; |
369 |
$result = queryMySQLDatabase($query); |
369 |
$result = queryMySQLDatabase($query); |
370 |
$resultArray["Table 'user_permissions': enabled the export feature for anyone who's not logged in. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
370 |
$resultArray["Table 'user_permissions': enabled the export feature for anyone who's not logged in. Affected rows"] = ($result ? $connection->affected_rows : 0); |
371 |
|
371 |
|
372 |
// Update table 'styles' |
372 |
// Update table 'styles' |
373 |
$query = "UPDATE " . $tableStyles . " SET style_spec = REPLACE(style_spec,'cite_','styles/cite_') WHERE style_spec RLIKE '^cite_'"; |
373 |
$query = "UPDATE " . $tableStyles . " SET style_spec = REPLACE(style_spec,'cite_','styles/cite_') WHERE style_spec RLIKE '^cite_'"; |
374 |
$result = queryMySQLDatabase($query); |
374 |
$result = queryMySQLDatabase($query); |
375 |
$resultArray["Table 'styles': updated 'style_spec' field. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
375 |
$resultArray["Table 'styles': updated 'style_spec' field. Affected rows"] = ($result ? $connection->affected_rows : 0); |
376 |
|
376 |
|
377 |
$values = "(NULL, 'Ann Glaciol', 'true', 'styles/cite_AnnGlaciol_JGlaciol.php', 'B010', '1')"; |
377 |
$values = "(NULL, 'Ann Glaciol', 'true', 'styles/cite_AnnGlaciol_JGlaciol.php', 'B010', '1')"; |
378 |
$resultArray["Table 'styles': inserted style 'Ann Glaciol'"] = insertIfNotExists(array("style_name" => "Ann Glaciol"), $tableStyles, $values); |
378 |
$resultArray["Table 'styles': inserted style 'Ann Glaciol'"] = insertIfNotExists(array("style_name" => "Ann Glaciol"), $tableStyles, $values); |
Lines 406-501
Link Here
|
406 |
|
406 |
|
407 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B010' WHERE style_name = 'Ann Glaciol'"; |
407 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B010' WHERE style_name = 'Ann Glaciol'"; |
408 |
$result = queryMySQLDatabase($query); |
408 |
$result = queryMySQLDatabase($query); |
409 |
$resultArray["Table 'styles': updated 'Ann Glaciol' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
409 |
$resultArray["Table 'styles': updated 'Ann Glaciol' style. Affected rows"] = ($result ? $connection->affected_rows : 0); |
410 |
|
410 |
|
411 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B020' WHERE style_name = 'Deep Sea Res'"; |
411 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B020' WHERE style_name = 'Deep Sea Res'"; |
412 |
$result = queryMySQLDatabase($query); |
412 |
$result = queryMySQLDatabase($query); |
413 |
$resultArray["Table 'styles': updated 'Deep Sea Res' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
413 |
$resultArray["Table 'styles': updated 'Deep Sea Res' style. Affected rows"] = ($result ? $connection->affected_rows : 0); |
414 |
|
414 |
|
415 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B030' WHERE style_name = 'J Glaciol'"; |
415 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B030' WHERE style_name = 'J Glaciol'"; |
416 |
$result = queryMySQLDatabase($query); |
416 |
$result = queryMySQLDatabase($query); |
417 |
$resultArray["Table 'styles': updated 'J Glaciol' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
417 |
$resultArray["Table 'styles': updated 'J Glaciol' style. Affected rows"] = ($result ? $connection->affected_rows : 0); |
418 |
|
418 |
|
419 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B040' WHERE style_name = 'Mar Biol'"; |
419 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B040' WHERE style_name = 'Mar Biol'"; |
420 |
$result = queryMySQLDatabase($query); |
420 |
$result = queryMySQLDatabase($query); |
421 |
$resultArray["Table 'styles': updated 'Mar Biol' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
421 |
$resultArray["Table 'styles': updated 'Mar Biol' style. Affected rows"] = ($result ? $connection->affected_rows : 0); |
422 |
|
422 |
|
423 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B050' WHERE style_name = 'MEPS'"; |
423 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B050' WHERE style_name = 'MEPS'"; |
424 |
$result = queryMySQLDatabase($query); |
424 |
$result = queryMySQLDatabase($query); |
425 |
$resultArray["Table 'styles': updated 'MEPS' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
425 |
$resultArray["Table 'styles': updated 'MEPS' style. Affected rows"] = ($result ? $connection->affected_rows : 0); |
426 |
|
426 |
|
427 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B060' WHERE style_name = 'Polar Biol'"; |
427 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'B060' WHERE style_name = 'Polar Biol'"; |
428 |
$result = queryMySQLDatabase($query); |
428 |
$result = queryMySQLDatabase($query); |
429 |
$resultArray["Table 'styles': updated 'Polar Biol' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
429 |
$resultArray["Table 'styles': updated 'Polar Biol' style. Affected rows"] = ($result ? $connection->affected_rows : 0); |
430 |
|
430 |
|
431 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'C010' WHERE style_name = 'Text Citation'"; |
431 |
$query = "UPDATE " . $tableStyles . " SET order_by = 'C010' WHERE style_name = 'Text Citation'"; |
432 |
$result = queryMySQLDatabase($query); |
432 |
$result = queryMySQLDatabase($query); |
433 |
$resultArray["Table 'styles': updated 'Text Citation' style. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
433 |
$resultArray["Table 'styles': updated 'Text Citation' style. Affected rows"] = ($result ? $connection->affected_rows : 0); |
434 |
|
434 |
|
435 |
// Update table 'types' |
435 |
// Update table 'types' |
436 |
$query = "UPDATE " . $tableTypes . " SET order_by = '01' WHERE type_name = 'Journal Article'"; |
436 |
$query = "UPDATE " . $tableTypes . " SET order_by = '01' WHERE type_name = 'Journal Article'"; |
437 |
$result = queryMySQLDatabase($query); |
437 |
$result = queryMySQLDatabase($query); |
438 |
$resultArray["Table 'types': updated 'Journal Article' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
438 |
$resultArray["Table 'types': updated 'Journal Article' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
439 |
|
439 |
|
440 |
$query = "UPDATE " . $tableTypes . " SET order_by = '02' WHERE type_name = 'Abstract'"; |
440 |
$query = "UPDATE " . $tableTypes . " SET order_by = '02' WHERE type_name = 'Abstract'"; |
441 |
$result = queryMySQLDatabase($query); |
441 |
$result = queryMySQLDatabase($query); |
442 |
$resultArray["Table 'types': updated 'Abstract' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
442 |
$resultArray["Table 'types': updated 'Abstract' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
443 |
|
443 |
|
444 |
$query = "UPDATE " . $tableTypes . " SET order_by = '03' WHERE type_name = 'Book Chapter'"; |
444 |
$query = "UPDATE " . $tableTypes . " SET order_by = '03' WHERE type_name = 'Book Chapter'"; |
445 |
$result = queryMySQLDatabase($query); |
445 |
$result = queryMySQLDatabase($query); |
446 |
$resultArray["Table 'types': updated 'Book Chapter' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
446 |
$resultArray["Table 'types': updated 'Book Chapter' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
447 |
|
447 |
|
448 |
$query = "UPDATE " . $tableTypes . " SET order_by = '04' WHERE type_name = 'Book Whole'"; |
448 |
$query = "UPDATE " . $tableTypes . " SET order_by = '04' WHERE type_name = 'Book Whole'"; |
449 |
$result = queryMySQLDatabase($query); |
449 |
$result = queryMySQLDatabase($query); |
450 |
$resultArray["Table 'types': updated 'Book Whole' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
450 |
$resultArray["Table 'types': updated 'Book Whole' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
451 |
|
451 |
|
452 |
$query = "UPDATE " . $tableTypes . " SET order_by = '05' WHERE type_name = 'Conference Article'"; |
452 |
$query = "UPDATE " . $tableTypes . " SET order_by = '05' WHERE type_name = 'Conference Article'"; |
453 |
$result = queryMySQLDatabase($query); |
453 |
$result = queryMySQLDatabase($query); |
454 |
$resultArray["Table 'types': updated 'Conference Article' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
454 |
$resultArray["Table 'types': updated 'Conference Article' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
455 |
|
455 |
|
456 |
$query = "UPDATE " . $tableTypes . " SET order_by = '06' WHERE type_name = 'Conference Volume'"; |
456 |
$query = "UPDATE " . $tableTypes . " SET order_by = '06' WHERE type_name = 'Conference Volume'"; |
457 |
$result = queryMySQLDatabase($query); |
457 |
$result = queryMySQLDatabase($query); |
458 |
$resultArray["Table 'types': updated 'Conference Volume' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
458 |
$resultArray["Table 'types': updated 'Conference Volume' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
459 |
|
459 |
|
460 |
$query = "UPDATE " . $tableTypes . " SET order_by = '07' WHERE type_name = 'Journal'"; |
460 |
$query = "UPDATE " . $tableTypes . " SET order_by = '07' WHERE type_name = 'Journal'"; |
461 |
$result = queryMySQLDatabase($query); |
461 |
$result = queryMySQLDatabase($query); |
462 |
$resultArray["Table 'types': updated 'Journal' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
462 |
$resultArray["Table 'types': updated 'Journal' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
463 |
|
463 |
|
464 |
$query = "UPDATE " . $tableTypes . " SET order_by = '08' WHERE type_name = 'Magazine Article'"; |
464 |
$query = "UPDATE " . $tableTypes . " SET order_by = '08' WHERE type_name = 'Magazine Article'"; |
465 |
$result = queryMySQLDatabase($query); |
465 |
$result = queryMySQLDatabase($query); |
466 |
$resultArray["Table 'types': updated 'Magazine Article' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
466 |
$resultArray["Table 'types': updated 'Magazine Article' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
467 |
|
467 |
|
468 |
$query = "UPDATE " . $tableTypes . " SET order_by = '09' WHERE type_name = 'Manual'"; |
468 |
$query = "UPDATE " . $tableTypes . " SET order_by = '09' WHERE type_name = 'Manual'"; |
469 |
$result = queryMySQLDatabase($query); |
469 |
$result = queryMySQLDatabase($query); |
470 |
$resultArray["Table 'types': updated 'Manual' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
470 |
$resultArray["Table 'types': updated 'Manual' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
471 |
|
471 |
|
472 |
$query = "UPDATE " . $tableTypes . " SET order_by = '10' WHERE type_name = 'Manuscript'"; |
472 |
$query = "UPDATE " . $tableTypes . " SET order_by = '10' WHERE type_name = 'Manuscript'"; |
473 |
$result = queryMySQLDatabase($query); |
473 |
$result = queryMySQLDatabase($query); |
474 |
$resultArray["Table 'types': updated 'Manuscript' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
474 |
$resultArray["Table 'types': updated 'Manuscript' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
475 |
|
475 |
|
476 |
$query = "UPDATE " . $tableTypes . " SET order_by = '11' WHERE type_name = 'Map'"; |
476 |
$query = "UPDATE " . $tableTypes . " SET order_by = '11' WHERE type_name = 'Map'"; |
477 |
$result = queryMySQLDatabase($query); |
477 |
$result = queryMySQLDatabase($query); |
478 |
$resultArray["Table 'types': updated 'Map' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
478 |
$resultArray["Table 'types': updated 'Map' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
479 |
|
479 |
|
480 |
$query = "UPDATE " . $tableTypes . " SET order_by = '12' WHERE type_name = 'Miscellaneous'"; |
480 |
$query = "UPDATE " . $tableTypes . " SET order_by = '12' WHERE type_name = 'Miscellaneous'"; |
481 |
$result = queryMySQLDatabase($query); |
481 |
$result = queryMySQLDatabase($query); |
482 |
$resultArray["Table 'types': updated 'Miscellaneous' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
482 |
$resultArray["Table 'types': updated 'Miscellaneous' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
483 |
|
483 |
|
484 |
$query = "UPDATE " . $tableTypes . " SET order_by = '13' WHERE type_name = 'Newspaper Article'"; |
484 |
$query = "UPDATE " . $tableTypes . " SET order_by = '13' WHERE type_name = 'Newspaper Article'"; |
485 |
$result = queryMySQLDatabase($query); |
485 |
$result = queryMySQLDatabase($query); |
486 |
$resultArray["Table 'types': updated 'Newspaper Article' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
486 |
$resultArray["Table 'types': updated 'Newspaper Article' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
487 |
|
487 |
|
488 |
$query = "UPDATE " . $tableTypes . " SET order_by = '14' WHERE type_name = 'Patent'"; |
488 |
$query = "UPDATE " . $tableTypes . " SET order_by = '14' WHERE type_name = 'Patent'"; |
489 |
$result = queryMySQLDatabase($query); |
489 |
$result = queryMySQLDatabase($query); |
490 |
$resultArray["Table 'types': updated 'Patent' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
490 |
$resultArray["Table 'types': updated 'Patent' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
491 |
|
491 |
|
492 |
$query = "UPDATE " . $tableTypes . " SET order_by = '15' WHERE type_name = 'Report'"; |
492 |
$query = "UPDATE " . $tableTypes . " SET order_by = '15' WHERE type_name = 'Report'"; |
493 |
$result = queryMySQLDatabase($query); |
493 |
$result = queryMySQLDatabase($query); |
494 |
$resultArray["Table 'types': updated 'Report' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
494 |
$resultArray["Table 'types': updated 'Report' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
495 |
|
495 |
|
496 |
$query = "UPDATE " . $tableTypes . " SET order_by = '16' WHERE type_name = 'Software'"; |
496 |
$query = "UPDATE " . $tableTypes . " SET order_by = '16' WHERE type_name = 'Software'"; |
497 |
$result = queryMySQLDatabase($query); |
497 |
$result = queryMySQLDatabase($query); |
498 |
$resultArray["Table 'types': updated 'Software' type. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
498 |
$resultArray["Table 'types': updated 'Software' type. Affected rows"] = ($result ? $connection->affected_rows : 0); |
499 |
|
499 |
|
500 |
$values = "(NULL, 'Abstract', 'true', 2, '02')"; |
500 |
$values = "(NULL, 'Abstract', 'true', 2, '02')"; |
501 |
$resultArray["Table 'types': inserted type 'Abstract'"] = insertIfNotExists(array("type_name" => "Abstract"), $tableTypes, $values); |
501 |
$resultArray["Table 'types': inserted type 'Abstract'"] = insertIfNotExists(array("type_name" => "Abstract"), $tableTypes, $values); |
Lines 546-623
Link Here
|
546 |
// Enable disabled localizations |
546 |
// Enable disabled localizations |
547 |
$query = "UPDATE " . $tableLanguages . " SET language_enabled = 'true' WHERE language_name = 'de'"; |
547 |
$query = "UPDATE " . $tableLanguages . " SET language_enabled = 'true' WHERE language_name = 'de'"; |
548 |
$result = queryMySQLDatabase($query); |
548 |
$result = queryMySQLDatabase($query); |
549 |
$resultArray["Table 'languages': enabled German language option. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
549 |
$resultArray["Table 'languages': enabled German language option. Affected rows"] = ($result ? $connection->affected_rows : 0); |
550 |
|
550 |
|
551 |
// Alter table specification for table 'formats' |
551 |
// Alter table specification for table 'formats' |
552 |
$query = "ALTER table " . $tableFormats . " MODIFY format_type enum('export','import','cite') NOT NULL default 'export'"; |
552 |
$query = "ALTER table " . $tableFormats . " MODIFY format_type enum('export','import','cite') NOT NULL default 'export'"; |
553 |
$result = queryMySQLDatabase($query); |
553 |
$result = queryMySQLDatabase($query); |
554 |
$resultArray["Table 'formats': altered table specification. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
554 |
$resultArray["Table 'formats': altered table specification. Affected rows"] = ($result ? $connection->affected_rows : 0); |
555 |
|
555 |
|
556 |
// Update existing formats in table 'formats' |
556 |
// Update existing formats in table 'formats' |
557 |
$query = "UPDATE " . $tableFormats . " SET format_name = 'BibTeX' WHERE format_name = 'Bibtex'"; |
557 |
$query = "UPDATE " . $tableFormats . " SET format_name = 'BibTeX' WHERE format_name = 'Bibtex'"; |
558 |
$result = queryMySQLDatabase($query); |
558 |
$result = queryMySQLDatabase($query); |
559 |
$resultArray["Table 'formats': renamed format name 'Bibtex' to 'BibTeX'. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
559 |
$resultArray["Table 'formats': renamed format name 'Bibtex' to 'BibTeX'. Affected rows"] = ($result ? $connection->affected_rows : 0); |
560 |
|
560 |
|
561 |
// Update existing import formats in table 'formats' |
561 |
// Update existing import formats in table 'formats' |
562 |
$query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_bib2refbase.php', order_by = 'A010' WHERE format_name = 'BibTeX' AND format_type = 'import'"; |
562 |
$query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_bib2refbase.php', order_by = 'A010' WHERE format_name = 'BibTeX' AND format_type = 'import'"; |
563 |
$result = queryMySQLDatabase($query); |
563 |
$result = queryMySQLDatabase($query); |
564 |
$resultArray["Table 'formats': updated 'BibTeX' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
564 |
$resultArray["Table 'formats': updated 'BibTeX' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
565 |
|
565 |
|
566 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A020' WHERE format_name = 'Copac' AND format_type = 'import'"; |
566 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A020' WHERE format_name = 'Copac' AND format_type = 'import'"; |
567 |
$result = queryMySQLDatabase($query); |
567 |
$result = queryMySQLDatabase($query); |
568 |
$resultArray["Table 'formats': updated 'Copac' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
568 |
$resultArray["Table 'formats': updated 'Copac' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
569 |
|
569 |
|
570 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A030' WHERE format_name = 'CSA' AND format_type = 'import'"; |
570 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A030' WHERE format_name = 'CSA' AND format_type = 'import'"; |
571 |
$result = queryMySQLDatabase($query); |
571 |
$result = queryMySQLDatabase($query); |
572 |
$resultArray["Table 'formats': updated 'CSA' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
572 |
$resultArray["Table 'formats': updated 'CSA' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
573 |
|
573 |
|
574 |
$query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_end2refbase.php', order_by = 'A040' WHERE format_name = 'Endnote' AND format_type = 'import'"; |
574 |
$query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_end2refbase.php', order_by = 'A040' WHERE format_name = 'Endnote' AND format_type = 'import'"; |
575 |
$result = queryMySQLDatabase($query); |
575 |
$result = queryMySQLDatabase($query); |
576 |
$resultArray["Table 'formats': updated 'Endnote' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
576 |
$resultArray["Table 'formats': updated 'Endnote' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
577 |
|
577 |
|
578 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A045' WHERE format_name = 'Endnote XML' AND format_type = 'import'"; |
578 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A045' WHERE format_name = 'Endnote XML' AND format_type = 'import'"; |
579 |
$result = queryMySQLDatabase($query); |
579 |
$result = queryMySQLDatabase($query); |
580 |
$resultArray["Table 'formats': updated 'Endnote XML' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
580 |
$resultArray["Table 'formats': updated 'Endnote XML' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
581 |
|
581 |
|
582 |
$query = "UPDATE " . $tableFormats . " SET format_name = 'ISI', format_spec = 'import_isi2refbase.php', order_by = 'A050', depends_id = 1 WHERE (format_name = 'RIS (ISI)' OR format_name = 'ISI') AND format_type = 'import'"; |
582 |
$query = "UPDATE " . $tableFormats . " SET format_name = 'ISI', format_spec = 'import_isi2refbase.php', order_by = 'A050', depends_id = 1 WHERE (format_name = 'RIS (ISI)' OR format_name = 'ISI') AND format_type = 'import'"; |
583 |
$result = queryMySQLDatabase($query); |
583 |
$result = queryMySQLDatabase($query); |
584 |
$resultArray["Table 'formats': updated 'ISI' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
584 |
$resultArray["Table 'formats': updated 'ISI' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
585 |
|
585 |
|
586 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A060' WHERE format_name = 'Pubmed Medline' AND format_type = 'import'"; |
586 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A060' WHERE format_name = 'Pubmed Medline' AND format_type = 'import'"; |
587 |
$result = queryMySQLDatabase($query); |
587 |
$result = queryMySQLDatabase($query); |
588 |
$resultArray["Table 'formats': updated 'Pubmed Medline' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
588 |
$resultArray["Table 'formats': updated 'Pubmed Medline' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
589 |
|
589 |
|
590 |
$query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_med2refbase.php', order_by = 'A065' WHERE format_name = 'Pubmed XML' AND format_type = 'import'"; |
590 |
$query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_med2refbase.php', order_by = 'A065' WHERE format_name = 'Pubmed XML' AND format_type = 'import'"; |
591 |
$result = queryMySQLDatabase($query); |
591 |
$result = queryMySQLDatabase($query); |
592 |
$resultArray["Table 'formats': updated 'Pubmed XML' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
592 |
$resultArray["Table 'formats': updated 'Pubmed XML' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
593 |
|
593 |
|
594 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A070' WHERE format_name = 'RefWorks' AND format_type = 'import'"; |
594 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A070' WHERE format_name = 'RefWorks' AND format_type = 'import'"; |
595 |
$result = queryMySQLDatabase($query); |
595 |
$result = queryMySQLDatabase($query); |
596 |
$resultArray["Table 'formats': updated 'RefWorks' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
596 |
$resultArray["Table 'formats': updated 'RefWorks' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
597 |
|
597 |
|
598 |
$query = "UPDATE " . $tableFormats . " SET format_spec = 'import_ris2refbase.php', order_by = 'A080', depends_id = 1 WHERE format_name = 'RIS' AND format_type = 'import'"; |
598 |
$query = "UPDATE " . $tableFormats . " SET format_spec = 'import_ris2refbase.php', order_by = 'A080', depends_id = 1 WHERE format_name = 'RIS' AND format_type = 'import'"; |
599 |
$result = queryMySQLDatabase($query); |
599 |
$result = queryMySQLDatabase($query); |
600 |
$resultArray["Table 'formats': updated 'RIS' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
600 |
$resultArray["Table 'formats': updated 'RIS' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
601 |
|
601 |
|
602 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A090' WHERE format_name = 'SciFinder' AND format_type = 'import'"; |
602 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A090' WHERE format_name = 'SciFinder' AND format_type = 'import'"; |
603 |
$result = queryMySQLDatabase($query); |
603 |
$result = queryMySQLDatabase($query); |
604 |
$resultArray["Table 'formats': updated 'SciFinder' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
604 |
$resultArray["Table 'formats': updated 'SciFinder' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
605 |
|
605 |
|
606 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A100' WHERE format_name = 'Text (Tab-Delimited)' AND format_type = 'import'"; |
606 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A100' WHERE format_name = 'Text (Tab-Delimited)' AND format_type = 'import'"; |
607 |
$result = queryMySQLDatabase($query); |
607 |
$result = queryMySQLDatabase($query); |
608 |
$resultArray["Table 'formats': updated 'Text (Tab-Delimited)' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
608 |
$resultArray["Table 'formats': updated 'Text (Tab-Delimited)' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
609 |
|
609 |
|
610 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A150' WHERE format_name = 'CrossRef XML' AND format_type = 'import'"; |
610 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A150' WHERE format_name = 'CrossRef XML' AND format_type = 'import'"; |
611 |
$result = queryMySQLDatabase($query); |
611 |
$result = queryMySQLDatabase($query); |
612 |
$resultArray["Table 'formats': updated 'CrossRef XML' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
612 |
$resultArray["Table 'formats': updated 'CrossRef XML' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
613 |
|
613 |
|
614 |
$query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_modsxml2refbase.php', order_by = 'A160', depends_id = 2 WHERE format_name = 'MODS XML' AND format_type = 'import'"; |
614 |
$query = "UPDATE " . $tableFormats . " SET format_spec = 'bibutils/import_modsxml2refbase.php', order_by = 'A160', depends_id = 2 WHERE format_name = 'MODS XML' AND format_type = 'import'"; |
615 |
$result = queryMySQLDatabase($query); |
615 |
$result = queryMySQLDatabase($query); |
616 |
$resultArray["Table 'formats': updated 'MODS XML' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
616 |
$resultArray["Table 'formats': updated 'MODS XML' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
617 |
|
617 |
|
618 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A170' WHERE format_name = 'OAI_DC XML' AND format_type = 'import'"; |
618 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'A170' WHERE format_name = 'OAI_DC XML' AND format_type = 'import'"; |
619 |
$result = queryMySQLDatabase($query); |
619 |
$result = queryMySQLDatabase($query); |
620 |
$resultArray["Table 'formats': updated 'OAI_DC XML' import format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
620 |
$resultArray["Table 'formats': updated 'OAI_DC XML' import format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
621 |
|
621 |
|
622 |
// Add new import formats in table 'formats' |
622 |
// Add new import formats in table 'formats' |
623 |
$values = "(NULL, 'Copac', 'import', 'true', 'bibutils/import_copac2refbase.php', 'A020', 2)"; |
623 |
$values = "(NULL, 'Copac', 'import', 'true', 'bibutils/import_copac2refbase.php', 'A020', 2)"; |
Lines 650-696
Link Here
|
650 |
// Update existing export formats in table 'formats' |
650 |
// Update existing export formats in table 'formats' |
651 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B010' WHERE format_name = 'BibTeX' AND format_type = 'export'"; |
651 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B010' WHERE format_name = 'BibTeX' AND format_type = 'export'"; |
652 |
$result = queryMySQLDatabase($query); |
652 |
$result = queryMySQLDatabase($query); |
653 |
$resultArray["Table 'formats': updated 'BibTeX' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
653 |
$resultArray["Table 'formats': updated 'BibTeX' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
654 |
|
654 |
|
655 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B040' WHERE format_name = 'Endnote' AND format_type = 'export'"; |
655 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B040' WHERE format_name = 'Endnote' AND format_type = 'export'"; |
656 |
$result = queryMySQLDatabase($query); |
656 |
$result = queryMySQLDatabase($query); |
657 |
$resultArray["Table 'formats': updated 'Endnote' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
657 |
$resultArray["Table 'formats': updated 'Endnote' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
658 |
|
658 |
|
659 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B050' WHERE format_name = 'ISI' AND format_type = 'export'"; |
659 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B050' WHERE format_name = 'ISI' AND format_type = 'export'"; |
660 |
$result = queryMySQLDatabase($query); |
660 |
$result = queryMySQLDatabase($query); |
661 |
$resultArray["Table 'formats': updated 'ISI' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
661 |
$resultArray["Table 'formats': updated 'ISI' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
662 |
|
662 |
|
663 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B080' WHERE format_name = 'RIS' AND format_type = 'export'"; |
663 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B080' WHERE format_name = 'RIS' AND format_type = 'export'"; |
664 |
$result = queryMySQLDatabase($query); |
664 |
$result = queryMySQLDatabase($query); |
665 |
$resultArray["Table 'formats': updated 'RIS' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
665 |
$resultArray["Table 'formats': updated 'RIS' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
666 |
|
666 |
|
667 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B105' WHERE format_name = 'Text (CSV)' AND format_type = 'export'"; |
667 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B105' WHERE format_name = 'Text (CSV)' AND format_type = 'export'"; |
668 |
$result = queryMySQLDatabase($query); |
668 |
$result = queryMySQLDatabase($query); |
669 |
$resultArray["Table 'formats': updated 'Text (CSV)' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
669 |
$resultArray["Table 'formats': updated 'Text (CSV)' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
670 |
|
670 |
|
671 |
$query = "UPDATE " . $tableFormats . " SET format_name = 'Atom XML', format_enabled = 'true', format_spec ='export_atomxml.php', order_by = 'B140' WHERE format_name = 'OpenSearch RSS' AND format_type = 'export'"; |
671 |
$query = "UPDATE " . $tableFormats . " SET format_name = 'Atom XML', format_enabled = 'true', format_spec ='export_atomxml.php', order_by = 'B140' WHERE format_name = 'OpenSearch RSS' AND format_type = 'export'"; |
672 |
$result = queryMySQLDatabase($query); |
672 |
$result = queryMySQLDatabase($query); |
673 |
$resultArray["Table 'formats': updated 'OpenSearch RSS' export format, and renamed it to 'Atom XML'. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
673 |
$resultArray["Table 'formats': updated 'OpenSearch RSS' export format, and renamed it to 'Atom XML'. Affected rows"] = ($result ? $connection->affected_rows : 0); |
674 |
|
674 |
|
675 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B160' WHERE format_name = 'MODS XML' AND format_type = 'export'"; |
675 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B160' WHERE format_name = 'MODS XML' AND format_type = 'export'"; |
676 |
$result = queryMySQLDatabase($query); |
676 |
$result = queryMySQLDatabase($query); |
677 |
$resultArray["Table 'formats': updated 'MODS XML' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
677 |
$resultArray["Table 'formats': updated 'MODS XML' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
678 |
|
678 |
|
679 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B170' WHERE format_name = 'OAI_DC XML' AND format_type = 'export'"; |
679 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B170' WHERE format_name = 'OAI_DC XML' AND format_type = 'export'"; |
680 |
$result = queryMySQLDatabase($query); |
680 |
$result = queryMySQLDatabase($query); |
681 |
$resultArray["Table 'formats': updated 'OAI_DC XML' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
681 |
$resultArray["Table 'formats': updated 'OAI_DC XML' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
682 |
|
682 |
|
683 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B180' WHERE format_name = 'ODF XML' AND format_type = 'export'"; |
683 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B180' WHERE format_name = 'ODF XML' AND format_type = 'export'"; |
684 |
$result = queryMySQLDatabase($query); |
684 |
$result = queryMySQLDatabase($query); |
685 |
$resultArray["Table 'formats': updated 'ODF XML' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
685 |
$resultArray["Table 'formats': updated 'ODF XML' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
686 |
|
686 |
|
687 |
$query = "UPDATE " . $tableFormats . " SET format_name = 'SRW_MODS XML', order_by = 'B195' WHERE format_name = 'SRW XML' AND format_type = 'export'"; |
687 |
$query = "UPDATE " . $tableFormats . " SET format_name = 'SRW_MODS XML', order_by = 'B195' WHERE format_name = 'SRW XML' AND format_type = 'export'"; |
688 |
$result = queryMySQLDatabase($query); |
688 |
$result = queryMySQLDatabase($query); |
689 |
$resultArray["Table 'formats': updated 'SRW XML' export format, and renamed it to 'SRW_MODS XML'. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
689 |
$resultArray["Table 'formats': updated 'SRW XML' export format, and renamed it to 'SRW_MODS XML'. Affected rows"] = ($result ? $connection->affected_rows : 0); |
690 |
|
690 |
|
691 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B200' WHERE format_name = 'Word XML' AND format_type = 'export'"; |
691 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'B200' WHERE format_name = 'Word XML' AND format_type = 'export'"; |
692 |
$result = queryMySQLDatabase($query); |
692 |
$result = queryMySQLDatabase($query); |
693 |
$resultArray["Table 'formats': updated 'Word XML' export format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
693 |
$resultArray["Table 'formats': updated 'Word XML' export format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
694 |
|
694 |
|
695 |
// Add new export formats in table 'formats' |
695 |
// Add new export formats in table 'formats' |
696 |
$values = "(NULL, 'ADS', 'export', 'true', 'bibutils/export_xml2ads.php', 'B005', 2)"; |
696 |
$values = "(NULL, 'ADS', 'export', 'true', 'bibutils/export_xml2ads.php', 'B005', 2)"; |
Lines 720-750
Link Here
|
720 |
// Update existing citation formats in table 'formats' |
720 |
// Update existing citation formats in table 'formats' |
721 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C010' WHERE format_name = 'html' AND format_type = 'cite'"; |
721 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C010' WHERE format_name = 'html' AND format_type = 'cite'"; |
722 |
$result = queryMySQLDatabase($query); |
722 |
$result = queryMySQLDatabase($query); |
723 |
$resultArray["Table 'formats': updated 'html' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
723 |
$resultArray["Table 'formats': updated 'html' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
724 |
|
724 |
|
725 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C020' WHERE format_name = 'RTF' AND format_type = 'cite'"; |
725 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C020' WHERE format_name = 'RTF' AND format_type = 'cite'"; |
726 |
$result = queryMySQLDatabase($query); |
726 |
$result = queryMySQLDatabase($query); |
727 |
$resultArray["Table 'formats': updated 'RTF' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
727 |
$resultArray["Table 'formats': updated 'RTF' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
728 |
|
728 |
|
729 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C030' WHERE format_name = 'PDF' AND format_type = 'cite'"; |
729 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C030' WHERE format_name = 'PDF' AND format_type = 'cite'"; |
730 |
$result = queryMySQLDatabase($query); |
730 |
$result = queryMySQLDatabase($query); |
731 |
$resultArray["Table 'formats': updated 'PDF' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
731 |
$resultArray["Table 'formats': updated 'PDF' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
732 |
|
732 |
|
733 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C040' WHERE format_name = 'LaTeX' AND format_type = 'cite'"; |
733 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C040' WHERE format_name = 'LaTeX' AND format_type = 'cite'"; |
734 |
$result = queryMySQLDatabase($query); |
734 |
$result = queryMySQLDatabase($query); |
735 |
$resultArray["Table 'formats': updated 'LaTeX' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
735 |
$resultArray["Table 'formats': updated 'LaTeX' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
736 |
|
736 |
|
737 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C045' WHERE format_name = 'LaTeX .bbl' AND format_type = 'cite'"; |
737 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C045' WHERE format_name = 'LaTeX .bbl' AND format_type = 'cite'"; |
738 |
$result = queryMySQLDatabase($query); |
738 |
$result = queryMySQLDatabase($query); |
739 |
$resultArray["Table 'formats': updated 'LaTeX .bbl' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
739 |
$resultArray["Table 'formats': updated 'LaTeX .bbl' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
740 |
|
740 |
|
741 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C050' WHERE format_name = 'Markdown' AND format_type = 'cite'"; |
741 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C050' WHERE format_name = 'Markdown' AND format_type = 'cite'"; |
742 |
$result = queryMySQLDatabase($query); |
742 |
$result = queryMySQLDatabase($query); |
743 |
$resultArray["Table 'formats': updated 'Markdown' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
743 |
$resultArray["Table 'formats': updated 'Markdown' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
744 |
|
744 |
|
745 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C060' WHERE format_name = 'ASCII' AND format_type = 'cite'"; |
745 |
$query = "UPDATE " . $tableFormats . " SET order_by = 'C060' WHERE format_name = 'ASCII' AND format_type = 'cite'"; |
746 |
$result = queryMySQLDatabase($query); |
746 |
$result = queryMySQLDatabase($query); |
747 |
$resultArray["Table 'formats': updated 'ASCII' citation format. Affected rows"] = ($result ? mysql_affected_rows($connection) : 0); |
747 |
$resultArray["Table 'formats': updated 'ASCII' citation format. Affected rows"] = ($result ? $connection->affected_rows : 0); |
748 |
|
748 |
|
749 |
// Add new citation formats in table 'formats' |
749 |
// Add new citation formats in table 'formats' |
750 |
$values = "(NULL, 'html', 'cite', 'true', 'formats/cite_html.php', 'C010', 1)"; |
750 |
$values = "(NULL, 'html', 'cite', 'true', 'formats/cite_html.php', 'C010', 1)"; |
Lines 773-782
Link Here
|
773 |
$formatIDArray = array(); |
773 |
$formatIDArray = array(); |
774 |
$query = "SELECT format_id, format_name FROM " . $tableFormats . " WHERE (format_name RLIKE '^(BibTeX|Endnote|RIS)$' AND format_type = 'export')"; |
774 |
$query = "SELECT format_id, format_name FROM " . $tableFormats . " WHERE (format_name RLIKE '^(BibTeX|Endnote|RIS)$' AND format_type = 'export')"; |
775 |
$result = queryMySQLDatabase($query); |
775 |
$result = queryMySQLDatabase($query); |
776 |
$rowsFound = @ mysql_num_rows($result); |
776 |
$rowsFound = @ $result->num_rows; |
777 |
if ($rowsFound > 0) |
777 |
if ($rowsFound > 0) |
778 |
{ |
778 |
{ |
779 |
while ($row = @ mysql_fetch_array($result)) |
779 |
while ($row = @ $result->fetch_array()) |
780 |
$formatIDArray[$row['format_id']] = $row['format_name']; |
780 |
$formatIDArray[$row['format_id']] = $row['format_name']; |
781 |
} |
781 |
} |
782 |
|
782 |
|
Lines 791-800
Link Here
|
791 |
$formatIDArray = array(); |
791 |
$formatIDArray = array(); |
792 |
$query = "SELECT format_id, format_name FROM " . $tableFormats . " WHERE (format_name RLIKE '^(ISI|ODF XML|Word XML)$' AND format_type = 'export') OR (format_name RLIKE '^(html|RTF|PDF|LaTeX)$' AND format_type = 'cite')"; |
792 |
$query = "SELECT format_id, format_name FROM " . $tableFormats . " WHERE (format_name RLIKE '^(ISI|ODF XML|Word XML)$' AND format_type = 'export') OR (format_name RLIKE '^(html|RTF|PDF|LaTeX)$' AND format_type = 'cite')"; |
793 |
$result = queryMySQLDatabase($query); |
793 |
$result = queryMySQLDatabase($query); |
794 |
$rowsFound = @ mysql_num_rows($result); |
794 |
$rowsFound = @ $result->num_rows; |
795 |
if ($rowsFound > 0) |
795 |
if ($rowsFound > 0) |
796 |
{ |
796 |
{ |
797 |
while ($row = @ mysql_fetch_array($result)) |
797 |
while ($row = @ $result->fetch_array()) |
798 |
$formatIDArray[$row['format_id']] = $row['format_name']; |
798 |
$formatIDArray[$row['format_id']] = $row['format_name']; |
799 |
} |
799 |
} |
800 |
|
800 |
|
Lines 802-811
Link Here
|
802 |
$styleIDArray = array(); |
802 |
$styleIDArray = array(); |
803 |
$query = "SELECT style_id, style_name FROM " . $tableStyles . " WHERE style_name RLIKE '^(AMA|APA|Chicago|Harvard( [0-9]+)?|J Glaciol|MLA|Vancouver)$'"; |
803 |
$query = "SELECT style_id, style_name FROM " . $tableStyles . " WHERE style_name RLIKE '^(AMA|APA|Chicago|Harvard( [0-9]+)?|J Glaciol|MLA|Vancouver)$'"; |
804 |
$result = queryMySQLDatabase($query); |
804 |
$result = queryMySQLDatabase($query); |
805 |
$rowsFound = @ mysql_num_rows($result); |
805 |
$rowsFound = @ $result->num_rows; |
806 |
if ($rowsFound > 0) |
806 |
if ($rowsFound > 0) |
807 |
{ |
807 |
{ |
808 |
while ($row = @ mysql_fetch_array($result)) |
808 |
while ($row = @ $result->fetch_array()) |
809 |
$styleIDArray[$row['style_id']] = $row['style_name']; |
809 |
$styleIDArray[$row['style_id']] = $row['style_name']; |
810 |
} |
810 |
} |
811 |
|
811 |
|
Lines 813-822
Link Here
|
813 |
$typeIDArray = array(); |
813 |
$typeIDArray = array(); |
814 |
$query = "SELECT type_id, type_name FROM " . $tableTypes . " WHERE type_name RLIKE '^(Abstract|Conference Article|Conference Volume|Magazine Article|Manual|Miscellaneous|Newspaper Article|Patent|Report|Software)$'"; |
814 |
$query = "SELECT type_id, type_name FROM " . $tableTypes . " WHERE type_name RLIKE '^(Abstract|Conference Article|Conference Volume|Magazine Article|Manual|Miscellaneous|Newspaper Article|Patent|Report|Software)$'"; |
815 |
$result = queryMySQLDatabase($query); |
815 |
$result = queryMySQLDatabase($query); |
816 |
$rowsFound = @ mysql_num_rows($result); |
816 |
$rowsFound = @ $result->num_rows; |
817 |
if ($rowsFound > 0) |
817 |
if ($rowsFound > 0) |
818 |
{ |
818 |
{ |
819 |
while ($row = @ mysql_fetch_array($result)) |
819 |
while ($row = @ $result->fetch_array()) |
820 |
$typeIDArray[$row['type_id']] = $row['type_name']; |
820 |
$typeIDArray[$row['type_id']] = $row['type_name']; |
821 |
} |
821 |
} |
822 |
|
822 |
|
Lines 843-852
Link Here
|
843 |
// First, check how many users are contained in table 'users': |
843 |
// First, check how many users are contained in table 'users': |
844 |
$query = "SELECT user_id, first_name, last_name FROM " . $tableUsers; |
844 |
$query = "SELECT user_id, first_name, last_name FROM " . $tableUsers; |
845 |
$result = queryMySQLDatabase($query); |
845 |
$result = queryMySQLDatabase($query); |
846 |
$rowsFound = @ mysql_num_rows($result); |
846 |
$rowsFound = @ $result->num_rows; |
847 |
if ($rowsFound > 0) // If there were rows (= user IDs) found ... |
847 |
if ($rowsFound > 0) // If there were rows (= user IDs) found ... |
848 |
{ |
848 |
{ |
849 |
while ($row = @ mysql_fetch_array($result)) |
849 |
while ($row = @ $result->fetch_array()) |
850 |
{ |
850 |
{ |
851 |
foreach ($formatIDArray as $formatID => $formatName) |
851 |
foreach ($formatIDArray as $formatID => $formatName) |
852 |
{ |
852 |
{ |