add class when scroll down jQuery

$(window).scroll(function() {    
    var scroll = $(window).scrollTop();

    if (scroll >= 100) {
        $("#audioplayer").addClass("player");
    } else {
        $("#audioplayer").removeClass("player");
    }
});

seconds to days in php

Example 1

function secondsToTime($seconds) {
    $dtF = new \DateTime('@0');
    $dtT = new \DateTime("@$seconds");
    return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds');
}
echo secondsToTime(1640467);
# 18 days, 23 hours, 41 minutes and 7 seconds

Example 2

public function toDateInterval($seconds) {
    return date_create('@' . (($now = time()) + $seconds))->diff(date_create('@' . $now));
}
echo $this->toDateInterval(1640467)->format('%a days %h hours %i minutes'));
18 days 23 hours 41 minutes

Maximum execution time of 300 seconds exceeded in

Xampp Users

  1. Go to xampp\phpMyAdmin\
  2. Open config.inc.php
  3. Search for $cfg['ExecTimeLimit'] = 300;
  4. Set a larger value or change to 0 for unlimited
  5. If not found add $cfg['ExecTimeLimit'] = 900; (or 0 for unlimited)
  6. Save the file and restart the server

Important: setting the execution time limit to unlimited is not recommended.

str_word_count

str_word_count(string,return,char)
ParameterDescription
stringRequired. Specifies the string to check
returnOptional. Specifies the return value of the str_word_count() function.Possible
values:
0 – Default. Returns the number of words found
1 – Returns an array with the words from the string
2 – Returns an array where the key is the position of the word in the string, and value is the actual word
charOptional. Specifies special characters to be considered as words.
<?php

print_r(str_word_count("Hello world!"));

print_r(str_word_count("Hello world!",1));


print_r(str_word_count("Hello world!",2));

print_r(str_word_count("Hello world & good morning!",1));

print_r(str_word_count("Hello world & good morning!",1,"&"));

?>

run code after ajax success

<script>
    var done = 0;
    var ind=1;
    var timer=3000;
    var forreplace='soatechnology.net';
      $('form#seoform').submit(function(e) {
        $('#btn').html('Please Wait');
        var form = new FormData($('#seoform')[0]);
$.ajax({
    type: "POST",
    url: "Action/AddWebsite.php",
    data: form,
    cache: false,
    contentType: false,
    processData: false,
    success:  function(data){
        //alert("---"+data);
        $("html, body").animate({ scrollTop: 100 }, "slow");
        if(data <= 0)
        {
          $("#info").html('Already submitted');
          done = 0;
        }else{
          $("#info").html('Submit successfully');
          done = 1;
        }
      $('#seoBtn').html('<a href="/free-website-submission" class="btn btn-success">NeW Submit</a>');  
    },
    complete: function (data) {
      staticWebsite = $("#staticWebsite").val();
            $("#curlresult").html('');
           if (staticWebsite.trim() == '') {
                return false;
            }
      if(done)   {
      
      myfun();
      
    }
     }
});
           
            e.preventDefault();          
       
      
               });
              
        function myfun(){
            
       var myVar = setInterval(ajaxfun, timer);
         
           function ajaxfun()
           {
               url=pausecontent.pop();
             url=url.replace(forreplace,staticWebsite);
              
               $.ajax({
                //api call
                url:  'Action/Curl.php',
                //api call end
                data: {
                    url: url,
                                  },
                type: 'POST',
                dataType: 'json',
                beforeSend: function() {
                 
                },
                complete: function(data) {
                     $("#curlresult").append('<li class="list-group-item list-group-item-action bg-light">'+ind+" "+url+'</li>  ');
                  //
                     ind ++;
               if(!pausecontent.length)
            {     clearInterval(myVar);
            
               }
               
                    },
                success: function(data) {
               //  console.log(ind);   
               
                },
                error: function(xhr, ajaxOptions, thrownError) {
                  //  alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
                  $("#curlresult").append('<li class="list-group-item list-group-item-action bg-light">'+ind+" "+url+' Error</li>  ');
                }
            });
           }
            
              
                  
              
        }
        </script>

Phone wallpaper mistakes to avoid

Using a typical image as wallpaper

Across mobile phones and devices, the wallpaper may differ in size. Pick the right dimensions for the proper display of your wallpaper.

Adding long or too much text

Having subtle or a fair amount of text is acceptable. But some phone wallpapers are so cramped with text that they overlap the app icons. Even if you’re featuring a motivational quote in your wallpaper, it should have limited text.

Too many focal points, colors, and elements

There are many phone backgrounds on the Web that look entirely jam-packed. A single glance of the same is sure to overwhelm you. Too many focal points, colors, and elements destroy the purpose.

Ignoring the wallpaper size

Mobile wallpapers’ sizes change as per the size of the device itself. Not following the dimensions may cause any part of your wallpaper to cut off. So it becomes essential to consider the size of the device before creating or downloading phone wallpaper.

HOW TO SET WALLPAPER ON IOS PHONE

There are two ways by which you can set wallpaper on your iPhone:

1st:

  • Go to your iPhone’s ‘Settings’ and pick the ‘Wallpaper’ option.
  • Now, pick the option ‘Choose new wallpaper’ where you will have the option to choose wallpaper from already saved designs, both dynamic and still. You can also pick a photo from the Gallery. 
  • Now, pick the ‘Set’ option that will provide you with three options: ‘Set Home Screen,’ Set Lock Screen,’ or both.

2nd:

  • Choose the ‘Photos’ app of your iPhone in order to pick the photo you want to use as wallpaper.
  • Tap on the ‘share icon’ appearing on the lower left of your screen. Now, choose the option ‘Use as Wallpaper.’ 
  • Now pick the option ‘Lock Screen,’ ‘Home Screen,’ or both.
  • If you can’t find a suitable image in your Gallery to be used as wallpaper, browse the Web and download. 

HOW TO SET WALLPAPER ON ANDROID PHONE

  • Press and hold the blank area on your screen (the blank space where no icons/apps are placed). As and when you press the screen, the home screen option appears. 
  • Pick the ‘add wallpaper’ option and select whether you want the wallpaper to appear on the ‘Lock Screen,’ ‘Home Screen,’ or ‘Home & Lock Screen.’
  • You will also have another set of options appearing in front of you for the selection of wallpaper from locations like — Gallery, Wallpapers, Live Wallpapers, or Photos. 
  • If your wallpaper is in the Gallery, pick the option. You can also crop the image to match the size. Once you are satisfied, tap on the ‘Done’ option.

send WhatsApp template message with parameters

{
    "messaging_product": "whatsapp",
    "to": "{{Recipient-Phone-Number}}",
    "type": "template",
    "template": {
        "name": "promote_website",
        "language": {
            "code": "en_US"
        },
        "components": [{
            "type": "body",
             "parameters": [
                {
                    "type": "text",
                    "text": "http://soatg.in"
                }
             ]
        }]
    }
}

Tips Message Template Guidelines for WhatsApp

  • Make your message template name clear. Instead of using a name like “template_014,” use “bus_ticket_details”.
  • Remember that someone outside of your business will be reviewing your message templates. Providing more clarity gives reviewers context around how the message template will be used.
  • All appeals for rejected message templates require a sample. You can appeal a rejected message template through Direct Support.
  • If you need to write a message template to reopen the 24-hour window, we suggest starting with some mention of the previous conversation thread:
    Example: “I’m sorry that I wasn’t able to respond to your concerns yesterday but I’m happy to assist you now. If you’d like to continue this discussion, please reply with ‘yes’.” or “I was able to do some follow-up based on our previous conversation, and I’ve found the answer to your question about our refund policy. If you’d like to continue our conversation, please say ‘yes’.”