本文整理汇总了PHP中api::bibliolog_write方法的典型用法代码示例。如果您正苦于以下问题:PHP api::bibliolog_write方法的具体用法?PHP api::bibliolog_write怎么用?PHP api::bibliolog_write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api
的用法示例。
在下文中一共展示了api::bibliolog_write方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bibliolog_compare
public static function bibliolog_compare($obj_db, $biblio_id, $user_id, $realname, $title, $current, $previous = NULL)
{
if ($previous == NULL) {
if ($current[0]['classification'] != 'NONE') {
api::bibliolog_write($obj_db, $biblio_id, $user_id, $realname, $title, 'update', 'classification', $current, 'New data. Classification. Number: ' . $current[0]['classification']);
}
if ($current[0]['image'] != NULL) {
api::bibliolog_write($obj_db, $biblio_id, $user_id, $realname, $title, 'update', 'cover', $current, 'New data. Image. File: ' . $current[0]['image']);
}
if ($current[0]['authors'] != NULL) {
$_authors = '';
foreach ($current[0]['authors'] as $key => $value) {
$_authors .= $value['author_name'] . '; ';
}
api::bibliolog_write($obj_db, $biblio_id, $user_id, $realname, $title, 'update', 'author', $current, 'New data. Author. Names: ' . $_authors);
}
if ($current[0]['subjects'] != NULL) {
$_subjects = '';
foreach ($current[0]['subjects'] as $key => $value) {
$_subjects .= $value['topic'] . '; ';
}
api::bibliolog_write($obj_db, $biblio_id, $user_id, $realname, $title, 'update', 'subject', $current, 'New data. Subject. Names: ' . $_subjects);
}
} else {
if ($current[0]['hash']['biblio'] != $previous[0]['hash']['biblio']) {
api::bibliolog_write($obj_db, $biblio_id, $user_id, $realname, $title, 'update', 'description', $current, 'Updated data. Bibliography.');
}
if ($current[0]['classification'] != 'NONE' and $current[0]['classification'] != $previous[0]['classification']) {
api::bibliolog_write($obj_db, $biblio_id, $user_id, $realname, $title, 'update', 'classification', $current, 'Updated data. Classification. Number: ' . $current[0]['classification']);
}
if ($current[0]['image'] != NULL and $current[0]['image'] != $previous[0]['image']) {
api::bibliolog_write($obj_db, $biblio_id, $user_id, $realname, $title, 'update', 'cover', $current, 'Updated data. Image. File: ' . $current[0]['image']);
}
if ($current[0]['authors'] != NULL and $current[0]['hash']['authors'] != $previous[0]['hash']['authors']) {
$_authors = '';
foreach ($current[0]['authors'] as $key => $value) {
$_authors .= $value['author_name'] . '; ';
}
api::bibliolog_write($obj_db, $biblio_id, $user_id, $realname, $title, 'update', 'author', $current, 'Updated data. Author. Names: ' . $_authors);
}
if ($current[0]['subjects'] != NULL and $current[0]['hash']['subjects'] != $previous[0]['hash']['subjects']) {
$_subjects = '';
foreach ($current[0]['subjects'] as $key => $value) {
$_subjects .= $value['topic'] . '; ';
}
api::bibliolog_write($obj_db, $biblio_id, $user_id, $realname, $title, 'update', 'subject', $current, 'Updated data. Subject. Names: ' . $_subjects);
}
}
}
示例2: array
$_POST['itemID'] = array((int) $_POST['itemID']);
}
// loop array
$http_query = '';
foreach ($_POST['itemID'] as $itemID) {
$itemID = (int) $itemID;
// check if this biblio data still have an item
$_sql_biblio_item_q = sprintf('SELECT b.title, COUNT(item_id) FROM biblio AS b
LEFT JOIN item AS i ON b.biblio_id=i.biblio_id
WHERE b.biblio_id=%d GROUP BY title', $itemID);
$biblio_item_q = $dbs->query($_sql_biblio_item_q);
$biblio_item_d = $biblio_item_q->fetch_row();
if ($biblio_item_d[1] < 1) {
if ($sysconf['log']['biblio']) {
$_rawdata = api::biblio_load($dbs, $itemID);
api::bibliolog_write($dbs, $itemID, $_SESSION['uid'], $_SESSION['realname'], $biblio_item_d[0], 'delete', 'description', $_rawdata, 'Data bibliografi dihapus.');
}
if (!$sql_op->delete('biblio', "biblio_id={$itemID}")) {
$error_num++;
} else {
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' DELETE bibliographic data (' . $biblio_item_d[0] . ') with biblio_id (' . $itemID . ')');
// delete related data
$sql_op->delete('biblio_topic', "biblio_id={$itemID}");
$sql_op->delete('biblio_author', "biblio_id={$itemID}");
$sql_op->delete('biblio_attachment', "biblio_id={$itemID}");
$sql_op->delete('biblio_relation', "biblio_id={$itemID}");
$sql_op->delete('search_biblio', "biblio_id={$itemID}");
// add to http query for UCS delete
$http_query .= "itemID[]={$itemID}&";
}