Ok - here it is. We were having a deep discussion on 'what' was happening and I was finding little or no correlation between analysis rendering and the module ‘not’ rendering. After extensive (many hours) searching of various files I came to the conclusion the PHPNuke uses many ‘dynamic’ variables (e.g. $module, instead of actually naming it). This is when the light clicked on. Where are these names defined, and why are they defined.
With PHPNuke (I admit I cheated a bit because I modded out my menu block to support images) you notice it is used around the world and many languages. Common items are defined in ‘language files’ to be cross-language compatible. This requires a lookup to the current language selection and then the ‘indexing’ of that current language file. In my case it was an “English†language file. As you might have guessed, the language file did contain spaces after the closing tag ‘?>’ which prevented the dynamic operation of generating the image because the English lang. file was not indexed.
This was the tip-off
|
Code:
|
$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . $sitekey . $random_num . $datekey));
$code = substr($rcode, 2, 6);
$image = ImageCreateFromJPEG("modules/$module_name/images/code_bg.jpg"); |
The global and operation on the fly DEPENDING on the proper definition in the language file.
So to fix your security image issues you MUST perform these steps:
- Run ‘analyze.php’ to determine proper GD version/options enabled
- Ensure analyze can render, if it cannot this is an image problem or permissions issue with the folder (analyze will tell you if it cannot locate the image. If it cannot the image is either missing or the wrong CHMOD/CHOWN value is present on one or more of the folders/files containing the image)
- Remove spaces in Config.php, Mainfile.php, and your default language file in the language folder after ‘?>’
Want to make it even more simple? If you are having a problem with the security image and see a red ‘x’ check the ‘alt’ or ‘description’ of that image. If it states ‘X_SECURITYIMAGE’ you should know RIGHT AWAY that this is an issue with the language file and to remove the space at the end.
Sorry to ramble on and on about it. It was troubling to see so many users with the issue and no one had an answer – not even the maker of the CMS – so this is a fine day indeed for the support community.
Steven G.