publish.php 19 KB

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