TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 629
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 513
  • Total: 513

Captcha For Article Comments Broken

Started by sheik28, October 20, 2008, 11:53:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sheik28

When I change to the default theme (CORE) I get this error at the top of the page
Parse error: syntax error, unexpected '<' i***/*****/Sources/Load.php(1741) : eval()'d code(183) : eval()'d code on line 1

SmokyBlue

ok so try to reupload the smf files as well.. post back, im sure we can get you going right..  ;)

sheik28

Here is the full error:
Quote

Apply Filter: Only show the errors with the same message
8: Undefined index: HTTP_X_UP_DEVCAP_SCREENPIXELS
/f/Sources/Load.php(1741) : eval()'d code
37

bloc

That seems like an error possibly related to the graphics library that loads within the server. CAPTCHA use font libraries to render the images.

Have CAPTCHA been working before?

sheik28

Quote from: Bloc on October 23, 2008, 04:20:13 PM
That seems like an error possibly related to the graphics library that loads within the server. CAPTCHA use font libraries to render the images.

Have CAPTCHA been working before?
Yes.

IchBin

It doesn't work because you have added some custom code to the theme BEFORE the <doctype> delcaration. You'll also notice that captcha for registration doesn't work if you have it enabled. This is a common problem some people seem to make. You've put a div in your index.template.php I'm assuming. This <div> needs to be moved directly AFTER the <body> tag. All your captcha stuff should start working after that.

FUBAR

I had the same problem a little while back and it wasn't Tinyportal that created the problem, it was an issue with SMF. 

If your problem is the same as mine then you'll probably notice you haven't had anyone register on your site for a while.  This is because the captcha affects the register page as well.  To check this just try and register on your site, if the image is blank then it's the same problem I had. 

Here's what I did to fix it...

Open up Sources/Subs-Graphics.php

Find:
      foreach ($characters as $char_index => $character)
      {
         // Can we use true type fonts?
         $can_do_ttf = function_exists('imagettftext');

         // How much rotation will we give?
         if ($rotationType == 'none')


Replace with:
      foreach ($characters as $char_index => $character)
      {
         // Can we use true type fonts?
         // Not on this server...
         $can_do_ttf = false;

         // How much rotation will we give?
         if ($rotationType == 'none')


Remember to backup this file before changing anything.

Hope this helps...;)

IchBin

There is no reason to make the above change if you follow my post.

FUBAR, I really appreciate the help. But changing that code turns off TrueType fonts, which is not necessary, and really should only be used as a last option if you have exhausted other options.

sheik28

Quote from: IchBinâ,,¢ on October 24, 2008, 12:03:04 AM
It doesn't work because you have added some custom code to the theme BEFORE the <doctype> delcaration. You'll also notice that captcha for registration doesn't work if you have it enabled. This is a common problem some people seem to make. You've put a div in your index.template.php I'm assuming. This <div> needs to be moved directly AFTER the <body> tag. All your captcha stuff should start working after that.
Thanks.
That worked for the CAPTCHA. :up: :up: :up:

FUBAR

Quote from: IchBinâ,,¢ on October 24, 2008, 12:18:19 AM
There is no reason to make the above change if you follow my post.

FUBAR, I really appreciate the help. But changing that code turns off TrueType fonts, which is not necessary, and really should only be used as a last option if you have exhausted other options.

I tried to look for <div> in my index.template.php in my default theme folder and my custom theme, although couldn't find it.  I would really like to solve this problem as well but using the correct method.  Is there something I'm doing wrong or am I looking on the wrong place? 

I am currently using the method I posted to correct the issue but would much rather have it corrected the proper way. 

This website is proudly hosted on Crocweb Cloud Website Hosting.