diff --git a/themes/rule34v2/.gitignore b/themes/rule34v2/.gitignore new file mode 100644 index 00000000..13c95f72 --- /dev/null +++ b/themes/rule34v2/.gitignore @@ -0,0 +1,8 @@ +*.png +*.jpg +*.gif +*.mp3 +*.html +ad* +ads* +random* diff --git a/themes/rule34v2/bg.png b/themes/rule34v2/bg.png new file mode 100644 index 00000000..45e1b42c Binary files /dev/null and b/themes/rule34v2/bg.png differ diff --git a/themes/rule34v2/favicon.ico b/themes/rule34v2/favicon.ico new file mode 100644 index 00000000..2ec940d8 Binary files /dev/null and b/themes/rule34v2/favicon.ico differ diff --git a/themes/rule34v2/flags/china-flag.png b/themes/rule34v2/flags/china-flag.png new file mode 100644 index 00000000..b54e1c73 Binary files /dev/null and b/themes/rule34v2/flags/china-flag.png differ diff --git a/themes/rule34v2/flags/dutch-flag.png b/themes/rule34v2/flags/dutch-flag.png new file mode 100644 index 00000000..99d69fde Binary files /dev/null and b/themes/rule34v2/flags/dutch-flag.png differ diff --git a/themes/rule34v2/flags/english-flag.png b/themes/rule34v2/flags/english-flag.png new file mode 100644 index 00000000..c171928b Binary files /dev/null and b/themes/rule34v2/flags/english-flag.png differ diff --git a/themes/rule34v2/flags/finnish-flag.png b/themes/rule34v2/flags/finnish-flag.png new file mode 100644 index 00000000..eddfdba4 Binary files /dev/null and b/themes/rule34v2/flags/finnish-flag.png differ diff --git a/themes/rule34v2/flags/german-flag.png b/themes/rule34v2/flags/german-flag.png new file mode 100644 index 00000000..1b9d04f6 Binary files /dev/null and b/themes/rule34v2/flags/german-flag.png differ diff --git a/themes/rule34v2/flags/italian-flag.png b/themes/rule34v2/flags/italian-flag.png new file mode 100644 index 00000000..c687ea2b Binary files /dev/null and b/themes/rule34v2/flags/italian-flag.png differ diff --git a/themes/rule34v2/flags/norway-flag.png b/themes/rule34v2/flags/norway-flag.png new file mode 100644 index 00000000..0e9bb5a8 Binary files /dev/null and b/themes/rule34v2/flags/norway-flag.png differ diff --git a/themes/rule34v2/flags/port-flag.png b/themes/rule34v2/flags/port-flag.png new file mode 100644 index 00000000..b883e280 Binary files /dev/null and b/themes/rule34v2/flags/port-flag.png differ diff --git a/themes/rule34v2/flags/russian-flag.png b/themes/rule34v2/flags/russian-flag.png new file mode 100644 index 00000000..95333f6f Binary files /dev/null and b/themes/rule34v2/flags/russian-flag.png differ diff --git a/themes/rule34v2/flags/spain-flag.png b/themes/rule34v2/flags/spain-flag.png new file mode 100644 index 00000000..4c2921f0 Binary files /dev/null and b/themes/rule34v2/flags/spain-flag.png differ diff --git a/themes/rule34v2/flags/swedish-flag.png b/themes/rule34v2/flags/swedish-flag.png new file mode 100644 index 00000000..b0e4a760 Binary files /dev/null and b/themes/rule34v2/flags/swedish-flag.png differ diff --git a/themes/rule34v2/header.inc b/themes/rule34v2/header.inc new file mode 100644 index 00000000..cfd26bab --- /dev/null +++ b/themes/rule34v2/header.inc @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + +
+ + + +
+ + +
diff --git a/themes/rule34v2/home.theme.php b/themes/rule34v2/home.theme.php new file mode 100644 index 00000000..b44a96f0 --- /dev/null +++ b/themes/rule34v2/home.theme.php @@ -0,0 +1,70 @@ +set_mode("data"); + $page->add_auto_html_headers(); + $hh = $page->get_all_html_headers(); + $page->set_data( + << + + $sitename + + + $hh + + + + + + $body + + +EOD +); + } + + public function build_body(string $sitename, string $main_links, string $main_text, string $contact_link, $num_comma, string $counter_text) + { + $main_links_html = empty($main_links) ? "" : ""; + $message_html = empty($main_text) ? "" : "
$main_text
"; + $counter_html = empty($counter_text) ? "" : "
$counter_text
"; + $contact_link = empty($contact_link) ? "" : "
Contact –"; + $search_html = " + + "; + return " +
+

$sitename

+ $main_links_html + $search_html + $message_html + $counter_html + +
"; + } +} diff --git a/themes/rule34v2/index.theme.php b/themes/rule34v2/index.theme.php new file mode 100644 index 00000000..04aab4fe --- /dev/null +++ b/themes/rule34v2/index.theme.php @@ -0,0 +1,39 @@ +can("delete_image") ? "can-del" : ""; + $h_query = html_escape($query); + + $table = "
"; + foreach ($images as $image) { + $table .= $this->build_thumb_html($image); + } + $table .= "
"; + return $table; + } + + public function display_page(Page $page, $images) + { + $this->display_page_header($page, $images); + + $nav = $this->build_navigation($this->page_number, $this->total_pages, $this->search_terms); + if (!empty($this->search_terms)) { + $page->_search_query = $this->search_terms; + } + $page->add_block(new Block("Navigation", $nav, "left", 0)); + + if (count($images) > 0) { + $this->display_page_images($page, $images); + } else { + $this->display_error( + 404, + "No Images Found", + "No images were found to match the search criteria. Try looking up a character/series/artist by another name if they go by more than one. Remember to use underscores in place of spaces and not to use commas. If you came to this page by following a link, try using the search box directly instead. See the FAQ for more information." + ); + } + } +} diff --git a/themes/rule34v2/menuh.css b/themes/rule34v2/menuh.css new file mode 100644 index 00000000..1d96dc42 --- /dev/null +++ b/themes/rule34v2/menuh.css @@ -0,0 +1,122 @@ +/* Begin CSS Drop Down Menu */ + +a:link.menu { color:#FF0000; text-decoration: none; } + +a:visited.menu { color: #FF0000; text-decoration: none; } + +a:hover.menu { color: #FF0000; text-decoration: none; } + +a:active.menu { color: #FF0000; text-decoration: none; } + +#menuh-container + { + font-size: 1em; + float: left; + top:0; + left: 5%; + width: 100%; + margin: 0px; + } + +#menuh + { + font-size: small; + font-family: arial, helvetica, sans-serif; + width:100%; + margin-top: 0px; + } + +#menuh a.sub_option + { + border: 1px solid #555; + /*background-image:url(topban.jpg);*/ + } + +#menuh a + { + text-align: center; + background: #ACE4A3; + display:block; + white-space:nowrap; + margin:0; + margin-top:0; + padding: 0.2em; + } + +#menuh a, #menuh a:visited /* menu at rest */ + { + color: #000099; + text-decoration:none; + } + +#menuh a:hover /* menu at mouse-over */ + { + color: #000000; + } + +#menuh a.top_parent, #menuh a.top_parent:hover /* attaches down-arrow to all top-parents */ + { + /*background-image: url(navdown_white.gif);*/ + background-position: right center; + background-repeat: no-repeat; + } + +#menuh a.parent, #menuh a.parent:hover /* attaches side-arrow to all parents */ + { + /*background-image: url(nav_white.gif);*/ + background-position: right center; + border: 1px solid #555; + background-repeat: no-repeat; + } + +#menuh ul + { + list-style:none; + margin:0; + padding:0; + float:left; + width:9em; /* width of all menu boxes */ + } + +#menuh li + { + position:relative; + min-height: 1px; /* Sophie Dennis contribution for IE7 */ + vertical-align: bottom; /* Sophie Dennis contribution for IE7 */ + } + +#menuh ul ul + { + position:absolute; + z-index:500; + top:auto; + display:none; + padding: 1em; + margin:-1em 0 0 -1em; + } + +#menuh ul ul ul + { + top:0; + left:100%; + } + +div#menuh li:hover + { + cursor:pointer; + z-index:100; + } + +div#menuh li:hover ul ul, +div#menuh li li:hover ul ul, +div#menuh li li li:hover ul ul, +div#menuh li li li li:hover ul ul +{display:none;} + +div#menuh li:hover ul, +div#menuh li li:hover ul, +div#menuh li li li:hover ul, +div#menuh li li li li:hover ul +{display:block;} + +/* End CSS Drop Down Menu */ diff --git a/themes/rule34v2/page.class.php b/themes/rule34v2/page.class.php new file mode 100644 index 00000000..6ecb5d71 --- /dev/null +++ b/themes/rule34v2/page.class.php @@ -0,0 +1,134 @@ +get_string('theme', 'default'); + $data_href = get_base_href(); + $contact_link = contact_link(); + $header_html = $this->get_all_html_headers(); + + $left_block_html = ""; + $right_block_html = ""; + $main_block_html = ""; + $head_block_html = ""; + $sub_block_html = ""; + + foreach ($this->blocks as $block) { + switch ($block->section) { + case "left": + $left_block_html .= $block->get_html(true); + break; + case "right": + $right_block_html .= $block->get_html(true); + break; + case "head": + $head_block_html .= "".$block->get_html(false).""; + break; + case "main": + $main_block_html .= $block->get_html(false); + break; + case "subheading": + $sub_block_html .= $block->body; // $block->get_html(true); + break; + default: + print "

error: {$block->header} using an unknown section ({$block->section})"; + break; + } + } + + $debug = get_debug_info(); + + $contact = empty($contact_link) ? "" : "
Contact"; + $subheading = empty($this->subheading) ? "" : "

{$this->subheading}
"; + + $wrapper = ""; + if (strlen($this->heading) > 100) { + $wrapper = ' style="height: 3em; overflow: auto;"'; + } + + $flash_html = $this->flash ? "".nl2br(html_escape(implode("\n", $this->flash)))."" : ""; + + $generated = autodate(date('c')); + $debug .= "; generated $generated"; + $query = !empty($this->_search_query) ? html_escape(Tag::implode($this->_search_query)) : ""; + + $self = _get_query(); + + # $header_html_thing = file_get_contents("themes/rule34v2/header.inc"); + print << + + + {$this->title} + + + +$header_html + + + + + + + + + + + + $sub_block_html + + + +
+ $flash_html + + $main_block_html +
+ + + + + + + + + +EOD; + } +} diff --git a/themes/rule34v2/rule34_logo_top.png b/themes/rule34v2/rule34_logo_top.png new file mode 100644 index 00000000..98298cb0 Binary files /dev/null and b/themes/rule34v2/rule34_logo_top.png differ diff --git a/themes/rule34v2/style.css b/themes/rule34v2/style.css new file mode 100644 index 00000000..99e9ba59 --- /dev/null +++ b/themes/rule34v2/style.css @@ -0,0 +1,367 @@ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* things common to all pages * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +BODY { + background: url(bg.png) #ACE4A3; + font-family: "Arial", sans-serif; + font-size: 14px; + margin: 0px; +} +#header { + border-bottom: 1px solid #7EB977; + margin-top: 0px; + margin-bottom: 16px; + padding: 8px; + background: #ACE4A3; + text-align: center; +} +H1 { + font-size: 5em; + margin: 0px; + padding: 0px; +} +H1 A { + color: black; +} +H3 { + text-align: center; + margin: 0px; +} +THEAD { + font-weight: bold; +} +TD { + vertical-align: top; + text-align: center; +} + +#subtitle { + width: 256px; + font-size: 0.75em; + margin: auto; + margin-top: -16px; + text-align: center; + border: 1px solid black; + border-top: none; + background: #DDD; +} +#flash { + background: #FF7; + display: block; + padding: 8px; + margin: 8px; + border: 1px solid #882; +} + +TABLE.zebra {background: #ACE4A3; border-collapse: collapse; border: 1px solid #7EB977;} +TABLE.zebra TD {font-size: 0.8em;margin: 0px; border-top: 1px solid #7EB977; padding: 2px;} +TABLE.zebra TR:nth-child(odd) {background: #9CD493;} +TABLE.zebra TR:nth-child(even) {background: #ACE4A3;} + +FOOTER { + clear: both; + padding: 8px; + font-size: 0.7em; + text-align: center; + border-top: 1px solid #7EB977; + background: #ACE4A3; +} + +A {color: #000099; text-decoration: none; font-weight: bold;} +A:hover {color: #000099; text-decoration: underline;} +A:visited {color: #000099; text-decoration: none} +A:active {color: #000099; text-decoration: underline;} + +UL { + text-align: left; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* the navigation bar, and all its blocks * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +NAV { + width: 250px; + float: left; + text-align: center; + margin-left: 16px; +} +NAV .blockbody { + font-size: 0.85em; + text-align: center; +} +NAV TABLE { + width: 100%; +} +NAV TD { + vertical-align: middle; +} +NAV INPUT { + width: 100%; + padding: 0px; +} +NAV SELECT { + width: 100%; + padding: 0px; +} + + +.comment .info { + background: #ACE4A3; + border: 1px solid #7EB977; +} + +.more:after { + content: " >>>"; +} + +.tag_count:before { + content: "("; +} +.tag_count:after { + content: ")"; +} + +#imagelist .blockbody, +#paginator .blockbody { + background: none; + border: none; + box-shadow: none; +} + +#commentlistimage .blockbody, +#commentlistrecent .blockbody { + background: none; + border: none; + box-shadow: none; + padding: 0px; +} + +#commentlistimage .blockbody .comment, +#commentlistrecent .blockbody .comment { + margin-left: 0px; + margin-right: 0px; +} + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* the main part of each page * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +ARTICLE { + margin-left: 276px; + margin-right: 16px; + text-align: center; + height: 1%; + margin-top: 16px; +} +ARTICLE TABLE { + width: 90%; + margin: auto; +} +NAV SECTION:first-child H3 { + margin-top: 0px; +} + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* specific page types * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#pagelist { + margin-top: 32px; +} + +#tagmap A { + padding: 8px 4px 8px 4px; +} + +SECTION>.blockbody, .comment, .setupblock { + background: #ACE4A3; + margin: 8px; + border: 1px solid #7EB977; + padding: 8px; +} + +SECTION>H3 { + text-align: center; + background: #9CD493; + margin: 8px; + border: 1px solid #7EB977; + padding: 8px; +} + +.thumb { + width: 226px; + display: inline-block; + zoom: 1; /* ie6 */ + *display: inline; /* ie6 */ + text-align: center; + margin-bottom: 8px; +} +.thumb IMG { + border: 1px solid #7EB977; + background: #ACE4A3; + padding: 4px; +} + +div#twitter_update_list li { + list-style:none; + padding-bottom:0px; + text-align:left; + margin-top:5px; + margin-bottom:5px; + border: solid 1px #000; + background: url(bg.png); +} + +.username { + font-weight: bold; +} + +#bans TD, .image_info TD { + vertical-align: middle; +} +#bans INPUT { + font-size: 0.85em; +} + +.need-del { + display: none; +} +.can-del .need-del { + display: inline; +} + + +.unread { + color: red; +} + +UL.tagit { + margin: 0px; +} +ul.tagit li.tagit-new { + width: 50px; +} + + +[data-tags~="animated"]>A>IMG { background: #CC00CC; } +[data-ext="mp4"]>A>IMG, +[data-ext="webm"]>A>IMG { background: #0000FF; } + +#menuh-container { + float: none; + width: 500px; + margin: auto; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* responsive overrides * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +@media (max-width: 750px) { + .atoz, #paginator { + font-size: 2em; + } + .header-sites { + display: none; + } + SECTION>.blockbody { + overflow-x: auto; + } +} + +/* responsive padding */ +@media (max-width: 1024px) { + NAV {margin-left: 0px;} + ARTICLE {margin-right: 0px; margin-left: 242px;} +} +@media (max-width: 750px) { + NAV {margin-left: 0px;} + ARTICLE {margin-right: 0px; margin-left: 250px;} +} + +/* responsive navbar */ +#nav-toggle {display: none;} +@media (max-width: 750px) { + TD#nav-toggle {display: table-cell; width: 40px;} + #nav-toggle A {border: 1px solid black; border-radius: 8px;} + #nav-toggle A:hover {text-decoration: none;} + + NAV>SECTION>.blockbody, + NAV>SECTION>.blockbody>.comment { + margin: 0px; + } + NAV>SECTION>H3 { + margin: 0px; + } + + BODY.navHidden #menuh-container {display: none;} + BODY.navHidden NAV {display: none;} + BODY.navHidden ARTICLE {margin-left: 0px;} + +/* + NAV { + position: fixed; + top: 6.5em; + bottom: 0px; + overflow-y: scroll; + } + */ +} + +/* sticky header */ +@media (max-width: 750px) { + BODY.navHidden {padding-top: 5.4em} +} +@media (max-width: 750px) { + #header {position: fixed; top: 0px; left: 0px; z-index: 99999999999;} + .ui-autocomplete {z-index: 999999999999;} + BODY {padding-top: 7em} +} + +/* responsive header */ +#Uploadleft {display: none;} +#Uploadhead {display: block;} +#UserBlockleft {display: none;} +#UserBlockhead {display: block;} +#Loginleft {display: none;} +#Loginhead {display: block;} +.headcol {width: 250px; font-size: 0.85em;} +.headbox {width: 80%; margin: auto;} +#big-logo {display: table-cell;} +#mini-logo {display: none;} +@media (max-width: 1024px) { + #Uploadleft {display: block;} + #Uploadhead {display: none;} + #UserBlockleft {display: block;} + #UserBlockhead {display: none;} + #Loginleft {display: block;} + #Loginhead {display: none;} + .headcol {display: none;} + .headbox {width: 100%; margin: auto;} + #big-logo {display: none;} + #mini-logo {display: table-cell; width: 100px;} + + /* hide nav-search when header-search is sticky */ + ARTICLE {margin-top: 0px;} + #Navigationleft .blockbody {font-size: 1.5em;} + #Navigationleft .blockbody P, + #Navigationleft .blockbody FORM + {display: none;} +} + +/* responsive comments */ +.comment_list_table {width: 100%;} + +/* responsive misc */ +@media (max-width: 750px) { + #shm-main-image { max-width: 95%; } +} + +#ed91727bc9c7a73fdcec6db562e63151main { + overflow: scroll; +} diff --git a/themes/rule34v2/tag_edit.theme.php b/themes/rule34v2/tag_edit.theme.php new file mode 100644 index 00000000..4e92654e --- /dev/null +++ b/themes/rule34v2/tag_edit.theme.php @@ -0,0 +1,38 @@ +get_tag_list()); + return " + + Tags + + + + + "; + } + + public function get_source_editor_html(Image $image): string + { + global $user; + $h_source = html_escape($image->get_source()); + $f_source = $this->format_source($image->get_source()); + $style = "overflow: hidden; white-space: nowrap; max-width: 350px; text-overflow: ellipsis;"; + return " + + Source Link + + ".($user->can("edit_image_source") ? " +
$f_source
+ + " : " +
$f_source
+ ")." + + + "; + } +} diff --git a/themes/rule34v2/themelet.class.php b/themes/rule34v2/themelet.class.php new file mode 100644 index 00000000..bc7ad99a --- /dev/null +++ b/themes/rule34v2/themelet.class.php @@ -0,0 +1,39 @@ +get("thumb-block:{$image->id}"); + if ($cached) { + return $cached; + } + + $i_id = (int) $image->id; + $h_view_link = make_link('post/view/'.$i_id); + $h_image_link = $image->get_image_link(); + $h_thumb_link = $image->get_thumb_link(); + $h_tip = html_escape($image->get_tooltip()); + $h_tags = strtolower($image->get_tag_list()); + $h_ext = strtolower($image->ext); + + // If file is flash or svg then sets thumbnail to max size. + if ($image->ext === 'swf' || $image->ext === 'svg') { + $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); + } else { + $tsize = get_thumbnail_size($image->width, $image->height); + } + + $html = "
". + ''.$h_tip.''. + '
Image Only'. + " - Ban". + "
\n"; + + // cache for ages; will be cleared in ext/index:onImageInfoSet + $cache->set("thumb-block:{$image->id}", $html, 0); + + return $html; + } +} diff --git a/themes/rule34v2/upload.theme.php b/themes/rule34v2/upload.theme.php new file mode 100644 index 00000000..766ac422 --- /dev/null +++ b/themes/rule34v2/upload.theme.php @@ -0,0 +1,30 @@ +add_block(new Block("Upload", $this->build_upload_block(), "head", 20)); + $page->add_block(new Block("Upload", $this->build_upload_block(), "left", 20)); + } + + public function display_full(Page $page) + { + $page->add_block(new Block("Upload", "Disk nearly full, uploads disabled", "head", 20)); + } + + public function display_page(Page $page) + { + parent::display_page($page); + $html = " + Tagging Guide + "; + $page->add_block(new Block(null, $html, "main", 19)); + } + + protected function build_upload_block(): string + { + $url = make_link("upload"); + return "Upload"; + } +} diff --git a/themes/rule34v2/user.theme.php b/themes/rule34v2/user.theme.php new file mode 100644 index 00000000..80856cdb --- /dev/null +++ b/themes/rule34v2/user.theme.php @@ -0,0 +1,39 @@ +name); + $lines = []; + foreach ($parts as $part) { + $lines[] = "{$part["name"]}"; + } + if (count($lines) < 6) { + $html = implode("\n
", $lines); + } else { + $html = implode(" | \n", $lines); + } + $page->add_block(new Block("Logged in as $h_name", $html, "head", 90, "UserBlockhead")); + $page->add_block(new Block("Logged in as $h_name", $html, "left", 15, "UserBlockleft")); + } + + public function display_login_block(Page $page) + { + global $config; + $html = " +
+ + + + +
Name
Password
+
+ "; + if ($config->get_bool("login_signup_enabled")) { + $html .= "Create Account"; + } + $page->add_block(new Block("Login", $html, "head", 90)); + $page->add_block(new Block("Login", $html, "left", 15)); + } +}