I'm creating a gallery that will display images to logged in users only. I will create the accounts on a need to basis (no user registration). I want the users to post comments on pictures and use the captcha system for the comments. I have everything running fine, except for the captcha, the image doesn't appear when the gallery is viewed with a theme I created. If I switch to the curve theme, for instance, then the captcha image shows up. My theme is based on the curve theme. I have looked in the docs and forum, and couldn't find any solution.
Technical info:
- Clean install of cpg 1.5.12
- GD library and Free Type are enabled
- Account for testing:
username: test
password: test
- Website: http://family.thealmostaranch.com (http://family.thealmostaranch.com)
Please attach your whole theme as zip file if you need help with your custom theme. Maybe you want to contribute that theme and share it with the community?
Sorry, didn't realize you'd need the theme files. I've attached them to this message (this is the first time I try an attachment here, so hopefully it'll work).
Never thought of contributing my themes 'cause I'm far from being perfect in my coding, I'm sure of that.
Although I do not have time to look at the theme a quick suggestion
is to look at / replace the file captcha.php.
Try: http://family.thealmostaranch.com/photogallery/captcha.php
You will see there is no image.
Also - try taking the gallery out of the frame you have it in.
Also - Make sure if using an HTML / php editor that all files are saved as UTF-8 without BOM.
It's definitely a theme error, probably a whitespace or blank line outside the <?php ?> block, because
- http://family.thealmostaranch.com/photogallery/captcha.php?theme=curve works, but
- http://family.thealmostaranch.com/photogallery/captcha.php?theme=x doesn't work.
I haven't tested that, but please try if it works when you remove the first line
<meta http-equiv="content-type" content="text/html;charset=utf-8">
in
theme.php completely.
André:
Thank you! That solved it. I can now see the Captcha image and it works.
Joe:
Thank you for the suggestions. André's solution is the one that worked. Never heard of utf-8 without BOM. Will have to look that up.