vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Contact Us Email Feedback Form (with IP address & status of sender) (https://vborg.vbsupport.ru/showthread.php?t=41791)

Erwin 07-31-2002 10:00 PM

Contact Us Email Feedback Form (with IP address & status of sender)
 
Contact Us Email Feedback Form (with IP address) Version 2.3
-------------------------------------------------------------------------

Reason:
--------------

This hack allows members and guests to email you the administrator using an online email form. This way, you keep your email address hidden from spambots that crawl sites for email addresses.

When members use the form, their name and email address gets automatically inserted. Guests will have to fill out the name and email boxes. If they are not filled, the email will not be sent. Users get to choose from a list of subjects, or they can enter their own email subject if they choose "Other".

If the member who emails you is Unregistered or Not Logged In, the email will tell you that the Sender is Unregistered or Not Logged In.

If the member who emails you is Registered, then the username and email address of the member on file will be sent to you as well - this way, even if a registered member tries to pretend to be another member or put in a fake address, you will know who the member is.

The email sent to you will have the IP address and if available, the Host Name of the sender, with a link to click that will automatically search the database for members sharing that same IP - good for tracking down people sending you abusive emails using the form.

Example of an email from a Registered Member:
----------------------------------------------------------

Quote:


******* Delete this section before replying ********

IP address of sender: 123.123.12.12
Host name: test.hostname.com
Click below to search for members with same IP:
http://www.yourforums.com/forums/adm...=123.123.12.12

Registered Member - Username: Erwin
Email on file: admin@myforums.com

******* Delete this section before replying ********

Hi,

Test message here...

- Erwin



Email from a Unregistered User or Member who is Not Logged In:
----------------------------------------------------------------------

Quote:


******* Delete this section before replying ********

IP address of sender: 123.123.12.12
Host name: test.hostname.com
Click below to search for members with same IP:
http://www.yourforums.com/forums/adm...=123.123.12.12

Not Logged In or Unregistered User


******* Delete this section before replying ********

Hi,

Test message here...

- Erwin



The form is web-based, and the feedback is emailed to you, without ever revealing your admin email address if you want to keep that private.


Screenshot:
-----------------------

http://www.medlinepro.com/contact22.jpg


Installation:
-------------------

Easy. There are no file changes, 3 new templates to make, and 2 files to upload.

Create the 3 templates based on the txt files - name the templates after the file names, and copy the content of the txt files into the templates.

contact
contact_error
contact_sent

Then upload the following files into your forums directory.

contact.php

Last thing you need to do is to place this link anywhere on your site, or in your contact link field in your vB Admin Options. I have placed mine in the footer template (change it to your forums URL).

<a href="http://www.yourforums.com/yourforums/contact.php">Contact Us</a>

And you're done!

Enjoy! :)


Version 2.0
------------------

Added the option for users to choose from a list of subjects. Also fixed a minor title bug. If the option "Other" is chosen, but no title filled out in the optional text box, a blank field error message will be shown.

To upgrade from Version 1.2 - just copy the new "contact.php" and "send.php" over the old files, and replace the "contact" template with the new one.

Feel free to add more email subject titles by modifying the "contact" template. :)

Version 2.1
-------------------

Added - IP address and if available, the Host Name of sender in the email sent to you, with a link to search the database for members with the same IP address in the email (in case of people sending you abusive emails using the form)!

Version 2.2
-------------------

Added - if the sender is a Registered Member the email will contain the username and email on file, regardless of what the sender puts in the fields. If the sender is Not Logged In or Unregistered, the email will let you know.

Version 2.3
-------------------

Tidied the code up, removed the need for send.php.


Upgrading
-------------------

- to upgrade from version 1.2 - upload the new contact.php and send.php files, and replace the "contact" template with the new one.

- to upgrade from version 2.0 - upload the new send.php

- to upgrade from version 2.1 - upload the new send.php

- to upgrade from version 2.2 - upload the new contact.php, delete send.php (not needed), replace "contact" template with contact.txt



Latest hack version 2.3 below:

MrLister 08-01-2002 07:55 PM

screenshot?

Erwin 08-01-2002 07:59 PM

Screenshot
-----------------------

New screenshot for Version 2.2, showing the new Subject Title options, and the optional Other text input box (in case the one in the 1st post is offline).

SpotMe 08-01-2002 08:04 PM

Sweet ;)

SpotMe 08-01-2002 08:12 PM

One thing...

The value for '$defaulttitle' is **** Feedback. I just changed it on mine to '$bbtitle Feedback'..

SpotMe 08-01-2002 08:15 PM

Also, instead of 'Your email has been sent to the *** Administrator', should be 'Your email has been sent to the $bbtitle Administrator' :)

Erwin 08-01-2002 08:15 PM

Ooops... I better go fix that. :)

Erwin 08-01-2002 08:21 PM

Okay, your own Forum name should now automatically be used rather than mine! :p

Unknown553 08-02-2002 12:32 AM

Nice spin off, I might even add this to my own forums :D Nice work Erwin.

Unknown553 08-02-2002 12:59 AM

Just noticed something

Quote:

Originally posted by Erwin
Last thing you need to do is to place this link anywhere on your site. I have placed mine in the footer template (change it to your forums URL).

<a href="http://www.yourforums.com/yourforums/contact.php">Contact Us</a>

This isn't necessary, is it? You can just change the contact link in the Admin CP, under vBulletin Options. On default it's <a href="mailto:webmaster@email.com">, so you can just edit that and it'll automatically be changed in the footer, right? Or am I missing something?

xeon 08-02-2002 02:09 AM

Quote:

Originally posted by Unknown553
Just noticed something

This isn't necessary, is it? You can just change the contact link in the Admin CP, under vBulletin Options. On default it's <a href="mailto:webmaster@email.com">, so you can just edit that and it'll automatically be changed in the footer, right? Or am I missing something?

Well the description says:
"Contact Us Link
Link for contacting the site. Can just be mailto:webmaster@whereever.com or your own form. Appears at the bottom of every page.

I would think what you said would be the case. Just change the field from the e-mail address to contact.php and that's all you should have to do.

Nice addition to keep the admin e-mail from spamming eyes.

Boofo 08-02-2002 03:11 AM

When I chnage the contact link in the option like you said, it just brings up an email error page. Also, how would we change it in our profile field? If I put in the link you suggested, it goes to the error page again. :)

Unknown553 08-02-2002 03:15 AM

try adding ?s= to the end of it. Or ?action=compose. I'm not quite sure why this happens, same bug is in my hack, and it only comes up for some members...

/me shrugs

Boofo 08-02-2002 03:23 AM

None of that worked. All I get is the contact error message. Even when I put the full URL to the file in the address bar, it always goes straight to the error message. No further. :eek:

Quote:

Originally posted by Unknown553
try adding ?s= to the end of it. Or ?action=compose. I'm not quite sure why this happens, same bug is in my hack, and it only comes up for some members...

* Unknown553 shrugs


Unknown553 08-02-2002 04:18 AM

And you're logged in ok? Are you browsing with or without cookies?

Boofo 08-02-2002 04:22 AM

Yes, I'm logged in AND using cookies. It's got me puzzled. :ermm:

Quote:

Originally posted by Unknown553
And you're logged in ok? Are you browsing with or without cookies?

Dean C 08-02-2002 09:53 AM

this is exactly what ive been looking for.. ill try it 2nite...

SpotMe 08-02-2002 10:26 AM

Quote:

Originally posted by Boofo
Yes, I'm logged in AND using cookies. It's got me puzzled. :ermm:



What error message are you getting.. 'nopermissions_loggedin'?

Lesane 08-02-2002 10:32 AM

Good hack, will install it later. Well done.

Erwin 08-02-2002 12:38 PM

Boofo, you always have trouble with hacks I release! ;)

Unknown553 - this hack is totally based on your great work, so all credit goes to you! :) All I did was stand on the shoulders of giants. :D Thanks for letting me share this with others.

Tungsten 08-02-2002 07:06 PM

For what it's worth... I am having the same problem as Boofo. :confused:

Unknown553 08-02-2002 07:06 PM

Quote:

Originally posted by Erwin
Unknown553 - this hack is totally based on your great work, so all credit goes to you! :) All I did was stand on the shoulders of giants. :D Thanks for letting me share this with others.
But unfortunately your hack is getting the same bug as mine. I think my code is corrupt or something :cross-eyed:

freeshares1 08-02-2002 08:45 PM

This is great, I use it for a slightly different use (for people claiming cashback on my site) working example at http://www.gamblingforums.net/vbport...ms/contact.php

Erwin 08-03-2002 02:52 AM

Quote:

Originally posted by freeshares1
This is great, I use it for a slightly different use (for people claiming cashback on my site) working example at http://www.gamblingforums.net/vbport...ms/contact.php
Nice modification of the hack, freeshares1. :)

Boofo, can you post a screenshot of the error you get? I would like to see if I can work out why you have that bug. The contact form works fine on my site.

SuB_ZeR0 08-03-2002 03:12 AM

Can it be setup so that only registered users can use this function? I don't want unkown ppl spamming my inbox. I want to provide help to my members only. Thanks.

Erwin 08-03-2002 03:17 AM

To only allow registered members to use this:

In contact.php, find:

PHP Code:


if ($action == 'compose') { 

ABOVE it, add:

PHP Code:


if ($bbuserinfo[userid]) { 

Then find:

PHP Code:


?>
 

ABOVE it, add:

PHP Code:


} else {
    eval(
"dooutput(\"".gettemplate('contact_error')."\");");


Edit the contact_error template to include "you need to be registered to use our contact form" or something like that. Should work.

Erwin 08-03-2002 03:19 AM

Boofo, I went to your site and clicked on your "Contact Us" link. You're right, it goes straight to the error template.

http://www.bearfacts2.com/forum/contact.php

Very weird... It works for other members though... it has to be the way your forum is setup...

Boofo 08-03-2002 03:33 AM

Sorry, but it foesn't work for Tungsten, either, so it can't just be my setup. :)

Quote:

Originally posted by Erwin
Boofo, I went to your site and clicked on your "Contact Us" link. You're right, it goes straight to the error template.

http://www.bearfacts2.com/forum/contact.php

Very weird... It works for other members though... it has to be the way your forum is setup...


SuB_ZeR0 08-03-2002 03:37 AM

Erwin>> Thanks for the prompt reply ... I'll try it tonight.

Erwin 08-03-2002 03:39 AM

I suspect it may be your PHP version. What version does your server use?

It probably is the "if (!isset($action))" command that your site is having a problem with - since it doesn't recognise this line, it automatically goes to "action=send" and because you haven't filled out any fields yet, you go to the error message as not all fields are entered.

This can be avoided by dividing the contact.php to 2 files, and not use the action variable... but that doesn't really make sense, since other vb files surely use the same variable too.

Erwin 08-03-2002 03:49 AM

Okay, I have an idea:

In contact.php, find:

PHP Code:


if (!isset($action)) { 

And replace with:

PHP Code:


if (isset($action)==0) { 

It should now work.

I have fixed up the ZIP file in the first post.

Boofo 08-03-2002 04:02 AM

Shouldn't this:

PHP Code:

if (isset($action)==0

actually be this?

PHP Code:

if (isset($action)==0) { 

else I get a parse error. And sorry, that didn't fix it. :)

EDIT: My server is using PHP 4.2.1 BTW.

Quote:

Originally posted by Erwin
Okay, I have an idea:

In contact.php, find:

PHP Code:


if (!isset($action)) { 

And replace with:

PHP Code:


if (isset($action)==0

It should now work.

I have fixed up the ZIP file in the first post.


Boofo 08-03-2002 04:07 AM

No, I am getting the contact_error message from the hack itself. :)

Quote:

Originally posted by SpotMe



What error message are you getting.. 'nopermissions_loggedin'?


Erwin 08-03-2002 04:07 AM

Arrghhh... I thought that it would... that's very weird then... I'm stumped...

Erwin 08-03-2002 04:19 AM

Okay try this:

In contact.php, find:

PHP Code:


    
} else {
        
$action 'send'

And remove it.

That should fix it.

Erwin 08-03-2002 04:24 AM

So that top section should now look like this:

PHP Code:

    if (isset($action)==0) {
        
$action 'compose';
        } 

Does that work?

Erwin 08-03-2002 04:30 AM

I've updated the ZIP with the changes anyway as version 1.1. If the hack is working for you, no need to make any changes. If the hack is not working for you, upload the new contact.php and give it a try.

Erwin 08-03-2002 04:46 AM

Okay, hack updated to version 1.2.

This SHOULD work now for Boofo and Tungsten, who seem to have problems with the ?action variables. I have removed them and split contact.php into 2 files, contact.php and send.php.

The contact template has been changed.

I will outline the changes here:

In the "contact" template, find:

Code:


contact.php?action=send"

Change to:

Code:


send.php"


Erwin 08-03-2002 04:48 AM

Then upload the new contact.php located below:

Erwin 08-03-2002 04:49 AM

And then upload the new send.php located below:


All times are GMT. The time now is 11:48 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01618 seconds
  • Memory Usage 1,850KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (12)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete