logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Martin Pham

Website

Bio:

My contact info

Email: marxvn@gmail.com

Answers Given: 104 (see them all)
Contests Won: 41
Prize Money Earned: $550
Questions asked: 0
Questions refunded: 0 (see all?)
Is a top asker (has the power to vote on anything):
Subscribes to all the discourse posted to the site?: No
Country: Vietnam
City: Ninh Binh
Netvotes this month (upvotes minus downvotes): 0
Netvotes of all time (upvotes minus downvotes): 0
Joined the site: July 9, 2012





Martin Pham's upvoted answers:






Martin Pham's downvoted answers:






Answers given to these questions:

See more?






Questions voted:

The community is grateful to those experts who take the time to vote on questions.

See more?






Martin Pham has not asked any questions






This member has not made any recommendations. If you are one of the top experts, please offer one now!






Martin Pham's discourse:

Written in response to Get age from birthdate function:

Hi,
I try to check the function of Fahd Murtaza, it will be limited by some the date format.

... will be:


function getAge($birthdate, $format = '' ) {
if(!$format) $format = get_option('date_format');
$birth = DateTime::createFromFormat($format, $birthdate);
return $birth->diff(new DateTime())->y;
}


for example:


$birthdate = '1983/07/22'; // wp date_format is : Y/m/d
echo getAge($birthdate);

// for custom

echo getAge($birthdate, 'Y/m/d');

link

Fahad Murtaza had responses to this.

Written in response to something Dbranes wrote.

Thanks Dbranes for this!

link

Dbranes had responses to this.

Hello everyone,
I have to go back and hope to help more people.

----
Dear Lawrence,

I see there is some error in javascript on this wpquestions, detail:

* This code has been set incorrectly

<script type="text/javascript">
var active_site_questions = "{"javascriptquestions":1,"filemakeremerg":0,"symfonyexperts":1,"mysqlemergency":0,"dotheyknowaboutyou":0,"tutorruby":0,"startupquestions":0,"dpquestion":0,"wpquestions":2,"minxaweb":0,"lkrubner":0,"myhomework":0}";
</script>


-- Correctly: do not use double quote "" the variable is an array.

<script type="text/javascript">
var active_site_questions = {"javascriptquestions":1,"filemakeremerg":0,"symfonyexperts":1,"mysqlemergency":0,"dotheyknowaboutyou":0,"tutorruby":0,"startupquestions":0,"dpquestion":0,"wpquestions":2,"minxaweb":0,"lkrubner":0,"myhomework":0};
</script>


------------------

function my_callback did not work correctly when receiving empty data.

please use:

function my_callback(object) {
// clear div makeup
jQuery('#who_is_logged_in').html(' ');

//return if object empty or not define
if (object === null || typeof object === 'undefined') return;

// do something
}

=======================
or use this solution to save a number of queries to the server (passed cross-domain with json callback):

1. For file who_is_logged_in_example.php (on a different domain):

<?php
ob_start();

if ( ! defined( 'DIR' ) ) define('DIR', (($getcwd = getcwd()) ? $getcwd : '.'));

$seconds_to_cache = 60;
/* Fetch cache file on disk
* Class JG_Cache at http://www.jongales.com/blog/2009/02/18/simple-file-based-php-cache-class/
*/
$cache = new JG_Cache(DIR.'/cache');
$data_users_login = $cache->get('key', $seconds_to_cache);

if($data_users_login === FALSE) {
$_users = array(); // do something
$data_users_login = json_encode($_users);
unset($content);
$cache->set('key', $data_users_login );
}

$exp = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT";
header("content-type: application/json");
header("Expires: $exp");
header("Pragma: cache");
header("Cache-Control: max-age=$seconds_to_cache");

echo $_GET['callback']. '('. $data_users_login . ')';

ob_end_flush();
?>


2. Use js functions on wpquestions.com or another domain:

function get_users_online() {
jQuery.ajax({
url: "http://domain.com/who_is_logged_in_example.php",
cache: false,
data: {}, // some query string
dataType: "jsonp",
jsonp : "callback",
jsonpCallback: "jsonpcallback_func"
});
}
function jsonpcallback_func(data) {
// do something with the received data
}


___

Best Regards,
Martin

link

Written in response to Please could i ask for assistance as to how an expert would visualize implementi...:

sorry John Cotton, I was wrong downvote for additional discourse http://wpquestions.com/flag/show/id/9805 after I read it.

link

Lawrence Krubner had responses to this.

Written in response to Add_Action Wordpress Gallery to use Name Instead of Post ID:

Hi spencert,
i'm wrong with $title vs $Title in function get_post_id_by_title

wrong

$post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} AND post_type='post' ", $Title) );


correct


$post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM {$wpdb->posts} AND post_type='post' ", $title) );

link

Written in response to Help with Flexi Quote Rotator Plugin:

please remove any line - space...empty before start line and end line. Make sure

<?php
.....
?>


dont




<?php
.....
?>


link

Sam Nasr had responses to this.

Written in response to Category Images displayed in a dynamic grid:

upload image using wordpress Media Library (wp-admin/upload.php) and select default when you post a page (grid) for display all parent category...edit link and make request to get child CAT of parent. Totally can do if you know patience.

link

Written in response to WP_Query do not include posts with certain value in custom field:

I think, I give solution for this problem works very well. But the question was given refund ...
And here http://wpquestions.com/question/showLoggedIn/id/6818 asked the same person and it also refund

link

Written in response to something Lawrence Krubner wrote.

Thanks Lawrence for this.
I will stop current job for Karent until this is resolved. I wait your response.

link

Lawrence Krubner had responses to this.

Written in response to Opencart SSL issues :

Change
http://s7.addthis.com/js/250/addthis_widget.js

to

https://s7.addthis.com/js/250/addthis_widget.js

link

Written in response to make div width for header:

I can only give you some small tips to be able to edit any of the themes. This is free. If you are interested can contact me via email: marxvn@gmail.com

link

See more?






Martin Pham has not had any questions refunded






Martin Pham suggested these prizes as appropriate for these questions:

See more?