Posted Post

Posted People, Posted Life.

Archive for all

Download StatCounter Log as CSV Function

Today I introduce you a very powerful asp/vbscript function: kDownloadStatCounterLog

Input:

Output:

An CSV text string, you can use CSV2Array function change it to an array

Read the rest of this entry »

Ultimate WP Post Name URL Sanitize Solution

Few days ago, I was not satisfied with the ugly URL of some post, so I hacked “sanitize_title” function. After I said that time, I also not satisfied with super-long URL and want short them. After short WP category permalink structure today, I put more hacked code in sanitize_title function for short URL. Anyhow, shit happens and I noticed sanitize_title function also used almost everywhere, special when normal visitor visit and process the URL. I don’t want to explain how this mess up, just forget it.

So, I need new method of short and nice URL for article post. I need find a place for “apply_filters” or “do_action“, after quite long time track from /wp-admin/post.php, finally I found at sanitize_post_field function, $value = apply_filters(”pre_$field”, $value); to pretreat all submit data.

Here is my filter: Read the rest of this entry »

Fairness, Idealism and Other Atrocities

I am a republican, I am on the RIGHT hand side of life. Check what I got today, Commencement advice you’re unlikely to hear elsewhere. very decent and useful, worth read and think, by P.J. O’Rourke

Well, here you are at your college graduation. And I know what you’re thinking: “Gimme the sheepskin and get me outta here!” But not so fast. First you have to listen to a commencement speech.

Don’t moan. I’m not going to “pass the wisdom of one generation down to the next.” I’m a member of the 1960s generation. We didn’t have any wisdom.

We were the moron generation. We were the generation that believed we could stop the Vietnam War by growing our hair long and dressing like circus clowns. We believed drugs would change everything — which they did, for John Belushi. We believed in free love. Yes, the love was free, but we paid a high price for the sex. Read the rest of this entry »