reorganize database columns, fix series search, show image licences
This commit is contained in:
@@ -911,19 +911,19 @@ sub get_query {
|
||||
my $search_cond = '';
|
||||
if ( ( defined $params->{search} ) && ( $params->{search} ne '' ) ) {
|
||||
my $search = lc $params->{search};
|
||||
$search =~ s/[^a-z0-9\_\.\-\:\!öäüßÖÄÜ \&]/%/;
|
||||
$search =~ s/\%+/\%/;
|
||||
$search =~ s/(?=[\\%_])/\\/g;
|
||||
$search =~ s/^[\%\s]+//;
|
||||
$search =~ s/[\%\s]+$//;
|
||||
if ( $search ne '' ) {
|
||||
$search = '%' . $search . '%';
|
||||
my @attr = ( 'title', 'series_name', 'excerpt', 'category', 'content', 'topic' );
|
||||
$search_cond = "(" . join( " or ", map { 'lower(' . $_ . ') like ?' } @attr ) . ")";
|
||||
$search_cond = "(" . join( " or ", map { 'lower(' . $_ . ') like ?' } @attr ) . ")";
|
||||
for my $attr (@attr) {
|
||||
push @$bind_values, $search;
|
||||
}
|
||||
}
|
||||
}
|
||||
#print STDERR $search_cond."\n";
|
||||
|
||||
my $project_cond = '';
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ sub delete_files{
|
||||
|
||||
return undef;
|
||||
|
||||
print log::error($config, 'missing permissions on writing into local media dir ' .$local_media_dir)unless(-w $local_media_dir);
|
||||
print log::error($config, 'missing permissions on writing into local media dir')unless(-w $local_media_dir);
|
||||
|
||||
if ($filename=~/[^a-zA-Z0-9\.\_\-]/){
|
||||
log::error($config, "invalid filename: '$filename'");
|
||||
|
||||
@@ -50,6 +50,11 @@ sub get{
|
||||
push @bind_values, $condition->{name};
|
||||
}
|
||||
|
||||
if ((defined $condition->{location}) && ($condition->{location} ne '')){
|
||||
push @conditions, 's.location=?';
|
||||
push @bind_values, $condition->{location};
|
||||
}
|
||||
|
||||
my $limit='';
|
||||
if ((defined $condition->{limit}) && ($condition->{limit} ne '')){
|
||||
$limit= 'limit '.$condition->{limit};
|
||||
|
||||
Reference in New Issue
Block a user