a href in contact form

tseyigai

Joined: 2012-11-06
Posts: 47
Posted: Sun, 2012-12-09 14:27

My contact form works well within my gallery, however the message field has this in it every time someone will want to contact me: This message refers to <a href="http://www.hansonartists.com/albums/1">this page</a>.

Any ideas how to get rid of this error simply?

Regards,
Tseyigai

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Mon, 2012-12-10 15:02

That's not really an error. It's pre-filled in the form to advise the admin of where the user was commenting from.

You could edit the following code in: <gallerydir>/modules/contactowner/contactowner.php from this:

    // If item_id is set, include a link to the item.
    $email_body = "";
    if ($item_id <> "") {
      $item = ORM::factory("item", $item_id);
      $email_body = "This message refers to <a href=\"" . url::abs_site("{$item->id}") . "\">this page</a>.";
    }

to this: (this will not pre-fill for the root album, but will for inside any subalbums)

    // If item_id is set, include a link to the item.
    $email_body = "";
    if ($item_id <> "" && $item_id != "1") {
      $item = ORM::factory("item", $item_id);
      $email_body = "This message refers to <a href=\"" . url::abs_site("{$item->id}") . "\">this page</a>.";
    }

Or just comment out the line with the "This message refers..." instead if you don't want it to pre-fill at all.

Note: Untested at this point...

 
tseyigai

Joined: 2012-11-06
Posts: 47
Posted: Mon, 2012-12-10 19:11

thanks, will give that a try.

 
tseyigai

Joined: 2012-11-06
Posts: 47
Posted: Mon, 2012-12-10 19:26

Nah, that doesn't work. I tried taking out the "This message refers to and then nothing was visible to send. Then I tried eliminating the This message refers to and left the " and then it's back to where it was before. Should I try to edit any of the <a href=\"" . url::abs_site("{$item->id}") . "\">this page</a>.";

?
thanks,Tseyigai

}

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Mon, 2012-12-10 19:36

Just put a '//' in the front of that line to comment it out. Then you should be fine.

 
tseyigai

Joined: 2012-11-06
Posts: 47
Posted: Tue, 2012-12-11 01:15
jnash wrote:
Just put a '//' in the front of that line to comment it out. Then you should be fine.

So,do you simply mean this line? $email_body = "This message refers to <a href=\"" . url::abs_site("{$item->id}") . "\">this page</a>."; and then put the // in front of it?
Thanks

 
tseyigai

Joined: 2012-11-06
Posts: 47
Posted: Tue, 2012-12-11 13:32

It worked. thanks.