FeedbackForm: Send along story URL

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
wfunderberg
Forum Members
Forum Members
Posts: 42
Joined: Tue Mar 28, 2006 8:05 pm

FeedbackForm: Send along story URL

Post 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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: FeedbackForm: Send along story URL

Post 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/
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
wfunderberg
Forum Members
Forum Members
Posts: 42
Joined: Tue Mar 28, 2006 8:05 pm

Re: FeedbackForm: Send along story URL

Post 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.
User avatar
sjg
Power Poster
Power Poster
Posts: 310
Joined: Thu Jan 27, 2005 5:11 pm
Location: Los Angeles, CA

Re: FeedbackForm: Send along story URL

Post 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___
Many modules available from the http://dev.cmsmadesimple.org
The CMS Made Simple Developer Cookbook is now available from Packt Publishers!
Post Reply

Return to “Modules/Add-Ons”