Page 1 of 1
FeedbackForm: Send along story URL
Posted: Tue Apr 11, 2006 3:16 pm
by wfunderberg
Hey,
Digging the FeedbackForm module currently but I have ran into a snag. I was wondering if it is possible to be able to send along the URL that the feedbackform is currently on.
I want users to be able to send feedback on stories found within the sites. The problem is that depending on the story, the feedback will go to the person who wrote the story. I am trying to get the current URL inserted into the feedback form so that the author can go directly to the story.
thanks in advance!
Wes
Re: FeedbackForm: Send along story URL
Posted: Tue Apr 11, 2006 3:20 pm
by calguy1000
That's definately a good idea. Maybe you could register a feature request on the forge for the feedbackform. that way poor _SjG_ can keep track of these things.
Here's the link:
http://dev.cmsmadesimple.org/projects/feedbackform/
Re: FeedbackForm: Send along story URL
Posted: Tue Apr 11, 2006 3:47 pm
by wfunderberg
Alright, registered it but trying to see if I can find a hack on how to make it work in the meantime. I noticed that the module does include the Function Callback "input" field to call a method within a module. I snuck around in the News module and found the GetURL() function which returns a string but not sure if this is what the Feedback field is referring to.
Re: FeedbackForm: Send along story URL
Posted: Thu Apr 13, 2006 7:06 am
by sjg
The Function Callback input might work for this, if you write a module that provides the name of the page or the URL for you.
I think it might be easier just to hack the code.
For example, you could edit FeedbackForm/classes/Form.class.php, and insert at line 190:
Code: Select all
echo CMSModule::CreateInputHidden($id,'source_url',$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']);
Then edit FeedbackForm/classes/DispositionEmailBase.class.php, and insert at line 105:
Code: Select all
$message = preg_replace('/\$source_url/',$_POST['m2source_url'], $message);
And then add "$source_url" somewhere in your email template.
If it doesn't work, view the source of the generated form, and make sure that the field name in DispositionEmailBase.class.php matches the name used in the form. This could potentially vary by version of CMS MS.
This only gives you the URL, but that might be sufficient.
Yikes. This is kind of hackish. Sorry 'bout that.
___Samuel___