reader.php 45 KB

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