reader.php 44 KB

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