Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#889 2010-10-12 16:30:08
Re: zem_contact_reborn 4.0.3.20
The problem is in this part (the last {
should be a }
):
input.zemSubmit {
background:none repeat scroll 0 0 #384F70;
border:medium none;
color:#FFFFFF;
margin-left:110px;
margin-top: 15px;
width: 110px;
clear:right;
{
Offline
#890 2010-10-12 18:04:00
Re: zem_contact_reborn 4.0.3.20
What an idiot I am! Thanks Ruud I never noticed that, it’s all working now – amazing how fragile CSS code is.
Offline
#891 2010-10-24 15:54:09
Re: zem_contact_reborn 4.0.3.20
Hi
I use zcr for many site and never had that problem before!
My pages are utf-8, but when the mail is sent i had encoding problem and i dont know why!
here is the diagnostic:
Textpattern version: 4.2.0 (r3275)
Last Update: 2010-10-17 14:46:31/2010-10-17 14:44:06
Document root: /home/ixdzco/public_html/titi
$path_to_site: /home/ixdzco/public_html/titi
Textpattern path: /home/ixdzco/public_html/titi/textpattern
Permanent link mode: section_id_title
Temporary directory path: /tmp
Site URL: titi.ix-dz.com
PHP version: 5.2.14
Register globals: 1
GD Image Library: version bundled (2.0.34 compatible), supported formats: GIF, JPG, PNG
Server TZ: America/Chicago
Server Local Time: 2010-10-24 10:50:34
DST enabled?: 0
Automatically adjust DST setting?: 0
Time Zone: Africa/Algiers (3600)
MySQL: 5.1.50
Locale: en_US.UTF-8
Server: Apache mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
PHP Server API: cgi-fcgi
RFC 2616 headers: 0
Server OS: Linux 2.6.34.6
Active plugins: zem_contact_lang-4.0.3.6m, zem_contact_reborn-4.0.3.20m, smd_if-0.81, stm_javascript-0.3, upm_insert_tab-0.2.2, rss_admin_db_manager-4.3m, jmd_admin_js-0.1
Admin-side theme: remora 4.2.0
.htaccess file contents:
————————————
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#Options -Indexes
<IfModule mod_rewrite.c> RewriteEngine On #RewriteBase /relative/web/path/
RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]
RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*) index.php
RewriteCond %{HTTP:Authorization} !^$
RewriteRule .* – [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
#php_value register_globals 0
————————————
If you want to test the page is here
Thanks
Offline
#892 2010-10-24 16:16:14
Re: zem_contact_reborn 4.0.3.20
Which encoding problem exactly (how does it look, how should it look)?
In the resulting email or on the website?
If in email, which mail client is used to read the email?
Offline
#893 2010-10-25 06:27:34
Re: zem_contact_reborn 4.0.3.20
Hi ruud
the encoding problem came with é and other accent letter that appears é , I use thunderbird 3.1.5 for reading mails.
Also the site was 4.0.6 and upgraded to 4.2
I have look into config.php and found that $txpcfg[‘dbcharset’] = ‘latin1’; if I change it to utf8 is that solve the problem? and must i change the mysql table interclassement?
Thanks
Offline
#894 2010-10-25 09:58:11
Re: zem_contact_reborn 4.0.3.20
The only way a database encoding issue could affect ZCR is if you use it to sent articles, but if you enter something in a form, that shouldn’t lead to encoding issues, so I doubt config.php has anything to do with it.
More interesting is the advanced preference “Use ISO-8859-1 encoding in e-mails sent (default is UTF-8)?”, which I’d recommend setting to “No”.
Offline
#895 2010-10-25 10:09:16
Re: zem_contact_reborn 4.0.3.20
Hi ruud and thanks to respond.
The setting of Use ISO-8859-1 encoding in e-mails sent (default is UTF-8)?” is set to off! then i tried to set it to yes and that solve the problem!!! why, I don’t know! but it solved it.
Thanks again ruud, I think that upgrading some old install can have bad effects cause the database changed (from mysql 4 to mysql 5) cause i noticed that fresh install give $txpcfg[‘dbcharset’] = ‘utf8’ and not latin1 in the same server!!
Offline
#896 2010-10-26 20:42:09
Re: zem_contact_reborn 4.0.3.20
How can I append a submitted email address to a text file? I created a plugin that loads zemcontact.submit
according to the instructions in the plugin help, but that’s as far as I can get. What I want to do is something like this:
register_callback('pax_myFunction','zemcontact.submit');
function pax_myFunction() {
/*
* 1. Get values from email field and zem_contact_secret.
* 2. If there is a valid email address and the secret field is set to a certain value,
* append the email address to a text file.
*/
$pax_myFile = "testFile.txt";
$pax_fh = fopen($pax_myFile, 'a') or die("Can't open file");
$pax_stringData = "New Stuff 1\n";
fwrite($pax_fh, $pax_stringData);
fclose($pax_fh);
I don’t know what I’m doing. Can anyone provide some illumination?
Thanks!
Offline
#897 2010-10-27 16:01:40
Re: zem_contact_reborn 4.0.3.20
The function needs a closing }
.
Did you activate that plugin?
If you put that code in a separate PHP file and run the code, does it work?
PS. this code may be simpler if you’re using PHP5 and takes care of file locking:
file_put_contents('testFile.txt', "New Stuff 1\n", FILE_APPEND|LOCK_EX) or die ("couldn't write to file");
Offline
#898 2010-10-27 16:20:06
Re: zem_contact_reborn 4.0.3.20
Thank you, Ruud— I’ll try that. What I forgot to explain is that the “New Stuff” I want to pass into the file is the email address entered by a site visitor into a zem_contact_form
where zem_contact_secret
is set to a certain value.
I have tested the code using a basic php and no callback to zem_contatct.submit
, and it works fine (in my actual version, I have closed the function with a }
. What’s puzzling me is how to get the submitted email address into the function, to pass it on to the function as “New Stuff”.
Offline
#899 2010-10-27 16:24:17
Re: zem_contact_reborn 4.0.3.20
The stuff that is commented out in the code block above refer to the concepts I’m missing.
Offline
#900 2010-10-27 17:00:18
Re: zem_contact_reborn 4.0.3.20
Assuming you have code like this in your form:
<txp:zem_contact_secret name="secret" value="topsecret" />
You could do this (not tested, and I’m a bit puzzled why your code doesn’t work):
register_callback('pax_myFunction','zemcontact.submit');
function pax_myFunction()
{
global $zem_contact_from, $zem_contact_values;
if ($zem_contact_values['secret'] == 'topsecret')
{
file_put_contents('testFile.txt', $zem_contact_from.n, FILE_APPEND|LOCK_EX)
or die ("couldn't write to file");
}
}
Offline