Archive for June, 2008

Change Text Color in Vader Style on the K2 Theme

This information is intended for WordPress K2 Theme users playing around with the included Vader style.

I was modifying the Vader.css for a site. I could not figure out how to change the text color for the posts. The style “right out of the box” has a gray text color on a black background which, in my opinion, is uncomfortable to read. I’m not a big fan of light text on a dark background anyway, but the default text color in Vader is really bad.

As it turns out, the text color is coming from style.css and not being changed by vader.css at all.

Add this to vader.css to change the text color:

.entry-content {
color: #999999;
}

“#999999″ works well or you can go lighter yet - just play with it. Hope this helps if you are exasperated and out searching. Leave me a comment if you found this post helpful. :-)

VDaemon Error: Can't unserialize validators information.

This post is for anyone having a problem using VDaemon for web form validation getting the error message “VDaemon Error: Can’t unserialize validators information.

I moved the site using VDaemon to a new server and started getting the error message.

Old Server:
VDaemon: 2.3.0
OS (from command “cat /etc/issue”): CentOS release 4.5 (Final)
Apache: 2.0.46 (Red Hat)
PHP: 4.4.2

New Server:
VDaemon: 2.30
OS (from command “cat /etc/issue”): Red Hat Enterprise Linux ES release 3 (Taroon Update 9)
Apache: 2.0.63 (Unix)
PHP: 5.25

The problem was in the vdaemon.php file in the function VDValidate().

There are two specific instances in the function where the line “$sErrMsg = VD_E_UNSERIALIZE;” is setting the error message.

There is a string comparison on the “if” statements before each line. From old server to new server the value being returned by the PHP “get_class” function in the “if” statement is returning a different case. My old server was returning a strictly lower case value and my new server is not.

The surest way to handle this error no matter what case your environment delivers the results is to force a comparison of same case to same case. I used the PHP “strtolower” function to convert the “get_class” result to lower case and *then* compare it to the string listed in the “if” statement. The text strings being compared (”cvdvalruntime” and “xmlnode”) were already in lower case on my distribution of VDaemon but if they are not strictly lower case in your code, change them to lower case.

Here are the two lines that I changed:

Before: if (!$oRuntime || get_class($oRuntime) != ‘cvdvalruntime’ || !is_array($oRuntime->aNodes))
After: if (!$oRuntime || strtolower(get_class($oRuntime)) != ‘cvdvalruntime’ || !is_array($oRuntime->aNodes))

Before: if (get_class($oRuntime->aNodes[$nIdx]) != ‘xmlnode’)
After: if (strtolower(get_class($oRuntime->aNodes[$nIdx])) != ‘xmlnode’)

This fixed it for me.

If this helped you out, leave a comment! :-)