reader.php 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258
  1. <?php
  2. require_once "../public/_pdo.php";
  3. require_once "../path.php";
  4. require_once '../public/load_lang.php';
  5. require_once '../public/function.php';
  6. require_once '../channal/function.php';
  7. require_once '../ucenter/function.php';
  8. global $_userinfo;
  9. global $_channal;
  10. $_userinfo = new UserInfo();
  11. $_channal = new Channal();
  12. ?>
  13. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  14. <html>
  15. <head>
  16. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  17. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  18. <link type="text/css" rel="stylesheet" href="../studio/css/font.css"/>
  19. <link type="text/css" rel="stylesheet" href="css/reader.css"/>
  20. <link type="text/css" rel="stylesheet" href="css/reader_mob.css" media="screen and (max-width:767px)">
  21. <title id="page_title">PCD Reader</title>
  22. <script src="js/jquery-3.3.1.min.js"></script>
  23. <script src="../public/js/jquery-ui-1.12.1/jquery-ui.js"></script>
  24. <script src="js/fixedsticky.js"></script>
  25. <script src="js/reader.js"></script>
  26. <script src="../public/js/comm.js"></script>
  27. <script src="../public/js/notify.js"></script>
  28. <script src="../term/term.js"></script>
  29. <script src="../term/note.js"></script>
  30. </head>
  31. <body class="reader_body" >
  32. <a name="page_head"></a>
  33. <script type="text/javascript">
  34. $(document).ready(function(){
  35. $(".toc_1_title").click(function(){
  36. $(this).parent().siblings().children(".toc_2").hide();
  37. $(this).siblings().slideToggle("200");
  38. });
  39. });
  40. </script>
  41. <style>
  42. .par_translate_div{
  43. margin-left: 1em;
  44. border-left: 1px solid gray;
  45. padding-left: 0.5em;
  46. margin-top: 0.5em;
  47. }
  48. .edit_icon{
  49. display:inline-block;
  50. width:1.4em;
  51. height:1.4em;
  52. }
  53. #para_nav {
  54. display: flex;
  55. justify-content: space-between;
  56. padding: 5px 1em;
  57. border-top: 1px solid gray;
  58. }
  59. .word{
  60. display:inline-block;
  61. padding: 1px 3px;
  62. }
  63. .mean{
  64. font-size: 65%;
  65. }
  66. /* 下拉内容 (默认隐藏) */
  67. #mean_menu {
  68. margin: 0.3em;
  69. position: absolute;
  70. background-color: white;
  71. min-width: 8em;
  72. max-width: 30em;
  73. margin: -1px 0px;
  74. box-shadow: 0px 3px 13px 0px black;
  75. color: var(--main-color);
  76. z-index: 200;
  77. }
  78. /* 下拉菜单的链接 */
  79. #mean_menu a {
  80. /*padding: 0.3em 0.4em;*/
  81. line-height: 160%;
  82. text-decoration: none;
  83. display: block;
  84. cursor: pointer;
  85. text-align: left;
  86. font-size:80%;
  87. }
  88. /* 鼠标移上去后修改下拉菜单链接颜色 */
  89. .mean_menu a:hover {
  90. background-color: blue;
  91. color: white;
  92. }
  93. .par_pali_div{
  94. margin-top:1em;
  95. }
  96. .par_pali_div{
  97. font-weight:700;
  98. }
  99. sent{
  100. font-weight:500;
  101. font-size:110%;
  102. line-height: 150%;
  103. }
  104. sent:hover{
  105. background-color:#fefec1;
  106. }
  107. para {
  108. color: #d27e17;
  109. background-color: unset;
  110. min-width: 2em;
  111. display: inline-block;
  112. text-align: center;
  113. padding: 3px 5px;
  114. border-radius: 99px;
  115. margin-right: 5px;
  116. cursor:pointer;
  117. font-size:90%;
  118. font-weight:400;
  119. }
  120. para:hover{
  121. color: white;
  122. background-color: #F1CA23;
  123. }
  124. paranum {
  125. font-weight: 700;
  126. }
  127. .sent_count{
  128. font-size:80%;
  129. color: white;
  130. background-color: #1cb70985;
  131. min-width: 2em;
  132. display: inline-block;
  133. text-align: center;
  134. padding: 2px 0;
  135. border-radius: 99px;
  136. margin-left: 5px;
  137. cursor:pointer;
  138. }
  139. .toc_1{
  140. padding: 5px;
  141. cursor: pointer;
  142. border-left: 3px solid #aaaaaa;
  143. }
  144. .toc_1_title{
  145. font-weight:700;
  146. }
  147. .toc_2{
  148. font-weight:500;
  149. padding-left:1em;
  150. display:none;
  151. }
  152. .curr_chapter{
  153. border-color: #4d4dff;
  154. color: #4d4dff;
  155. }
  156. .toc_curr_chapter2{
  157. display:block;
  158. }
  159. .toc_title2 a{
  160. color:black;
  161. line-height:1.4em;
  162. text-decoration: none;
  163. }
  164. .toc_title2 a:hover{
  165. text-decoration: underline;
  166. }
  167. .curr_chapter_title2 a{
  168. color:#4d4dff;
  169. font-weight:900;
  170. }
  171. #leftmenuinner{
  172. width: 20em;
  173. max-width: 90%;
  174. overflow-y: scroll;
  175. border-right: unset;
  176. }
  177. #leftmenuinnerinner{
  178. }
  179. #leftmenuinnerinner{
  180. margin-left: 2em;
  181. font-size: 0.8em;
  182. border-right: unset;
  183. }
  184. .sent_toc{
  185. font-weight:700;
  186. font-family: Noto serif;
  187. font-size: 150%;
  188. }
  189. note{
  190. color:blue;
  191. }
  192. .mine{
  193. color:green;
  194. }
  195. .sent_block{
  196. display:flex;
  197. padding: 2px 10px;
  198. }
  199. .sent_block>.sent_body>.sent_text{
  200. font-size: 110%;
  201. max-height: 5em;
  202. overflow-y: scroll;
  203. }
  204. .fun_frame {
  205. border: 1px solid gray;
  206. margin-right: 10px;
  207. margin-bottom: 10px;
  208. border-radius: 5px;
  209. }
  210. .fun_frame>.title{
  211. border-bottom: 1px solid gray;
  212. padding:6px;
  213. }
  214. .fun_frame>.content{
  215. padding:6px;
  216. max-height:6em;
  217. overflow-y: scroll;
  218. }
  219. #right_panal_toc{
  220. position: fixed;
  221. top: 3em;
  222. width: 24em;
  223. left: calc(100% - 24em);
  224. height: auto;
  225. min-height: 30em;
  226. font-size: 80%;
  227. padding: 2em 0.5em;
  228. }
  229. .list_with_head{
  230. display:flex;
  231. }
  232. .head_img{
  233. display: inline-block;
  234. width: 20px;
  235. font-size: 14px;
  236. padding: 2px;
  237. background-color: gray;
  238. color: white;
  239. border-radius: 99px;
  240. text-align: center;
  241. margin-right: 0.5em;
  242. margin-top: 0.5em;
  243. }
  244. .term_mean{
  245. color:blue;
  246. cursor: pointer;
  247. }
  248. </style>
  249. <!-- tool bar begin-->
  250. <div id="main_tool_bar" class='reader_toolbar'>
  251. <div id="index_nav">
  252. <button onclick="setNaviVisibility()">
  253. <svg t='1598084571450' class='icon' viewBox='0 0 1029 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='6428' width='20px' height='20px'><path d='M159.744 69.632 53.248 69.632C28.672 69.632 4.096 90.112 4.096 118.784l0 94.208c0 28.672 24.576 49.152 53.248 49.152l102.4 0C184.32 266.24 208.896 241.664 208.896 212.992L208.896 118.784C208.896 90.112 184.32 69.632 159.744 69.632zM970.752 69.632 368.64 69.632c-28.672 0-57.344 24.576-57.344 49.152l0 94.208c0 28.672 32.768 49.152 57.344 49.152l598.016 0c28.672 0 57.344-24.576 57.344-49.152L1024 118.784C1028.096 94.208 999.424 69.632 970.752 69.632zM159.744 413.696 53.248 413.696c-28.672 0-53.248 24.576-53.248 49.152l0 94.208c0 28.672 24.576 49.152 53.248 49.152l102.4 0c28.672 0 53.248-24.576 53.248-49.152l0-94.208C208.896 438.272 184.32 413.696 159.744 413.696zM970.752 413.696 368.64 413.696c-28.672 0-57.344 24.576-57.344 49.152l0 94.208c0 28.672 32.768 49.152 57.344 49.152l598.016 0c28.672 0 57.344-24.576 57.344-49.152l0-94.208C1028.096 438.272 999.424 413.696 970.752 413.696zM159.744 757.76 53.248 757.76c-28.672 0-53.248 24.576-53.248 49.152l0 94.208c0 28.672 24.576 49.152 53.248 49.152l102.4 0c28.672 0 53.248-24.576 53.248-49.152l0-94.208C208.896 782.336 184.32 757.76 159.744 757.76zM970.752 761.856 368.64 761.856c-28.672 0-57.344 24.576-57.344 49.152l0 94.208c0 28.672 32.768 49.152 57.344 49.152l598.016 0c28.672 0 57.344-24.576 57.344-49.152l0-94.208C1028.096 782.336 999.424 761.856 970.752 761.856z' fill='#757AF7' p-id='6429'></path></svg>
  254. </button>
  255. </div>
  256. <div>
  257. <span id="tool_bar_title" style="font-family: 'Noto Serif';"><?php echo $_local->gui->title; ?></span>
  258. </div>
  259. <div style="display: flex;">
  260. <form action="../studio/project.php" method="post" onsubmit="return pali_canon_edit_now(this)" target="_blank" style="display: inline-block;">
  261. <div style="display:none;">
  262. <input type="input" name="op" value="create">
  263. <input type="hidden" name="view" value="<?php echo $_GET["view"]?>" />
  264. <input type="hidden" name="book" value="<?php echo $_GET["book"]?>" />
  265. <input type="hidden" id = "para" name="para" value="" />
  266. <input type="hidden" id = "para_end" name="para_end" value="" />
  267. <input type="hidden" id = "chapter_title" name="chapter_title" value="" />
  268. <textarea id="project_new_res_data" rows="3" cols="18" name="data"></textarea>
  269. </div>
  270. <input type="submit" value="<?php echo $_local->gui->edit_now; ?>">
  271. </form>
  272. <div class="case_dropdown">
  273. <p class="case_dropbtn"><button>
  274. <svg t='1598086376923' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='8426' width='20px' height='20px'><path d='M609.745455 453.818182v130.327273h69.818181V535.272727H744.727273v377.018182h95.418182V535.272727H907.636364v48.872728h69.818181V453.818182z' p-id='8427' fill='#757AF7'></path><path d='M677.236364 300.218182V111.709091H46.545455V300.218182h69.818181v-51.2h162.909091v663.272727h165.236364V249.018182h162.909091v51.2z' p-id='8428' fill='#757AF7'></path></svg>
  275. </button></p>
  276. <div class="case_dropdown-content" style="right: 0;width:10em;">
  277. <div ><button>A+</button><button>A-</button></div>
  278. <div ><button><?php echo $_local->gui->white;?></button><button><?php echo $_local->gui->dawn;//棕?></button><button><?php echo $_local->gui->night;//夜?></button></div>
  279. </div>
  280. </div>
  281. <div class="case_dropdown">
  282. <p class="case_dropbtn"><button>
  283. <svg t='1598086493824' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='9217' width='20px' height='20px'><path d='M912.695652 512m-111.304348 0a5 5 0 1 0 222.608696 0 5 5 0 1 0-222.608696 0Z' p-id='9218' fill='#757AF7'></path><path d='M512 512m-111.304348 0a5 5 0 1 0 222.608696 0 5 5 0 1 0-222.608696 0Z' p-id='9219' fill='#757AF7'></path><path d='M111.304348 512m-111.304348 0a5 5 0 1 0 222.608696 0 5 5 0 1 0-222.608696 0Z' p-id='9220' fill='#757AF7'></path></svg>
  284. </button></p>
  285. <div class="case_dropdown-content" style="right: 2em;min-width:6em;">
  286. <a onclick="tool_changed('dighest')"><?php echo $_local->gui->digest; //书摘?></a>
  287. <a onclick="tool_changed('comments')"><?php echo $_local->gui->comment; //批注?></a>
  288. <a onclick="tool_changed('target')"><?php echo $_local->gui->tag; //标签?></a>
  289. <a onclick="tool_changed('layout')"><?php echo $_local->gui->layout; //布局?></a>
  290. <a onclick="tool_changed('porpername')"><?php echo $_local->gui->dict_terms; //术语?></a>
  291. <a onclick="tool_changed('share')"><?php echo $_local->gui->share; //分享?></a>
  292. <a onclick="tool_changed('fix')"><?php echo $_local->gui->modify; //修改?></a>
  293. </div>
  294. </div>
  295. </div>
  296. </div>
  297. <div id="tool_bar_comments">
  298. <div class='reader_toolbar' style="height:auto;">
  299. <div>
  300. </div>
  301. <div>
  302. <span>单击段落文字添加批注</span>
  303. </div>
  304. <div>
  305. </div>
  306. </div>
  307. </div>
  308. <div id="tool_bar_dighest">
  309. <div class='reader_toolbar' style="height:auto;">
  310. <div>
  311. <button onclick="dighest_cancle()">取消</button>
  312. </div>
  313. <div>
  314. <span id="dighest_message">单击文字选择段落</span>
  315. </div>
  316. <div>
  317. <button onclick="dighest_ok()">完成</button>
  318. </div>
  319. </div>
  320. </div>
  321. <div id="tool_bar_fix">
  322. <div class='reader_toolbar' style="height:auto;">
  323. <div>
  324. <button onclick="fix_cancle()">取消</button>
  325. </div>
  326. <div>
  327. <span id="fix_message">单击按钮调整段落</span>
  328. </div>
  329. <div>
  330. <button onclick="fix_ok()">完成</button>
  331. </div>
  332. </div>
  333. </div>
  334. <!--tool bar end -->
  335. <div id="main_text_view" style="padding-bottom: 10em;">
  336. <?php
  337. $tocHtml="";
  338. if(isset($_GET["album"])){
  339. $album=$_GET["album"];
  340. }
  341. if(isset($_GET["channal"])){
  342. $channal=$_GET["channal"];
  343. }
  344. if(isset($_GET["sent"])){
  345. echo "<script> _sent_id='{$_GET["sent"]}';</script>";
  346. }
  347. if(isset($_GET["book"])){
  348. $book=$_GET["book"];
  349. }
  350. else{
  351. echo "no book id";
  352. }
  353. if(substr($book,0,1)=='p'){
  354. $book=substr($book,1);
  355. }
  356. if(isset($_GET["paragraph"])){
  357. $paragraph = $_GET["paragraph"];
  358. }
  359. else if(isset($_GET["para"])){
  360. $paragraph = $_GET["para"];
  361. }
  362. else{
  363. $paragraph = -1;
  364. }
  365. if(isset($_GET["view"])){
  366. $_view = $_GET["view"];
  367. }
  368. else{
  369. echo "Error : 未定义必要的参数view";
  370. exit;
  371. }
  372. if(isset($_GET["display"])){
  373. $_display = $_GET["display"];
  374. }
  375. else{
  376. if($_view=="para" || $_view=="sent"){
  377. $_display = "sent";//默认值
  378. }
  379. else{
  380. $_display = "para";
  381. }
  382. }
  383. $tocList = array();
  384. $FetchChannal = array();
  385. if($_view=="chapter" || $_view=="para" || $_view=="sent" ){
  386. PDO_Connect("sqlite:"._FILE_DB_PALITEXT_);
  387. //生成目录
  388. $htmlToc2 = "<div><a href='#page_head'>页首</a></div>";
  389. //找到该位置对应的书
  390. $query = "select paragraph,level,chapter_len,parent from 'pali_text' where book='$book' and paragraph='$paragraph'";
  391. $FetchParInfo = PDO_FetchAll($query);
  392. $deep = 0;
  393. if(count($FetchParInfo)>0){
  394. $para = $FetchParInfo[0]["paragraph"];
  395. $level = $FetchParInfo[0]["level"];
  396. $chapter_len = $FetchParInfo[0]["chapter_len"];
  397. $parent = $FetchParInfo[0]["parent"];
  398. $currParaBegin = $para;
  399. $currParaEnd = $para + $chapter_len;
  400. $currParaLevel = $level;
  401. $currParaParentLevel = 0;
  402. //循环查找父标题 找到level=1的段落 也就是书名
  403. while($parent>-1){
  404. $query = "select paragraph,level,parent,chapter_len from pali_text where \"book\" = '{$book}' and \"paragraph\" = '{$parent}' limit 0,1";
  405. $FetParent = PDO_FetchAll($query);
  406. if(count($FetParent)>0){
  407. $para = $FetParent[0]["paragraph"];
  408. $level = $FetParent[0]["level"];
  409. $chapter_len = $FetParent[0]["chapter_len"];
  410. $parent = $FetParent[0]["parent"];
  411. if($currParaParentLevel==0){
  412. $currParaParentLevel = $level;
  413. }
  414. }
  415. $deep++;
  416. if($deep>8){
  417. break;
  418. }
  419. }
  420. $paraBegin = $para+1;
  421. $paraEnd = $para+$chapter_len;
  422. $query = "SELECT toc,paragraph,level,chapter_len,parent FROM 'pali_text' WHERE book='$book' AND (paragraph BETWEEN '$paraBegin' AND '$paraEnd') and level<100";
  423. $chapter_toc = PDO_FetchAll($query);
  424. $tocMaxLevel = 0;
  425. $tocMinLevel = 0;
  426. $tocBegin = 0;
  427. $tocEnd = 0;
  428. $toc1Level = 0;
  429. $toc2Level = 0;
  430. echo "<div><div>";
  431. foreach ($chapter_toc as $key => $value) {
  432. $tocList[$value["paragraph"]] = $value["level"];
  433. $classCurrToc="";
  434. $classCurrToc2 = "";
  435. $classCurrTocTitle2="";
  436. if($paragraph>=$value["paragraph"] && $paragraph<$value["paragraph"]+$value["chapter_len"]){
  437. $classCurrToc = " curr_chapter";
  438. $classCurrToc2 = " toc_curr_chapter2";
  439. $classCurrTocTitle2=" curr_chapter_title2";
  440. }
  441. if($tocBegin==0 || ($tocBegin>0 && $value["paragraph"]>=$tocEnd)){
  442. //开始新的标题1
  443. $tocBegin =$value["paragraph"];
  444. $tocEnd = $tocBegin + $value["chapter_len"];
  445. $toc1Level = $value["level"];
  446. if(isset($chapter_toc[$key+1])){
  447. if($chapter_toc[$key+1]["level"]>$toc1Level){
  448. $toc2Level = $chapter_toc[$key+1]["level"];
  449. }
  450. else{
  451. $tocBegin=0;
  452. }
  453. }
  454. $tocHtml .= "</div></div><div class='toc_1 {$classCurrToc}'>";
  455. $tocHtml .= "<div class='toc_1_title {$classCurrToc}'>{$value["toc"]}</div><div class='toc_2 $classCurrToc2'>";
  456. }
  457. else{
  458. //下一级标题
  459. if($value["level"]==$toc2Level ){
  460. $tocHtml .= "<div class='toc_title2 {$classCurrToc}{$classCurrTocTitle2}'><a href='reader.php?view=chapter&book={$book}&para={$value["paragraph"]}&display={$_display}'>{$value["toc"]}</a></div>";
  461. }
  462. }
  463. //右侧目录
  464. if($value["paragraph"]>$currParaBegin && $value["paragraph"]<$currParaEnd){
  465. //$tocList[$value["paragraph"]] = $value["level"];
  466. $htmlToc2 .= "<div><a href='#para_{$value["paragraph"]}'>{$value["toc"]}</a></div>";
  467. }
  468. }
  469. echo " </div></div>";
  470. }
  471. $htmlToc2 .= "<div><a href='#nav_foot'>导航</a></div>";
  472. $htmlToc2 .= "<div><a href='#sim_doc'>相关文档</a></div>";
  473. //获取段落信息 如 父段落 下一个段落等
  474. $query = "select * from 'pali_text' where book='$book' and paragraph='$paragraph'";
  475. $FetchParInfo = PDO_FetchAll($query);
  476. if(count($FetchParInfo)==0){
  477. echo "Error:no paragraph info";
  478. echo $query;
  479. }
  480. $currLevel = $FetchParInfo[0]["level"];
  481. $par_begin=$paragraph+1-1;
  482. if($_view=="para"){
  483. $par_end = $par_begin;
  484. }
  485. else{
  486. $par_end=$par_begin+$FetchParInfo[0]["chapter_len"]-1;
  487. }
  488. $par_next=$FetchParInfo[0]["next_chapter"];
  489. $par_prev=$FetchParInfo[0]["prev_chapter"];
  490. $par_parent=$FetchParInfo[0]["parent"];
  491. if($par_parent >= 0){
  492. $query = "select toc from 'pali_text' where book='$book' and paragraph='$par_parent'";
  493. $FetchToc = PDO_FetchAll($query);
  494. if(count($FetchToc)>0){
  495. $_parent_title = $FetchToc[0]["toc"];
  496. }
  497. }
  498. //查询标题
  499. if($_view=="chapter"){
  500. $par_title = $FetchParInfo[0]["toc"];
  501. }
  502. else{
  503. $par_title = $_parent_title;
  504. }
  505. //导航按钮
  506. if($_view=="sent"){
  507. $next_para_link = "";
  508. $prev_para_link = "";
  509. }
  510. else{
  511. if($par_next != -1){
  512. $query = "select paragraph , toc from 'pali_text' where book='$book' and paragraph='$par_next' ";
  513. $FetchPara = PDO_FetchAll($query);
  514. if(count($FetchPara)>0){
  515. $next_para_link = "<a href='reader.php?view={$_view}&book={$book}&para={$par_next}&display={$_display}'><span id='para_nav_next'>{$FetchPara[0]["toc"]}</span><span id='para_nav_next_a'>";
  516. $next_para_link .= "<svg t='1598093121925' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4451' width='32px' height='32px'><path d='M540.5696 102.4c-225.83296 0-409.6 183.74656-409.6 409.6s183.76704 409.6 409.6 409.6c225.85344 0 409.6-183.74656 409.6-409.6s-183.74656-409.6-409.6-409.6z m180.14208 439.84896l-109.19936 128.59392a46.65344 46.65344 0 0 1-65.86368 5.36576 46.71488 46.71488 0 0 1-5.38624-65.8432l43.86816-51.63008h-188.12928a46.6944 46.6944 0 1 1 0-93.42976h188.12928l-43.86816-51.63008a46.75584 46.75584 0 0 1 71.24992-60.47744l109.19936 128.59392c14.82752 17.408 14.82752 43.008 0 60.45696z' p-id='4452' fill='#757AF7'></path></svg>";
  517. $next_para_link .= "</span></a>";
  518. }
  519. else{
  520. $next_para_link = $_local->gui->text_without_title;
  521. }
  522. }
  523. else{
  524. $next_para_link = $_local->gui->end_of_text;
  525. }
  526. if($par_prev != -1){
  527. $query = "select paragraph , toc from 'pali_text' where book='$book' and paragraph='$par_prev' ";
  528. $FetchPara = PDO_FetchAll($query);
  529. if(count($FetchPara)>0){
  530. $prev_para_link = "<a href='reader.php?view={$_view}&book={$book}&para={$par_prev}&display={$_display}'><span id='para_nav_prev_a'>";
  531. $prev_para_link .= "<svg t='1598093521111' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4644' width='32' height='32'><path d='M540.5696 102.4c-225.83296 0-409.6 183.74656-409.6 409.6s183.76704 409.6 409.6 409.6c225.85344 0 409.6-183.74656 409.6-409.6s-183.74656-409.6-409.6-409.6z m144.54784 456.31488h-188.12928l43.84768 51.63008a46.6944 46.6944 0 0 1-35.59424 76.96384 46.55104 46.55104 0 0 1-35.61472-16.4864l-109.24032-128.59392a46.71488 46.71488 0 0 1 0-60.47744l109.24032-128.59392a46.6944 46.6944 0 1 1 71.20896 60.47744l-43.84768 51.63008h188.12928a46.6944 46.6944 0 1 1 0 93.45024z' p-id='4645' fill='#757AF7'></path></svg>";
  532. if($FetchPara[0]["toc"]==""){
  533. $prev_para_link .= "</span><span id='para_nav_prev'>({$_local->gui->text_without_title})</span></a>";
  534. }
  535. else{
  536. $prev_para_link .= "</span><span id='para_nav_prev'>{$FetchPara[0]["toc"]}</span></a>";
  537. }
  538. }
  539. else{
  540. $prev_para_link = $_local->gui->text_without_title;
  541. }
  542. }
  543. else{
  544. $prev_para_link = $_local->gui->begin_of_text;
  545. }
  546. }
  547. //设置标题栏的经文名称
  548. echo "<script>";
  549. echo "document.getElementById('tool_bar_title').innerHTML='".$par_title."';\n";
  550. echo "$('#chapter_title').val('".$par_title."');\n";
  551. echo "$('#para_end').val('".$par_end."');\n";
  552. echo "$('#para').val('".$par_begin."');\n";
  553. echo "</script>";
  554. }
  555. if($currParaLevel==1 || $currParaParentLevel==1){
  556. echo $_local->gui->chapter_select;
  557. }
  558. else{
  559. //上一级
  560. echo "<div>";
  561. switch($_view){
  562. case 1 :
  563. break;
  564. case 2:
  565. break;
  566. case 3:
  567. break;
  568. case 4:
  569. break;
  570. case 5:
  571. break;
  572. case 5:
  573. break;
  574. case 6:
  575. break;
  576. case "chapter":
  577. if($par_parent >= 0 && $currLevel>$tocMinLevel){
  578. echo "<a href='reader.php?view={$_view}&book={$book}&para={$par_parent}'>";
  579. echo "<svg t='1598083209786' class='icon' style='fill:#666666;' height='30px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4926'><path d='M446.464 118.784l-254.976 256c-13.312 13.312-4.096 35.84 15.36 35.84H716.8c18.432 0 28.672-22.528 15.36-35.84l-254.976-256c-9.216-8.192-22.528-8.192-30.72 0zM563.2 796.672V533.504c0-11.264-9.216-21.504-21.504-21.504H379.904c-11.264 0-21.504 9.216-21.504 21.504v366.592c0 11.264 9.216 21.504 21.504 21.504h467.968c11.264 0 21.504-9.216 21.504-21.504V839.68c0-11.264-9.216-21.504-21.504-21.504H584.704c-12.288 0-21.504-9.216-21.504-21.504z m0 21.504' p-id='4927'></path></svg>";
  580. echo "{$_parent_title}</a>";
  581. }
  582. break;
  583. case "para":
  584. if($par_parent >= 0){
  585. echo "<a href='reader.php?view=chapter&book={$book}&para={$par_parent}'>";
  586. echo "<svg t='1598083209786' class='icon' style='fill:#666666;' height='30px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4926'><path d='M446.464 118.784l-254.976 256c-13.312 13.312-4.096 35.84 15.36 35.84H716.8c18.432 0 28.672-22.528 15.36-35.84l-254.976-256c-9.216-8.192-22.528-8.192-30.72 0zM563.2 796.672V533.504c0-11.264-9.216-21.504-21.504-21.504H379.904c-11.264 0-21.504 9.216-21.504 21.504v366.592c0 11.264 9.216 21.504 21.504 21.504h467.968c11.264 0 21.504-9.216 21.504-21.504V839.68c0-11.264-9.216-21.504-21.504-21.504H584.704c-12.288 0-21.504-9.216-21.504-21.504z m0 21.504' p-id='4927'></path></svg>";
  587. echo "{$_parent_title}</a>";
  588. }
  589. break;
  590. case "sent":
  591. echo "<a href='reader.php?view=para&book={$book}&para={$paragraph}'>";
  592. echo "<svg t='1598083209786' class='icon' style='fill:#666666;' height='30px' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4926'><path d='M446.464 118.784l-254.976 256c-13.312 13.312-4.096 35.84 15.36 35.84H716.8c18.432 0 28.672-22.528 15.36-35.84l-254.976-256c-9.216-8.192-22.528-8.192-30.72 0zM563.2 796.672V533.504c0-11.264-9.216-21.504-21.504-21.504H379.904c-11.264 0-21.504 9.216-21.504 21.504v366.592c0 11.264 9.216 21.504 21.504 21.504h467.968c11.264 0 21.504-9.216 21.504-21.504V839.68c0-11.264-9.216-21.504-21.504-21.504H584.704c-12.288 0-21.504-9.216-21.504-21.504z m0 21.504' p-id='4927'></path></svg>";
  593. echo "{$paragraph}</a>";
  594. break;
  595. case 10:
  596. break;
  597. }
  598. echo "</div>";
  599. //生成一个段落空壳 等会儿查询数据,按照不同数据类型填充进去
  600. PDO_Connect("sqlite:"._FILE_DB_PALI_SENTENCE_);
  601. if($_display=="sent"){
  602. //逐句显示
  603. for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
  604. if($_view=="sent"){
  605. $query = "select html, begin, end from 'pali_sent' where book='$book' and paragraph='$paragraph' and begin='{$_GET["begin"]}' and end ='{$_GET["end"]}'";
  606. }
  607. else{
  608. $query = "select html, begin, end from 'pali_sent' where book='$book' and paragraph='$iPar'";
  609. }
  610. if(isset($tocList[$iPar])){
  611. $sentClass = " sent_toc";
  612. }
  613. else{
  614. $sentClass = "";
  615. }
  616. $FetchSent = PDO_FetchAll($query);
  617. echo "<div id='par-b$book-$iPar' class='par_div'>";
  618. if($_view=="chapter"){
  619. echo "<para book='$book' para='$iPar' ";
  620. if(isset($tocList[$iPar])){
  621. echo " level = '{$tocList[$iPar]}' ";
  622. }
  623. echo ">$iPar</para><a name='para_{$iPar}'></a>";
  624. }
  625. foreach ($FetchSent as $key => $value) {
  626. echo "<div id='sent-pali-b$book-$iPar-{$value["begin"]}' class='par_pali_div'>";
  627. $pali_sent=$value["html"];
  628. echo "<sent class='{$sentClass}' book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >".$pali_sent."</sent>";
  629. echo "</div>";
  630. echo "<div id='sent-wbwdiv-b$book-$iPar-{$value["begin"]}' class='par_wbw_div'>";
  631. echo "</div>";
  632. echo "<div id='sent-translate-b$book-$iPar-{$value["begin"]}' class='par_translate_div'>";
  633. echo "</div>";
  634. }
  635. echo "</div>";
  636. }
  637. }
  638. else{
  639. //段落显示
  640. for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
  641. if(isset($tocList[$iPar])){
  642. $sentClass = " sent_toc";
  643. }
  644. else{
  645. $sentClass = "";
  646. }
  647. $query = "select html , begin, end from 'pali_sent' where book='$book' and paragraph='$iPar'";
  648. $FetchSent = PDO_FetchAll($query);
  649. echo "<div id='par-b$book-$iPar' class='par_div'>";
  650. echo "<div id='par-pali-b$book-$iPar' class='par_pali_div'>";
  651. if($_view=="chapter"){
  652. echo "<para book='$book' para='$iPar' ";
  653. if(isset($tocList[$iPar])){
  654. echo " level = '{$tocList[$iPar]}' ";
  655. }
  656. echo ">$iPar</para><a name='para_{$iPar}'></a>";
  657. }
  658. foreach ($FetchSent as $key => $value) {
  659. $pali_sent=$value["html"];
  660. echo "<sent class='{$sentClass}' book='{$book}' para='{$iPar}' begin='{$value["begin"]}' end='{$value["end"]}' >{$pali_sent}</sent>";
  661. }
  662. echo "</div>";
  663. echo "<div id='par-wbwdiv-b$book-$iPar' class='par_wbw_div'>";
  664. echo "</div>";
  665. echo "<div id='par-translate-b$book-$iPar' class='par_translate_div'>";
  666. echo "</div>";
  667. echo "<div id='par-note-b$book-$iPar' class='par_note_div'>";
  668. echo "</div>";
  669. echo "</div>";
  670. }
  671. }
  672. $strSimSent = "";
  673. if($_GET["view"]=="sent"){
  674. $query = "select sim_sents from 'pali_sent' where book='$book' and paragraph='$paragraph' and begin='{$_GET["begin"]}' and end ='{$_GET["end"]}'";
  675. $FetchSent = PDO_FetchOne($query);
  676. if(!empty($FetchSent)){
  677. $sim_sents = str_replace(",","','",$FetchSent);
  678. $sim_sents = "'".$sim_sents."'";
  679. $query = "SELECT book, paragraph,begin, end, text from 'pali_sent' where id IN ( {$sim_sents} ) ";
  680. $FetchSim = PDO_FetchAll($query);
  681. foreach ($FetchSim as $key => $value) {
  682. $strSimSent .= "<div>". $value["text"]."</div>";
  683. $strSimSent .= "<div><a href='../pcdl/reader.php?view=para&book={$value["book"]}&para={$value["paragraph"]}'>"._get_para_path($value["book"],$value["paragraph"])."</a></div><br/>";
  684. }
  685. }
  686. }
  687. if(isset($_GET["sent_mode"])){
  688. }
  689. //查询编辑者数量
  690. //查询句子译文内容
  691. PDO_Connect("sqlite:"._FILE_DB_SENTENCE_);
  692. $dbh = new PDO("sqlite:"._FILE_DB_PALI_SENTENCE_, "", "");
  693. $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
  694. //查询channal数量
  695. switch ($_view) {
  696. case 'chapter':
  697. $query = "SELECT channal from 'sentence' where book= ? and (paragraph between ? and ? ) group by channal";
  698. $FetchChannal = PDO_FetchAll($query,array($book,$par_begin,$par_end));
  699. break;
  700. case 'para':
  701. # code...
  702. $query = "SELECT channal from 'sentence' where book= ? and paragraph = ? group by channal";
  703. $FetchChannal = PDO_FetchAll($query,array($book,$par_begin));
  704. break;
  705. case 'sent':
  706. # code...
  707. $query = "SELECT channal from 'sentence' where book= ? and paragraph = ? AND begin = ? AND end = ? group by channal";
  708. $FetchChannal = PDO_FetchAll($query,array($book,$par_begin,$_GET["begin"],$_GET["end"]));
  709. break;
  710. default:
  711. $FetchChannal = array();
  712. break;
  713. }
  714. for($iPar=$par_begin;$iPar<=$par_end;$iPar++){
  715. if($_view=="sent"){
  716. $FetchPaliSent = array(array("begin" => $_GET["begin"] , "end" => $_GET["end"]));
  717. }
  718. else{
  719. $query = "select begin, end from 'pali_sent' where book='$book' and paragraph='$iPar'";
  720. $stmt = $dbh->query($query);
  721. $FetchPaliSent = $stmt->fetchAll(PDO::FETCH_ASSOC);
  722. }
  723. //使用巴利语句子列表 查询译文
  724. foreach ($FetchPaliSent as $key => $value) {
  725. $begin = $value["begin"];
  726. $end = $value["end"];
  727. $query_channal = "";
  728. if(isset($_GET["channal"])){
  729. $query_channal = " AND channal=".$PDO->quote($_GET["channal"]);
  730. }
  731. $sent_count = 1;
  732. if($_view=="sent"){
  733. //显示一个巴利句子 以及相应的译文
  734. if(isset($_GET["sent"])){
  735. //如果指定译文句子编号,只显示该句子(和后面的跟帖)
  736. $query="SELECT * FROM \"sentence\" WHERE id = ".$PDO->quote($_GET["sent"]);
  737. }
  738. else{
  739. $query="SELECT * FROM \"sentence\" WHERE (book = ".$PDO->quote($book)." AND \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end' AND strlen <> 0 AND (parent = '' OR parent IS NULL) ) {$query_channal} order by modify_time DESC";
  740. }
  741. }
  742. else{
  743. $query = "SELECT * FROM \"sentence\" WHERE book = ".$PDO->quote($book)." AND \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end' AND strlen <> 0 {$query_channal} order by modify_time DESC limit 0, 1";
  744. $query_count = "SELECT count(book) FROM \"sentence\" WHERE book = ".$PDO->quote($book)." AND \"paragraph\" = ".$PDO->quote($iPar)." AND begin = '$begin' AND end = '$end' AND strlen > 0 {$query_channal} ";
  745. $sent_count = PDO_FetchOne($query_count);
  746. if($sent_count>9){
  747. $sent_count = "9+";
  748. }
  749. }
  750. $FetchText = PDO_FetchAll($query);
  751. $i = 0;
  752. foreach ($FetchText as $key => $value) {
  753. $thisSent = $value;
  754. $sentClass = "";
  755. # 找出句子中 我贡献的,优先显示
  756. if($_view != "sent"){
  757. if(isset($_COOKIE["userid"])){
  758. if($thisSent["editor"] !== $_COOKIE["userid"]){
  759. $query="SELECT * FROM sentence WHERE parent = ".$PDO->quote($thisSent["id"])." AND editor = ".$PDO->quote($_COOKIE["userid"])." order by modify_time DESC limit 0,1";
  760. $myText = PDO_FetchAll($query);
  761. if(count($myText)>0){
  762. $thisSent = $myText[0];
  763. $sentClass = "mine";
  764. }
  765. }
  766. }
  767. }
  768. echo render_sent($thisSent,$i,$_display,$sent_count,$sentClass);
  769. $i++;
  770. }
  771. if(count($FetchText)>0){
  772. if(isset($_GET["sent"])){
  773. //如果指定句子译文编号,显示句子的跟帖
  774. $query="SELECT * FROM \"sentence\" WHERE parent = ".$PDO->quote($_GET["sent"]);
  775. $FetchChildren = PDO_FetchAll($query);
  776. $i = 0;
  777. echo "<div style='margin-left:1em;'>";
  778. foreach ($FetchChildren as $key => $value) {
  779. echo render_sent($value,$i,$_display,$sent_count);
  780. $i++;
  781. }
  782. echo "</div>";
  783. }
  784. }
  785. }
  786. }
  787. //查询句子译文内容结束
  788. echo "<div id='para_nav'><a name='nav_foot'></a>";
  789. echo "<div style='display:inline-flex;'>";
  790. echo "<svg t='1598094361320' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4933' width='32' height='32'><path d='M698.75712 684.4416a81.92 81.92 0 0 1-124.88704 106.06592l-191.488-225.4848a81.89952 81.89952 0 0 1 0-106.06592l191.488-225.4848a81.92 81.92 0 0 1 124.88704 106.06592l-146.45248 172.46208 146.45248 172.4416z' p-id='4934' fill='#757AF7'></path></svg>";
  791. echo "$prev_para_link</div>";
  792. echo "<div style='display:inline-flex;'>$next_para_link";
  793. echo "<svg t='1598094021808' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='4451' width='32' height='32'><path d='M698.75712 565.02272l-191.488 225.4848a81.73568 81.73568 0 0 1-62.48448 28.89728 81.89952 81.89952 0 0 1-62.40256-134.94272l146.432-172.4416-146.432-172.4416a81.92 81.92 0 0 1 124.88704-106.06592l191.488 225.4848a81.87904 81.87904 0 0 1 0 106.02496z' p-id='4452' fill='#757AF7'></path></svg>";
  794. echo "</div>";
  795. echo "</div>";
  796. }
  797. ?>
  798. <?php
  799. function render_sent($sent_data,$sn,$display_mode,$sent_count,$class=""){
  800. global $_userinfo;
  801. global $_channal;
  802. global $PDO;
  803. global $_local;
  804. global $_local_arr;
  805. $output = "";
  806. $currParNo=$sent_data["paragraph"];
  807. $book = $sent_data["book"];
  808. if($display_mode=="sent"){
  809. $sent_style = "display:flex;";
  810. }
  811. else{
  812. $sent_style = "";
  813. }
  814. if(!empty($sent_data["parent"])){
  815. $reply_style = " sent_reply ";
  816. }
  817. else{
  818. $reply_style = "";
  819. }
  820. $tran_text = str_replace("[[","<term status='0'>",$sent_data["text"]);
  821. $tran_text = str_replace("]]","</term>",$tran_text);
  822. $output .= "<sent_trans style='margin-bottom:1em;{$sent_style}{$reply_style}' id='sent-tran-b{$book}-{$currParNo}-{$sent_data["begin"]}-{$sn}' class='sent_trans ' book='$book' para='$currParNo' begin='{$sent_data["begin"]}'>";
  823. if($display_mode=="sent"){
  824. $output .= "<span>";
  825. $output .= "<span class='head_img'>";
  826. $name = $_userinfo->getName($sent_data["editor"]);
  827. $output .= mb_substr($name["nickname"],0,2);
  828. $output .= "</span>";
  829. $output .= "</span>";
  830. }
  831. $output .= "<span>";
  832. $output .= "<span>";
  833. $output .= "<span class='sent_text {$class}' ";
  834. $output .= " sent_id='".$sent_data["id"]."'";
  835. $output .= " editor='".$sent_data["editor"]."'";
  836. $output .= " book='".$sent_data["book"]."'";
  837. $output .= " para='".$sent_data["paragraph"]."'";
  838. $output .= " begin='".$sent_data["begin"]."'";
  839. $output .= " end='".$sent_data["end"]."'";
  840. $output .= " lang='".$sent_data["language"]."'";
  841. $output .= " channal='".$sent_data["channal"]."'";
  842. $output .= " tag='".$sent_data["tag"]."'";
  843. $output .= " author='".$sent_data["author"]."'";
  844. $output .= " nickname='".$name["nickname"]."'";
  845. $output .= " username='".$name["username"]."'";
  846. $output .= " text='".$sent_data["text"]."'";
  847. $output .= ">";
  848. $output .= $tran_text;
  849. $output .= "</span>";
  850. if($display_mode=="sent"){
  851. if((isset($_GET["channal"]) || $_GET["view"]=="sent") ){
  852. if($sent_data["editor"] == $_COOKIE["userid"]){
  853. $output .= "<svg class='edit_icon';'><use xlink:href='../studio/svg/icon.svg#ic_mode_edit'></use></svg>";
  854. }
  855. }
  856. else{
  857. $output .= "<span class='sent_count'>$sent_count</span>";
  858. }
  859. }
  860. echo "</span>";
  861. if($_GET["view"]=="sent"){
  862. $channalInfo = $_channal->getChannal($sent_data["channal"]);
  863. $query="SELECT count(*) FROM \"sentence\" WHERE parent = ".$PDO->quote($sent_data["id"]);
  864. $edit_count = PDO_FetchOne($query);
  865. $output .= "<div style='font-size:80%;color:gray;'>{$name["nickname"]} <span style='color:gray;'>@{$name["username"]} </span>· {$channalInfo["name"]}</div>";
  866. $output .= "<div class='sent_blcok_tools'>";
  867. if($sent_data["editor"] == $_COOKIE["userid"]){
  868. $output .= "<span>{$_local_arr["gui"]["revise"]}</span>";
  869. }
  870. else{
  871. $output .= "<edit>{$_local_arr["gui"]["revise"]}</edit>";
  872. }
  873. $output .= "{$edit_count} ";
  874. if($sent_data["editor"] != $_COOKIE["userid"]){
  875. $output .= "<span onclick=\"sent_apply('{$sent_data["id"]}')\">采纳</span>";
  876. }
  877. $output .= '<svg t="1600445373282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2368" width="16" height="16"><path fill="silver" d="M854.00064 412.66688h-275.99872v-35.99872c48-102.00064 35.99872-227.99872 0-288-12.00128-18.00192-35.99872-35.99872-54.00064-35.99872s-35.99872 6.00064-35.99872 54.00064c0 96-6.00064 137.99936-24.00256 179.99872-12.00128 29.99808-77.99808 96-156.00128 120.00256v480c12.00128 6.00064 35.99872 24.00256 54.00064 29.99808 18.00192 12.00128 48 18.00192 60.00128 18.00192h306.00192c77.99808 0 108.00128-29.99808 108.00128-66.00192 0-18.00192 0-29.99808-18.00192-35.99872V796.672c41.99936 0 83.99872-12.00128 83.99872-48 0-29.99808-12.00128-35.99872-18.00192-35.99872v-35.99872h6.00064c24.00256 0 60.00128-35.99872 60.00128-60.00128 0-18.00192-6.00064-35.99872-18.00192-41.99936-6.00064-6.00064-24.00256-6.00064-24.00256-6.00064v-35.99872s12.00128 0 24.00256-12.00128c18.00192-12.00128 18.00192-42.00448 18.00192-42.00448v-12.00128c0-29.99808-48-54.00064-96-54.00064zM67.99872 478.6688l35.99872 408.00256c6.00064 24.00256 24.00256 48 48 48h83.99872c6.00064 0 12.00128-6.00064 18.00192-12.00128s12.00128-6.00064 18.00192-12.00128V412.66688H128c-35.99872 0-60.00128 35.99872-60.00128 66.00192z" p-id="2369"></path></svg>';
  878. $output .= '<span id="num_like">0</span>';
  879. $output .="</div>";
  880. }
  881. echo "</span>";
  882. $output .= "</sent_trans>";
  883. if($_GET["view"]!="sent"){
  884. $output .= "<script>";
  885. if($display_mode=="sent"){
  886. $output .= "document.getElementById('sent-translate-b{$book}-{$currParNo}-{$sent_data["begin"]}').appendChild(document.getElementById('sent-tran-b{$book}-{$currParNo}-{$sent_data["begin"]}-{$sn}'));";
  887. }
  888. else{
  889. $output .= "document.getElementById('par-translate-b{$book}-{$currParNo}').appendChild(document.getElementById('sent-tran-b{$book}-{$currParNo}-{$sent_data["begin"]}-{$sn}'));";
  890. }
  891. $output .= "</script>";
  892. }
  893. return $output;
  894. }
  895. ?>
  896. <div>
  897. <a name="sim_doc"></a>
  898. <div>相似句子</div>
  899. <?php echo $strSimSent; ?>
  900. <div>相关段落</div>
  901. <ul>
  902. <?php
  903. //查找相关标题
  904. if(strtolower(mb_substr($par_title,mb_strlen($par_title,"UTF-8")-7,null,"UTF-8"))=="vaṇṇanā"){
  905. $searchToc = strtolower(mb_substr($par_title,0,-7,"UTF-8"));
  906. }
  907. else{
  908. $searchToc = strtolower(mb_substr($par_title,0,-1,"UTF-8"));
  909. }
  910. PDO_Connect("sqlite:"._FILE_DB_RESRES_INDEX_);
  911. $query = "select book, paragraph,title from 'index' where \"title\" like ".$PDO->quote($searchToc.'%')." limit 0,50";
  912. $Fetch = PDO_FetchAll($query);
  913. foreach ($Fetch as $key => $value) {
  914. echo "<div style='margin-bottom: 0.5em;'>";
  915. echo "<div><a href='reader.php?view=chapter&book={$value["book"]}&para={$value["paragraph"]}' target='_blank'> {$value["title"]} </a></div>";
  916. echo "<div>". _get_para_path($value["book"],$value["paragraph"])."</div>";
  917. echo "</div>";
  918. }
  919. ?>
  920. </ul>
  921. </div>
  922. </div><!--main_text_view end-->
  923. <div id="new_comm_shell" style="display:none;">
  924. <div id="new_comm_div">
  925. <textarea id="new_comm_text"></textarea>
  926. <button onclick="new_comm_submit()"><?php echo $_local->gui->submit;?></button>
  927. <button onclick="new_comm_cancel()"><?php echo $_local->gui->cancel;?></button>
  928. </div>
  929. </div>
  930. <div id="dighest_edit_div" class="full_screen_window">
  931. <div class="win_caption">
  932. <div><button onclick="dighest_edit_cancle()"><?php echo $_local->gui->cancel;?></button></div>
  933. <div><button onclick="dighest_edit_submit()"><?php echo $_local->gui->submit;?></button></div>
  934. </div>
  935. <div id="dighest_edit_body" class="win_body">
  936. <div>
  937. <?php echo $_local->gui->title;?>:<input id="dighest_edit_title" />
  938. </div>
  939. <div>
  940. <?php echo $_local->gui->introduction;?>:<textarea id="dighest_edit_summary"></textarea>
  941. </div>
  942. <div>
  943. <?php echo $_local->gui->tag;?>:<input id="dighest_edit_taget" />
  944. </div>
  945. <div id="dighest_text_preview">
  946. </div>
  947. </div>
  948. </div>
  949. <div id="right_panal_toc" >
  950. <div class="fun_frame">
  951. <div class="title">跳转到</div>
  952. <div class="content" >
  953. <?php
  954. if($currLevel>=$tocMinLevel){
  955. echo $htmlToc2;
  956. }
  957. ?>
  958. </div>
  959. </div>
  960. <div class="fun_frame">
  961. <div class="title">CSCD4 Paragraph Number</div>
  962. <div class="content" id="s6_para">
  963. </div>
  964. </div>
  965. <div class="fun_frame">
  966. <div class="title">译文语言</div>
  967. <div class="content" >
  968. </div>
  969. </div>
  970. <div class="fun_frame">
  971. <div class="title">贡献者</div>
  972. <div class="content" style='max-height:10em;' >
  973. <?php
  974. echo "<div>";
  975. echo "<a href='../pcdl/reader.php?view={$_GET["view"]}";
  976. echo "&book=".$_GET["book"];
  977. echo "&para=".$_GET["para"];
  978. if(isset($_GET["begin"])){
  979. echo "&begin=".$_GET["begin"];
  980. }
  981. if(isset($_GET["end"])){
  982. echo "&end=".$_GET["end"];
  983. }
  984. echo "' >";
  985. echo "全部";
  986. echo "</a>";
  987. echo "</div>";
  988. foreach ($FetchChannal as $key => $value) {
  989. if(!$value["channal"]){
  990. continue;
  991. }
  992. # code...
  993. $channalInfo = $_channal->getChannal($value["channal"]);
  994. if($channalInfo){
  995. $user = $_userinfo->getName($channalInfo["owner"]);
  996. }
  997. else{
  998. $user=null;
  999. }
  1000. echo "<div class='list_with_head'>";
  1001. echo "<div class='head'>";
  1002. echo "<span class='head_img'>";
  1003. echo mb_substr($user["nickname"],0,2);
  1004. echo "</span>";
  1005. echo "</div>";
  1006. echo "<div>";
  1007. echo "<div>";
  1008. echo "<a href='../pcdl/reader.php?view={$_GET["view"]}";
  1009. echo "&book=".$_GET["book"];
  1010. echo "&para=".$_GET["para"];
  1011. if(isset($_GET["begin"])){
  1012. echo "&begin=".$_GET["begin"];
  1013. }
  1014. if(isset($_GET["end"])){
  1015. echo "&end=".$_GET["end"];
  1016. }
  1017. if(isset($_GET["display"])){
  1018. echo "&display=".$_GET["display"];
  1019. }
  1020. echo "&channal=".$value["channal"]."' >";
  1021. if($channalInfo){
  1022. echo $user["nickname"];
  1023. echo '/'.$channalInfo["name"];
  1024. }
  1025. echo "</a>";
  1026. echo "</div>";
  1027. echo "<div>";
  1028. echo "@".$user["username"];
  1029. echo "</div>";
  1030. echo "</div>";
  1031. echo "</div>";
  1032. }
  1033. ?>
  1034. </div>
  1035. </div>
  1036. </div>
  1037. <!-- 全屏 黑色背景 -->
  1038. <div id="BV" class="blackscreen" onclick="setNaviVisibility()"></div>
  1039. <!-- nav begin-->
  1040. <div id="leftmenuinner" class="viewswitch_off">
  1041. <div class="win_caption">
  1042. <div><button id="left_menu_hide" onclick="setNaviVisibility()">返回</button></div>
  1043. <div id="menubartoolbar_New">
  1044. <ul class="common-tab">
  1045. <li id="content_menu_li" class="common-tab_li_act" onclick="menuSelected_2(menu_toc,'content_menu_li')">目录</li>
  1046. <li id="palicanon_menu_li" class="common-tab_li" onclick="menuSelected_2(menu_pali_cannon,'palicanon_menu_li')">批注</li>
  1047. <li id="bookmark_menu_li" class="common-tab_li" onclick="menuSelected_2(menu_bookmark,'bookmark_menu_li')">书签</li>
  1048. </ul>
  1049. </div>
  1050. </div>
  1051. <div class='toc' id='leftmenuinnerinner' style="font-family: 'Noto Serif';">
  1052. <!-- toc begin -->
  1053. <div class="menu" id="menu_toc">
  1054. <a name="_Content" ></a>
  1055. <div id="toc_content"><?php echo $tocHtml; ?></div>
  1056. </div>
  1057. <!-- toc end -->
  1058. <!-- comments begin -->
  1059. <div class="menu" id="menu_comments">
  1060. <div id="navi_comments_inner"></div>
  1061. </div>
  1062. <!-- comments end -->
  1063. <!-- book mark begin -->
  1064. <div class="menu" id="menu_bookmark" style="display:none;">
  1065. <div>
  1066. <input id="B_Bookmark_All" onclick="setBookmarkVisibility('all')" type="checkbox" style="width: 20px; height: 20px" />
  1067. <input id="B_Bookmark_A" onclick="setBookmarkVisibility('bma','B_Bookmark_A')" type="checkbox" style="width: 20px; height: 20px" /><span class="bookmarkcolora , bookmarkcolorblock" >a</span>
  1068. <input id="B_Bookmark_X" onclick="setBookmarkVisibility('bmx','B_Bookmark_X')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolorx , bookmarkcolorblock" >?</span>
  1069. <input id="B_Bookmark_1" onclick="setBookmarkVisibility('bm1','B_Bookmark_1')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor1 , bookmarkcolorblock" >1</span>
  1070. <input id="B_Bookmark_2" onclick="setBookmarkVisibility('bm2','B_Bookmark_2')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor2 , bookmarkcolorblock" >2</span>
  1071. <input id="B_Bookmark_3" onclick="setBookmarkVisibility('bm3','B_Bookmark_3')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor3 , bookmarkcolorblock" >3</span>
  1072. <input id="B_Bookmark_4" onclick="setBookmarkVisibility('bm4','B_Bookmark_4')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor4 , bookmarkcolorblock" >4</span>
  1073. <input id="B_Bookmark_5" onclick="setBookmarkVisibility('bm5','B_Bookmark_5')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor5 , bookmarkcolorblock" >5</span>
  1074. <input id="B_Bookmark_0" onclick="setBookmarkVisibility('bm0','B_Bookmark_0')" type="checkbox" style="width: 20px; height: 20px" checked /><span class="bookmarkcolor0 , bookmarkcolorblock" >0</span>
  1075. </div>
  1076. <div id="navi_bookmark_inner"></div>
  1077. </div>
  1078. <!-- book mark end -->
  1079. </div>
  1080. </div>
  1081. <!-- nav end -->
  1082. </div>
  1083. <div id="mean_menu" ></div>
  1084. <div id="dlg_bg" class="blackscreen" style="z-index: 30;"></div>
  1085. <style>
  1086. .dlg_modal{
  1087. width:650px;
  1088. height:auto;
  1089. max-width:100%;
  1090. margin:0 auto;
  1091. left:0;
  1092. right:0;
  1093. position: fixed;
  1094. top:30px;
  1095. background-color:white;
  1096. z-index: 40;
  1097. border-radius: 5px;
  1098. display:none;
  1099. }
  1100. #sent_modify_win_body{
  1101. height:430px;
  1102. }
  1103. #sent_modify_win_title{
  1104. border-bottom: 1px solid gray;
  1105. padding: 5px;
  1106. }
  1107. #sent_modify_win_bottom{
  1108. border-top: 1px solid gray;
  1109. padding: 5px;
  1110. }
  1111. #sent_modify_win_org{
  1112. font-size:100%;
  1113. }
  1114. #sent_modify_text{
  1115. font-size:150%;
  1116. width:100%;
  1117. height:5em;
  1118. }
  1119. #sent_modify_win_new{
  1120. padding: 0.2em 1em;
  1121. }
  1122. #sent_modify_text{
  1123. }
  1124. #sent_modify_win_pali{
  1125. padding: 10px;
  1126. max-height: 5em;
  1127. overflow-y: scroll;
  1128. }
  1129. </style>
  1130. <div id="sent_modify_win" class="dlg_modal" >
  1131. <div id="sent_modify_win_title">
  1132. <button onclick="trans_sent_cancel()">Cancel</button>
  1133. </div>
  1134. <div id="sent_modify_win_body">
  1135. <div id="sent_modify_win_pali">
  1136. </div>
  1137. <div id="sent_modify_win_org">
  1138. </div>
  1139. <div style='padding: 1em 1em 0;'>译文修改</div>
  1140. <div id="sent_modify_win_new">
  1141. <textarea id="sent_modify_text">
  1142. </textarea>
  1143. </div>
  1144. </div>
  1145. <div id="sent_modify_win_bottom">
  1146. <button onclick="trans_sent_save()">Save</button>
  1147. </div>
  1148. </div>
  1149. <script>
  1150. reader_init();
  1151. </script>
  1152. </body>
  1153. </html>