Author Topic: captcha for 1.7.1  (Read 4676 times)

0 Members and 1 Guest are viewing this topic.

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
captcha for 1.7.1
« on: July 11, 2008, 01:27:21 PM »
Hi,

I have still version 1.7.1 installed. Update to 1.7.6 is not possible at the moment.
But I'd like to implement the captcha feature at least in my contact form.

Can somebody tell me, which code in which file I have to update?
I saw there is a new file captcha.php.

Thanks a lot.
TIMIT

Offline honda2000

  • 4images Guru
  • *******
  • Posts: 3.263
    • View Profile
    • Wir machen Internet!
Re: captcha for 1.7.1
« Reply #1 on: July 11, 2008, 07:53:36 PM »
naja, wenn 1.7.6 nicht geht, dann solltest du dir mal http://www.4homepages.de/forum/index.php?topic=13732.0

das sind die Änderungen von 1.7.2 zur ersten Version mit Captcha 1.7.3

also im prinzip:
/captcha/ als ordner aus der Version 1.7.6 komplett laden
die captcha.php ins root, aus dem update die Erweiterungen der Templates und in dem kompletten Fall noch aus /images/ das rss.gif, exif_bit.html, rss.xml, rss_item.xml als komplett neue Dateien (auch aus der neuen 1.7.6er-Version)

dann hast du zwar immernoch Version 1.7.1

aber mit Captcha, mit RSS, mit EXIF-Info

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Re: captcha for 1.7.1
« Reply #2 on: July 12, 2008, 10:59:06 AM »
warum wird mir captcha in postcard_preview nicht angezeigt?
Wenn ich folgenden Code in postcard_preview lösche, wird der text aber nicht der einzugebende Code angezeigt:
Code: [Select]
{if captcha_postcards}
Code: [Select]
{endif captcha_postcards}(siehe Beispiel unten)

muss ich noch was aktivieren?

was habe ich gemacht:

folgende tables habe ich aus der Version 1.7.6 kopiert:
- captcha.php
- includes/captcha_utils.php
- Folder: /captcha/
- rss.php
- postcards.php
- templates/default/rss.xml
- templates/default/rss_item.xml

postcard_preview.html:
Code: [Select]
{if captcha_postcards}
  <br />
  <table width="450" border="0" cellspacing="0" cellpadding="1" align="center">
    <tr>
      <td valign="top" class="head1">
        <table width="100%" border="0" cellpadding="4" cellspacing="0">
          <tr>
            <td class="row1" valign="top"><b>{lang_captcha}</b></td>
            <td class="row1">
  <a href="javascript:new_captcha_image();"><img src="{url_captcha_image}" border="0" id="captcha_image" /></a> <br />
              <input type="text" name="captcha" size="30" value="" class="commentinput" id="captcha_input" />
              <br />
              {lang_captcha_desc}
</td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  {endif captcha_postcards}

header.html
Code: [Select]
<script language="javascript" type="text/javascript">
<!--

  var captcha_reload_count = 0;
var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
  document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
} else {
  document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
}

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
 
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");

// -->
</script>
{if has_rss}
<link rel="alternate" type="application/rss+xml" title="{rss_title}" href="{rss_url}" />
{endif has_rss}

global.php
Code: [Select]
// Initialize CAPTCHA configuration
$captcha_enable              = 1;
$captcha_enable_comments     = 1;
$captcha_enable_upload       = 1;
$captcha_enable_registration = 1;
$captcha_enable_postcards    = 1;
$captcha_ttf                 = 1;
$captcha_path                = ROOT_PATH.'captcha';
$captcha_chars               = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$captcha_length              = 5;
$captcha_wordfile            = 0;
$captcha_width               = 200;
$captcha_height              = 70;
$captcha_text_color          = '#000000';
$captcha_text_size           = 25;
$captcha_text_transparency   = 60;
$captcha_filter_text         = 1;
$captcha_filter_bg           = 1;

Code: [Select]
if (!$captcha_enable) {
  $captcha_enable_comments     = 0;
  $captcha_enable_upload       = 0;
  $captcha_enable_registration = 0;
  $captcha_enable_postcards    = 0;

Code: [Select]
//-----------------------------------------------------
//--- CAPTCHA -----------------------------------------
//-----------------------------------------------------
include_once(ROOT_PATH.'includes/captcha_utils.php');

page_header.php
Code: [Select]
  "url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),
folgenes hatte ich auch versucht - config.php
Code: [Select]
$captcha_enable = 1;
$captcha_enable_postcards = 1;
$captcha_path = './captcha';
« Last Edit: July 12, 2008, 01:46:46 PM by TIMT »