publish.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. <?php
  2. require 'checklogin.inc';
  3. require '../path.php';
  4. require "../public/_pdo.php";
  5. require "./public.inc";
  6. $type["pali"] = 1;
  7. $type["wbw"] = 2;
  8. $type["translate"] = 3;
  9. $type["note"] = 4;
  10. $type["dighest"] = 5;
  11. $type["templet"] = 6;
  12. $type["heading"] = 7;
  13. $iType["1"] = "pali";
  14. $iType["2"] = "wbw";
  15. $iType["3"] = "translate";
  16. $iType["4"] = "note";
  17. $iType["5"] = "dighest";
  18. $iType["6"] = "templet";
  19. $iType["7"] = "heading";
  20. $sLang["pali"] = 1;
  21. $sLang["en"] = 2;
  22. $sLang["sc"] = 3;
  23. $sLang["tc"] = 4;
  24. $sLang["1"] = "pali";
  25. $sLang["2"] = "en";
  26. $sLang["3"] = "sc";
  27. $sLang["4"] = "tc";
  28. if (isset($_GET["step"])) {
  29. $step = $_GET["step"];
  30. }
  31. if ($_COOKIE["userid"]) {
  32. $userid = $_COOKIE["userid"];
  33. $uid = $_COOKIE["uid"];
  34. } else {
  35. echo "尚未登录";
  36. exit;
  37. }
  38. $thisfile = basename(__FILE__);
  39. function new_album($filename, $book, $album_id, $album_type, $album_author, $album_title)
  40. {
  41. $thisfile = basename(__FILE__);
  42. echo "<div class='fun_block'>";
  43. echo "<h2>创建新的专辑</h2>";
  44. echo "<form action=\"{$thisfile}\" method=\"get\">";
  45. echo "<input type='hidden' name='step' value='2'/>";
  46. echo "<input type='hidden' name='filename' value='{$filename}'/>";
  47. echo "<input type='hidden' name='album_id' value='{$album_id}'/>";
  48. echo "<input type='hidden' name='album_type' value='{$album_type}'/>";
  49. echo "<input type='hidden' name='book' value='{$book}'/>";
  50. echo "Author(必填):<input type='input' name='author' value='{$album_author}'/><br>";
  51. echo "Title(必填):<input type='input' name='title' value='{$album_title}'/><br>";
  52. echo "Tag:<input type='input' name='tag' value=''/><br>";
  53. echo "Summary:<input type='input' name='summary' value=''/><br>";
  54. echo "Edition:<input type='input' name='edition' placeholder=\"第一版\" value=''/><br>";
  55. echo "<input type=\"submit\" value='下一步'>";
  56. echo "</form>";
  57. echo "</div>";
  58. }
  59. switch ($step) {
  60. case 1:
  61. if (isset($_GET["filename"])) {
  62. $db_file = _FILE_DB_RESRES_INDEX_;
  63. PDO_Connect("$db_file");
  64. $album_id = $_GET["id"];
  65. $filename = $_GET["filename"];
  66. $book = $_GET["book"];
  67. $album_type = $_GET["type"];
  68. $album_author = $_GET["author"];
  69. $album_title = $_GET["title"];
  70. $album_lang = $_GET["lang"];
  71. $query = "select * from 'album' where id='{$album_id}'";
  72. $Fetch = PDO_FetchAll($query);
  73. $iFetch = count($Fetch);
  74. if ($iFetch == 0) { //没有找到专辑guid
  75. echo "专辑不存在。请指定专辑后再发布。";
  76. } else //找到专辑guid
  77. {
  78. echo "<p>找到专辑</p>";
  79. if ($Fetch[0]["owner"] == $UID) { //这是自己的专辑
  80. $thisfile = basename(__FILE__);
  81. echo "正在发布";
  82. echo "<script>";
  83. echo "window.location.assign(\"{$thisfile}?step=4&filename={$filename}&album_id={$album_id}&book={$book}&album_type={$album_type}\");";
  84. echo "</script>";
  85. } else {
  86. echo "<p>此书属于他人。您没有发布权限</p>";
  87. }
  88. }
  89. } else {
  90. echo "no file name";
  91. exit;
  92. }
  93. break;
  94. case 3: //选择专辑
  95. $db_file = _FILE_DB_RESRES_INDEX_;
  96. PDO_Connect("$db_file");
  97. $album_type = $_GET["album_type"];
  98. $book = $_GET["book"];
  99. $filename = $_GET["filename"];
  100. $query = "select * from 'album' where book='{$book}' and type='{$type[$album_type]}' and owner='{$uid}'";
  101. $Fetch = PDO_FetchAll($query);
  102. $iFetch = count($Fetch);
  103. if ($iFetch == 0) { //没有找到专辑guid
  104. echo "没有找到专辑";
  105. } else {
  106. echo "<div>发布到</div>";
  107. echo "<ul class='publish_album_list'>";
  108. foreach ($Fetch as $oneAlbum) {
  109. $link = basename(__FILE__) . "?step=4&album_id={$oneAlbum["guid"]}&album_type={$album_type}&book={$book}&filename={$filename}";
  110. echo "<li><div class='title'><a href='{$link}'>{$oneAlbum["title"]}</a></div>";
  111. echo "<div class='info'>";
  112. echo "author:<span>{$oneAlbum["author"]}</span> ";
  113. echo "Edition:<span>{$oneAlbum["edition"]}</span> ";
  114. echo "Update:<span>{$oneAlbum["update_time"]}</span>";
  115. echo "</div>";
  116. echo "</li>";
  117. }
  118. echo "</ul>";
  119. $album_lang = "en";
  120. $album_author = $nickname;
  121. $album_edition = "";
  122. $album_title = $Fetch[0]["title"];
  123. $album_id = UUID();
  124. echo "<div><div onclick='show_new_album()'><a>新建专辑</a></div><div id='div_new_album' style='display:none;'>";
  125. new_album($filename, $book, $album_id, $album_type, $album_author, $album_title);
  126. echo "</div></div>";
  127. }
  128. break;
  129. case 4: //发布
  130. echo "step 4 正在发布数据";
  131. $album_id = $_GET["album_id"];
  132. $album_type = $_GET["album_type"];
  133. $book = $_GET["book"];
  134. $filename = $_GET["filename"];
  135. echo "album_type:$album_type";
  136. switch ($album_type) {
  137. case "wbw":
  138. $dbFileName = "../appdata/palicanon/wbw/p" . $book . "_wbw.db3";
  139. PDO_Connect("$dbFileName");
  140. $filename = $_GET["filename"];
  141. $dir = $dir_user_base . $userid . $dir_mydocument;
  142. $xml = simplexml_load_file($dir . $filename);
  143. $sDataTableName = "p{$book}_wbw_data";
  144. $sInfoTableName = "p{$book}_wbw_info";
  145. $paraList = "(";
  146. $dataBlock = $xml->xpath('//block');
  147. foreach ($dataBlock as $block) {
  148. if ($block->info->album_id == $album_id) {
  149. $paraList .= "'" . $block->info->paragraph . "',";
  150. }
  151. }
  152. $paraList = mb_substr($paraList, 0, -1, "UTF-8");
  153. $paraList .= ")";
  154. echo "paraList:$paraList";
  155. // 提交更改 删除数据表内容
  156. $query = "DELETE FROM '{$sDataTableName}' WHERE album_id='{$album_id}' AND paragraph in {$paraList}";
  157. $stmt = @PDO_Execute($query);
  158. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  159. $error = PDO_ErrorInfo();
  160. echo "error - $error[2] <br>";
  161. } else {
  162. echo "delete info table recorders.<br>";
  163. }
  164. // 提交更改 删除信息表内容
  165. $query = "DELETE FROM '{$sInfoTableName}' WHERE album_id='{$album_id}' AND paragraph in {$paraList}";
  166. $stmt = @PDO_Execute($query);
  167. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  168. $error = PDO_ErrorInfo();
  169. echo "error - $error[2] <br/>";
  170. } else {
  171. echo "delete data table recorders.<br/>";
  172. }
  173. // 更新infomation表 开始一个事务,关闭自动提交
  174. $PDO->beginTransaction();
  175. $query = "INSERT INTO '{$sInfoTableName}' ('id',
  176. 'album_id',
  177. 'paragraph',
  178. 'level',
  179. 'language',
  180. 'author',
  181. 'editor',
  182. 'version',
  183. 'edition',
  184. 'update_time'
  185. )
  186. VALUES (NULL,?,?,?,?,?,?,?,?,?)";
  187. $stmt = $PDO->prepare($query);
  188. $count = 0;
  189. $arrToc = array();
  190. $dataBlock = $xml->xpath('//block');
  191. foreach ($dataBlock as $block) {
  192. if ($block->info->album_id == $album_id) {
  193. $newData = array(
  194. $album_id,
  195. $block->info->paragraph,
  196. $block->info->level,
  197. $sLang["{$block->info->language}"],
  198. $block->info->author,
  199. $block->info->editor,
  200. $block->info->version,
  201. $block->info->edition,
  202. time(),
  203. );
  204. $stmt->execute($newData);
  205. $count++;
  206. }
  207. }
  208. // 提交更改
  209. $PDO->commit();
  210. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  211. $error = PDO_ErrorInfo();
  212. echo "error - $error[2] <br>";
  213. } else {
  214. echo " info 表 发布成功。提交 {$count} 条数据。<br />";
  215. }
  216. $query = "select id from '{$sInfoTableName}' WHERE album_id='{$album_id}' AND paragraph in {$paraList}";
  217. $arrInfoId = PDO_FetchAll($query);
  218. // 开始一个事务,关闭自动提交
  219. $PDO->beginTransaction();
  220. $query = "INSERT INTO '{$sDataTableName}' ('id',
  221. 'info_id',
  222. 'album_id',
  223. 'paragraph',
  224. 'sn',
  225. 'style',
  226. 'enter',
  227. 'word',
  228. 'real',
  229. 'type',
  230. 'gramma',
  231. 'mean',
  232. 'note',
  233. 'part',
  234. 'partmean'
  235. )
  236. VALUES (NULL,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
  237. $stmt = $PDO->prepare($query);
  238. $count = 0;
  239. $iIndex = 0;
  240. $arrToc = array();
  241. $dataBlock = $xml->xpath('//block');
  242. foreach ($dataBlock as $block) {
  243. if ($block->info->album_id == $album_id) {
  244. $paraText = "";
  245. $toc = "";
  246. foreach ($block->data->children() as $word) {
  247. if ($block->info->level > 0 && $block->info->level < 8) {
  248. $toc .= $word->pali;
  249. }
  250. $wordid = str_getcsv($word->id, "-");
  251. if (count($wordid) >= 3) {
  252. $sn = $wordid[2];
  253. } else {
  254. $sn = 0;
  255. }
  256. $newData = array($arrInfoId[$iIndex]["id"],
  257. $album_id,
  258. $block->info->paragraph,
  259. $sn,
  260. $word->style,
  261. $word->enter,
  262. $word->pali,
  263. $word->real,
  264. $word->type,
  265. $word->gramma,
  266. $word->mean,
  267. $word->note,
  268. $word->org,
  269. $word->om,
  270. );
  271. $stmt->execute($newData);
  272. $count++;
  273. }
  274. if ($block->info->level > 0 && $block->info->level < 8) {
  275. array_push($arrToc,
  276. array("book" => $block->info->book,
  277. "para" => $block->info->paragraph,
  278. "album_id" => $block->info->album_id,
  279. "title" => $toc,
  280. "level" => $block->info->level,
  281. "author" => $block->info->author,
  282. "editor" => $block->info->editor,
  283. "edition" => $block->info->edition,
  284. "lang" => $block->info->language,
  285. "type" => $block->info->type,
  286. ));
  287. }
  288. $iIndex++;
  289. }
  290. }
  291. // 提交更改
  292. $PDO->commit();
  293. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  294. $error = PDO_ErrorInfo();
  295. echo "error - $error[2] <br>";
  296. } else {
  297. echo " data 发布成功。提交 {$count} 条数据。<br />";
  298. }
  299. //更新索引表
  300. $db_file = _FILE_DB_RESRES_INDEX_;
  301. PDO_Connect("$db_file");
  302. echo "开始更新索引 ", count($arrToc), "<br />";
  303. //开始更新索引
  304. foreach ($arrToc as $oneTitle) {
  305. $query = "select * from 'index' where album = '$album_id' and book='" . $oneTitle["book"] . "' and paragraph='" . $oneTitle["para"] . "'";
  306. $search_title = PDO_FetchAll($query);
  307. $title_en = pali2english($oneTitle["title"]);
  308. //找到已有的记录 更新
  309. if (count($search_title) != 0) {
  310. $sCurrLang = $oneTitle["lang"];
  311. $query = "UPDATE 'index' SET title = '{$oneTitle["title"]}' ,
  312. title_en = '{$title_en}',
  313. author = '{$oneTitle["author"]}' ,
  314. editor = '{$oneTitle["editor"]}' ,
  315. share = '1' ,
  316. update_time = '" . time() . "'
  317. WHERE id='" . $search_title[0]["id"] . "' ";
  318. $stmt = @PDO_Execute($query);
  319. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  320. $error = PDO_ErrorInfo();
  321. print_r($error[2]);
  322. break;
  323. } else {
  324. echo "更新索引表成功";
  325. }
  326. } else {
  327. /*未找到 插入*/
  328. $currType = $oneTitle["type"];
  329. $currLang = $oneTitle["lang"];
  330. $icurrType = $type["{$currType}"];
  331. $icurrLang = $sLang["{$currLang}"];
  332. echo "type:$currType lang:$currLang<br>";
  333. $book = $oneTitle["book"];
  334. if (substr($book, 0, 1) == "b") {
  335. $book = substr($book, 1);
  336. }
  337. $query = "INSERT INTO 'index' (id,
  338. book,
  339. paragraph,
  340. title,
  341. title_en,
  342. level,
  343. type,
  344. language,
  345. author,
  346. editor,
  347. share,
  348. edition,
  349. album,
  350. create_time,
  351. update_time)
  352. VALUES (NULL,
  353. '{$book}',
  354. '{$oneTitle["para"]}',
  355. '{$oneTitle["title"]}',
  356. '{$title_en}',
  357. '{$oneTitle["level"]}',
  358. '{$icurrType}',
  359. '{$icurrLang}',
  360. '{$oneTitle["author"]}',
  361. '{$oneTitle["editor"]}',
  362. '1',
  363. '{$oneTitle["edition"]}',
  364. '{$album_id}',
  365. '" . time() . "',
  366. '" . time() . "')";
  367. $stmt = @PDO_Execute($query);
  368. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  369. $error = PDO_ErrorInfo();
  370. print_r($error[2]);
  371. } else {
  372. echo "新建索引记录成功";
  373. }
  374. }
  375. }
  376. break;
  377. case "translate":
  378. $dbFileName = "../appdata/palicanon/" . $album_type . "/p" . $book . "_" . $album_type . ".db3";
  379. PDO_Connect("$dbFileName");
  380. $filename = $_GET["filename"];
  381. $dir = $dir_user_base . $userid . $dir_mydocument;
  382. $xml = simplexml_load_file($dir . $filename);
  383. $sDataTableName = "p{$book}_translate_data";
  384. $sInfoTableName = "p{$book}_translate_info";
  385. $paraList = "(";
  386. $dataBlock = $xml->xpath('//block');
  387. foreach ($dataBlock as $block) {
  388. if ($block->info->album_id == $album_id) {
  389. $paraList .= "'" . $block->info->paragraph . "',";
  390. }
  391. }
  392. $paraList = mb_substr($paraList, 0, -1, "UTF-8");
  393. $paraList .= ")";
  394. echo "paraList:$paraList";
  395. // 提交更改 删除数据表内容
  396. $query = "DELETE FROM '{$sDataTableName}' WHERE album_id='{$album_id}' AND paragraph in {$paraList}";
  397. $stmt = @PDO_Execute($query);
  398. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  399. $error = PDO_ErrorInfo();
  400. echo "error - $error[2] <br>";
  401. } else {
  402. echo "delete recorders.";
  403. }
  404. // 提交更改 删除信息表内容
  405. $query = "DELETE FROM '{$sInfoTableName}' WHERE album_id='{$album_id}' AND paragraph in {$paraList}";
  406. $stmt = @PDO_Execute($query);
  407. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  408. $error = PDO_ErrorInfo();
  409. echo "error - $error[2] <br>";
  410. } else {
  411. echo "delete recorders.";
  412. }
  413. // 更新infomation表 开始一个事务,关闭自动提交
  414. $PDO->beginTransaction();
  415. $query = "INSERT INTO '{$sInfoTableName}' ('id',
  416. 'album_id',
  417. 'paragraph',
  418. 'level',
  419. 'language',
  420. 'author',
  421. 'editor',
  422. 'version',
  423. 'edition',
  424. 'update_time'
  425. )
  426. VALUES (NULL,?,?,?,?,?,?,?,?,?)";
  427. $stmt = $PDO->prepare($query);
  428. $count = 0;
  429. $arrToc = array();
  430. $dataBlock = $xml->xpath('//block');
  431. foreach ($dataBlock as $block) {
  432. if ($block->info->album_id == $album_id) {
  433. $newData = array(
  434. $album_id,
  435. $block->info->paragraph,
  436. $block->info->level,
  437. $sLang["{$block->info->language}"],
  438. $block->info->author,
  439. $block->info->editor,
  440. $block->info->version,
  441. $block->info->edition,
  442. time(),
  443. );
  444. $stmt->execute($newData);
  445. $count++;
  446. }
  447. }
  448. // 提交更改
  449. $PDO->commit();
  450. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  451. $error = PDO_ErrorInfo();
  452. echo "error - $error[2] <br>";
  453. } else {
  454. echo " info 表 发布成功。提交 {$count} 条数据。<br />";
  455. }
  456. $query = "select id from '{$sInfoTableName}' WHERE album_id='{$album_id}' AND paragraph in {$paraList}";
  457. $arrInfoId = PDO_FetchAll($query);
  458. // 开始一个事务,关闭自动提交
  459. $PDO->beginTransaction();
  460. $query = "INSERT INTO '{$sDataTableName}' ('id',
  461. 'info_id',
  462. 'album_id',
  463. 'paragraph',
  464. 'begin',
  465. 'end',
  466. 'text'
  467. )
  468. VALUES (NULL,?,?,?,?,?,?)";
  469. $stmt = $PDO->prepare($query);
  470. $count = 0;
  471. $iIndex = 0;
  472. $arrToc = array();
  473. $dataBlock = $xml->xpath('//block');
  474. foreach ($dataBlock as $block) {
  475. if ($block->info->album_id == $album_id) {
  476. $paraText = "";
  477. $toc = "";
  478. foreach ($block->data->children() as $sen) {
  479. if (isset($sen->begin)) {
  480. $sent_begin = $sen->begin;
  481. } else {
  482. $sent_begin = "";
  483. }
  484. if (isset($sen->end)) {
  485. $sent_end = $sen->end;
  486. } else {
  487. $sent_end = "";
  488. }
  489. if (isset($sen->text)) {
  490. $paraText = $sen->text;
  491. if ($block->info->level > 0 && $block->info->level < 8) {
  492. $toc .= $sen->text;
  493. }
  494. }
  495. $newData = array($arrInfoId[$iIndex]["id"],
  496. $album_id,
  497. $block->info->paragraph,
  498. $sent_begin,
  499. $sent_end,
  500. $paraText,
  501. );
  502. $stmt->execute($newData);
  503. $count++;
  504. }
  505. if ($block->info->level > 0 && $block->info->level < 8) {
  506. array_push($arrToc,
  507. array("book" => $block->info->book,
  508. "para" => $block->info->paragraph,
  509. "album_id" => $block->info->album_id,
  510. "title" => $toc,
  511. "level" => $block->info->level,
  512. "author" => $block->info->author,
  513. "editor" => $block->info->editor,
  514. "edition" => $block->info->edition,
  515. "lang" => $block->info->language,
  516. "type" => $block->info->type,
  517. ));
  518. }
  519. $iIndex++;
  520. }
  521. }
  522. // 提交更改
  523. $PDO->commit();
  524. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  525. $error = PDO_ErrorInfo();
  526. echo "error - $error[2] <br>";
  527. } else {
  528. echo " data 发布成功。提交 {$count} 条数据。<br />";
  529. }
  530. //更新索引表
  531. $db_file = _FILE_DB_RESRES_INDEX_;
  532. PDO_Connect("$db_file");
  533. echo "开始更新索引 ", count($arrToc), "<br />";
  534. //开始更新索引
  535. foreach ($arrToc as $oneTitle) {
  536. $query = "select * from 'index' where album = '$album_id' and book='" . $oneTitle["book"] . "' and paragraph='" . $oneTitle["para"] . "'";
  537. $search_title = PDO_FetchAll($query);
  538. $title_en = pali2english($oneTitle["title"]);
  539. //找到已有的记录 更新
  540. if (count($search_title) != 0) {
  541. $sCurrLang = $oneTitle["lang"];
  542. $query = "UPDATE 'index' SET title = '{$oneTitle["title"]}' ,
  543. title_en = '{$title_en}',
  544. author = '{$oneTitle["author"]}' ,
  545. editor = '{$oneTitle["editor"]}' ,
  546. share = '1' ,
  547. update_time = '" . time() . "'
  548. WHERE id='" . $search_title[0]["id"] . "' ";
  549. $stmt = @PDO_Execute($query);
  550. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  551. $error = PDO_ErrorInfo();
  552. print_r($error[2]);
  553. break;
  554. } else {
  555. echo "更新索引表成功";
  556. }
  557. } else {
  558. /*未找到 插入*/
  559. $currType = $oneTitle["type"];
  560. $currLang = $oneTitle["lang"];
  561. echo "type:$currType lang:$currLang<br>";
  562. $book = $oneTitle["book"];
  563. if (substr($book, 0, 1) == "b") {
  564. $book = substr($book, 1);
  565. }
  566. $query = "INSERT INTO 'index' (id,
  567. book,
  568. paragraph,
  569. title,
  570. title_en,
  571. level,
  572. type,
  573. language,
  574. author,
  575. editor,
  576. share,
  577. edition,
  578. album,
  579. create_time,
  580. update_time)
  581. VALUES (NULL,
  582. '{$book}',
  583. '{$oneTitle["para"]}',
  584. '{$oneTitle["title"]}',
  585. '{$title_en}',
  586. '{$oneTitle["level"]}',
  587. '{$type["{$currType}"]}',
  588. '{$sLang["{$currLang}"]}',
  589. '{$oneTitle["author"]}',
  590. '{$oneTitle["editor"]}',
  591. '1',
  592. '{$oneTitle["edition"]}',
  593. '{$album_id}',
  594. '" . time() . "',
  595. '" . time() . "')";
  596. $stmt = @PDO_Execute($query);
  597. if (!$stmt || ($stmt && $stmt->errorCode() != 0)) {
  598. $error = PDO_ErrorInfo();
  599. print_r($error[2]);
  600. } else {
  601. echo "新建索引记录成功";
  602. }
  603. }
  604. }
  605. break;
  606. case "note":
  607. break;
  608. }
  609. break;
  610. }