當前位置: 首頁>>代碼示例>>PHP>>正文


PHP api::bibliolog_write方法代碼示例

本文整理匯總了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);
         }
     }
 }
開發者ID:slims,項目名稱:slims8_akasia,代碼行數:49,代碼來源:api.inc.php

示例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}&";
           }
開發者ID:slims,項目名稱:slims8_akasia,代碼行數:31,代碼來源:index.php


注:本文中的api::bibliolog_write方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。