kotlin – access intent storage internal directory specific

hello I want to open the file explorer in a folder of my internal storage, it always starts me in the wathsapp folder this is my code:

            val intent = Intent()
            intent.type = "image/*"
            val urixe: Uri = Uri.parse(filesDir.toString()+"/Pictures/images/")
            intent.action = Intent.ACTION_GET_CONTENT
            intent.setDataAndType(urixe,"image/*")
            startActivityForResult(Intent.createChooser(intent, "Select picture"), SELECT_FILE)

linux – Ubuntu 16.0.4 – How to run PHP 5 in a specific directory

I have a VPS running ubuntu 16.0.4. I have already installed the lamp stack. I have an application I bought from code canyon which needs PHP 5.6 to run.

Main App (directory)
--------
  code-canyon-app (this directory needs PHP 5)

How can I install PHP 5 and make it available to the app directory?

Is it possible to create a Lightroom Smart Collection to include only specific keywords and exclude all others?

In Lightroom, I have marked my photos using keywords of the names of people, say A B C D & E and so on. I want to use smart collections to trap all photos where there are keywords A AND B. However, this traps even those where C and/or D and/or E and/or others may be in the photo. I can write individual conditions to exclude C D & E, but since I have about 100 keywords, this would make the number of excluding conditions too long.

Is there a way where I can trap only keywords A AND B and exclude all other keywords more conveniently than writing individual exclusions?

hardware failure – PC shuts down in specific games

My pc just turns off when I reach certain spots of certain games. It does not shut down, but simply goes out and then starts up again automatically.
I have had this behavior so far in Red Dead Redemption 2 at various points, but especially when you reach Saint Denis. In Phasmaphobia when I play Karty Asylum and leave the truck and in Assassin’s Creed Odysee as soon as I start a new game.
In all three cases it appears as if the error always occurs in a very similar place. As if something were being loaded that caused the computer to crash.

At first I assumed the part was overheated. However, all measurements showed that shortly before the crash all sensors were between 54 ° C and a maximum of 62 ° C. So actually no temperature where I would expect such behavior.
I then went through the hard drive and started the games from another hard drive. However, the behavior remained the same.

I have already replaced the RAM and the GPU. The error still occurred.

My system looks like this:

  • System: MS-7A38
  • CPU: AMD Ryzen 9 3900X 12-core, 3800 MHz
  • RAM: G.SKILL Value DDR4 2400 C15 4x8GB
  • OS: Windows 10 Home
  • Graphics card: NVIDIA GeForce RTX 2060 Super

Does anyone have any idea what else I could check? I’m not getting the impression that it’s just a hardware failure.

page specific settings – Sort by price wpdb

I have a page on my wordpress to search for tires everything works fine but I would have liked to know how to add an extra column to sort them also by price.

They can already be sorted by size and type… But I can’t find a solution for the price.

Thanks in advance !

Here is the code :

<?php
$resultLargura = $wpdb->get_results ("SELECT wp_t.name FROM $wpdb->term_taxonomy AS wp_tt
                                        INNER JOIN $wpdb->terms AS wp_t ON wp_t.term_id = wp_tt.term_id 
                                        WHERE wp_tt.taxonomy = 'pa_largeur'ORDER BY wp_t.name ASC");

$resultAltura = $wpdb->get_results ("SELECT wp_t.name FROM $wpdb->term_taxonomy AS wp_tt
                                        INNER JOIN $wpdb->terms AS wp_t ON wp_t.term_id = wp_tt.term_id 
                                        WHERE wp_tt.taxonomy = 'pa_hauteur' ORDER BY wp_t.name ASC");

                                    
$resultDiametro = $wpdb->get_results ("SELECT wp_t.name FROM $wpdb->term_taxonomy AS wp_tt
                                        INNER JOIN $wpdb->terms AS wp_t ON wp_t.term_id = wp_tt.term_id 
                                        WHERE wp_tt.taxonomy = 'pa_diametre' ORDER BY wp_t.name ASC");

$resultTipoPneu = $wpdb->get_results ("SELECT wp_t.name FROM $wpdb->term_taxonomy AS wp_tt
                                        INNER JOIN $wpdb->terms AS wp_t ON wp_t.term_id = wp_tt.term_id 
                                        WHERE wp_tt.taxonomy = 'pa_type-de-pneu' ORDER BY wp_t.name");

$resultDePneu = $wpdb->get_results ("SELECT wp_t.name FROM $wpdb->term_taxonomy AS wp_tt
                                        INNER JOIN $wpdb->terms AS wp_t ON wp_t.term_id = wp_tt.term_id 
                                        WHERE wp_tt.taxonomy = 'pa_marque-pneus' ORDER BY wp_t.name");

$resultDePneus = $wpdb->get_results ("SELECT wp_t.name FROM $wpdb->term_taxonomy AS wp_tt
                                        INNER JOIN $wpdb->terms AS wp_t ON wp_t.term_id = wp_tt.term_id 
                                        WHERE wp_tt.taxonomy = 'pa_categories-de-pneus' ORDER BY wp_t.name");

?>

Recherche par dimension

name=”largura”>
Largeur

name; ?>”>name; ?>

name=”altura”>
Hauteur

name; ?>”>name; ?>

name=”diametro”>
Diamètre

name; ?>”>name; ?>

name; ?>”>name; ?>

name; ?>”>name; ?>

<label class="fullwidth floatleft">
    <option  style="color: black; font-weight: bold; ">Plus d'indications :</option>
    <select type="checkbox" class="fullwidth floatleft"  name="DePneus">
        <option value="">Aucun</option>
        <?php
            foreach( $resultDePneus as $value ) { ?>
            
                <option value="<?php echo $value->name; ?>"><?php echo $value->name; ?></option>
            <?php
            }
        ?>
        
    </select>
</label>

    
<label class="fullwidth floatleft">
    <option  style="color: black; font-weight: bold; ">Choix du prix :</option>
    <select type="checkbox" class="fullwidth floatleft"  name="posts_this_price">
        <option value="">Aucun</option>
        <?php
            foreach( $posts_this_price as $value ) { ?>
            
                <option value="<?php echo $value->name; ?>"><?php echo $value->name; ?></option>
            <?php
            }
        ?>
        
    </select>
</label>




<input type="submit" value="RECHERCHE" name="PESQUISAR" class="fullwidth floatleft">            

And the other page :

<?php 



$optionLargura = isset($_GET('largura')) ? $_GET('largura') : false;
$optionAltura = isset($_GET('altura')) ? $_GET('altura') : false;
$optionDiametro = isset($_GET('diametro')) ? $_GET('diametro') : false;
$optionTipoPneu = isset($_GET('tipoPneu')) ? $_GET('tipoPneu') : false; 
$marqueDePneu = isset($_GET('DePneu')) ? $_GET('DePneu') : false; 
$catDePneus = isset($_GET('DePneus')) ? $_GET('DePneus') : false; 

$coin="CHF";


        $tax_query = array('relation' => 'AND');
        if ($optionLargura!='')
        {
            $tax_query() =  array(
                'taxonomy'        => 'pa_largeur',
                'field'           => 'slug',
                'terms'           =>  array($optionLargura),
                'operator'        => 'IN',
            );
        }
        if ($optionAltura!='')
        {
            $tax_query() =  array(
                'taxonomy'        => 'pa_hauteur',
                'field'           => 'slug',
                'terms'           =>  array($optionAltura),
                'operator'        => 'IN',
            );
        }
        if ($optionDiametro!='')
        {
            $tax_query() =  array(
                'taxonomy'        => 'pa_diametre',
                'field'           => 'slug',
                'terms'           =>  array($optionDiametro),
                'operator'        => 'IN',
            );
        }
        if ($optionTipoPneu!='')
        {
            $tax_query() =  array(
                'taxonomy'        => 'pa_type-de-pneu',
                'field'           => 'slug',
                'terms'           =>  array($optionTipoPneu),
                'operator'        => 'IN',
            );
        }

          if ($marqueDePneu!='')
        {
            $tax_query() =  array(
                'taxonomy'        => 'pa_marque-pneus',
                'field'           => 'slug',
                'terms'           =>  array($marqueDePneu),
                'operator'        => 'IN',
            );
        }

                      if ($catDePneus!='')
        {
            $tax_query() =  array(
                'taxonomy'        => 'pa_categories-de-pneus',
                'field'           => 'slug',
                'terms'           =>  array($catDePneus),
                'operator'        => 'IN',
                
            );
        }

         

if ( get_query_var(‘paged’) ) {
$paged = get_query_var(‘paged’);
} elseif ( get_query_var(‘page’) ) { // ‘page’ is used instead of ‘paged’ on Static Front Page
$paged = get_query_var(‘page’);
} else {
$paged = 1;
}

$args  = array( 
             'post_type'           => array('product', 'product_variation'),
            'post_status'         => 'publish',
            'posts_per_page' => get_option('posts_per_page'),
            'paged'          => $paged,
            'tax_query'      => $tax_query,
            'orderby' => 'price',
             'order' => 'asc',
                        
              );


$prods=new WP_Query($args);

    if( $prods->have_posts() ){

            $content = '<form class="cart" action="https://ahcor-autoshop.ch/panier" method="post" enctype="multipart/form-data" wtx-context="D6ECEB0A-195E-4229-9B5D-1A13E3D7E5AF">';
            

        
        

        while($prods->have_posts()) : 
            $product=$prods->the_post();
            $content .= '<div class="search-col" id="search-product-'.get_the_ID().'">';

                        $attachment_url='<div class="w10 floatleft"><img alt="' . get_the_title() . '" src="https://ahcor-autoshop.ch/wp-content/uploads/pneusahc.png" width="80"></div>';
                        $attachment_id=get_post_thumbnail_id(get_the_ID());
                        if($attachment_id){
                            $post_attachment_url=wp_get_attachment_url($attachment_id);
                            if($post_attachment_url)$attachment_url='<div class="w15 floatleft"><img alt="' . get_the_title() . '" src="'.$post_attachment_url.'" width="80"></div>';
                        }
                        $content.=$attachment_url;



        
        
        
                        //$content .= '<div class="w60 floatleft"><a href="https://ahcor-autoshop.ch/produit/'.$row->post_name.'/">' . $row->post_title . '</a>';
                        $content .= '<div class="w60 floatleft"><a href="'.get_the_permalink().'">' . get_the_title() . '</a>';
                        $content .= '<div class="fullwidth floatleft"><small class="inline floatleft">Tags</small></div>';

                        $price=get_post_meta(get_the_ID(),'_regular_price',true);
                        if(date("Y-m-d") != "2020-12-30")
                        {
        
                          
                            $calcAscTotal= $price ;

                            $content .= '<h3 style="color:#d52b1e;"><del style="opacity: .5; display: inline-block; margin: 15px;color: #545454;"></del> CHF '.round($calcAscTotal, 0, PHP_ROUND_HALF_UP).' .- '.'</h3>'; 
                        }
                        else
                        {
                            $content .= '<h3><small>Seulement</small> '. $price.' CHF.- '.'</h3>'; 
                        }
                        $content .= '</div>'; 
                        $content .= '<button type="submit" name="add-to-cart" value='. get_the_ID() .' class="single_add_to_cart_button button alt w20 floatright">Panier</button>'; 
                        //$content .= '</div>'; 

            $content.='</div>';
      
       endwhile; 
        


       $content.= '<a onclick="window.history.go(-1); return false;" href="#" class="text-red center-el bold" style="font-size:2em; padding: 20px 0">Retour</a>';
       $content.='</form>';

    }
    else{
        $content.="<h2 class='text-center'>".__('Aucun résultat trouvé','ahcor-autoshop').".</h2>";
        $content.= '<a onclick="window.history.go(-1); return false;" href="#" class="text-red center-el bold" style="font-size:2em; padding: 20px 0">Retour</a>';
    }



            
      if($content != "" )echo $content;
        





 if ($prods->max_num_pages > 1) : // custom pagination  
   
    $orig_query = $wp_query; // fix for pagination to work
    $wp_query = $prods;
    ?>
    <nav class="prev-next-posts" style="display: flex; justify-content: space-between; padding: 20px;">
         <div class="next-posts-link" class="text-red center-el bold" style="font-size:2em;" >
            <?php echo get_previous_posts_link( 'Précédent' ); ?>
        </div>
        <div class="prev-posts-link" class="text-red center-el bold" style="font-size:2em; text-align: right;">
            <?php echo get_next_posts_link( 'Suivant', $prods->max_num_pages ); ?>
        </div>
    </nav>
    <?php
    $wp_query = $orig_query; // fix for pagination to work
    ?>
<?php endif; ?>


    <form class="woocommerce-ordering" method="get" value="pneus">
<select name="orderby" class="orderby" aria-label="Commande">
                <option value="menu_order" selected="selected">Tri par défaut</option>
                <option value="popularity">Tri par popularité</option>
                <option value="rating">Tri par notes moyennes</option>
                <option value="date">Tri du plus récent au plus ancien</option>
                <option value="price">Tri par tarif croissant</option>
                <option value="price-desc">Tri par tarif décroissant</option>
        </select>
<input type="hidden" name="paged" value="1">
</form>

How google offers questions and answers in search for specific sites [closed]

How does google offers questions and answers for specific sites like this?

enter image description here

how to know when the user is in specific part of the website and when he leaves that part and display the data in the admin dashboard

I want to display for the admin when a user visits a page and when he leaves that page

the page is for example test.test/my-dashboard. and it’s only available for the logged in users.
the admin knows to know the time when the user is in that page and the time the user leaves that page.

thanks in advance and excuse my language.

Is there only one unique DPDA that accepts a specific language?

Or is it possible to construct more than one DPDA that accepts exactly the same language?

links – How do you run code on a specific page without missing the init hook?

The earliest that functions such as get_permalink or is_page are available is parse_query (afaik). Then I thought, ok, clearly, I can’t say if( is_page('myPage') ) { add_action( 'init'... // because is_page will always resolve to false.

So then I thought, well, how about wrapping parse_query inside init like so:

add_action( 'init', function() {
    add_action( 'parse_query', function() use() {
        if( is_page( 'myPage' ) ) { //
    }, 10 );
}, 10 );

Well, that still does nothing. The code works, but hooking into init there doesn’t really work. My goal here is to make use of items that need to launch/are available on init:10. So, I said, ok, just pass them, right?

add_action( 'init', function() {
  $something_i_need_from_init_10 = //do something.
  add_action( 'parse_query', function() use( $something_i_need_from_init_10 )
  //
}

Which works, now, there are two cases that you’ll use this for:

  1. Getting something. If it’s available on init:10, isn’t it available on parse_query since parse_query come after? Sure, for most things, but remember that WP core itself gets rid of certain get_post_* functionality once it hits certain actions. Perhaps you have a service container that works well with WP and a service is only available on init:10.
  2. Doing something. Perhaps something needs to fire here. If so, this still works.

But all of this is clunky to write.

Is there no way to tell WP to run code on init, on a certain page only? Just looking at the link won’t do. There are rewrite rules, link formats and so on that one has to take care of and that probably don’t load until later on.

Ultimately, it’d be nice if all I had to write was:

add_action( 'init', function() {
  if( is_page( 'myPage' ) ) {
    //do stuff
  }
}

What can one do when trying to design this way?


I don’t know how to figure it myself, but perhaps pipelining this process through the page.php / single.php pages will work. I assume WP has to figure out very early on what page, with what template it has to serve for any given link, for which it calls these 2 (usually).

8 – How State is specific to the specific environment, when its actually pushed to all environments with DB sync?

When you copy your development/testing database to your production
database, you’re effectively replacing your production site’s state
with your development site’s state. Therefore if you put your
production site in maintenance mode, then import a database that says
the site is not in maintenance mode, then your site will stop being in
maintenance mode.

Conceptually, state is specific to an environment, so long as you
aren’t copying your database when you push changes from development to
production.

Your solution may be to avoid doing these database imports altogether.
If you are just making configuration changes on your local development
site and just need to push those, you can export the site’s
configuration to code, commit it to version control, push that config
to production and then import it. (See
https://www.drupal.org/docs/configuration-management for info.)

If you are creating content in the local development environment that
you need to push to production, then you may want to look at using the
Migrate API.

If you absolutely must push these database updates but want the
production site to remain in maintenance mode when you do it, then
you’ll need to put your development site into maintenance mode before
copying its database to production.