Sony Vaio Won’t Start Up Fix

A week ago my Sony Vaio, that had just inched past the warranty period, refused to boot up. This was following a power surge/spike and I thought the computer was completely fried. After a few hours of troubleshooting and trying things, I finally found out the problem.

The battery.

Now, you would assume the battery would have nothing to do with the computer starting up. Indeed, I would assume some people run their laptops without the battery altogether. But in my case, I found out the laptop needed the battery to start up.

Unfortunately, my battery was zapped/drained of all energy too.

So, what I did was … wait. I removed the battery from the laptop compartment and set it on my desk for an hour, put it back into the laptop, plugged in the AC and it booted up. It would seem that if the power is completely knocked out of the laptop, it still needs a boost of battery power to get it going – even with an ac adapter.

Without the battery, my laptop wouldnt start up, and the “plugged in” indicator on the laptop wouldn’t even light up. The AC adapter looked fine, and tested fine, but it would not power on the device until the battery built up enough charge by remaining dormant and then finally it had enough juice to start up and begin charging the battery again.

I think maybe the shock drained the CMOS battery, and it needs to draw from the battery to get it going again.

Now that it is up and running – no problems! I hope this helps others with the same issue with their Vaio laptop not powering on.

My Basement Flooding

A short video of my basement flooding Tuesday night. Yay.

Using PHP in WordPress3 Posts and Pages

A project we are working on at Captain Jack Communications sent me googling for a solution today, when we needed to extend WordPress and provide some custom database programming within a particular page. From my own personal dabblings in such things, I knew there was a plugin (or two) that allowed you to put PHP in text box widgets and pages.

I went to the page for Exec PHP plugin, and despite reading the warnings, decided to give it a try – no luck.  It seems it does not work on the latest version of WordPress.  I also learned of another one that would do includes, but again, no luck.  So, after thinking for a bit, I came up with the only solution, and maybe it actually is the best solution.

I connected to the server via FTP and navigated to the themes folder, and downloaded the page.php file of the theme I was using.  I renamed it, in this case, rankings.php and uploaded it.  Then I used my FTP client to change the permission to 777 so it could be edited from within wordpress.

From there, I edited the new file, making sure the first few lines were:

<?php
/*
Template Name: Rankings
*/

get_header();
?>

After that, I had the entire page the same as the theme’s default template, and where I wanted my PHP to be I added this line:

<? include ABSPATH . "/wp-content/custom-php/ranking_page.php"; ?>

I then uploaded my PHP script(s) to that new custom-php directory where they lived happily ever after.

Now, when I add a page in the admin area, on the right hand side under Page Template, it asks me if I want the rankings.php page or the template’s default.  I choose the rankings.php page, hit publish, and my code is now integrated into that page only.

I hope this makes sense.  If anybody knows of a PHP plugin that actually works with WordPress 3, please let me know.  But I think this way is far more secure and coder-friendly.