riccardocrosa
Forum Replies Created
-
Forum: Plugins
In reply to: [Get Use APIs - JSON Content Importer] Coordinate from current productHello Bernhard,
I did some tests with PHP everywhere, but since the php code should be in the right column of the backend of each product, I thought to use a plugin that reserves to the administrator the view of the code, avoiding that anyone (vendors) must insert it, see it or modify it.https://it.www.ads-software.com/plugins/insert-php/
So, with this code in a shortcode the system works fine
<?php echo do_shortcode('[jsoncontentimporter url=https://api.openweathermap.org/data/2.5/weather?lat=45&lon=7&appid=MY_APP_ID&units=metric&lang=it] Ubicazione: {name} {subloop:main:-1}{main.temp} °C {/subloop:main} {subloop-array:weather:-1} {weather.description} {/subloop-array:weather} [/jsoncontentimporter]'); ?>
But problem remains the usual when I try to insert in the middle of the URL that invokes the Openweathermap API the php code that gets the coordinates of the product on the fly
<?php if (function_exists('geo_mashup_map')) $coords = GeoMashup::post_coordinates(); if ($coords) { echo 'lat=' . $coords['lat'] . '&lon=' . $coords['lng'] ; } ?>
and the system breaks the URL making visible only the second part with an error.
I’m blocked on a single row of code!
Thank you,
RiccardoForum: Plugins
In reply to: [Get Use APIs - JSON Content Importer] Coordinate from current productHello Bernhard,
I saw that, but I can’t edit the posts (the system don’t show me the edit link) so I cancelled the token on openweathermap.
I thought was to create the url of example 2 that is created correctly and copy it into your plugin.
I can’t find the way to build the code.
Thanks
RiccardoForum: Plugins
In reply to: [Get Use APIs - JSON Content Importer] Coordinate from current productHi Bernhard,
thanks for your reply.
So, I made some test with the code1) code
[jsoncontentimporter url=https://api.openweathermap.org/data/2.5/weather?lat=44.9810638&lon=10.0421553&appid=MY_API_CODE&units=metric&lang=it] Ubicazione: {name} {subloop:main:-1}{main.temp} °C {/subloop:main} {subloop-array:weather:-1} {weather.description} {/subloop-array:weather} [/jsoncontentimporter]
page show: Ubicazione: Busseto 24.78 °C cielo sereno
2) code
https://api.openweathermap.org/data/2.5/weather?[php_everywhere]&appid=MY_API_CODE&units=metric&lang=it
with php
<?php if (function_exists('geo_mashup_map')) $coords = GeoMashup::post_coordinates(); if ($coords) { echo 'lat=' . $coords['lat'] . '&lon=' . $coords['lng'] ; } ?>
page show a valid URL: https://api.openweathermap.org/data/2.5/weather?lat=44.9810638&lon=10.0421553&appid=MY_API_CODE&units=metric&lang=it
3) code
[jsoncontentimporter url=https://api.openweathermap.org/data/2.5/weather?[php_everywhere]&appid=5b2810e06f7abcaa01fc2de6569918ce&units=metric&lang=it debugmode=10] Ubicazione: {name} {subloop:main:-1}{main.temp} °C {/subloop:main} {subloop-array:weather:-1} {weather.description} {/subloop-array:weather} [/jsoncontentimporter]
with php
<?php if (function_exists('geo_mashup_map')) $coords = GeoMashup::post_coordinates(); if ($coords) { echo 'lat=' . $coords['lat'] . '&lon=' . $coords['lng'] ; } ?>
page show: &appid=MY_API_CODE&units=metric&lang=it debugmode=10] Ubicazione: °C
it seems that the code is cut perhaps because one shortcode contains another shortcode.
Any idea?Thank you
RiccardoForum: Plugins
In reply to: [Get Use APIs - JSON Content Importer] Coordinate from current productThank you Bernhard,
I’ve found this
https://github.com/cyberhobo/wordpress-geo-mashup/wiki/Tag-Reference#post-coordinates
and this
https://github.com/cyberhobo/wordpress-geo-mashup/issues/134And I’ve tried to put in place this code
[jsoncontentimporter url=https://api.openweathermap.org/data/2.5/weather?<?php if (function_exists(‘geo_mashup_map’)) $coords =
GeoMashup::post_coordinates(); if ($coords) { echo
‘<span>lat=’ . $coords[‘lat’] .
‘&lon=’ . $coords[‘lng’] .
‘</span>’; } ?>&appid=MY_API_ID&units=metric&lang=it] Meteo ubicazione: {name} {subloop:main:-1}{main.temp} °C {/subloop:main} {subloop-array:weather:-1} {weather.description} {/subloop-array:weather}? [/jsoncontentimporter]but don’t works.
Have some ideas?
Thanks
RiccardoForum: Plugins
In reply to: [Weather Atlas Widget] Coordinates on the fly in background.
Forum: Plugins
In reply to: [Weather Atlas Widget] Coordinates on the fly in backgroundThanks for the information.
Forum: Plugins
In reply to: [WP Custom Admin Interface] Site footerYou’re right to be confused!
I’ve been with too little coffee and too many hours seeing 1,000 things!
Sorry, it wasn’t due to your plugin that works perfectly, but it was my mistake.
Thanks again to youForum: Plugins
In reply to: [Foyer - Digital Signage for WordPress] Feature RequestsThanks a lot Darnell, I’ll run some tests.
Forum: Plugins
In reply to: [Foyer - Digital Signage for WordPress] Feature RequestsInteresting!
Please Darnell, can you suggest some of those existing plugins?
Thank you