From 5a692586e9bb38ffaa763ef63bf13bea0f97d598 Mon Sep 17 00:00:00 2001 From: Shish Moom Date: Mon, 6 Jul 2009 04:31:40 -0700 Subject: [PATCH] new default theme --- themes/default/b.png | Bin 0 -> 229 bytes themes/default/br.png | Bin 0 -> 215 bytes themes/default/circle-bl.png | Bin 0 -> 214 bytes themes/default/circle-br.png | Bin 0 -> 208 bytes themes/default/circle-tl.png | Bin 0 -> 219 bytes themes/default/circle-tr.png | Bin 0 -> 226 bytes themes/default/circle.png | Bin 0 -> 326 bytes themes/default/comment.theme.php | 51 +++++++ themes/default/dcircle-bl.png | Bin 0 -> 224 bytes themes/default/dcircle-br.png | Bin 0 -> 215 bytes themes/default/dcircle-tl.png | Bin 0 -> 223 bytes themes/default/dcircle-tr.png | Bin 0 -> 234 bytes themes/default/layout.class.php | 112 ++++++++++++++++ themes/default/page.class.php | 6 + themes/default/r.png | Bin 0 -> 225 bytes themes/default/script.js | 136 +++++++++++++++++++ themes/default/sidebar.js | 83 ++++++++++++ themes/default/style.css | 214 ++++++++++++++++++++++++++++++ themes/default/themelet.class.php | 102 ++++++++++++++ 19 files changed, 704 insertions(+) create mode 100644 themes/default/b.png create mode 100644 themes/default/br.png create mode 100644 themes/default/circle-bl.png create mode 100644 themes/default/circle-br.png create mode 100644 themes/default/circle-tl.png create mode 100644 themes/default/circle-tr.png create mode 100644 themes/default/circle.png create mode 100644 themes/default/comment.theme.php create mode 100644 themes/default/dcircle-bl.png create mode 100644 themes/default/dcircle-br.png create mode 100644 themes/default/dcircle-tl.png create mode 100644 themes/default/dcircle-tr.png create mode 100644 themes/default/layout.class.php create mode 100644 themes/default/page.class.php create mode 100644 themes/default/r.png create mode 100644 themes/default/script.js create mode 100644 themes/default/sidebar.js create mode 100644 themes/default/style.css create mode 100644 themes/default/themelet.class.php diff --git a/themes/default/b.png b/themes/default/b.png new file mode 100644 index 0000000000000000000000000000000000000000..e879616c7ee96ae81e3a20453e6538ac3d6b5fb3 GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPggab~X-4{eYZ>ML;3R64!_l=ltB< z)VvY~=c3falGGH1^30M91$R&1fbd2>aiAgxPZ!4!iOa2hj(iLP0?f-hSO2dv(|@3l zQZ86LciGy8Lra*ICNzjG;Z|F~wsS&mz=Y#RCdV&W&!2bwpWp=jqINc=6?`tI&TNhY Pn#JJh>gTe~DWM4f3x-5N literal 0 HcmV?d00001 diff --git a/themes/default/br.png b/themes/default/br.png new file mode 100644 index 0000000000000000000000000000000000000000..ae3666ef699529d8e668bf16dc641dc9d5744bbd GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|*pj^6U4S$Y z{B+)352QE?JR*x37`TN&n2}-D90{Nxdx@v7EBj4$HcolHg3mFbKq1Kz*N775{M_8s zyb=cIqSVBa)D(sC%#sWRcTeAd@J2pypduqr7sn8Z%gHGT2`iEk5`G*waNq-{SG~(3 xdm~3n3r6k`^*B}*-ya^)!V;1a5{XE)7O>#COaFKxcuu)8FoM+$r9Iy66gHf+|;}h2Ir#G#FEq$h4Rdj z3*ue@!$5(N{`z0xR0h;+Z2V0Zo8|r zsd?2qhfmuJzOyp8w9M3HP%yT?`&&j(Wp{PjIZOWBA3OgTe~DWM4f DB`iRx literal 0 HcmV?d00001 diff --git a/themes/default/circle-br.png b/themes/default/circle-br.png new file mode 100644 index 0000000000000000000000000000000000000000..0a8806c858d57e9fa1be5d531a53443850641196 GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1SGw4HSYi^#^NA%Cx&(BWL^R}oCO|{#S9GG z!XV7ZFl&wkP>{XE)7O>#COaFKxF~meqXJM!vcxr_#5q4VH#M(>!MP|ku_QG`p**uB zL&4qCHz2%`PaLSo*3-o?gyVW{_d!kuL!QHzZWSv0UOzqd*NcOW8|P2jlcsiO+fs%- x3NKq#lvkayG1|Oaxyir!r8>ieDK7u+GFn_=ZZkDai2)kK;OXk;vd$@?2>?@UJ?#Jh literal 0 HcmV?d00001 diff --git a/themes/default/circle-tl.png b/themes/default/circle-tl.png new file mode 100644 index 0000000000000000000000000000000000000000..12ab8650906557d74c0129a1b9600e4bc45212c9 GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1SGw4HSYi^#^NA%Cx&(BWL^R}oCO|{#S9GG z!XV7ZFl&wkP>{XE)7O>#COaFKIP?F_CWSyD$r9Iy66gHf+|;}h2Ir#G#FEq$h4Rdj z3mdK II;Vst03hZ<=l}o! literal 0 HcmV?d00001 diff --git a/themes/default/circle-tr.png b/themes/default/circle-tr.png new file mode 100644 index 0000000000000000000000000000000000000000..1589c841e92d7be26bb1b260e67e60e75ce69421 GIT binary patch literal 226 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1SGw4HSYi^#^NA%Cx&(BWL^R}oCO|{#S9GG z!XV7ZFl&wkP>{XE)7O>#COaFKIA0@^#~GlIWQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FM zhJw4NZ$Nk>pEyvFzo(012*>r((~evR6nI=NX38p6{C{1^Etn+p!ig((N&W91;qUiO zak_NI<54ezif7UHsO;>w2YUVA*&Xv>aBw+eDQt27o;4#w_F9=beoubagKAc>vWs^D Pjb`w4^>bP0l+XkK%ymPc literal 0 HcmV?d00001 diff --git a/themes/default/circle.png b/themes/default/circle.png new file mode 100644 index 0000000000000000000000000000000000000000..66193e159e1108cf3c63c8931aaacd3453cf551a GIT binary patch literal 326 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfO?EaeZf~tOs2Z`S%)M{<2X0w;tQd zt_5F&^!{&R->Pr--e;N`3;vXPAD^of%dD}# RksIiI22WQ%mvv4FO#tsgb%Fo@ literal 0 HcmV?d00001 diff --git a/themes/default/comment.theme.php b/themes/default/comment.theme.php new file mode 100644 index 00000000..405b3518 --- /dev/null +++ b/themes/default/comment.theme.php @@ -0,0 +1,51 @@ +"; + $html .= "
" . $this->build_thumb_html($image) . "
"; + $html .= "
" . $this->comments_to_html($comments) . "
"; + $html .= ""; + if($with_postbox) { + $html .= "
".($this->build_postbox($image->id))."
"; + } + else { + // $html .= "

You need to create an account before you can comment

"; + $html .= "

 

"; + } + + $page->add_block(new Block("{$image->id}: ".($image->get_tag_list()), $html, "main", $position)); + } + + protected function comment_to_html($comment, $trim=false) { + global $user; + + $tfe = new TextFormattingEvent($comment->comment); + send_event($tfe); + + $i_uid = int_escape($comment->owner_id); + $h_name = html_escape($comment->owner_name); + $h_poster_ip = html_escape($comment->poster_ip); + $h_comment = ($trim ? substr($tfe->stripped, 0, 50)."..." : $tfe->formatted); + $i_comment_id = int_escape($comment->comment_id); + $i_image_id = int_escape($comment->image_id); + + $h_userlink = "$h_name"; + $stripped_nonl = str_replace("\n", "\\n", $tfe->stripped); + $stripped_nonl = str_replace("\r", "\\r", $stripped_nonl); + $h_dellink = $user->is_admin() ? + "
($h_poster_ip, Del)" : ""; + $h_imagelink = $trim ? ">>>\n" : ""; + return " +
+
+
+ $h_userlink: $h_comment $h_imagelink $h_dellink +
+
+
"; + } +} +?> diff --git a/themes/default/dcircle-bl.png b/themes/default/dcircle-bl.png new file mode 100644 index 0000000000000000000000000000000000000000..8939b4b98e197d3eac4f1de3de4a302151af7ab4 GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1SGw4HSYi^#^NA%Cx&(BWL^R}oCO|{#S9GG z!XV7ZFl&wkP>{XE)7O>#COaFKw)W1iPfLJ8k|nMYCC>S|xv6<249-QVi6yBi3gww4 z84B*6z5(HleBwYwzMd|QAsp9pPaASE7;?B=JlW*I6ct(V|8vDO6ER1Rjd#VmFW1T$ zD>2=bQ+kzn?q+kxmjh>3-C|%cj?Ok^IB>Uq|HkkC7OgV+Jg4}5E#s|3Av0bX-vFS& N44$rjF6*2UngAF{Mj-$I literal 0 HcmV?d00001 diff --git a/themes/default/dcircle-br.png b/themes/default/dcircle-br.png new file mode 100644 index 0000000000000000000000000000000000000000..f51ee37ce0a68ecf1c6238fc3d95762aae4eae1e GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1SGw4HSYi^#^NA%Cx&(BWL^R}oCO|{#S9GG z!XV7ZFl&wkP>{XE)7O>#COaFKw$cI3*b6`*$r9Iy66gHf+|;}h2Ir#G#FEq$h4Rdj z3~NSiaY54mP6;j7MI!clE~U?v{JC`1 z^qiSD`BchJoMBzXb%0aw;$5Yr{XE)7O>#COaFKwgAUJo&cbbWQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FM zhJw4NZ$Nk>pEyvFkEe@c2*>r@9z(7J4je4KPyWB(BEZe+y2WGSlOmSox96tv3pP$a zW3stp#j4`1XV$FJwrlFRBWw2I-oGe@1845Y+a;zMGzuDazmq%4T5?DCsAd$i8qiz@ MPgg&ebxsLQ03D!1-2eap literal 0 HcmV?d00001 diff --git a/themes/default/dcircle-tr.png b/themes/default/dcircle-tr.png new file mode 100644 index 0000000000000000000000000000000000000000..f3226fa39289168beee238879ffe34ef7f55d956 GIT binary patch literal 234 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1SGw4HSYi^#^NA%Cx&(BWL^R}oCO|{#S9GG z!XV7ZFl&wkP>{XE)7O>#COaFKw)A|Rt2cl`k|nMYCC>S|xv6<249-QVi6yBi3gww4 z84B*6z5(HleBwYw;hrvzAsp9pPaASEDDt>mys4@nw(QeC^G|YOVS*wvowy@!DDAKP zvwVt@lHsu_K^%FVdQ&MBb@03zB*8vpget_string('theme', 'default'); + $data_href = get_base_href(); + $contact_link = $config->get_string('contact_link'); + $version = "Shimmie-".VERSION; + + $header_html = ""; + foreach($page->headers as $line) { + $header_html .= "\t\t$line\n"; + } + + $left_block_html = ""; + $main_block_html = ""; + + foreach($page->blocks as $block) { + switch($block->section) { + case "left": + $left_block_html .= $this->block_to_html($block, true, "left"); + break; + case "main": + $main_block_html .= $this->block_to_html($block, false, "main"); + break; + default: + print "

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

{$page->subheading}
"; + + $wrapper = ""; + if(strlen($page->heading) > 100) { + $wrapper = ' style="height: 3em; overflow: auto;"'; + } + + print << + + + {$page->title} + + +$header_html + + + + + + {$page->heading} + $subheading + + +
$main_block_html
+ + + + +EOD; + } + + function block_to_html($block, $hidable=false, $salt="") { + $h = $block->header; + $b = $block->body; + $html = ""; + $i = str_replace(' ', '_', $h) . $salt; + if($hidable) { + $toggle = " onclick=\"toggle('$i')\""; + } + else { + $toggle = ""; + } + if(!is_null($h)) $html .= " +
+
+

$h

+
+
+ "; + if(!is_null($b)) { + if(strpos($b, "rrcontent")) { + $html .= "
$b
"; + } + else { + $html .= " +
+
+
$b
+
+
+ "; + } + } + + return $html; + } +} +?> diff --git a/themes/default/page.class.php b/themes/default/page.class.php new file mode 100644 index 00000000..07d2fc45 --- /dev/null +++ b/themes/default/page.class.php @@ -0,0 +1,6 @@ + diff --git a/themes/default/r.png b/themes/default/r.png new file mode 100644 index 0000000000000000000000000000000000000000..401418cd5adbb8ece5ceaac2adff12644309ff60 GIT binary patch literal 225 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPggab~X-4HO&o@*MLHjC9V-A&iT2y zsd*&~&PAz-C8;S2<(VZJ3hti10pX2&;y^_i@i$C~4hri$^(f=EFvNCvH;Fm4V(@Y1N!{F)a K=d#Wzp$PyCC_!WZ literal 0 HcmV?d00001 diff --git a/themes/default/script.js b/themes/default/script.js new file mode 100644 index 00000000..3b26466e --- /dev/null +++ b/themes/default/script.js @@ -0,0 +1,136 @@ +var defaultTexts = new Array(); + +window.onload = function(e) { + var sections=get_sections(); + for(var i=0;iINPUT[type="submit"] {width: 100%;} +TD>INPUT[type="text"] {width: 100%;} +TD>INPUT[type="password"] {width: 100%;} +TD>SELECT {width: 100%;} + +TABLE.zebra {border-spacing: 0px;} +TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} +TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #CCC;} +TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #CCC;} +TABLE.zebra TR {border-bottom: 1px solid #DDD;} +TABLE.zebra TR.odd {background: #EFEFEF;} +TABLE.zebra TR.even {background: #E0E0E0;} + +#footer { + clear: both; + padding: 8px; + font-size: 0.7em; + text-align: center; + border-top: 1px solid black; + background: #BBB; +} + +*[onclick] {cursor: pointer;} +IMG {border: none;} +FORM {margin: 0px;} +A {text-decoration: none;} +A:hover {text-decoration: underline;} + +BLOCKQUOTE { + border: 1px solid black; + padding: 8px; + background: #DDD; +} + +UL { + text-align: left; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* the navigation bar, and all its blocks * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#nav { + width: 200px; + float: left; + text-align: center; + margin-left: 16px; +} +#nav .blockbody { + font-size: 0.85em; + text-align: center; +} +#nav TABLE { + width: 150px; +} +#nav TD { + vertical-align: middle; +} +#nav INPUT { + width: 100%; + padding: 0px; +} +#nav SELECT { + width: 100%; + padding: 0px; +} + +#comments P { + text-align: left; + width: 150px; + max-width: 150px; + overflow: hidden; +} + +.more:after { + content: " >>>"; +} + +.tag_count:before { + content: "("; +} +.tag_count:after { + content: ")"; +} + +.paginator { + clear: both; + padding: 4px; + margin-bottom: 32px; +} + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* the main part of each page * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#body { + margin-left: 226px; + margin-right: 16px; + text-align: center; + height: 1%; +} +#body TABLE { + width: 90%; + margin: auto; +} + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* specific page types * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#pagelist { + margin-top: 32px; +} + +#tagmap A { + padding: 8px 4px 8px 4px; +} + +.rr {text-align: left; background: #DDD; margin: 8px;} +.rrtop {background: url("circle-tl.png") no-repeat top left;} +.rrtop div {background: url("circle-tr.png") no-repeat top right;} +.rrbot {background: url("circle-bl.png") no-repeat bottom left;} +.rrbot div {background: url("circle-br.png") no-repeat bottom right;} +.rrtop, .rrtop div, .rrbot, .rrbot div {height: 8px; width: 100%;} +.rrcontent {margin: 0px 8px;} + +.hrr {text-align: left; background: #CCC; margin: 8px;} +.hrrtop {background: url("dcircle-tl.png") no-repeat top left;} +.hrrtop div {background: url("dcircle-tr.png") no-repeat top right;} +.hrrbot {background: url("dcircle-bl.png") no-repeat bottom left;} +.hrrbot div {background: url("dcircle-br.png") no-repeat bottom right;} +.hrrtop, .hrrtop div, .hrrbot, .hrrbot div {height: 8px; width: 100%;} +.hrrcontent {margin: 0px 8px;} + +.setupblock { + border: 1px solid #AAA; + padding: 8px; + margin: 16px; + width: 350px; +} + +.helpable { + border-bottom: 1px dashed gray; +} + +.ok { + background: #AFA; +} +.bad { + background: #FAA; +} + +.thumbblock { + width: 220px; + height: 220px; + display: inline-block; + float: left; +} +.thumb { + display: inline-block; + text-align: center; + vertical-align: center; + margin-bottom: 32px; +} + diff --git a/themes/default/themelet.class.php b/themes/default/themelet.class.php new file mode 100644 index 00000000..7f749e73 --- /dev/null +++ b/themes/default/themelet.class.php @@ -0,0 +1,102 @@ +set_title($title); + $page->set_heading($title); + $page->add_block(new NavBlock()); + $page->add_block(new Block("Error", $message)); + } + + + /** + * A specific, common error message + */ + public function display_permission_denied($page) { + header("HTTP/1.0 403 Permission Denied"); + $this->display_error($page, "Permission Denied", "You do not have permission to access this page"); + } + + + /** + * Generic thumbnail code; returns HTML rather than adding + * a block since thumbs tend to go inside blocks... + */ + public function build_thumb_html($image, $query=null) { + global $config; + $i_id = int_escape($image->id); + $h_view_link = make_link("post/view/$i_id", $query); + $h_tip = html_escape($image->get_tooltip()); + $h_thumb_link = $image->get_thumb_link(); + $tsize = get_thumbnail_size($image->width, $image->height); + $hm8 = $tsize[1]-8; + $wm8 = $tsize[0]-8; + return " +
+
+
+
+ + $h_tip + +
+
+
+
+ "; + } + + + /** + * Add a generic paginator + */ + public function display_paginator($page, $base, $query, $page_number, $total_pages) { + if($total_pages == 0) $total_pages = 1; + $body = $this->build_paginator($page_number, $total_pages, $base, $query); + $page->add_block(new Block(null, $body, "main", 90)); + } + + private function gen_page_link($base_url, $query, $page, $name) { + $link = make_link("$base_url/$page", $query); + return "$name"; + } + + private function gen_page_link_block($base_url, $query, $page, $current_page, $name) { + $paginator = ""; + if($page == $current_page) $paginator .= ""; + $paginator .= $this->gen_page_link($base_url, $query, $page, $name); + if($page == $current_page) $paginator .= ""; + return $paginator; + } + + private function build_paginator($current_page, $total_pages, $base_url, $query) { + $next = $current_page + 1; + $prev = $current_page - 1; + $rand = rand(1, $total_pages); + + $at_start = ($current_page <= 1 || $total_pages <= 1); + $at_end = ($current_page >= $total_pages); + + $first_html = $at_start ? "First" : $this->gen_page_link($base_url, $query, 1, "First"); + $prev_html = $at_start ? "Prev" : $this->gen_page_link($base_url, $query, $prev, "Prev"); + $random_html = $this->gen_page_link($base_url, $query, $rand, "Random"); + $next_html = $at_end ? "Next" : $this->gen_page_link($base_url, $query, $next, "Next"); + $last_html = $at_end ? "Last" : $this->gen_page_link($base_url, $query, $total_pages, "Last"); + + $start = $current_page-5 > 1 ? $current_page-5 : 1; + $end = $start+10 < $total_pages ? $start+10 : $total_pages; + + $pages = array(); + foreach(range($start, $end) as $i) { + $pages[] = $this->gen_page_link_block($base_url, $query, $i, $current_page, $i); + } + $pages_html = implode(" | ", $pages); + + return "

$first_html | $prev_html | $random_html | $next_html | $last_html". + "
<< $pages_html >>

"; + } +} +?>