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;
# Preparsing
my $post = II::T->in_pre($data->{post});
# Make data
my %out = (
hash => $hash,
@ -54,7 +57,7 @@ sub encode {
from_user => $data->{from},
to_user => $data->{to},
subg => $data->{subg},
post => $data->{post},
post => $post,
base64 => $encoded,
send => 0,
);

16
II/T.pm
View File

@ -145,12 +145,28 @@ sub send {
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 {
my ( $self, $post ) = @_;
$post =~ s/</&lt;/g;
$post =~ s/>/&gt;/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/(.?)\n/$1<br>\n/g;
$post

View File

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