Ads

Saturday, May 23, 2020

how to prnt json data printed from get_file_contents php function

I printed this json from a get_file_contents output.

{"status":"INVALID_CREDENTIALS"}

Now I want to echo the content of "status" and I used

echo $status

but not working. Please help.



source https://stackoverflow.com/questions/61965703/how-to-prnt-json-data-printed-from-get-file-contents-php-function

Execute script from Web Server

I want to run an Apache web server on my raspberry pi 4, assuming i've already set this up what would i need to do so that every time that the web page was accessed a python script on my windows pc would run.

for example i have a script called test.py located at 'C:\Users\jack\python\test.py

How would i be able to make this script run every time that the web page running on my pi was accessed. The only way ive seen is to set up a receiver python script on my windows pc to listen for incoming requests from a script that would run on the web server however i just want a script to launch on my pc when the webpage is accessed and not have to be running a receiver script.

The devices are both connected to the same network



source https://stackoverflow.com/questions/61965663/execute-script-from-web-server

search users and posts WP

Changing my earlier post as I realised it wasn't the way I thought, and included most of below is the search file used on my website, it searches in posts table title and IDs, I want it to search users table too, so if the keyword matches a user_nicename then it should include the user name or at least users posts in the search result.

enter code here````if( !class_exists( 'Adifier_Advert_Query' ) ){

    public $args;

    function __construct( $args = array() ) {

        $args['orderby'] = empty( $args['orderby'] ) ? 'expire' : $args['orderby'];
        $args['order'] = empty( $args['order'] ) ? 'DESC' : $args['order'];

        $args = array_merge( array(
            'post_type'             => 'advert',
            'orderby'               => 'expire',
            'order'                 => 'DESC',
            'post_parent'           => 0,
            'status'                => '',
            'posts_per_page'        => adifier_get_option( 'adverts_per_page' ),
            'return_all'            => false,
            'expired'               => false,
            'sold'                  => false,
            'urgent'                => false,
            'include_top_ads'       => false,
        ), $args);

        $this->args = $args;

        add_filter( 'posts_fields', array( $this, 'posts_fields' ) );
        add_filter( 'posts_join', array( $this, 'posts_join' ) );
        add_filter( 'posts_where', array( $this, 'posts_where' ) );
        add_filter( 'posts_orderby', array( $this, 'posts_orderby' ));
        if( $this->args['include_top_ads'] ){
            add_filter( 'posts_request', array( $this, 'posts_request' ));
        }

        parent::__construct( $args );

        adifier_clear_filter( 'posts_fields', array( $this, 'posts_fields' ) );
        adifier_clear_filter( 'posts_join', array( $this, 'posts_join' ) );
        adifier_clear_filter( 'posts_where', array( $this, 'posts_where' ) );
        adifier_clear_filter( 'posts_orderby', array( $this, 'posts_orderby' ));
        if( $this->args['include_top_ads'] ){
            adifier_clear_filter( 'posts_request', array( $this, 'posts_request' ));
        }
    }

    /*
    * In order to provide top ads which will list with regular ones we need to use UNION ALL
    * This will be applied on completed query for searching
    */
    static public function posts_request_process( $sql, $ids, $posts_per_page, $paged ){
        if( !empty( $ids ) ){
            global $wpdb;
            $ids = array_unique( $ids );
            $sql = preg_replace( "/LIMIT.*/", '', $sql );
            preg_match("/ORDER BY.*/", $sql, $match);
            $orderby = !empty( $match[0] ) ? str_replace( array('adverts.', 'ORDER BY ', $wpdb->posts.'.'), '', $match[0] ) : '';
            $sql = $sql1 = $sql2 = preg_replace( "/ORDER.*/", '', $sql );
            if( strstr( $orderby, 'post_date' ) ){
                $select_fields = "{$wpdb->posts}.ID, {$wpdb->posts}.post_author, FROM_UNIXTIME(1544822069+FLOOR(RAND()*31536000)) AS post_date, {$wpdb->posts}.post_date_gmt, {$wpdb->posts}.post_content, {$wpdb->posts}.post_title, {$wpdb->posts}.post_excerpt, {$wpdb->posts}.post_status, {$wpdb->posts}.comment_status, {$wpdb->posts}.ping_status, {$wpdb->posts}.post_password, {$wpdb->posts}.post_name, {$wpdb->posts}.to_ping, {$wpdb->posts}.pinged, {$wpdb->posts}.post_modified, {$wpdb->posts}.post_modified_gmt, {$wpdb->posts}.post_content_filtered, {$wpdb->posts}.post_parent, {$wpdb->posts}.guid, {$wpdb->posts}.menu_order, {$wpdb->posts}.post_type, {$wpdb->posts}.post_mime_type, {$wpdb->posts}.comment_count ";
                $sql1 = str_replace( $wpdb->posts.'.*', $select_fields, $sql1 );
            }
            $sql1 = str_replace( array( 'SQL_CALC_FOUND_ROWS', 'AND adverts.expire'), array( 'SQL_CALC_FOUND_ROWS 1 AS topad, ', 'AND '.$wpdb->posts.'.ID IN ('.join( ',', $ids ).') AND adverts.expire' ), $sql1 );
            $sql2 = str_replace( 'SQL_CALC_FOUND_ROWS', '0 AS topad, ', $sql2 );
            $offset = ( $paged - 1 ) * $posts_per_page;

            return "({$sql1}) UNION ALL ({$sql2}) ORDER BY topad DESC, {$orderby} LIMIT ".$wpdb->prepare( "%d, %d", $offset, $posts_per_page);
        }
        else{
            return $sql;
        }
    }


    function posts_request( $sql ){
        $top_ads = adifier_get_top_ads_list();
        $ids = array();
        if( !empty( $top_ads ) ){
            if( !empty( $_POST['category'] ) && !empty( $top_ads[$_POST['category']] ) ){
                $ids = array_keys( $top_ads[$_POST['category']] );
            }
            else{
                foreach( $top_ads as $term_id => $data ){
                    $ids = array_merge( $ids, array_keys( $data ) );
                }
            }
        }
        if( !empty( $ids ) ){
            return self::posts_request_process( $sql, $ids, $this->args['posts_per_page'], $this->args['paged'] );
        }
        else{
            return $sql;
        }
    }

    /*
    * Select all values from adifier_advert_meta_data table
    */
    static public function posts_main_fields( $sql ){
        return $sql . ", adverts.*, ".self::currency_filter()." AS sort_price ";
    }

    function posts_fields( $sql ) {
        return self::posts_main_fields( $sql );
    }

    /*
    * Join adifier_advert_data table and all relationships for range searches
    */
    static public function posts_main_join( $sql ){
        global $wpdb;
        $sql .= " INNER JOIN {$wpdb->prefix}adifier_advert_data AS adverts ON $wpdb->posts.ID = adverts.post_id ";

        return $sql;
    }

    function posts_join( $sql ) {
        global $wpdb;
        $sql = self::posts_main_join( $sql );
        if( !empty( $this->args['tax_query_between'] ) ){
            foreach( $this->args['tax_query_between'] as $key => $data ){
                $unique = esc_sql( preg_replace("/[^a-z]+/", "", $data['taxonomy']) ).'_'.esc_sql( $key );
                $sql .= " LEFT JOIN {$wpdb->prefix}term_relationships AS btr{$unique} ON $wpdb->posts.ID = btr{$unique}.object_id ";            
            } 
        }

        return $sql;
    }

    static public  function posts_where_not_expired( $sql ){
        global $wpdb;

        $sql .= $wpdb->prepare( " AND adverts.expire > %d ", current_time('timestamp') );

        /* this is applied onbly on public queries so we will add filter by inactive users here */
        $inactive = get_option( 'adifier_inactive_users' );
        if( !empty( $inactive ) ){
            $sql .= " AND {$wpdb->posts}.post_author NOT IN (".join( ',', $inactive ).") ";
        }       

        return $sql;
    }

    function posts_where( $sql ) {
        global $wpdb;
if( !empty( $this->args['s'] ) ){ $sh = $args['s'];
$nowhere = str_replace('(' .$wpdb->users . '.ID LIKE', '(' . $wpdb->users . '.user_nicename LIKE ' . $sh . ') OR (' . $wpdb->users . '.ID LIKE', $nowhere); echo "$nowhere";} 


        /* if keyword is set and it is numeric search for ID as well */
        if( !empty( $this->args['s'] ) ){
            if( is_numeric( $this->args['s'] ) ){       
                $sql = str_replace( "({$wpdb->posts}.post_title LIKE", $wpdb->prepare( "({$wpdb->posts}.ID LIKE %s) OR ({$wpdb->posts}.post_title LIKE", $this->args['s'] ), $sql);
            }
        }       



source https://stackoverflow.com/questions/61953484/search-users-and-posts-wp

Monday, June 24, 2019

How to Register Mobile Phone in PTA?


Next Video: How to unblock your pta blocked phone? (Subscribe and Share before new video) How to Register Mobile Phone in PTA ? How to Register Mobile in Pakistan? Register mobile phone and pay duty tax. mobile register karne ka tarika Mobile ko passport per register krne ka tareeka register mobile phone pta registration mobile pta pta mobile registration free how to register mobile in pta with passport pta mobile registration kaise kare Subscribe to my channel https://www.youtube.com/channel/UCG1Z... Learn and get useful information about Mobiles, Software and Computer. Donate some $$ if your phone come to life! Skrill: athar.techs@gmail.com PerfectMoney: U19533564

Saturday, December 31, 2016

Rubix Cube solve Step by Step - Rubix Cube Solve - Solve Rubic Cube in Two moves - Rubix Cube Easy Solution - Rubic Cube Fomula

Watch this video and learn how to solve Rubix Cube in just two easy moves.Watch and follow the formula to solve rubix cube.

{ Rubix Cube solve Step by Step - Rubix Cube Solve - Solve Rubic Cube in Two moves - Rubix Cube Easy Solution - Rubic Cube Fomula }


Tuesday, December 13, 2016

Most Funny: Baby eating punch

funny videos 2016 - Self walking machine- Very funny video

Very funny video: Sweet baby playing with cat

Payoneer & Fiverr: Make Money Online and Recieve with Payoneer

Earn Money Online:
There are many ways to make money online but , in Pakistan, it is very difficult to receive payments from other countries online.So there is an easy way ,discussed bellow, make money in Pakistan easily with Fiverr.
Now people in Pakistan can receive their payments directly to their bank account easily.

What is fiverr?
Fiverr is an alternative to Freelancer where workers sell their services and make Thousands of dollars per day.It means that users (Particularly students) can earn money easily.On fiverr, Buyers create a request for service and set their budget and Sellers give them an offer.If the buyer accepts the offer, he pays to him and get his service.

How to make money?
This is well known question asked by many people especially by students who want to make money online.Today I will describe an easy way to make money online and I'll teach you that how you can receive your earnings in your Account (especially in Pakistan). Many Pakistani people have trouble in receiving their earnings.Now they can receive their earnings easily by using Payoneer Account.
First of all, register your account on fiverr by just following these steps

-- Register Your Account on Fiverr by Clicking on Register Now bellow

-- Set an attractive profile picture so that people can trust you

-- Update your Description which may contain on your Experiences and your Hobbies

-- After updating your description, Create a New Gig and enter what you can do and set prices for your service

-- After completing the Gig process, share it to your Friends so that you will get more buyers.

For some days, you will not get any order for your service but don't worry, You will get orders after a few days or weeks.

Register Now


How to receive your Earning in Pakistan?
It is very difficult to receive money online in Pakistan so we have found an online USA company who provides the facility to receive money in Pakistan and in all over the world.That company is Payoneer.Payoneer allows people to send and receive money online in all over the world.After registering your Account with Payoneer, thay will send you a master card which can be used to withdraw money from your account.They also provides an US Payment service to Deposite money in your Payoneer account.
How to Apply for Payoneer Master Card?
You can apply for a Payoneer's Master Card by just following the bellow steps.Payoneer's Master Card is free charge.You will receive your Master Card in 7-15 business days and after receiving your card, you will have to activate it before using.So lets start to apply for Master Card

-- Click on Apply Now

-- Fill the form with your personal details and Complete the registration form

-- You will be prompted for you ID, Just capture two pictures of your NIC (Front and Back side) and Submit it when prompted.

-- After successful registration, you will have to wait for 7-15 business days to get your Card.

-- When you will receive your Master Card, Now you have to activate it so you can use it after activating.When you will login to your Payoneer Account, there you see an activate card link.Click on that link and set new Pin for you Master Card.

Apply Now


Congratulations...!
Now you are ready to use your Payoneer Account to receive money from Fiverr.

(Note: Please do not apply for more than 1 account per family, otherwise they can ban your account and you can lose your account balance!)

Tuesday, October 18, 2016

SMS CASTER 3.6 keygen

Hello friends! Now you can buy sms caster 3.6 keygen in just Rs. 500, or call me to get a discount price. My phone no.  03039470421

Saturday, October 15, 2016

Best web hosting 30 days free trial without need of credit card

Today I going to share a website that provides Best web hosting 30 days free trial without need of credit card. It means that you dont have to pay a panny to start your website. You have to just regigister ur account with zameenhost and you will get a trail of 30 days with full functionality. Just register your account on this website  ZAMEENHOST