Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-03-12 21:16:26

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 251
Website

Error on global

Hello,
trying to implement some function that hooks zem_contact, I’m following the guidelines on this page but I get an error regarding the global declaration global zem_contact_form;

This is the error I get (4.5.4): Parse error: syntax error, unexpected ‘zem_contact_form’ (T_STRING), expecting variable (T_VARIABLE) or ‘$’

I’m putting the global prefix outside any function, but within the plugin.

Any suggestion?

Thanks!

Offline

#2 2013-03-12 22:27:03

MarcoK
Plugin Author
From: Como
Registered: 2006-10-17
Posts: 248
Website

Re: Error on global

must use a variable:

global $zem_contact_form;

Offline

#3 2013-03-13 10:35:59

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 251
Website

Re: Error on global

Grazie Marco!

I’m having still some troubles following the API guides,

global $zem_contact_form;
$evaluator = &get_zemcontact_evaluator(); 

This returns Fatal error: Call to undefined function get_zemcontact_evaluator()

Any idea?
Thanks a lot

Offline

#4 2013-03-13 11:26:42

MarcoK
Plugin Author
From: Como
Registered: 2006-10-17
Posts: 248
Website

Re: Error on global

Ci vuole lo spazio:

$evaluator =& get_zemcontact_evaluator();

L’ho scoperto anche io ora: =& è un operatore di assegnazione in php!!

$a = 42;
$b =& $a;
//later
echo $a; // 42
echo $b; // 42
$a = 13;
echo $a; // 13
echo $b; // 13

Must use $evaluator =& get_zemcontact_evaluator();

=& is an assigment operator by reference

Offline

#5 2013-03-13 12:03:54

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 251
Website

Re: Error on global

Ciao,
thanks, it returns unknown function as well, even in the correct form as you suggest

(che bello parlare la propria lingua) ;)

Offline

Board footer

Powered by FluxBB