Merge branch 'master' of github.com:shish/shimmie2

This commit is contained in:
Shish 2012-03-13 08:09:41 +00:00
commit bdf24c1f2a
13 changed files with 308 additions and 356 deletions

View File

@ -27,15 +27,10 @@ class FeaturedTheme extends Themelet {
$h_tip = html_escape($image->get_tooltip()); $h_tip = html_escape($image->get_tooltip());
$tsize = get_thumbnail_size($image->width, $image->height); $tsize = get_thumbnail_size($image->width, $image->height);
return " return "
<center><div> <a href='$h_view_link'>
<a href='$h_view_link' style='position: relative; height: {$tsize[1]}px; width: {$tsize[0]}px;'>
<img id='thumb_$i_id' title='$h_tip' alt='$h_tip' class='highlighted' style='height: {$tsize[1]}px; width: {$tsize[0]}px;' src='$h_thumb_link'> <img id='thumb_$i_id' title='$h_tip' alt='$h_tip' class='highlighted' style='height: {$tsize[1]}px; width: {$tsize[0]}px;' src='$h_thumb_link'>
</a> </a>
</div></center>
"; ";
} }
} }

View File

@ -5,12 +5,7 @@ class PrivMsgTheme extends Themelet {
global $user; global $user;
$html = " $html = "
<script type='text/javascript'> <table id='pms' class='zebra sortable'>
$(document).ready(function() {
$(\"#pms\").tablesorter();
});
</script>
<table id='pms' class='zebra'>
<thead><tr><th>Subject</th><th>From</th><th>Date</th><th>Action</th></tr></thead> <thead><tr><th>Subject</th><th>From</th><th>Date</th><th>Action</th></tr></thead>
<tbody>"; <tbody>";
$n = 0; $n = 0;
@ -49,8 +44,8 @@ class PrivMsgTheme extends Themelet {
<form action="$post_url" method="POST"> <form action="$post_url" method="POST">
$auth $auth
<input type="hidden" name="to_id" value="$to_id"> <input type="hidden" name="to_id" value="$to_id">
<table style="width: 400px;"> <table style="width: 400px;" class="form">
<tr><td>Subject:</td><td><input type="text" name="subject" value="$h_subject"></td></tr> <tr><th>Subject:</th><td><input type="text" name="subject" value="$h_subject"></td></tr>
<tr><td colspan="2"><textarea style="width: 100%" rows="6" name="message"></textarea></td></tr> <tr><td colspan="2"><textarea style="width: 100%" rows="6" name="message"></textarea></td></tr>
<tr><td colspan="2"><input type="submit" value="Send"></td></tr> <tr><td colspan="2"><input type="submit" value="Send"></td></tr>
</table> </table>

View File

@ -3,7 +3,7 @@ class QRImageTheme extends Themelet {
public function links_block($link) { public function links_block($link) {
global $page; global $page;
$page->add_block( new Block( $page->add_block( new Block(
"QR Code","<img src='http://chart.apis.google.com/chart?chs=150x150&cht=qr&chl=$link' />","left",50)); "QR Code","<img alt='QR Code' src='http://chart.apis.google.com/chart?chs=150x150&amp;cht=qr&amp;chl=$link' />","left",50));
} }
} }
?> ?>

View File

@ -284,7 +284,7 @@ class Image {
return $this->parse_link_template($image_ilink); return $this->parse_link_template($image_ilink);
} }
else if($config->get_bool('nice_urls', false)) { else if($config->get_bool('nice_urls', false)) {
return $this->parse_link_template(make_link('_images/$hash/$id - $tags.$ext')); return $this->parse_link_template(make_link('_images/$hash/$id%20-%20$tags.$ext'));
} }
else { else {
return $this->parse_link_template(make_link('image/$id.$ext')); return $this->parse_link_template(make_link('image/$id.$ext'));

View File

@ -83,6 +83,22 @@ function no_escape($input) {
return $input; return $input;
} }
// Original PHP code by Chirp Internet: www.chirp.com.au
// Please acknowledge use of this code by including this header.
function truncate($string, $limit, $break=" ", $pad="...") {
// return with no change if string is shorter than $limit
if(strlen($string) <= $limit) return $string;
// is $break present between $limit and the end of the string?
if(false !== ($breakpoint = strpos($string, $break, $limit))) {
if($breakpoint < strlen($string) - 1) {
$string = substr($string, 0, $breakpoint) . $pad;
}
}
return $string;
}
/** /**
* Turn a human readable filesize into an integer, eg 1KB -> 1024 * Turn a human readable filesize into an integer, eg 1KB -> 1024
* *

View File

@ -161,7 +161,7 @@ class CommentListTheme extends Themelet {
$h_name = html_escape($comment->owner_name); $h_name = html_escape($comment->owner_name);
$h_poster_ip = html_escape($comment->poster_ip); $h_poster_ip = html_escape($comment->poster_ip);
$h_timestamp = autodate($comment->posted); $h_timestamp = autodate($comment->posted);
$h_comment = ($trim ? substr($tfe->stripped, 0, 50) . (strlen($tfe->stripped) > 50 ? "..." : "") : $tfe->formatted); $h_comment = ($trim ? truncate($tfe->stripped, 50) : $tfe->formatted);
$i_comment_id = int_escape($comment->comment_id); $i_comment_id = int_escape($comment->comment_id);
$i_image_id = int_escape($comment->image_id); $i_image_id = int_escape($comment->image_id);

View File

@ -5,7 +5,7 @@ class PixelFileHandlerTheme extends Themelet {
global $config; global $config;
$u_ilink = $image->get_image_link(); $u_ilink = $image->get_image_link();
$html = "<img id='main_image' src='$u_ilink'>"; $html = "<img alt='main image' id='main_image' src='$u_ilink'>";
if($config->get_bool("image_show_meta")) { if($config->get_bool("image_show_meta")) {
# FIXME: only read from jpegs? # FIXME: only read from jpegs?
$exif = @exif_read_data($image->get_image_filename(), 0, true); $exif = @exif_read_data($image->get_image_filename(), 0, true);

View File

@ -7,7 +7,7 @@
} }
#wrapper { #wrapper {
opacity: 0.4; opacity: 0.4;
filter: alpha(opacity=40); // msie filter: alpha(opacity=40); /* msie */
} }
/* This is needed since the theme style.css forcibly sets vertical align to "top". */ /* This is needed since the theme style.css forcibly sets vertical align to "top". */

View File

@ -87,12 +87,6 @@ margin:auto;
text-align:center; text-align:center;
width:256px; width:256px;
} }
ARTICLE select {
width:150px;
}
td > input[type="submit"] {width: 100%;}
td > input[type="text"] {width: 100%;}
td > input[type="password"] {width: 100%;}
FOOTER { FOOTER {
clear:both; clear:both;
color:#CCCCCC; color:#CCCCCC;
@ -100,12 +94,6 @@ font-size:0.9em;
padding-left:10px; padding-left:10px;
padding-top:8px; padding-top:8px;
} }
[onclick] {
cursor:pointer;
}
img {
border:medium none;
}
form { form {
margin:0; margin:0;
} }
@ -148,7 +136,7 @@ width:150px;
color:#AAAAAA; color:#AAAAAA;
} }
.more { .more {
content:"More <EFBFBD>â"; content:"More â";
} }
.comment { .comment {
margin-bottom:8px; margin-bottom:8px;

View File

@ -45,15 +45,6 @@ TD {
vertical-align: top; vertical-align: top;
text-align: center; text-align: center;
} }
ARTICLE SELECT {width: 150px;}
INPUT, TEXTAREA {box-sizing: border-box;}
TD>INPUT[type="button"] {width: 100%;}
TD>INPUT[type="submit"] {width: 100%;}
TD>INPUT[type="text"] {width: 100%;}
TD>INPUT[type="password"] {width: 100%;}
TD>TEXTAREA {width: 100%;}
TD>SELECT {width: 100%;}
[onclick] {cursor:pointer;}
TABLE.zebra {border-spacing: 0px; border: 2px solid #CCC;} TABLE.zebra {border-spacing: 0px; border: 2px solid #CCC;}
TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;}
@ -63,10 +54,6 @@ TABLE.zebra TR TD {border-bottom: 1px solid #DDD;}
TABLE.zebra TR:nth-child(odd) {background: #EFEFEF;} TABLE.zebra TR:nth-child(odd) {background: #EFEFEF;}
TABLE.zebra TR:nth-child(even) {background: #E0E0E0;} TABLE.zebra TR:nth-child(even) {background: #E0E0E0;}
TABLE.form TD, TABLE.form TH {vertical-align: middle;}
TABLE.form TBODY TD {text-align: left;}
TABLE.form TBODY TH {text-align: right; padding-right: 4px;}
FOOTER { FOOTER {
clear: both; clear: both;
font-size: 0.7em; font-size: 0.7em;
@ -75,9 +62,6 @@ FOOTER {
border: 1px solid #AAA; border: 1px solid #AAA;
} }
*[onclick] {cursor: pointer;}
IMG {border: none;}
FORM {margin: 0px;}
A {text-decoration: none;} A {text-decoration: none;}
A:hover {text-decoration: underline;} A:hover {text-decoration: underline;}

View File

@ -28,9 +28,6 @@ FOOTER {
text-align: center; text-align: center;
} }
*[onclick] {cursor: pointer;}
IMG {border: none;}
FORM {margin: 0px;}
A, A:visited {text-decoration: none; color: #0000EE;} A, A:visited {text-decoration: none; color: #0000EE;}
A:hover {text-decoration: underline; color: #DD0000;} A:hover {text-decoration: underline; color: #DD0000;}
HR {border: none; border-top: 1px solid #D9BFB7; height: 0px; clear: both;} HR {border: none; border-top: 1px solid #D9BFB7; height: 0px; clear: both;}

View File

@ -133,13 +133,6 @@ CODE {
border-top: none; border-top: none;
background: #DDD; background: #DDD;
} }
ARTICLE SELECT {width: 150px;}
TD>INPUT[type="submit"] {width: 100%;}
TD>INPUT[type="text"] {width: 100%;}
TD>INPUT[type="password"] {width: 100%;}
TD>TEXTAREA {width: 100%;}
TD>SELECT {width: 100%;}
[onclick] {cursor:pointer;}
TABLE.zebra {border-spacing: 0px; border: 2px solid #C3D2E0;} TABLE.zebra {border-spacing: 0px; border: 2px solid #C3D2E0;}
TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;}
@ -173,9 +166,6 @@ FOOTER {
background: #E3EFFA; background: #E3EFFA;
} }
*[onclick] {cursor: pointer;}
IMG {border: none;}
FORM {margin: 0px;}
A {text-decoration: none;} A {text-decoration: none;}
A:hover {text-decoration: underline;} A:hover {text-decoration: underline;}

View File

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3 things common to all pages * * things common to all pages *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
BODY { BODY {
@ -50,12 +50,6 @@ CODE {
border-top: none; border-top: none;
background: #DDD; background: #DDD;
} }
ARTICLE SELECT {width: 150px;}
INPUT, TEXTAREA {box-sizing: border-box;}
TD>INPUT[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; border: 1px solid #B89F7C; } TABLE.zebra {border-spacing: 0px; border: 1px solid #B89F7C; }
TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;}
@ -65,10 +59,6 @@ TABLE.zebra TD {border-top: 1px solid #B89F7C;}
TABLE.zebra TR:nth-child(odd) {background: #FCD9A9;} TABLE.zebra TR:nth-child(odd) {background: #FCD9A9;}
TABLE.zebra TR:nth-child(even) {background: #DABC92;} TABLE.zebra TR:nth-child(even) {background: #DABC92;}
TABLE.form TD, TABLE.form TH {vertical-align: middle;}
TABLE.form TBODY TD {text-align: left;}
TABLE.form TBODY TH {text-align: right; padding-right: 4px;}
FOOTER { FOOTER {
clear: both; clear: both;
padding: 8px; padding: 8px;
@ -78,9 +68,6 @@ FOOTER {
background: #FCD9A9; background: #FCD9A9;
} }
*[onclick] {cursor: pointer;}
IMG {border: none;}
FORM {margin: 0px;}
A {color: #665844; text-decoration: none; font-weight: bold;} A {color: #665844; text-decoration: none; font-weight: bold;}
A:hover {color: #665844; text-decoration: underline;} A:hover {color: #665844; text-decoration: underline;}
A:visited {color: #665844; text-decoration: none} A:visited {color: #665844; text-decoration: none}