Updates from September, 2016 Toggle Comment Threads | Keyboard Shortcuts

  • yalamber 7:05 pm on September 24, 2016 Permalink | Reply
    Tags: , Mobile App   

    Calculate Gestational Age based on Nepali date.
    https://play.google.com/store/apps/details?id=net.yalamber.gestationalAge
    Github: https://github.com/yalamber/GestationalAgeCalculator

     
  • yalamber 2:12 pm on September 24, 2016 Permalink | Reply
    Tags:   

    This is quite useful to change translations on the fly.

    function wpexpo_text_strings( $translated_text, $text, $domain ) {
    	switch ( $translated_text ) {
    		case 'Sorry, No coupons available for you.' :
    			$translated_text = __( 'Sorry, there are no coupons available.', 'woocommerce-smart-coupons' );
    			break;
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'wpexpo_text_strings', 20, 3 );
    
     
  • yalamber 8:05 am on September 22, 2016 Permalink | Reply
    Tags: Follow up Emails, Woocommerce,   

    “fue_send_queue_item” filter can be used to manipulate sending email in follow up email plugin.

    add_filter('fue_send_queue_item', function ($status, $queue_item, $email_data, $headers) {
        //TODO: Query to check if queueitem order id email is already sent 
        global $wpdb;
        //check if this is for subscription
        if(
            !empty($queue_item->order_id) 
            && !empty($queue_item->email_id) 
            && !empty($queue_item->meta['subs_key'])
        ) {
            //TODO get subscription and verify. Might not be needed
            //check if we have already sent this email
            $query_email_orders = $wpdb->prepare('SELECT * FROM '.$wpdb->prefix .'followup_email_orders 
            WHERE order_id = %d AND email_id = %d AND is_sent = 1', $queue_item->order_id, $queue_item->email_id);
            $queue_item_row = $wpdb->get_row($query_email_orders);
            if(!empty($queue_item_row->id)) {
                //if already sent delete all other emails with same order_id and email_id
                $query_delete_emails = $wpdb->prepare('DELETE FROM '.$wpdb->prefix .'followup_email_orders 
                WHERE email_id = %d AND order_id = %d AND id != %d', $queue_item_row->email_id, $queue_item_row->order_id, $queue_item_row->id);
                $wpdb->query($query_delete_emails);
                return true;
            } else {
                return false;
            }
        }
        return false;
    }, 10, 4);
     
  • yalamber 3:09 am on September 10, 2016 Permalink | Reply
    Tags: , smartphone   

    OnePlus 3, So far it’s a great phone.

     
  • yalamber 3:00 pm on September 2, 2016 Permalink | Reply
    Tags: , ,   

    This is important to update individual fields in netforum

    function netforum_ind_info_parameters($ind_objects = array()) {
      $xml = "<IndividualObjects>";
      // if it is not an array of hashed arrays, make it one.
      if ( isset($ind_objects[0]) === false || is_array($ind_objects[0]) === false) {
        $ind_objects = array($ind_objects);
      }
      
      foreach ($ind_objects as $ind_fields) {
        $xml .="<IndividualObject>";
        foreach ($ind_fields as $col_name => $data) {
          $xml .= "<$col_name>$data</$col_name>";
        }
        $xml .= "</IndividualObject>";
      }  
      $xml .= "</IndividualObjects>";
      $oUpdateNode = new SoapParam("this", "doesntmatter");
      $oUpdateNode->any = $xml;
      return $oUpdateNode;
    }
     
  • yalamber 2:32 pm on September 2, 2016 Permalink | Reply
    Tags: networking, weekdays   

    Done with setting up our local wireless network. Troublesome day.

     
  • yalamber 12:06 pm on September 1, 2016 Permalink | Reply
    Tags: poem   

    Bhatti talai mana parcha bhatti malai maan parcha
    https://www.facebook.com/formydesh/videos/933427796779755/

     
  • yalamber 9:47 am on September 1, 2016 Permalink | Reply
    Tags: API, ,   

    Successfully done with netforum pro API integration.

     
  • yalamber 9:26 am on September 1, 2016 Permalink | Reply
    Tags: , ,   

    Anything not in the WSDL will get lumped into this “any” element at the end of parsing the XML

     
  • yalamber 5:04 am on September 1, 2016 Permalink | Reply
    Tags:   

    So wordpress does not support slashes in password? Spent lot of hours figuring why netforum SSO was not working and it was because password contained / and quotes.
    Screen Shot 2016-09-01 at 10.48.45 AM

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel