From 40963ce3cb3931102d0eeab34ac381cba841c00f Mon Sep 17 00:00:00 2001 From: lenovo Date: Wed, 26 Oct 2022 19:55:16 +0200 Subject: [PATCH] finally a tuto that seems ok --- README.md | 1 + srcs/plugins/google_map/debug.php | 13 ++++++++++ srcs/plugins/google_map/get_url.php | 23 +++++++++++++++++ srcs/plugins/google_map/index.php | 39 ++++++++++------------------- srcs/plugins/google_map/script.js | 0 srcs/plugins/google_map/style.css | 0 srcs/plugins/map_prof/map_prof.php | 4 +-- 7 files changed, 52 insertions(+), 28 deletions(-) create mode 100644 srcs/plugins/google_map/debug.php create mode 100644 srcs/plugins/google_map/get_url.php mode change 100755 => 100644 srcs/plugins/google_map/index.php mode change 100755 => 100644 srcs/plugins/google_map/script.js mode change 100755 => 100644 srcs/plugins/google_map/style.css diff --git a/README.md b/README.md index d620e66..19c4369 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ - [symlink pbm with php-fpm](https://joshtronic.com/2019/07/29/symlinks-with-nginx-and-php-fpm/) - [my post on unix stack](https://unix.stackexchange.com/questions/722503/symlink-doent-works-with-nginx-and-php-fpm-and-docker/722511#722511) - [my post on wordpress stack](https://wordpress.stackexchange.com/questions/410735/i-dont-understand-how-symlinks-in-plugin-work) +- [maps api in php](http://www.learningaboutelectronics.com/Articles/Google-maps-API-JSON-PHP.php) --- --- diff --git a/srcs/plugins/google_map/debug.php b/srcs/plugins/google_map/debug.php new file mode 100644 index 0000000..a572a1c --- /dev/null +++ b/srcs/plugins/google_map/debug.php @@ -0,0 +1,13 @@ +' . $js_code . ''; + } + echo $js_code; +} + +?> diff --git a/srcs/plugins/google_map/get_url.php b/srcs/plugins/google_map/get_url.php new file mode 100644 index 0000000..30b2128 --- /dev/null +++ b/srcs/plugins/google_map/get_url.php @@ -0,0 +1,23 @@ + diff --git a/srcs/plugins/google_map/index.php b/srcs/plugins/google_map/index.php old mode 100755 new mode 100644 index f3f9d5a..5025caf --- a/srcs/plugins/google_map/index.php +++ b/srcs/plugins/google_map/index.php @@ -1,31 +1,19 @@ -// https://www.inkthemes.com/implement-google-map-plugin-for-wodpress/ -// Error: Publishing failed. The response is not a valid JSON response. -// -> https://wordpress.org/support/topic/publishing-failed-error-message-the-response-is-not-a-valid-json-response-2/ -// - solution permalink -> broken -// - permalink broken : https://wordpress.org/support/topic/permalinks-change-breaks-all-links/ -// - solution classic editor -> ok - -// https://stackify.com/how-to-log-to-console-in-php/ -function console_log($output, $with_script_tags = true) { - $js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) . - ');'; - if ($with_script_tags) { - $js_code = ''; - } - echo $js_code; -} + -
- diff --git a/srcs/plugins/google_map/script.js b/srcs/plugins/google_map/script.js old mode 100755 new mode 100644 diff --git a/srcs/plugins/google_map/style.css b/srcs/plugins/google_map/style.css old mode 100755 new mode 100644 diff --git a/srcs/plugins/map_prof/map_prof.php b/srcs/plugins/map_prof/map_prof.php index d401b55..ba8b8c2 100755 --- a/srcs/plugins/map_prof/map_prof.php +++ b/srcs/plugins/map_prof/map_prof.php @@ -37,7 +37,7 @@ function add_map_api(){

OSM map 2

"; return $content; }; -add_action('the_content', 'print_content', 1); +//add_action('the_content', 'print_content', 1); ?>