New ui style

This commit is contained in:
Difrex(Denis Zheleztsov) 2014-07-01 11:27:24 +04:00
parent 6e0cf197d1
commit 72d4c5f4c8
3 changed files with 30 additions and 7 deletions

View File

@ -46,6 +46,9 @@ sub encode {
$encoded =~ s/\//_/g; $encoded =~ s/\//_/g;
$encoded =~ s/\+/-/g; $encoded =~ s/\+/-/g;
# Preparsing
my $post = II::T->in_pre($data->{post});
# Make data # Make data
my %out = ( my %out = (
hash => $hash, hash => $hash,
@ -54,7 +57,7 @@ sub encode {
from_user => $data->{from}, from_user => $data->{from},
to_user => $data->{to}, to_user => $data->{to},
subg => $data->{subg}, subg => $data->{subg},
post => $data->{post}, post => $post,
base64 => $encoded, base64 => $encoded,
send => 0, send => 0,
); );

16
II/T.pm
View File

@ -145,12 +145,28 @@ sub send {
return $p->output(); return $p->output();
} }
# Preparsing before input to SQL
sub in_pre {
my ($self, $post) = @_;
$post =~ s/'/\\'/g;
$post =~ s/"/\\"/g;
$post =~ s/'/\\'/g;
$post =~ s/`/\\`/g;
$post =~ s/\$/\\\$/g;
return $post;
}
# Preparsing output
sub pre { sub pre {
my ( $self, $post ) = @_; my ( $self, $post ) = @_;
$post =~ s/</&lt;/g; $post =~ s/</&lt;/g;
$post =~ s/>/&gt;/g; $post =~ s/>/&gt;/g;
$post =~ s/&gt;(.+)/<font color='green'>>$1<\/font>/g; $post =~ s/&gt;(.+)/<font color='green'>>$1<\/font>/g;
$post =~ s/--/&mdash;/g;
$post =~ s/.?\*(.+)\*.?/<b>$1<\/b>/g;
$post =~ s/^$/<br>\n/g; $post =~ s/^$/<br>\n/g;
$post =~ s/(.?)\n/$1<br>\n/g; $post =~ s/(.?)\n/$1<br>\n/g;
$post $post

View File

@ -8,7 +8,7 @@
.post { .post {
border-width: 1; border-width: 1;
border: solid; border: solid;
border-color: #C7BA6C; border-color: #CCC;
border-radius: 10px; border-radius: 10px;
margin-top: 0.5em; margin-top: 0.5em;
margin-left: 15%; margin-left: 15%;
@ -17,9 +17,9 @@
} }
.post h2 { .post h2 {
display: block; display: block;
/*position: relative;*/ background-color: #CCC;
background-color: #C7BA6C; border-color: #C9C9C9;
border-color: #999; border-style: solid;
color: #222; color: #222;
border-radius: 5px; border-radius: 5px;
padding-left: 0.5em; padding-left: 0.5em;
@ -28,13 +28,15 @@
margin-top: 0.5em; margin-top: 0.5em;
margin-bottom: 0px; margin-bottom: 0px;
} }
.post h2:hover {
background-color: #c4c4c4;
}
.post img { .post img {
display: inline-block; display: inline-block;
border-radius: 10px; border-radius: 10px;
} }
.subg { .subg {
display: block; display: block;
/*background-color: #C7CCCA;*/
border-radius: 5px; border-radius: 5px;
margin-top: 0.5em; margin-top: 0.5em;
margin-left: 15%; margin-left: 15%;
@ -57,12 +59,14 @@
display: block; display: block;
margin-left: 0.5em; margin-left: 0.5em;
margin-top: -0.8em; margin-top: -0.8em;
margin-right: 0.5em;
} }
.headall { .headall {
text-align: center; text-align: center;
display: block; display: block;
color: #000; color: #000;
background-color: #C7BA6C; /*background-color: #C7BA6C;*/
background-color: #C9C9C9;
border-radius: 5px; border-radius: 5px;
width: 75%; width: 75%;
position: top; position: top;