reader.php 43 KB

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