Burning Burning
  • Theme Designer
  • Theme Designer
  • Joined: 2006/8/22 15:44
  • Group: Registered Users Repository Group
  • Posts: 1163
  • Posted on: 2010/9/29 8:36
Improve default captcha - trouble with language define and path #1
hi'

First sorry if this question has been already resolved, I don't know wich keyword to use


I would like to replace this sentence by an icon :
Quote:
define('_CAPTCHA_REFRESH', 'Click to refresh the image if it is not clear enough.');

(www/language/english/captcha)


To do it, I must :

• 1. edit www/class/captcha/image.php, line 89

Replace :
$image .= "<br /><a href="javascriptxoops_captcha_refresh('" . ($this->config['name']) . "')">" _CAPTCHA_REFRESH "</a>";

By :
$image .= "<a href="javascriptxoops_captcha_refresh('" . ($this->config['name']) . "')" title="_CAPTCHA_REFRESH"><img class="captcha-reload" src="captcha-ico-refresh.gif"></a>";


• 2. put my icon into www/modules/xforms/
(it is the module I use)

Resized Image



Now, two questions :

a • title="_CAPTCHA_REFRESH" does not display sentence, _CAPTCHA_REFRESH appears when I roll hover the icon. Could you tell me the right syntax ?

b • <img class="captcha-reload" src="captcha-ico-refresh.gif"> : path is not very pratical, I would prefer something like <{xoAppUrl /uploads/captcha-refresh.gif}>... so the same icon could be used for all my modules. Again, could you tell me the right syntax ?


Thanks in advance for responses :)
Still learning CSS and... english
trabis trabis
  • Core Developer
  • Core Developer
  • Joined: 2006/9/1 14:10
  • From Portugal
  • Group: Webmaster Registered Users
  • Posts: 2253
  • Posted on: 2010/9/29 8:57
Re: Improve default captcha - trouble with language define and path #2
$image .= '<a href="javascript: xoops_captcha_refresh("' . ($this->config['name']) . '")" title="' . _CAPTCHA_REFRESH . '"><img class="captcha-reload" src="' . XOOPS_URL . '"/uploads/captcha-ico-refresh.gif"></a>';

or


$image .= '<a href="javascript: xoops_captcha_refresh(\'' . ($this->config['name']) . '\')" title="' . _CAPTCHA_REFRESH . '"><img class="captcha-reload" src="' . XOOPS_URL . '"/uploads/captcha-ico-refresh.gif"></a>';

?
Burning Burning
  • Theme Designer
  • Theme Designer
  • Joined: 2006/8/22 15:44
  • Group: Registered Users Repository Group
  • Posts: 1163
  • Posted on: 2010/9/29 9:08
Re: Improve default captcha - trouble with language define and path #3
Many thanks !!

Both codes work, just a little " to delete before /uploads:
$image .= '<a href="javascript: xoops_captcha_refresh('' . ($this->config['name']) . '')" title="' _CAPTCHA_REFRESH '"><img class="captcha-reload" src="' XOOPS_URL '/uploads/captcha-ico-refresh.gif"></a>';


Now sentence is displayed properly and refresh icon at the right place


Edit : oups! first Trabis code does not work, refresh feature is broken
Still learning CSS and... english
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team