shellzy

LJ Generator code

Jan 7th, 2018
1,233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.78 KB | None | 0 0
  1. layerinfo "type" = "layout";
  2. layerinfo "name" = "";
  3.  
  4. # -*-s2-*-
  5. layerinfo type = "layout";
  6. layerinfo name = "Generator";
  7. layerinfo redist_uniq = "generator/layout";
  8. layerinfo previews = "generator/generator.jpg";
  9. layerinfo des = "Centered boxes, perfectly aligned.";
  10.  
  11. propgroup presentation {
  12. property int box_width {
  13. des = "Content area width in pixels";
  14. }
  15.  
  16. property string box_alignment {
  17. des = "Alignment of the content area";
  18. values = "left|Left|center|Center|right|Right";
  19. }
  20.  
  21. property string box_margin {
  22. des = "Margin size on either the left or right side of the content area";
  23. note = "A left alignment means this value will change the left margin. A right alignment means this value will change the right margin. A center alignment means this value will have no effect. Don't forget to include units; e.g. px, %";
  24. }
  25.  
  26. property string box_top_margin {
  27. des = "Margin size on the top of the content area";
  28. note = "You can use this to shift your journal contents down in order to display a background image at the top of your journal. Don't forget to include units; e.g. px, %";
  29. }
  30.  
  31. property string entryborder_size {
  32. des = "Size of borders around all boxes";
  33. note = "Don't forget to include the units, e.g. px";
  34. }
  35.  
  36. property string entryborder_style {
  37. des = "Style of borders around all boxes";
  38. values = "solid|Solid|dashed|Dashed|dotted|Dotted|double|Double|hidden|Invisible";
  39. }
  40.  
  41. property bool show_header {
  42. des = "Show the top box's header bar";
  43. }
  44.  
  45. property bool show_header_title {
  46. des = "Show the title in the top box's header bar";
  47. note = "The header bar must be enabled in order for this to have an effect.";
  48. }
  49.  
  50. property bool show_header_links {
  51. des = "Show the navigation links in the top box's header bar";
  52. note = "The header bar must be enabled in order for this to have an effect.";
  53. }
  54.  
  55. property bool transparent {
  56. des = "Make journal content transparent instead of using given background colors";
  57. }
  58.  
  59. property use page_recent_items;
  60. property use page_friends_items;
  61. property use view_entry_disabled;
  62. property use use_shared_pic;
  63. property use comment_userpic_style;
  64. property bool show_entrynav_icons {
  65. des = "Toggle to show the next, memory, edit, etc icons on the entry view page";
  66. }
  67. property use external_stylesheet;
  68. property use linklist_support;
  69. property string counter_code {
  70. des = "If you have an external web counter, you can enter the HTML for it here";
  71. note = "Your counter will appear in between the title and navigation links in the box at the top of your journal.";
  72. maxlength = 2000;
  73. string_mode = "html-oneline";
  74. }
  75. property use custom_control_strip_colors;
  76. }
  77. propgroup colors {
  78. property Color entry_back {
  79. des = "Entry background";
  80. s1color = "page_back";
  81. }
  82. property Color entry_text {
  83. des = "Entry text color";
  84. s1color = "page_text";
  85. }
  86. property Color border_color {
  87. des = "Color of borders around all boxes";
  88. note = "If you don't set a border size and style in the \"Presentation\" section, this won't have any effect.";
  89. }
  90. property Color page_link {
  91. des = "Link color";
  92. s1color = "page_link";
  93. }
  94. property Color page_vlink {
  95. des = "Visited link color";
  96. s1color = "page_vlink";
  97. }
  98. property Color page_alink {
  99. des = "Active link color";
  100. s1color = "page_alink";
  101. }
  102. property Color page_back {
  103. des = "Page background color (and around userpics)";
  104. s1color = "strong_back";
  105. }
  106. property Color stronger_back {
  107. des = "Background color for the bar above entries";
  108. s1color = "strong_back";
  109. }
  110. property Color stronger_text {
  111. des = "Text color for the bar above entries";
  112. s1color = "stronger_text";
  113. }
  114. property Color weak_back {
  115. des = "Background color for the bar below entries";
  116. s1color = "weak_back";
  117. }
  118. property Color weak_text {
  119. des = "Text color for the bar below entries";
  120. s1color = "weak_text";
  121. }
  122. property Color comment_bar_one_bgcolor {
  123. des = "Alternating background color for comment bars (one)";
  124. }
  125. property Color comment_bar_two_fgcolor {
  126. des = "Text color on alternating comment bars (one)";
  127. }
  128. property Color comment_bar_two_bgcolor {
  129. des = "Alternating background color for comment bars (two)";
  130. }
  131. property Color comment_bar_one_fgcolor {
  132. des = "Text color on alternating comment bars (two)";
  133. }
  134. property Color comment_bar_screened_bgcolor {
  135. des = "Background bar color for screened comments";
  136. }
  137. property Color comment_bar_screened_fgcolor {
  138. des = "Text color on background bar for screened comments";
  139. }
  140. property use control_strip_bgcolor;
  141. property use control_strip_fgcolor;
  142. property use control_strip_bordercolor;
  143. property use control_strip_linkcolor;
  144. }
  145. propgroup fonts {
  146. property use font_base;
  147. property use font_fallback;
  148. }
  149. propgroup images {
  150. property string page_background_image {
  151. des = "Background image URL";
  152. }
  153. property string page_background_repeat {
  154. des = "Background image repeat";
  155. values = "repeat|Repeat|no-repeat|Don't repeat|repeat-x|Repeat across only|repeat-y|Repeat down only";
  156. }
  157. property string page_background_position {
  158. des = "Background image position";
  159. note = "Does not apply if Background Image Repeat is set to 'Repeat'.";
  160. values = "top|Top|top left|Top-left|top right|Top-right|center|Center|center left|Center-left|center right|Center-right|bottom|Bottom|bottom left|Bottom-left|bottom right|Bottom-right|left|Left|right|Right";
  161. }
  162. property string page_background_scrolling {
  163. des = "Background image scrolling";
  164. note = "Not supported in all browsers, but allows for the background image to be in a fixed position when scrolling.";
  165. values = "scroll|Scroll|fixed|Fixed";
  166. }
  167. property string img_btwn_comments {
  168. des = "URL to an image to be used between your comment links";
  169. note = "If you specify an image to use, it will replace any text between the comment links.";
  170. }
  171. }
  172. propgroup text {
  173. property string text_journal_title {
  174. des = "The title of your journal, which appears in the box at the top of your journal above the navigation links";
  175. note = "If set to '[[name]]', the title will be replaced with the name you specified at the Edit Profile page.";
  176. }
  177. property string text_website {
  178. des = "The label for the 'website' link under the title in the box at the top of your journal";
  179. note = "Make this box empty if you don't want to show this link.";
  180. }
  181. property string text_userinfo_label {
  182. des = "The label for the 'userinfo' link under the title in the box at the top of your journal";
  183. note = "Make this box empty if you don't want to show this link.";
  184. }
  185. property string text_userinfo_value {
  186. des = "The value of the 'userinfo' link";
  187. }
  188. property string text_archive_label {
  189. des = "The label for the 'archive' link under the title in the box at the top of your journal";
  190. note = "Make this box empty if you don't want to show this link.";
  191. }
  192. property string text_archive_value {
  193. des = "The value of the 'archive' link";
  194. }
  195. property string text_other1_label {
  196. des = "The label for a custom link in the box at the top of your journal";
  197. note = "Make this box empty if you don't want to show this link.";
  198. }
  199. property string text_other1_value {
  200. des = "The value of the custom link";
  201. }
  202. property string text_other1_url {
  203. des = "The URL of the custom link";
  204. }
  205. property string text_other2_label {
  206. des = "The label for a second custom link in the box at the top of your journal";
  207. note = "Make this box empty if you don't want to show this link.";
  208. }
  209. property string text_other2_value {
  210. des = "The value of the second custom link";
  211. }
  212. property string text_other2_url {
  213. des = "The URL of the custom link";
  214. }
  215. property string text_other3_label {
  216. des = "The label for a third custom link in the box at the top of your journal";
  217. note = "Make this box empty if you don't want to show this link.";
  218. }
  219. property string text_other3_value {
  220. des = "The value of the third custom link";
  221. }
  222. property string text_other3_url {
  223. des = "The URL of the custom link";
  224. }
  225. property string text_navlinks_left {
  226. des = "Text to go in front of each navigation link in the box at the top of your journal";
  227. }
  228. property string text_navlinks_btwn {
  229. des = "Text to go in between the label and value of each navigation link in the box at the top of your journal";
  230. }
  231. property string text_navlinks_right {
  232. des = "Text to go at the end of each navigation link in the box at the top of your journal";
  233. }
  234. property use text_post_comment;
  235. property use text_read_comments;
  236. property use text_post_comment_friends;
  237. property use text_read_comments_friends;
  238. property use text_meta_music;
  239. property use text_meta_mood;
  240. property use text_meta_location;
  241. property use text_meta_groups;
  242.  
  243. property string text_left_comments {
  244. des = "Text to be used in front of your comment links";
  245. }
  246. property string text_btwn_comments {
  247. des = "Text to be used between your comment links";
  248. note = "If you specified an image to be used between your comments links in the \"Images\" section, then this option will not have any effect.";
  249. }
  250. property string text_right_comments {
  251. des = "Text to be used at the end of your comment links";
  252. }
  253. property string date_format {
  254. des = "Date format for entries";
  255. }
  256. property string time_format {
  257. des = "Time format for entries";
  258. }
  259. property string btwn_datetime {
  260. des = "Text to be used between the date and time for entries";
  261. }
  262. property string datetime_comments_format {
  263. des = "Date and time format for comments";
  264. }
  265. property string date_daypage_format {
  266. des = "Date format for the day page";
  267. }
  268. }
  269. propgroup customcss {
  270. property use include_default_stylesheet;
  271. property use linked_stylesheet;
  272. property use custom_css;
  273. }
  274.  
  275. # Set default colors
  276. set entry_back = "#ffffff";
  277. set entry_text = "#000000";
  278. set border_color = "#000000";
  279. set page_link = "#0000ff";
  280. set page_vlink = "#0000ff";
  281. set page_alink = "#00ffff";
  282. set page_back = "#2d4f89";
  283. set stronger_back = "#000000";
  284. set stronger_text = "#ffffff";
  285. set weak_back = "#aaaaaa";
  286. set weak_text = "#000000";
  287. set comment_bar_one_bgcolor = "#aaaaaa";
  288. set comment_bar_one_fgcolor = "#000000";
  289. set comment_bar_two_bgcolor = "#dddddd";
  290. set comment_bar_two_fgcolor = "#000000";
  291. set comment_bar_screened_bgcolor = "#5f6f99";
  292. set comment_bar_screened_fgcolor = "#000000";
  293.  
  294. set box_width = 600;
  295. set box_alignment = "center";
  296. set box_margin = "0";
  297. set box_top_margin = "0";
  298. set entryborder_size = "";
  299. set entryborder_style = "hidden";
  300. set show_header = true;
  301. set show_header_title = true;
  302. set show_header_links = true;
  303. set transparent = false;
  304. set counter_code = "";
  305.  
  306. set show_entrynav_icons = true;
  307. set page_background_image = "";
  308. set img_btwn_comments = "";
  309.  
  310. set font_base = "Verdana";
  311. set font_fallback = "sans-serif";
  312.  
  313. set text_journal_title = "[[name]]";
  314. set text_website = "website";
  315. set text_userinfo_label = "userinfo";
  316. set text_userinfo_value = "livejournal userinfo";
  317. set text_archive_label = "archive";
  318. set text_archive_value = "journal archive";
  319. set text_other1_label = "";
  320. set text_other1_value = "";
  321. set text_other1_url = "";
  322. set text_other2_label = "";
  323. set text_other2_value = "";
  324. set text_other2_url = "";
  325. set text_other3_label = "";
  326. set text_other3_value = "";
  327. set text_other3_url = "";
  328. set text_navlinks_left = "[";
  329. set text_navlinks_btwn = "|";
  330. set text_navlinks_right = "]";
  331.  
  332. # Customize the view names to be short and lowercase
  333. # (Sorry translators, you will have to do these again - keep them short!)
  334. set text_view_recent = "entries";
  335. set text_view_friends = "friends";
  336. set text_view_archive = "archive";
  337. set text_view_userinfo = "userinfo";
  338.  
  339. set text_left_comments = "";
  340. set text_btwn_comments = "|";
  341. set text_right_comments = "";
  342. set date_format = "%%mon%%. %%dayord%%, %%yyyy%%";
  343. set time_format = "%%hh%%:%%min%% %%a%%m";
  344. set btwn_datetime = "|";
  345. set datetime_comments_format = "%%yyyy%%-%%mm%%-%%dd%% %%hh%%:%%min%% %%a%%m";
  346. set date_daypage_format = "%%month%% %%dayord%%, %%yyyy%%";
  347.  
  348. set tags_aware = true;
  349.  
  350. function prop_init () {
  351. if ($*control_strip_bgcolor.as_string == "") {
  352. $*control_strip_bgcolor = $*entry_back;
  353. }
  354. if ($*control_strip_fgcolor.as_string == "") {
  355. $*control_strip_fgcolor = $*entry_text;
  356. }
  357. if ($*control_strip_bordercolor.as_string == "") {
  358. $*control_strip_bordercolor = $*border_color;
  359. }
  360. if ($*control_strip_linkcolor.as_string == "") {
  361. $*control_strip_linkcolor = $*page_link;
  362. }
  363.  
  364. $*theme_bgcolor = $*entry_back;
  365. $*theme_fgcolor = $*entry_text;
  366. $*theme_bordercolor = $*stronger_back;
  367. $*theme_linkcolor = $*page_link;
  368. }
  369.  
  370. function print_stylesheet () {
  371. if(clean_url($*page_background_image) != "" and viewer_sees_control_strip() and $*page_background_scrolling=="scroll") {
  372. var string page_background_position_display = $*page_background_position;
  373. if ($*page_background_position == "top") {
  374. $page_background_position_display = "center 45px";
  375. }
  376. elseif ($*page_background_position == "top left") {
  377. $page_background_position_display = "0 45px";
  378. }
  379. elseif ($*page_background_position == "top right") {
  380. $page_background_position_display = "100% 45px";
  381. }
  382.  
  383. """body {
  384. background-image: url("$*page_background_image");
  385. background-position: $page_background_position_display;
  386. background-repeat: $*page_background_repeat;
  387. background-attachment: $*page_background_scrolling;
  388. }""";
  389. }
  390. elseif(clean_url($*page_background_image) != "" ) {
  391. """body {
  392. background-image: url("$*page_background_image");
  393. background-position: $*page_background_position;
  394. background-repeat: $*page_background_repeat;
  395. background-attachment: $*page_background_scrolling;
  396. }""";
  397. }
  398.  
  399. """body, td {
  400. """;
  401. if ($*font_base != "" or $*font_fallback != "none") {
  402. "font-family: ";
  403. if ($*font_base != "") {
  404. "\"$*font_base\"";
  405. if ($*font_fallback != "none") {
  406. ", ";
  407. }
  408. }
  409. if ($*font_fallback != "none") {
  410. print $*font_fallback;
  411. }
  412. ";\n";
  413. }
  414. """font-size: 10pt;
  415. }
  416. a {
  417. text-decoration: none;
  418. }
  419. a:hover {
  420. text-decoration: underline;
  421. }
  422. .shadowed {
  423. font-size: 8pt;
  424. background: $*weak_back;
  425. }
  426. .meta {
  427. font-size: 8pt;
  428. }
  429. .index {
  430. font-size: 8pt;
  431. }
  432. .caption, .index {
  433. color: $*stronger_text;
  434. }
  435.  
  436. .caption A, .caption A:hover, .caption A:visited {
  437. color: $*stronger_text;
  438. text-decoration: none;
  439. }
  440. .comments {
  441. font-size: 8pt;
  442. }
  443. .quickreply {
  444. margin-top: 1em;
  445. width:100%;
  446. }
  447. .box, .entrybox {
  448. border: $*entryborder_size $*entryborder_style $*border_color;
  449. }""";
  450. if (not $*show_header) {
  451. """
  452. #topbox tr.caption {
  453. display: none;
  454. }""";
  455. } else {
  456. if (not $*show_header_title) {
  457. """
  458. #topbox table tr.caption td.caption {
  459. visibility: hidden;
  460. }""";
  461. }
  462. if (not $*show_header_links) {
  463. """
  464. #topbox table tr.caption td.index {
  465. visibility: hidden;
  466. }""";
  467. }
  468. }
  469.  
  470. if ($*transparent) {
  471. """
  472. tr, td, .shadowed {
  473. background: transparent;
  474. }
  475. """;
  476. }
  477.  
  478. print_custom_control_strip_css();
  479. }
  480.  
  481. function Page::lay_top_userpic () {
  482. var Image up_img = $.journal.default_pic;
  483. if (defined $up_img) {
  484. """<td><table cellpadding="2" bgcolor="$*entry_back" cellspacing="0" border="0" summary="">
  485. <tr><td bgcolor="$*stronger_back" align="center"><img border="0" src="$up_img.url" height="$up_img.height" width="$up_img.width" alt=""></td></tr>
  486. </table></td>
  487. """;
  488. }
  489. }
  490. function FriendsPage::lay_top_userpic () { }
  491.  
  492. function Page::print_linklist() {
  493. if (size $.linklist <= 0) {
  494. return;
  495. }
  496.  
  497. println """
  498. <p>
  499. <table width='$*box_width' cellpadding='2' cellspacing='0'
  500. border='0'
  501. summary='' class='box'>
  502. <tr><td bgcolor='$*stronger_back' align='center'>
  503. <table width='100%' cellpadding='3' cellspacing='0'
  504. border='0'
  505. summary=''>
  506. <tr class='caption'>
  507. <td class='caption' align='left'><b>Links</b></td>
  508. </tr></table>
  509. <table width='100%' cellpadding='3' cellspacing='0'
  510. border='0'
  511. summary=''>
  512. <tr class='shadowed'>
  513. <td align='center'>
  514. <table cellspacing='5'
  515. cellpadding='0'
  516. border='0'
  517. summary=''>
  518. """;
  519. var bool section_open = false;
  520. if (not $.linklist[0].is_heading) {
  521. println """<tr><td class="meta">[</td><td class="meta" align="right"><b>Links:</b></td><td class="meta" align="center">|</td><td class="meta">""";
  522. $section_open = true;
  523. }
  524. foreach var UserLink l ($.linklist) {
  525. if ($l.title) {
  526. if ($l.is_heading) {
  527. if ($section_open) {
  528. println """</td><td class="meta">]</td></tr>""";
  529. }
  530. println """<tr><td class="meta">[</td><td class="meta" align="right"><b>$l.title</b></td><td class="meta" align="center">|</td><td class="meta">""";
  531. $section_open = true;
  532. } else {
  533. println """<a href="$l.url">$l.title</a> """;
  534. }
  535. }
  536. }
  537. println """</td><td class="meta">]</td></tr>""";
  538.  
  539. "</table>
  540. </td>
  541. </tr>
  542. </table>
  543. </td>
  544. </tr></table>
  545. </p>
  546. ";
  547. }
  548.  
  549. function Page::print ()
  550. {
  551. var string title = $this->title();
  552.  
  553. var string margin = "";
  554. var string margin_top = ""; # Only used if vbox is on
  555.  
  556. if ($*box_alignment == "left" and $*box_margin != "0") {
  557. $margin = "margin-left: $*box_margin;";
  558. } elseif ($*box_alignment == "right" and $*box_margin != "0") {
  559. $margin = "margin-right: $*box_margin;";
  560. }
  561. if ($*box_top_margin != "0") {
  562. if (viewer_sees_vbox()) {
  563. $margin_top = """<table width="100%" height="100%" style="margin-top: $*box_top_margin;">""";
  564. } else {
  565. $margin = $margin + "margin-top: $*box_top_margin;";
  566. }
  567. }
  568. if ($margin != "") {
  569. $margin = "<div align=\"$*box_alignment\" style=\"" + $margin + "\">";
  570. }
  571.  
  572. var string links;
  573. var bool firstlink = true;
  574. foreach var string v ($.views_order) {
  575. if ($firstlink == false) {
  576. $links = "$links|";
  577. }
  578. else {
  579. $firstlink = false;
  580. }
  581. $links = $links + ($.view == $v ?
  582. "<b>"+lang_viewname($v)+"</b>" :
  583. "<a class='index' href='$.view_url{$v}'>"+lang_viewname($v)+"</a>");
  584. }
  585.  
  586. """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n<html>\n
  587. <head>\n<meta http-equiv="X-UA-Compatible" content="IE=7"/>\n""";
  588.  
  589. $this->print_head();
  590. $this->print_stylesheets();
  591.  
  592. print safe """<title>$title</title>
  593. </head>
  594. <body bgcolor="$*page_back" text="$*entry_text" link="$*page_link" vlink="$*page_vlink" alink="$*page_alink">
  595. """;
  596. $this->print_control_strip();
  597. if (viewer_sees_vbox()) {
  598. if ($margin_top == "") {
  599. """<table width="100%" height="100%">""";
  600. } else {
  601. print safe $margin_top;
  602. }
  603. """<tr><td valign="top">""";
  604. }
  605. if ($margin == "") {
  606. """<div align="$*box_alignment">""";
  607. } else {
  608. print safe $margin;
  609. }
  610. if (viewer_sees_hbox_top()) {
  611. """
  612. <table cellpadding="2" cellspacing="0" border="0" summary="" style="margin-bottom: 10px;" class="box">
  613. <tr><td bgcolor="$*stronger_back" align="center">
  614. <table width="100%" cellpadding="3" cellspacing="0"
  615. border="0"
  616. summary="">
  617. <tr>
  618. <td class="shadowed" align="center">
  619. <table cellspacing="5"
  620. cellpadding="0"
  621. border="0"
  622. summary="" style="margin-left: auto; margin-right: auto;">
  623. <tr><td><div align="center">
  624. """;
  625. $this->print_hbox_top();
  626. """
  627. </div></td></tr></table>
  628. </td></tr></table>
  629. </td></tr></table>
  630. """;
  631. }
  632. """
  633. <table width="$*box_width" cellpadding="2" cellspacing="0"
  634. border="0"
  635. summary="" class="box" id="topbox">
  636. <tr><td bgcolor="$*stronger_back" align="center">
  637. <table width="100%" cellpadding="3" cellspacing="0"
  638. border="0"
  639. summary="">
  640. <tr class="caption">""";
  641. print safe """<td class="caption" align="left"><b>$title</b></td>""";
  642. """
  643. <td class="index" align="right">[$links]</td>
  644. </tr></table>
  645. <table width="100%" cellpadding="3" cellspacing="0"
  646. border="0"
  647. summary="">
  648. <tr>
  649. <td class="shadowed" align="center">
  650. <table cellspacing="5"
  651. cellpadding="0"
  652. border="0"
  653. summary="" style="margin-left: auto; margin-right: auto;">
  654. <tr>""";
  655. $this->lay_top_userpic();
  656.  
  657. var string sitename_lc = $*SITENAMESHORT->lower();
  658.  
  659. """<td>
  660. <div align="center"><b>""";
  661. if ($*text_journal_title == "[[name]]") {
  662. print safe "$.journal.name";
  663. } else {
  664. print safe "$*text_journal_title";
  665. }
  666. """</b>""";
  667. if ($*counter_code != "") {
  668. """<p>$*counter_code</p>""";
  669. }
  670. """</div><p>
  671. <table cellspacing="0"
  672. cellpadding="0"
  673. border="0"
  674. summary="">""";
  675.  
  676. # Print navigation links
  677.  
  678. var string label = "";
  679. var string url = "";
  680. var string value = "";
  681. var string website_value = $.journal.website_name ? $.journal.website_name : $*text_website_default_name;
  682. var string userinfo_value = ($*text_userinfo_value == "livejournal userinfo") ? "$sitename_lc userinfo" : "$*text_userinfo_value";
  683.  
  684. var string[] labels = [$*text_website, $*text_userinfo_label, $*text_archive_label, $*text_other1_label, $*text_other2_label, $*text_other3_label];
  685. var string[] urls = [$.journal.website_url, $.view_url{"userinfo"}, $.view_url{"archive"}, $*text_other1_url, $*text_other2_url, $*text_other3_url];
  686. var string[] values = [$website_value, $userinfo_value, $*text_archive_value, $*text_other1_value, $*text_other2_value, $*text_other3_value];
  687.  
  688. foreach var int i (0 .. ((size $labels) - 1)) {
  689. $label = $labels[$i];
  690. $url = $urls[$i];
  691. $value = $values[$i];
  692.  
  693. if ($label != "" and $url != "") {
  694. print safe """
  695. <tr>
  696. <td class="meta">$*text_navlinks_left</td>
  697. <td class="meta" align="right"><b>$label</b></td>
  698. <td class="meta" align="center">$*text_navlinks_btwn</td>
  699. <td class="meta" align="left"><a href="$url">$value</a></td>
  700. <td class="meta">$*text_navlinks_right</td>
  701. </tr>
  702.  
  703. """;
  704. }
  705. }
  706.  
  707. """
  708. </table>
  709. </td>
  710. </tr>
  711. </table>
  712. </td>
  713. </tr></table>
  714. </td></tr>
  715. </table>
  716.  
  717. """;
  718. if (size $.linklist > 0 and $*linklist_support) {
  719. $this->print_linklist();
  720. }
  721. """
  722.  
  723. <p>
  724. """;
  725. $this->print_body();
  726.  
  727. if (viewer_sees_hbox_bottom()) {
  728. """
  729. <table cellpadding="2" cellspacing="0" border="0" summary="" style="margin-top: 10px;" class="box">
  730. <tr><td bgcolor="$*stronger_back" align="center">
  731. <table width="100%" cellpadding="3" cellspacing="0"
  732. border="0"
  733. summary="">
  734. <tr>
  735. <td class="shadowed" align="center">
  736. <table cellspacing="5"
  737. cellpadding="0"
  738. border="0"
  739. summary="" style="margin-left: auto; margin-right: auto;">
  740. <tr><td><div align="center">
  741. """;
  742. $this->print_hbox_bottom();
  743. """
  744. </div></td></tr></table>
  745. </td></tr></table>
  746. </td></tr></table>
  747. """;
  748. }
  749. """
  750. </div>
  751. """;
  752. if (viewer_sees_vbox()) {
  753. """
  754. </td>
  755. <td valign="top" align="right" width="20%">
  756. <table cellpadding="2" cellspacing="0" border="0" summary="" class="box">
  757. <tr><td bgcolor="$*stronger_back" align="center">
  758. <table width="100%" cellpadding="3" cellspacing="0"
  759. border="0"
  760. summary="">
  761. <tr>
  762. <td class="shadowed" align="center">
  763. <table cellspacing="5"
  764. cellpadding="0"
  765. border="0"
  766. summary="" style="margin-left: auto; margin-right: auto;">
  767. <tr><td><div align="center">
  768. """;
  769. $this->print_vbox();
  770. """
  771. </div></td></tr></table>
  772. </td></tr></table>
  773. </td></tr></table>
  774. </td></tr></table>
  775. """;
  776. }
  777. """
  778. <p>
  779. </body>
  780. </html>
  781. """;
  782. }
  783.  
  784. function print_entry (Page p, Entry e, Color bgcolor, Color fgcolor, bool hide_text)
  785. {
  786. var string datetime;
  787. $datetime = $e.time->date_format($*date_format)+"$*btwn_datetime<b>"
  788. + $e.time->time_format($*time_format) + "</b>";
  789.  
  790. """
  791. <table width="$*box_width" cellpadding="2" cellspacing="0" border="0" summary="" class="entrybox">
  792. <tr align='left'>
  793. <td bgcolor="$*stronger_back" align="center">
  794. <table width="100%" cellpadding="5" cellspacing="0" border="0" summary="">
  795. <tr align='left'>
  796. <td class="caption">""";
  797.  
  798. if ($e.security != "") {
  799. $e.security_icon->print();
  800. }
  801.  
  802. if ($p.view != "entry") {
  803. print $e->formatted_subject({"class"=>"subj-link"});
  804. } else { print safe "$e.subject"; }
  805. """</td>
  806. <td align="right" class="index">[$datetime]</td>
  807. </tr>
  808. <tr align='left'>
  809. <td colspan="2" bgcolor="$*entry_back">
  810. """;
  811.  
  812. if ($p.view == "entry" and $*show_entrynav_icons)
  813. {
  814. print "<div style='text-align: center'>";
  815. $e->print_linkbar();
  816. print "</div>";
  817. }
  818.  
  819. if ($p.view == "friends" or
  820. $p.journal_type == "C" or
  821. $e.poster.username != $e.journal.username)
  822. {
  823. var UserLite linkto;
  824. var bool showposter;
  825. if ($p.view == "recent" and $p.journal_type == "C") {
  826. $linkto = $e.poster;
  827. $showposter = false;
  828. } else {
  829. $linkto = $e.journal;
  830. $showposter = true;
  831. }
  832.  
  833. """<table cellpadding="1" align="right" cellspacing="0" border="0" summary=""><tr align='left'><td bgcolor="$*stronger_back">""";
  834. """<table cellpadding="2" align="center" cellspacing="0" border="0" summary="">""";
  835. """<tr align='left'><td bgcolor="$bgcolor" align="center"><a class="index" href=\"""" + $linkto->base_url() + "/\">";
  836. if (defined $e.userpic) {
  837. """<img border="0" src="$e.userpic.url" width="$e.userpic.width" height="$e.userpic.height" alt=""><br>""";
  838. }
  839.  
  840. "<font color=\"$fgcolor\">$linkto.username</font></a>";
  841. if ($e.poster.username != $e.journal.username and $showposter) {
  842. "<br>[<a class=\"index\" href=\"" +
  843. $e.poster->base_url() + "/\"><font color=\"$fgcolor\">$e.poster.username</font></a>]";
  844. }
  845. "</td></tr></table></td></tr></table>";
  846. }
  847.  
  848. var string metadata;
  849. if ($e.metadata) {
  850. foreach var string k ($e.metadata) {
  851. var string text = $k;
  852. var string val = $e.metadata{$k};
  853. if ($k == "mood") {
  854. $text = $*text_meta_mood;
  855. } elseif ($k == "music") {
  856. $text = $*text_meta_music;
  857. } elseif ($k == "location") {
  858. $text = $*text_meta_location;
  859. } elseif ($k == "groups") {
  860. $text = $*text_meta_groups;
  861. }
  862. if ($k == "mood" and defined $e.mood_icon) {
  863. var Image i = $e.mood_icon;
  864. $val = "<img src='$i.url' width='$i.width' height='$i.height' align='absmiddle'> $val";
  865. }
  866. $metadata = """$metadata\n<tr><td class="meta">[</td><td class="meta" align="right"><b>$text</b></td>
  867. <td class="meta" align="center">|</td><td class="meta">$val</td><td class="meta">]</td></tr>""";
  868. }
  869. }
  870.  
  871. var string tags;
  872. if ($e.tags) {
  873. var int tcount = 0;
  874. $tags = """<tr><td class="meta">[</td><td class="meta" align="right"><b>Tags</b></td>""";
  875. $tags = """$tags<td class="meta" align="center">|</td><td class="meta">""";
  876. foreach var Tag t ($e.tags) {
  877. $tags = """$tags<a rel="tag" href="$t.url">$t.name</a>""";
  878. $tcount++;
  879. if ($tcount != size $e.tags) { $tags = """$tags, """; }
  880. }
  881. $tags = """$tags</td><td class="meta">]</td></tr>""";
  882. }
  883.  
  884. if (not $hide_text) {
  885. if ($tags or $metadata) {
  886. print """<table cellspacing="0" cellpadding="0" border="0" summary="">""";
  887. print $tags;
  888. print safe $metadata;
  889. print "</table>";
  890. print "<br />";
  891. }
  892. $e->print_text();
  893. }
  894. $p->print_reply_container({"target" => "topcomment", "class" => "quickreply"});
  895.  
  896. """</td></tr>
  897. <tr bgcolor="$*weak_back"><td align='left' class='comments' valign='top'>
  898. <a href="$e.permalink_url">$*text_permalink</a></td>""";
  899. if ($p.view != "entry" and $p.view != "reply") {
  900. "<td align='right' class='comments'>"; $e.comments->print();
  901. } elseif ($e.comments.enabled) {
  902. "<td align='right' class='comments'>"; $p->print_reply_link({"linktext" => $*text_comment_reply, "target" => "topcomment"});
  903. } else {
  904. "<td>";
  905. }
  906. "<br/>";
  907. """</td></tr></table></td></tr></table><p>""";
  908.  
  909. } # print_entry(Page,Entry,Color,Color,bool)
  910.  
  911. function Page::print_entry (Entry e) {
  912. print_entry($this, $e, null Color, null Color, false);
  913. }
  914.  
  915. function FriendsPage::print_entry (Entry e) {
  916. var Friend f = $.friends{$e.journal.username};
  917. print_entry($this, $e, $f.bgcolor, $f.fgcolor, false);
  918. }
  919.  
  920. function print_ebox (Entry e)
  921. {
  922. if ($e->viewer_sees_ebox()) {
  923. """
  924. <table cellpadding="2" cellspacing="0" border="0" summary="" class="box" width=$*box_width>
  925. <tr><td bgcolor="$*stronger_back" align="center">
  926. <table width="100%" cellpadding="3" cellspacing="0"
  927. border="0"
  928. summary="">
  929. <tr>
  930. <td class="shadowed" align="center">
  931. <table cellspacing="5"
  932. cellpadding="0"
  933. border="0"
  934. summary="" style="margin-left: auto; margin-right: auto;">
  935. <tr><td><div align="center">
  936. """;
  937. $e->print_ebox();
  938. """
  939. </div></td></tr></table>
  940. </td></tr></table>
  941. </td></tr></table><p>
  942. """;
  943. }
  944. }
  945.  
  946. function RecentPage::print_body ()
  947. {
  948. foreach var Entry e ($.entries) {
  949. $this->print_entry($e);
  950. print_ebox($e);
  951. }
  952.  
  953. var string range = "most recent entries";
  954. if ($.nav.skip > 0) {
  955. $range = "$.nav.skip entries back";
  956. }
  957.  
  958. """
  959. <table cellpadding="2" cellspacing="0"
  960. border="0"
  961. summary="" class="box">
  962. <tr><td bgcolor="$*stronger_back">
  963. <table cellpadding="3" cellspacing="0"
  964. border="0"
  965. summary="">
  966. <tr>
  967. <td align="center" class="index">navigation</td>
  968. </tr>
  969. <tr>
  970. <td bgcolor="$*entry_back" align="center">
  971. <table cellspacing="0"
  972. cellpadding="0"
  973. border="0"
  974. summary="">
  975. <tr>
  976. <td class="meta">[</td>
  977. <td class="meta" align="right"><b>viewing</b></td>
  978. <td class="meta" align="center">|</td>
  979. <td class="meta">$range</td>
  980. <td class="meta">]</td>
  981. </tr>
  982. """;
  983.  
  984. # go forward/backward if possible
  985. if ($.nav.forward_url != "" or $.nav.backward_url != "") {
  986. var string sep;
  987. var string back;
  988. var string forward;
  989. if ($.nav.backward_url != "") {
  990. $back = """<a href="$.nav.backward_url">earlier</a>""";
  991. }
  992. if ($.nav.forward_url != "") {
  993. $forward = """<a href="$.nav.forward_url">later</a>""";
  994. }
  995. if ($back != "" and $forward != "") { $sep = "/"; }
  996. """<tr>
  997. <td class="meta">[</td>
  998. <td class="meta" align="right"><b>go</b></td>
  999. <td class="meta" align="center">|</td>
  1000. <td class="meta">$back$sep$forward</td>
  1001. <td class="meta">]</td>
  1002. </tr>""";
  1003. }
  1004.  
  1005. "</table></td></tr></table></table>";
  1006. }
  1007.  
  1008. function CommentInfo::print() {
  1009. if ($.show_readlink or $.show_postlink) {
  1010. print safe "$*text_left_comments";
  1011. if ($.show_readlink) {
  1012. "<b>"; $this->print_readlink(); "</b>";
  1013. }
  1014. if ($.show_postlink and $.show_readlink) {
  1015. if (clean_url($*img_btwn_comments) != "") {
  1016. """ <img src="$*img_btwn_comments" alt="" /> """;
  1017. } else {
  1018. print safe "$*text_btwn_comments";
  1019. }
  1020. }
  1021. if ($.show_postlink) {
  1022. $this->print_postlink();
  1023. }
  1024. print safe "$*text_right_comments";
  1025. }
  1026. }
  1027.  
  1028. function YearPage::print_year_links ()
  1029. {
  1030. """<table cellpadding="2" cellspacing="0" border="0" summary="" class="box">
  1031. <tr><td bgcolor="$*stronger_back" align="center">
  1032. <table cellpadding="5" cellspacing="0" border="0" summary="">
  1033. <tr><td class="caption">Years</td></tr><tr>
  1034. <td colspan="2" bgcolor="$*entry_back">""";
  1035. foreach var YearYear y ($.years) {
  1036. if ($y.displayed) {
  1037. "<b>$y.year</b>&nbsp;";
  1038. } else {
  1039. "<a href=\"$y.url\">$y.year</a>&nbsp;";
  1040. }
  1041. }
  1042. """</td></tr></table></td></tr></table><p>""";
  1043.  
  1044. }
  1045.  
  1046. function YearPage::print_month (YearMonth m)
  1047. {
  1048. if (not $m.has_entries) { return; }
  1049. """<table cellpadding="2" cellspacing="0" border="0" summary="" class="box">
  1050. <tr><td bgcolor="$*stronger_back" align="center">
  1051. <table cellpadding="5" cellspacing="0" border="0" summary="">
  1052. <tr>
  1053. <td class="caption">""";
  1054. print $m->month_format();
  1055. """</td>
  1056. <td class="caption" align="right">[<a href="$m.url" class="index">subjects</a>]</td>
  1057. </tr>
  1058. <tr>
  1059. <td colspan="2" bgcolor="$*entry_back">
  1060. <!-- now the headings for the week -->
  1061. <table width="100%" cellpadding="5" cellspacing="0" border="0" summary="">
  1062. <tr align="center">
  1063. """;
  1064. foreach var int d (weekdays()) {
  1065. "<td>"+$*lang_dayname_short[$d]+"</td>\n";
  1066. }
  1067.  
  1068. "</tr>";
  1069.  
  1070. foreach var YearWeek w ($m.weeks) {
  1071. $w->print();
  1072. }
  1073.  
  1074. """</table></td></tr></table></td></tr></table><p>""";
  1075. }
  1076.  
  1077. function YearWeek::print () {
  1078. "<tr valign='top'>";
  1079. if ($.pre_empty) { "<td colspan='$.pre_empty'></td>"; }
  1080. foreach var YearDay d ($.days) {
  1081. """<td><div class="meta">$d.day</div>""";
  1082. if ($d.num_entries) {
  1083. """<div align="center"><a href="$d.url">$d.num_entries</a></div>""";
  1084. } else {
  1085. "&nbsp;";
  1086. }
  1087. "</td>";
  1088. }
  1089. if ($.post_empty) { "<td colspan='$.post_empty'></td>"; }
  1090. "</tr>";
  1091. }
  1092.  
  1093. function DayPage::print_body() {
  1094.  
  1095. """<table cellpadding="2" cellspacing="0" border="0" summary="" class="box">
  1096. <tr><td bgcolor="$*stronger_back" align="center">
  1097. <table cellpadding="5" cellspacing="0" border="0" summary="">
  1098. <tr><td bgcolor="$*entry_back">""";
  1099.  
  1100. if ($.has_entries) {
  1101. print $.date->date_format($*date_daypage_format);
  1102. } else {
  1103. print ehtml($*text_noentries_day);
  1104. }
  1105.  
  1106. """</td></tr></table></td></tr></table><p>""";
  1107.  
  1108. foreach var Entry e ($.entries) {
  1109. $this->print_entry($e);
  1110. if ($e->viewer_sees_ebox()) {
  1111. """
  1112. <table cellpadding="2" cellspacing="0" border="0" summary="" class="box" width=$*box_width>
  1113. <tr><td bgcolor="$*stronger_back" align="center">
  1114. <table width="100%" cellpadding="3" cellspacing="0"
  1115. border="0"
  1116. summary="">
  1117. <tr>
  1118. <td class="shadowed" align="center">
  1119. <table cellspacing="5"
  1120. cellpadding="0"
  1121. border="0"
  1122. summary="" style="margin-left: auto; margin-right: auto;">
  1123. <tr><td><div align="center">
  1124. """;
  1125. $e->print_ebox();
  1126. """
  1127. </div></td></tr></table>
  1128. </td></tr></table>
  1129. </td></tr></table><p>
  1130. """;
  1131. }
  1132. }
  1133.  
  1134. var string tprev = ehtml($*text_day_prev);
  1135. var string tnext = ehtml($*text_day_next);
  1136. var string daylong = $.date->date_format($*date_daypage_format);
  1137.  
  1138. """<table cellpadding="2" cellspacing="0" border="0" summary="" class="box">
  1139. <tr><td bgcolor="$*stronger_back">
  1140. <table cellpadding="3" cellspacing="0" border="0" summary="">
  1141. <tr>
  1142. <td align="center" class="index">navigation</td>
  1143. </tr>
  1144. <tr>
  1145. <td bgcolor="$*entry_back" align="center">
  1146. <table cellspacing="0" cellpadding="0" border="0" summary="">
  1147. <tr>
  1148. <td class="meta">[</td>
  1149. <td class="meta" align="right"><b>viewing</b></td>
  1150. <td class="meta" align="center">|</td>
  1151. <td class="meta">$daylong</td>
  1152. <td class="meta">]</td>
  1153. </tr>
  1154.  
  1155. <tr>
  1156. <td class="meta">[</td>
  1157. <td class="meta" align="right"><b>go</b></td>
  1158. <td class="meta" align="center">|</td>
  1159. <td class="meta">""";
  1160. if ($.prev_url != "") {
  1161. """<a href="$.prev_url">$tprev</a>""";
  1162. }
  1163. if ($.prev_url != "" and $.next_url != "") {
  1164. """|""";
  1165. }
  1166. if ($.next_url != "") {
  1167. """<a href="$.next_url">$tnext</a>""";
  1168. }
  1169. """</td>
  1170. <td class="meta">]</td>
  1171. </tr>
  1172. </table>
  1173. </td>
  1174. </tr>
  1175. </table>
  1176. </table>""";
  1177.  
  1178. }
  1179.  
  1180. function TagsPage::print_body () {
  1181. """<table width="$*box_width" cellpadding="2" cellspacing="0" border="0" summary="" class="entrybox">
  1182. <tr align='left'>
  1183. <td bgcolor="$*stronger_back" align="center">
  1184. <table width="100%" cellpadding="5" cellspacing="0" border="0" summary="">
  1185. <tr align='left'><td class="caption" colspan='2'>Visible Tags</td></tr>
  1186. <tr align='left'>
  1187. <td colspan="2" bgcolor="$*entry_back">
  1188. <ul class='ljtaglist'>""";
  1189.  
  1190. foreach var TagDetail td ($.tags) {
  1191. var string uses = get_plural_phrase($td.use_count, "text_tag_uses");
  1192. print """<li><a href="$td.url">$td.name</a> - $uses</li>""";
  1193. }
  1194.  
  1195. """<ul></td></tr></table>
  1196. </td></tr></table><p>""";
  1197. }
  1198.  
  1199. function MonthPage::print_body () {
  1200. """<table width="$*box_width" cellpadding="2" cellspacing="0" border="0" summary="" class="entrybox">
  1201. <tr align='left'>
  1202. <td bgcolor="$*stronger_back" align="center">
  1203. <table width="100%" cellpadding="5" cellspacing="0" border="0" summary="">
  1204. <tr align='left'>
  1205. <td class="caption" colspan='2'>""";
  1206.  
  1207. print $.date->date_format($*lang_fmt_month_long);
  1208.  
  1209. """</td></tr>
  1210. <tr align='left'>
  1211. <td colspan="2" bgcolor="$*entry_back">""";
  1212.  
  1213. #Lifted from core, looks decent:
  1214. "<form method='post' action='$.redir.url'><center>";
  1215. $.redir->print_hiddens();
  1216. if ($.prev_url != "") { "[<a href='$.prev_url'>&lt;&lt;&lt;</a>]\n"; }
  1217. if (size $.months > 1) {
  1218. "<select name='redir_key'>\n";
  1219. foreach var MonthEntryInfo mei ($.months) {
  1220. var string sel;
  1221. if ($mei.date.year == $.date.year and $mei.date.month == $.date.month) {
  1222. $sel = " selected='selected'";
  1223. }
  1224. "<option value='$mei.redir_key'$sel>" + $mei.date->date_format($*lang_fmt_month_long) + "</option>";
  1225. }
  1226. "</select>\n<input type='submit' value='View' />";
  1227. }
  1228. if ($.next_url != "") { "\n[<a href='$.next_url'>&gt;&gt;&gt;</a>]\n"; }
  1229. "</center></form>\n<dl>";
  1230. foreach var MonthDay d ($.days) {
  1231. if ($d.has_entries) {
  1232. "<dt><a href=\"$d.url\"><b>";
  1233. print lang_ordinal($d.day);
  1234. "</b></a></dt>\n<dd>";
  1235. $d->print_subjectlist();
  1236. "</dd>\n";
  1237. }
  1238. }
  1239. "</dl>\n";
  1240. """</td></tr></table>
  1241. </td></tr></table><p>""";
  1242. }
  1243.  
  1244. function EntryPage::print_body () {
  1245.  
  1246. print_entry($this, $.entry, null Color, null Color, $.viewing_thread);
  1247. print_ebox($.entry);
  1248. if ($.entry.comments.enabled and $.comment_pages.total_subitems > 0)
  1249. {
  1250. $this->print_multiform_start();
  1251. """<table width="$*box_width" cellpadding="2" cellspacing="0" border="0" summary="" class="entrybox">
  1252. <tr align='left'>
  1253. <td bgcolor="$*stronger_back" align="center">
  1254. <table width="100%" cellpadding="5" cellspacing="0" border="0" summary="">
  1255. <tr align='left'>
  1256. <td class="caption" colspan='2'>Comments:</td></tr>""";
  1257.  
  1258. """<tr align='left'><td colspan="2" bgcolor="$*entry_back"><a name='comments'></a>""";
  1259.  
  1260. $.comment_pages->print();
  1261.  
  1262. set_handler("unscreen_comment_#", [
  1263. [ "style_bgcolor", "cmtbar#", "$*comment_bar_one_bgcolor", ],
  1264. [ "style_color", "cmtbar#", "$*comment_bar_one_fgcolor", ],
  1265. ]);
  1266. set_handler("screen_comment_#", [
  1267. [ "style_bgcolor", "cmtbar#", "$*comment_bar_screened_bgcolor", ],
  1268. [ "style_color", "cmtbar#", "$*comment_bar_screened_fgcolor", ],
  1269. ]);
  1270.  
  1271. $this->print_comments($.comments);
  1272. $.comment_pages->print();
  1273. """</td></tr></table></td></tr></table><p>""";
  1274.  
  1275. if ($this.multiform_on) {
  1276. """<table width="$*box_width" cellpadding="2" cellspacing="0" border="0" summary="" class="entrybox">
  1277. <tr align='left'>
  1278. <td bgcolor="$*stronger_back" align="center">
  1279. <table width="100%" cellpadding="5" cellspacing="0" border="0" summary="">
  1280. <tr align='left'>
  1281. <td class="caption" colspan='2'>Mass Action:</td></tr>""";
  1282.  
  1283. """<tr align='left'><td colspan="2" bgcolor="$*entry_back">""";
  1284. $this->print_multiform_actionline();
  1285. """</td></tr></table></td></tr></table><p>""";
  1286. $this->print_multiform_end();
  1287. }
  1288. }
  1289.  
  1290. }
  1291.  
  1292. function EntryPage::print_comment (Comment c) {
  1293. var Color background; var Color color;
  1294. if ($c.screened) {
  1295. $background = $*comment_bar_screened_bgcolor;
  1296. $color = $*comment_bar_screened_fgcolor;
  1297. } elseif ($c.depth % 2) {
  1298. $background = $*comment_bar_one_bgcolor;
  1299. $color = $*comment_bar_one_fgcolor;
  1300. } else {
  1301. $background = $*comment_bar_two_bgcolor;
  1302. $color = $*comment_bar_two_fgcolor;
  1303. }
  1304. if ($*transparent) {
  1305. $background = "transparent";
  1306. }
  1307. var string poster = defined $c.poster ? $c.poster->as_string() : "<i>(Anonymous)</i>";
  1308. var string sub_icon;
  1309. if (defined $c.subject_icon) {
  1310. $sub_icon = $c.subject_icon->as_string();
  1311. }
  1312. "<a name='$c.anchor'></a><div id='cmtbar$c.talkid' style='background-color: $background; color: $color; margin-top: 10px; width: 100%;'>";
  1313. "<table border='0' cellpadding='2' cellspacing='0' summary='0' style='width: 100%'><tr valign='top'>";
  1314. if (defined $c.userpic and $*comment_userpic_style != "off") {
  1315. var int w = $c.userpic.width;
  1316. var int h = $c.userpic.height;
  1317. # WARNING: this will later be done by the system (it'll be a
  1318. # constructional property), so don't copy this hack into your
  1319. # layout layers or you'll be messed up later.
  1320. if ($*comment_userpic_style == "small") {
  1321. $w = $w / 2;
  1322. $h = $h / 2;
  1323. }
  1324. print "<td style='width: 102px'><img src='$c.userpic.url' width='$w' height='$h' alt='[User Picture]' /></td>";
  1325. }
  1326.  
  1327. "<td style='width: 50%'>";
  1328.  
  1329. ### From, date, etc
  1330. print "<strong>From:</strong> $poster<br /><small>";
  1331. print $c->time_display($*datetime_comments_format, "none");
  1332. if ($c.metadata{"poster_ip"}) { print "<br />IP: [" + $c.metadata{"poster_ip"} + "]"; }
  1333. "</small><br />";
  1334.  
  1335. print (defined $c.subject_icon or $c.subject != "") ? "<h3>$c.subject_icon $c.subject</h3>" : "";
  1336.  
  1337. "</td>";
  1338.  
  1339. ### Gadgets
  1340. "<td align='right' style='width: 50%'>";
  1341. if ($this.multiform_on) {
  1342. " <label for='ljcomsel_$c.talkid'>$*text_multiform_check</label>";
  1343. $c->print_multiform_check();
  1344. }
  1345. $c->print_linkbar();
  1346.  
  1347. ### Permalink
  1348. print "<p><strong>(<a href='$c.permalink_url'>Link</a>)</strong></p>\n";
  1349.  
  1350. "</td>";
  1351.  
  1352. print "</tr></table></div>";
  1353. print "<div style='margin-left: 5px'>"; $c->print_text(); "</div>";
  1354. print "<div style='margin-top: 3px; font-size: smaller'>";
  1355.  
  1356. "<span class='commentlinks'>";
  1357. if ($c.frozen) {
  1358. "(Replies frozen) ";
  1359. } else {
  1360. "(";
  1361. ###$c->print_reply_link({"linktext" => "Reply to this"});
  1362. if($c.screened == true) {
  1363. ### if comment screened - show link for unscreen
  1364. var Link link;
  1365. $link = $c->get_link("unscreen_to_reply");
  1366. """<a href="$link.url" title="$link.caption">$link.caption</a>""";
  1367. } else {
  1368. ### showing reply link if comment not screened
  1369. $c->print_reply_link({ "linktext" => $*text_comment_reply });
  1370. }
  1371.  
  1372. ") ";
  1373. }
  1374. "</span>";
  1375.  
  1376. if ($c.parent_url != "") { "(<a href='$c.parent_url'>Parent</a>) "; }
  1377. if ($c.thread_url != "") {
  1378. "(<a href='$c.thread_url'>Thread</a>) ";
  1379. var Link expand_link = $c->get_link("expand_comments");
  1380. if (defined $expand_link) {
  1381. "(" + $c->expand_link() + ") ";
  1382. }
  1383. }
  1384. if (not $c.frozen) {
  1385. $c->print_reply_container({"class" => "quickreply"});
  1386. }
  1387. "</div>";
  1388. }
  1389.  
  1390. function ReplyPage::print_body () {
  1391. if (not $.entry.comments.enabled) {
  1392. """<table width="$*box_width" cellpadding="2" cellspacing="0" border="0" summary="" class="entrybox">
  1393. <tr align='left'>
  1394. <td bgcolor="$*stronger_back" align="center">
  1395. <table width="100%" cellpadding="5" cellspacing="0" border="0" summary="">
  1396. <tr align='left'>
  1397. <td class="caption" colspan='2'>$*text_reply_nocomments_header</td></tr>
  1398. <tr align='left'>
  1399. <td colspan="2" bgcolor="$*entry_back">""";
  1400.  
  1401. print "<p>$*text_reply_nocomments</p>";
  1402. """</td></tr></table></td></tr></table><p>""";
  1403. return;
  1404. }
  1405.  
  1406. if ($.replyto isa Entry) {
  1407. var Entry en = $.replyto as Entry;
  1408.  
  1409. print_entry($this, $en, null Color, null Color, false);
  1410. } else {
  1411. var string datetime;
  1412. $datetime = $.replyto.time->date_format($*date_format)+"$*btwn_datetime<b>" + $.replyto.time->time_format($*time_format) + "</b>";
  1413. """<table width="$*box_width" cellpadding="2" cellspacing="0" border="0" summary="" class="entrybox">
  1414. <tr align='left'>
  1415. <td bgcolor="$*stronger_back" align="center">
  1416. <table width="100%" cellpadding="5" cellspacing="0" border="0" summary="">
  1417. <tr align='left'>
  1418. <td class="caption">$.replyto.subject</td>""";
  1419. print safe """<td class="index" align="right">[$datetime]</td></tr>""";
  1420. """<tr align='left'>
  1421. <td colspan="2" bgcolor="$*entry_back">
  1422. <table cellpadding="1" align="right" cellspacing="0" border="0" summary="">
  1423. <tr align='left'><td bgcolor="$*stronger_back">
  1424. <table cellpadding="2" align="center" cellspacing="0" border="0" summary="">
  1425. <tr align='left'><td align="center" style="color: $*stronger_text">""";
  1426.  
  1427. if (defined $.replyto.poster) {
  1428. "<a href='" + $.replyto.poster->base_url() + "/'>";
  1429. if (defined $.replyto.userpic) {
  1430. """<img border="0" src="$.replyto.userpic.url" width="$.replyto.userpic.width" """;
  1431. """height="$.replyto.userpic.height" alt=""><br />""";
  1432. }
  1433. "$.replyto.poster.username</a>";
  1434. } else {
  1435. print "<i>Anonymous</i>";
  1436. }
  1437.  
  1438. """</td></tr></table></td></tr></table>"""; $.replyto->print_text(); """</td></tr>
  1439. <tr bgcolor="$*weak_back"><td align='left' class='comments'>
  1440. <a href="$.replyto.permalink_url">$*text_permalink</a></td>
  1441. <td align='right' class='comments'><a href='$.entry.comments.read_url'>Read Comments</a></td>
  1442. </tr></table></td></tr></table><p>""";
  1443. }
  1444.  
  1445. print_ebox($.entry);
  1446.  
  1447. """<table width="$*box_width" cellpadding="2" cellspacing="0" border="0" summary="" class="entrybox">
  1448. <tr align='left'>
  1449. <td bgcolor="$*stronger_back" align="center">
  1450. <table width="100%" cellpadding="5" cellspacing="0" border="0" summary="">
  1451. <tr align='left'>
  1452. <td class="caption" colspan='2'>Reply:</td></tr>
  1453. <tr align='left'>
  1454. <td colspan="2" bgcolor="$*entry_back">""";
  1455.  
  1456. $.form->print();
  1457.  
  1458. """</td></tr></table></td></tr></table><p>""";
  1459. }
  1460.  
  1461. function print_theme_preview () {
  1462. """<table width='100%' bgcolor='$*page_back' cellpadding=10><tr><td align='center'>
  1463.  
  1464. <table width='400' cellpadding='2' cellspacing='2'>
  1465. <tr align='left'><td bgcolor="$*stronger_back" align="center">
  1466.  
  1467. <table width="100%" cellpadding="5" cellspacing="0" border="0" summary="">
  1468. <tr align='left'><td style="color: $*stronger_text">Preview Subject</td><td align="right" style="font-size: 8pt; color: $*stronger_text">[Feb. 5th, 2002|<b>8:46 pm</b>]</td></tr>
  1469. <tr align='left'>
  1470. <td colspan="2" bgcolor="$*entry_back" style='color: $*entry_text'>
  1471. Preview text, preview text, etc, etc..... words, words and more words.
  1472.  
  1473. </td></tr>
  1474.  
  1475. <tr bgcolor="$*weak_back"><td align='left' class='style: font-size: 8pt'>
  1476. <a style='text-decoration:none;color: $*page_link' href="#">$*text_permalink</a>
  1477. </td><td align='right' style='font-size: 8pt'>
  1478. <a href='#' style='text-decoration:none;color:$*page_vlink'><b>1 comment</b></a>|<a href='#' style='text-decoration:none;color:$*page_link'>post comment</a>
  1479.  
  1480. </td></tr></table>
  1481. </td></tr></table>
  1482. </td></tr></table>
  1483. """;
  1484. }
Advertisement
Add Comment
Please, Sign In to add comment