If your OpenX installation is printing-out the following: Strict Standards: Non-static method PEAR::setErrorHandling() should not be called statically in /home/user/directory/lib/Max.php on line 222 Strict Standards: Non-static method OA::debug() should not be called statically, assuming $this from incompatible context in /home/user/directory/lib/max/ErrorHandler.php on line 134 Strict Standards: Non-static method Log::singleton() should not be called statically, assuming $this… Continue reading OpenX – PHP 5.4.34 Upgrade Error Fix
Tag: PHP
Avoid FTP Info Request From WordPress Updates
When performing WordPress updates, some installations prompt for FTP information. This request for FTP information is because WordPress cannot write the updates to files on the server through PHP and therefore requests FTP login information to attempt to write files via FTP instead of PHP. But, if you do not have FTP access, or do… Continue reading Avoid FTP Info Request From WordPress Updates
Solving WordPress’s White Screen of Death
WordPress has an issue that can be dumbfounding to say the least. An occurrence called the “White Screen of Death” can happen for really any issue; incompatible plugin, theme bug, an update to a file, etc. But it’s the blank screen with no information that is the difficult part of solving the blank screens cause.… Continue reading Solving WordPress’s White Screen of Death
How to Get The Domain and TLD from a URL using PHP and Regular Expression
How to get a domain and it’s TLD from a URL string using PHP and Regular Expression: preg_match(“/[a-z0-9\-]{1,63}\.[a-z\.]{2,6}$/”, parse_url($_url_string, PHP_URL_HOST), $_domain_tld); echo $_domain_tld[0]; This is particularly useful for dealing with country TLD’s, like co.uk, on.gc along with the general .com, .net, etc. It is also capable of ruling-out multiple subdomains like: http://i83tr.cdn-2.delivery.net/homepage/sprite.png so you end… Continue reading How to Get The Domain and TLD from a URL using PHP and Regular Expression
PHP, Dynamically Checking Colors for Legibility Contrast
When writing code to dynamically create background colours and text colours, there is always the potential those two colours will not look appropriate together, and will either render the text illegible or create oscillating text. Enter Split Brain .org‘s Color Contrast Checker It’s a very helpful script, to prevent some illegible dynamic text colors from… Continue reading PHP, Dynamically Checking Colors for Legibility Contrast
WordPress Find All Global Details
The following piece of code will help list all objects, arrays and vars in the $GLOBALS variable scope. < ?php foreach($GLOBALS as $glob_key => $glob_val){ echo $glob_key.” – “; echo (is_array($glob_val)||is_object($glob_val))?print_r($glob_val,1):$glob_val; echo “\r\n”; } ?> This can be very useful as there is usually a lot of information stored in $GLOBALS by both WordPress and… Continue reading WordPress Find All Global Details
WordPress Reserved Terms
A great list to know: WordPress, Reserved Terms A lot of issues can arrise if reserved terms are used in customization of WordPress Taxonomy and Post Types. Just best to avoid these terms in whole.
Replace HTML tags with PHP
preg_replace(‘@< (iframe|script|noscript)\b.*?>.*?@si’, ”, $string); Removes iframe, script and noscript tags and contents from $string. Performs an inverted version of strip_tags function.
PHP imagick – website references, manuals and information
http://eclecticdjs.com/mike/tutorials/php/imagemagick/ http://jamesroberts.name/blog/tag/imagick/ Mikko’s blog imagick is a more advanced graphics library than the default GD for PHP, but the ImageMagick PHP library imagick is only documented on PHP.net comments, so using the library can be a bit challenging, but the sites above help in using the library.
Multiple MySQL query with PHP
// Enter multiple query string $query_str = ” — Update table UPDATE t SET id = id + 1; — Insert into table INSERT INTO example (name, age) VALUES(‘John Doe’, ’23’ ); “; // Explode string into separate queries $query = explode(‘;’,$query_str); // Loop through exploded queries and execute foreach($query as $index => $sql) {… Continue reading Multiple MySQL query with PHP