Sometimes (make that many), I find out hacks or little solutions on my own to help fellow colleagues and friends. I always thought that someone on the internet might also find them useful but never posted them because they are little hacks and wouldn’t look good for a whole post. So, today it struck me that I should create a single post that I could update with time and include all the little hacks in it.If you think that you have a better solution to something I post, then please feel free to post it. Let’s start off with some:
1- Magento Admin Logon fails on Localhost
Why it happens: Magento has a core security feature that checks if the domain it is installed on is indeed legit or correct. It can be avoided if you use the option to save session data in the database while installing Magento.
Solution: If you’re using Magento version 1.4+ then do this:
Open up Varien.php at app\code\core\Mage\Core\Model\Session\Abstract and search for the following line:
call_user_func_array('session_set_cookie_params', $cookieParams);
Comment that line and it will start working. Remember that it is not a good idea to use this hack on a live server.
If you’re using Magento version <=1.3, this solution is present on Magento forums as well. Open the same file (Varien.php) and do the following:
-Find the code,
session_set_cookie_params( $this->getCookie()->getLifetime(), $this->getCookie()->getPath(), $this->getCookie()->getDomain(), $this->getCookie()->isSecure(), $this->getCookie()->getHttponly() );
-Replace above code by,
session_set_cookie_params( $this->getCookie()->getLifetime(), $this->getCookie()->getPath() //$this->getCookie()->getDomain(), //$this->getCookie()->isSecure(), //$this->getCookie()->getHttponly() );
2- Changing Windows 7/Vista wallpaper through Commandline/Registry
Now I know that this hack isn’t the best way to do it. So, if you guys know of a better way, then do let me know.
copy TranscodedWallpaper.jpg %APPDATA%\Microsoft\windows\Themes\ > nul reg add "HKCU\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "%APPDATA%\Microsoft\windows\Themes\TranscodedWallpaper.jpg" /f > nul taskkill /f /IM explorer.exe > nul start explorer.exe
Yes, the file needs to be named TranscodedWallpaper.jpg, because if you don’t then Windows will rename it and Transcode it to JPG automatically.
3- WordPress AZIndex plugin shows a blank page/broken page
AZIndex is a great plugin for wordpress but unfortunately, the author hasn’t been updating it for a while now. One of the issues that has risen after the wordpress 2.8 upgrade is the plugin not displaying any output. It will either display a blank page or a broken page with no entries on it when used.
The solution is simple, you need to look into your site’s error log and search for the term “strtoupper" function does not exist or there’s an error in the azindex cache file. Here’s what you need to if you see that error:
1) Open the “azindex/az-index-cache.php” in your wordpress plugin directory.
2) Search forĀ (function_exists("mb_substr"))
2) Replace
} else if (function_exists("mb_substr")) {
with
} else if (function_exists("mb_substr") && function_exists("mb_strtoupper")) {
3) Save the file and refresh your wordpress page.
It should work now.
Related posts:







No comments yet.
Leave a comment