2
0

reader1.php 49 KB

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