Wednesday 29 September 2010 2:54:18 pm
Hy Jorge, I'm glad you got mail working :-) Theroretically your form should work too. Please find below an example form I used. This is kinda hackish but it should implement the minimum amount of code.
{def $nodo=2
$nodocontentobject=65}
<form method="post" action={"content/action/"|ezurl}>
<input type="hidden" name="ContentNodeID" value="{$nodo}" />
<input type="hidden" name="ContentObjectID" value="{$nodocontentobject}" />
<input type="hidden" name="ContentLanguageCode" value="{ezini( 'RegionalSettings', 'ContentObjectLocale', 'site.ini')}" />
<input class="button" type="submit" name="ActionAddToNotification" value="{'Keep me updated'|i18n( 'design/ezwebin/full/forum' )}" />
<input type="hidden" name="NodeID" value="{$nodo}" />
</form> This is what is happening in the background when submitting this form:
First, the kernel-module "content/action" is called. You can find its code in "kernel/content/action.php". This action.php tries to match several POST variables/keys in order to determine what to to. In your case it matches the following statement:
else if ( $http->hasPostVariable( "ActionAddToNotification" ) )
{
$nodeID = $http->postVariable( 'ContentNodeID' );
$module->redirectTo( 'notification/addtonotification/' . $nodeID . '/' );
return;
} You see, it's looking for the POST variable "ActionAddToNotification" which is sent. Then all it does is to redirect to another module which has the correct logic to handle notification requests: "/notfication/addtonotification". It also appends the nodeID of the node you would like to add to your notification list. kinda + hopefully. (What exactly is not working in your case? How 'far' can you go?) So, now lets look at the code for the notfication module. You can find it at "kernel/notification/addtonotification.php". All code here is more or less straight forward. The important thing is to check, if the actual user is logged in and if the supplied url-nodeid-argument is indeed a valid ezpublish node id and it also checks, if the current logged in user has READ-access to this node. If everything is ok, the nodeID / node should have been added to the users notfication list. Easy hugh? But now dont ask me, why in your case nothin happens. Please take a look at your ezpublish logfiles. You can find them in var/log. Go though the last few lines of error.log, warning.log and/or notice.log. My guess is, that somewhere exists an error which prevents the above described behaviour. As always: have you cleared your cache after modifiying the template? I'm not the great template guy, more the extension and hacking freak. So with template stuff I'm not directly the right one to ask ;-) Hope you can find it out. cheers, chris EDIT: wow. This was the most esthetically post I've every written so far. Its syntax coloring and text-flow is mind blowing ;-)
Hannover, Germany
eZ-Certified http://auth.ez.no/certification/verify/395613
|