reader.php 45 KB

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