rpetersen29
Forum Replies Created
-
Hi @mikeviele
Sorry about the difficulty using the UTC time. That feature is long overdue for an upgrade. Working with time, more specifically timezones, can be difficult, so standardizing the timezone was the choice I made in order to keep things working properly. But I do understand it’s a better user experience to work in your own timezone, and possibly have a datetime picker to make that easier.
The logic currently sits in the backend php plugin files. It uses php DateTime, https://www.php.net/manual/en/class.datetime.php. And its used in a function that purely determines whether to show or hide the banner. This is executed on runtime or cached depending on your site settings. Until i update that logic, you can use this PHP interpreter to play around with values, https://www.w3schools.com/php/phptryit.asp?filename=tryphp_compiler. With the code:
<!DOCTYPE html>
<html>
<body>
<?php
$curr_date = new DateTime('now', new DateTimeZone('UTC'));
$start_date = new DateTime('24 Oct 2024 12:46:00');
// Compare the dates
if ($curr_date < $start_date) {
echo 'Shown';
} else {
echo 'Not shown';
}
?>
</body>
</html>Just change the date in $start_date and press “Run >” to see if your date will work.
perfect, glad that worked!
get rid of those inner quotes on auto and leave only the outer quotes and it should work
So no need for CSS, replace your Simple Banner Text value with
<span dir=”auto”>20% OFF ON THE ENTIRE SITE UNITL SUKKOT (26/10/2024)</span>
Hi @areyeh
Sorry for the delay. Does the 20% appear at the end of the sentence with no changes or when you use dir=”rtl”? I would maybe try using auto either way. So you simple banner text would be something like
<span dir="auto">YOUR TEXT HERE</span>
let me know if that works!
So sorry for the delay here. Yes you can do this pretty simply with CSS. In Website Custom CSS you would put something like:
@keyframes myAnimation{
0%{
opacity: 1;
}
90%{
opacity: 1;
}
95%{
opacity: 0.5;
}
100%{
display: none;
opacity: 0;
}
}
#simple-banner{
animation-name: myAnimation;
animation-duration: 5s;
animation-fill-mode: forwards;
}You can play around with this, the animation-duration is the amount of time you want to show the banner, in seconds but can take milliseconds as well. And then i just made it so the fade happens in the last 10% of the time remaining and eventually disappears. Let me know how this works out for you!
can you provide your URL so I can take a look? Thanks.
You need to clear your server side cache, likely another plugin you have installed, in order to fully remove Simple Banner.
And if you feel comfortable sharing what specifically you didn’t enjoy from the banner, I’m always looking for feedback and ways to improve the plugin. Thanks.
Hi @areyeh
The Simple Banner Text field supports html, which provides some tools for rtl languages. See documentation: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir. Hope that answers your question!
Hi @farsidefarm
The Simple Banner JavaScript is still being cached. You may have not cleared the correct cache. I would look for a specific JavaScript cache to resolve your issue. You may also have a cache associated with another plugin so I would check that as well.
Hi @emilyharrishpna
We are discouraged from talking about paid featuresets in these forums. Please reach out to me via the email at this site, https://rpetersen29.github.io/, to further debug your issue.Great! Glad it worked.
Hi @skepticp
Simple Banner does allow you to display banners one after the other using the Start After Date and Remove After Date set. But if you want to randomly show banners when a user comes to your site you will need some custom Javascript. Essentially you would just create a random number generator and then show or hide banners base on that number. First you would set
display: none;
in all of your.simple-banner {
custom CSS textfields. And the Website Custom Javascript would look something like:jQuery(document).ready(function ($) {
const random = Math.ceil(Math.random() * (5))
const banner_id = random === 1 ? '' :_${random}
;
if (document.getElementById(simple-banner${banner_id}
)) document.getElementById(strings.simpleBanner).style.display = 'block';
}Let me know how that works.
Clearing your server side JavaScript cache will fix the issue. If that doesn’t work then clear the browser cache on your android phone. The undefined banner is due to the client running the 2.17.x version of the banner JavaScript, but with a data structure for the 3.0.x banner. Simple Banner attaches a version number to its JavaScript file in order to prevent this caching. But if you use an optimization plugins, this often bundles together plugin JavaScript and removes that version number.
If your theme has a setting for additional CSS that might work! Otherwise there are plenty of free “additional CSS” plugins available.