Jump to content

ohno

Members
  • Content Count

    90
  • Joined

  • Last visited

  • Days Won

    1

ohno last won the day on March 28 2020

ohno had the most liked content!

Community Reputation

2 Neutral

About ohno

  • Rank
    Regular Member
  1. To add, I tried the latest version of the script : - https://github.com/tuupola/lazyload#changelog & tried modifying this code : - let images = document.querySelectorAll(".example"); lazyload(images); To the span name but still nothing, the rendered HTML of the image is like this :- <span class="thumb" style="background-image: url(https://www.example.com/images/thumbnails/example.jpg);"></span> I wonder if the lack of height & width maybe causing it? (this info is in the CSS file but I'll try adding it inline now)
  2. Hi, I've implemented lazy loading on my website using this guide : - https://web.dev/codelab-use-lazysizes-to-lazyload-images/ However I can't get the last bit of code to work! Basically I have images that are in a span tag loaded as a background image, I have this is the CSS : - .blocks1 .block a span.thumb { width: 120px; height: 90px; background-repeat: no-repeat; background-position: center; background-size: contain; margin: 0 auto } The page uses this tpl file for the images : - {section name=c loop=$cats->mCats} <div class="block"&g
  3. I now get this error (in PHP8) Could not execute MySQL query: SELECT * FROM blog_posts WHERE status<>'Hidden' ORDER BY publish_date DESC LIMIT -1,1 . Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-1,1' at line 4 && [16-Feb-2021 19:49:52 Europe/London] PHP Warning: Undefined variable $search in /home/public_html/blog/meta.php on line 50 Line 50 of meta.php :- WHERE status<>'Hidden' " .$search . " Which is in this block of code :- $sql = "SELECT
  4. When I say "nothing" I just get this error on the page :- Fatal error: Uncaught TypeError: Unsupported operand types: string - int in /home/public_html/blog/blog.php:614 Stack trace: #0 {main} thrown in /home/public_html/blog/blog.php on line 614 Line 614 :- $prev = $page - 1; The whole block of code is this :- // pagination query and variables starts $sql = "SELECT count(*) as total FROM ".$TABLE["Posts"]." WHERE status<>'Hidden' " .$search; $sql_result = sql_result($sql); $row = mysqli_fetch_array($sql_result); mysqli_free_result($sql_result); $total
  5. Well, I can only dump that variable when running PHP7.4 as if that code is left in place (the code I commented out as above) with PHP8 I get nothing! At the moment PHP8 is looking like a stack of work as a lot of things have broken when testing with 8! Even LiveZilla which we use for online chat (which sadly closed last year) breaks when switching to 8. Beginning to think it's not worth the hassle but 7.4 will only have security updates for another 18 months or so.
  6. I'm getting this error for a blog script that is on my site :- PHP Fatal error: Uncaught TypeError: Unsupported operand types: string - int The line in questions is this :- $prev = $page - 1; If I comment out this block of code the blog appears (with other errors, but I'll move on to those if I can fix this first!). /* Setup page vars for display. */ if (isset($page) and $page == 0) $page = 1; //if no page var is given, default to 1. $prev = $page - 1; //previous page is page - 1 $next = $page + 1;
  7. To add, some delivery methods have delivery on a Saturday.
  8. Sorry, I don't follow? Probably because I've been staring at this all day!!
  9. Pasted on phone and can't see how to format code on a mobile browser?? Sorry!
  10. I thought I’d sorted this but alas, no <?php class BoDelivery { public function EstimatedDaysWithHoliday($off, $days, $saturday) { require_once FILE_ROOT . '/data_objects/do_settings.php'; $doSettings = new DoSettings(); // Holidays that happen every year in MM-DD format. $holidays_every_year=($doSettings->GetSetting(51)); $date_array= explode(',',$holidays_every_year); $holidays_every_year= array(); foreach ($date_array as $value) { trim($value); if (strtotime($value)=== false ){ //bad date }else{ $holidays_every_year[] = date('m-d',str
  11. Thanks for replying. Of what I can gather, delivery is always 1 day, $off is the cutoff time for delivery that day, eg, after 4pm that delivery will not ship that day, it will ship the next business day. $standard_days is the number of business days for delivery. $saturday is whether delivery can happen on a Saturday (so if a user orders on a Friday & selects Saturday delivery). But Saturdays should NOT count towards delivery progress for other delivery options. $delay adds day(s) as required to the delivery progress. This is how the function is currently being used :- // Est D
  12. I have this block of code that was written by someone years ago :- <?php class BoDelivery { public function EstimatedDays($off, $standard_days, $saturday, $delay) { $today = date("N"); // Weekday - number 1-7 $now = strtotime("now"); // Unix $off_array = explode(":", str_replace(".", ":", $off)); $off_unix = mktime($off_array[0], $off_array[1], "00", date("n"), date("j"), date("Y")); $sending_days_from_now = 0; if ($now > $off_unix) { $sending_
  13. Thanks, fixed that issue now the payment page has a whole load of similar errors! <input <?php if (isset($_smarty_tpl->tpl_vars['cart']->value->mErrors['BillingFirstName'])) {?>class="error"<?php }?> type="text" name="BillingFirstName" tabindex="8" maxlength="25" value="<?php echo $_smarty_tpl->tpl_vars['cart']->value->mVars['BillingFirstName'];?> Stuck on this one TBH!
  14. Not sure how to find what is causing my issue here, I'm running smarty which gives me this error if I switch PHP version to 7.4 (was on 7.3) : - The line the error refers to is this : - <p class="cart_del_info_box_text"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <span class="cart_del_info_box_message"><?php echo $_smarty_tpl->tpl_vars['cart']->value->mDelivery['cartdeliverymessage'];?> How do I go about finding which file has the actual problem? Thanks for any pointers.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.