Contact Us form WeBid 1.2.* ONLY

adds a 'Contact Us' form which is emailed to the Administrators email address

  1. audiobay

    audiobay Donor Donor

    Joined:
    Jan 20, 2013
    Messages:
    10
    Likes Received:
    0
    AAhhh - Thanks - I wasn't logged in - I'll try again
     
  2. audiobay

    audiobay Donor Donor

    Joined:
    Jan 20, 2013
    Messages:
    10
    Likes Received:
    0
    Well - didn't work - the difference is that when I isn't logged in the formular have a field for "your email address" - when I am logged in this field is not there (this make sense..) - the result is unfortunately the same - no email address to respond to... :(
    < Audiobay.eu
     
  3. PiataRO

    PiataRO New Member

    Joined:
    Feb 5, 2012
    Messages:
    49
    Likes Received:
    5
    You need to add extra filelds in tpl to what to get from data, if you tell what exactly do you need i will make mods and posts for you how to do it ( if you don`t know )

    // Edit how to show the email of who sent :

    open email_request_support.php


    look for :
    Code:
    $emailer->email_sender($admin_email, 'email_request.inc.php', $subject);
    
    And replace with this :
    PHP:
    $emailer->email_contact($admin_email'email_request.inc.php'$subject$from_id);
    Now since i changed the sendmail function you need to open /includes/functions_email.php
    Look for :
    Code:
    	function email_sender($to, $file, $subject)
    	{
    		$this->to = $to;
    		$this->subject = $subject;
    		$this->build_header();
    		$this->buildmessage($file);
    		$this->sendmail();
    	}
    
    And under it add this new function :
    PHP:
        function email_contact($to$file$subject$from_id)
        {
            
    $this->to $to;
            
    $this->subject $subject;
            
    $this->from $from_id;
            
    $this->build_header();
            
    $this->buildmessage($file);
            
    $this->sendmail();
        }
    New the contact mail will be send with a new function and will show you recived from email what was write on form.

    I hope it was usefull.
     
    Last edited: Jan 31, 2013
  4. audiobay

    audiobay Donor Donor

    Joined:
    Jan 20, 2013
    Messages:
    10
    Likes Received:
    0
    Thanks - what I need is very simple - I need to see who sent the mail to "Admin" so it is possible to give an answer.
     
  5. PiataRO

    PiataRO New Member

    Joined:
    Feb 5, 2012
    Messages:
    49
    Likes Received:
    5
    i made the edit when you posted, the mod its posted.
     
  6. audiobay

    audiobay Donor Donor

    Joined:
    Jan 20, 2013
    Messages:
    10
    Likes Received:
    0
    Thanks but i did not help really - I get theis reply:

    "Dear Site Administrator,

    This message is sent from WeBid site member.

    User Test test Has a question for you .

    Question: Here is a question "

    I cannot see who the site member is.. ?
     
  7. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    62
    Ok i updated the contact us mod by added a subject, email copy that is sent to the sender and will show the sender email in the email that is sent to the admin. but to use this mod the sender has to be logged in to us the new contact us mod.

    (1) Download the 'New Contact Us Mod v1.2.zip' from bellow
    (2) Unpack the 'New Contact Us Mod v1.2.zip' to a safe place on your computer
    (3) Login to the root of your WeBid install VIA FTP
    (4) Upload all of the files and folders you unpacked in step 2 if prompted by your FTP software select 'overwrite all' or 'Replace All'
     

    Attached Files:

    Last edited: Jan 31, 2013
  8. PiataRO

    PiataRO New Member

    Joined:
    Feb 5, 2012
    Messages:
    49
    Likes Received:
    5
    the function of email_sender its missing the $from so when you recived mail, you will recive like

    From : admin@yoursite
    Replay : admin@yoursite

    ( Or only in my custom version its missing ) Anyway who have that problem i posted a fix here.
     
  9. audiobay

    audiobay Donor Donor

    Joined:
    Jan 20, 2013
    Messages:
    10
    Likes Received:
    0
    Hi maid - I just love this forum - always help to find...
    Everything works perfect - and with some "extras" as well... Nice work THANKS
    Now I just need to make an error message for those who are not logged in - who knows - maybe I can figure this out myself..?
    Thanks again !
    Audiobay
     
  10. Guest

    Guest Guest

    Hi jjason nice work - trying New Contact Us Mod v1.2.zip
    renamed email_request_copy_to_sender.inc.inc
    to email_request_copy_to_sender.inc.php

    changed
    PHP:
     <li><a href="{SITEURL}email_request_support.php" alt="contact">Contact us</a></li>
    to
    PHP:
    <li><a href="{SITEURL}email_request_support.php" alt="contact">{L_210}</a></li>
    {L_210} = contact
    plus added
    PHP:
    $MSG['con001'] = "Choose a Subject:";
    $MSG['con002'] = "Request a new Category:";
    $MSG['con003'] = "Site Suggestions:";
    $MSG['con004'] = "General Enquiry:";
    $MSG['con005'] = "Error:";
    to make it multi language.

    so changed line 24-30
    to
    PHP:
                {L_con001}

            <
    input type="button" class="input" onclick="this.form.subject.value=this.value;" value="{L_con002}">
            <
    input type="button" class="input" onclick="this.form.subject.value=this.value;" value="{L_con003}">
            <
    input type="button" class="input" onclick="this.form.subject.value=this.value;" value="{L_con004}">
            <
    input type="button" class="input" onclick="this.form.subject.value=this.value;" value="{L_con005}">
    ---
    WeBid RC1-3
    try to make it run there, as i only has that version installed,
    but got error caused by the new include path so changed, it to the new one
    from include 'includes/common.inc.php';
    to include 'common.php';
    but got one more error, not sure if its the new version causes it
    Fatal error: Class 'email_class' not found in /email_request_support.php on line 96

    ---

    Audiobay:
    If you place it inside <!-- IF B_LOGGED_IN -->
    there is no need for error message.:)

    And here is code for adding it to the footer off coarse also to be placed inside <!-- IF B_LOGGED_IN -->
    PHP:
            | <a href="{SITEURL}email_request_support.php" alt="contact">{L_210}</a>
     
    Last edited by a moderator: Feb 1, 2013
  11. jjjason84

    jjjason84 Donor Donor

    Joined:
    Jun 26, 2012
    Messages:
    702
    Likes Received:
    62
    hmm i am not Andrew and nay fixed his mod because it did not work then i fixed contact us mod that nay did with the extra stuff lol and for the email_request_copy_to_sender.inc.php it should of been named that in the zip folder.
     
    Last edited: Feb 1, 2013
  12. Guest

    Guest Guest

    ok dident noticed that ,sorry changed andrew to jjason ;)
    yes i use the zipped version there i had to rename it
     
    Last edited by a moderator: Feb 1, 2013
  13. Guest

    Guest Guest

    small problem
    when send mail message ends up on one line.

    if message is

    Subject:
    new test

    Question:
    line1line1
    line2
    line3

    result is
    Subject:
    ny test

    Question:
    line1line1 line2 line3

    so instead of new line it make one space.
     
  14. Guest

    Guest Guest

    my php code for webid 1.1.0
    i need code for sending mail without being logged in first, so hope anyone can help with solution.

    email_request_support.php
    Code:
    <?php
    /***************************************************************************
     *   copyright				: (C) 2008, 2009 WeBid
     *   site					: http://www.webidsupport.com/
     ***************************************************************************/
    
    /***************************************************************************
     *   This program is free software; you can redistribute it and/or modify
     *   it under the terms of the GNU General Public License as published by
     *   the Free Software Foundation; either version 2 of the License, or
     *   (at your option) any later version. Although none of the code may be
     *   sold. If you have been sold this script, get a refund.
     ***************************************************************************/
    
    include 'common.php';
    // check recaptcha is enabled
    if ($system->SETTINGS['spam_register'] == 2)
    {
    	include $main_path . 'inc/captcha/recaptchalib.php';
    }
    elseif ($system->SETTINGS['spam_register'] == 1)
    {
    	include $main_path . 'inc/captcha/securimage.php';
    }
    
    // if (!$user->is_logged_in())
    // {
    	// $_SESSION['REDIRECT_AFTER_LOGIN'] = 'email_request_support.php';
    	// header('location: user_login.php');
    	// exit;
    // }
    $spam_html = '';
    
    	if ($system->SETTINGS['spam_register'] == 1)
    		{
    			$resp = new Securimage();
    			$spam_html = $resp->show_html();
    		}
    
    	$site_id = $system->SETTINGS['sitename'];
    	$page_title = 'Contact Us';
    	$admin_nick = 'Site Administrator';
    	$admin_email = $system->SETTINGS['adminmail'];
    
    
    if (isset($_POST['action']) || !empty($_POST['action']))
    {
    	$cleaned_question = $system->cleanvars($_POST['sender_question']);
    	if ($system->SETTINGS['wordsfilter'] == 'y')
    	{
    		$cleaned_question = $system->filter($cleaned_question);
    	}
    
    	// Check errors
    	if (isset($_POST['action']) && (!isset($_POST['sender_name']) || !isset($_POST['sender_email']) || empty($admin_nick) || empty($admin_email)))
    	{
    		$TPL_error_text = $ERR_032;
    	}
    
    	if (empty($cleaned_question))
    	{
    		$TPL_error_text = $ERR_031;
    	}
    
    	if (isset($_POST['action']) && (!preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i', $_POST['sender_email']) || !preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i', $admin_email)))
    	{
    		$TPL_error_text = $ERR_008;
    	}
    	
    	if ($system->SETTINGS['spam_register'] == 2)
    				{
    					$resp = recaptcha_check_answer($system->SETTINGS['recaptcha_private'], $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field']);
    				}
    	
    				if ($system->SETTINGS['spam_register'] == 2 && !$resp->is_valid)
    				{
    					$TPL_error_text = $MSG['752'];
    				}
    			elseif ($system->SETTINGS['spam_register'] == 1 && !$resp->check($_POST['captcha_code']))
    				{
    					$TPL_error_text = $MSG['752'];
    				}
    		
    
    	if (empty($TPL_error_text))
    	{
    		$mes = $MSG['337'] . ': <i>' . $admin_nick . '</i><br><br>';
    		$emailer = new email_handler();
    		$emailer->assign_vars(array(
    				'SENDER_NAME' => $user->user_data['name'],
    				'SENDER_QUESTION' => $cleaned_question,
    				'SENDER_EMAIL' => $user->user_data['email'],
    				'SITENAME' => $system->SETTINGS['sitename'],
    				'SITEURL' => $system->SETTINGS['siteurl'],
    				'SELLER_NICK' => $admin_nick
    				));
    		$page_title = $system->uncleanvars($page_title);
    		$subject = $system->SETTINGS['sitename'] . ' ' . $page_title;
    		$from_id = (!$user->logged_in) ? $_POST['sender_email'] : $user->user_data['id'];
    		$id_type = (!$user->logged_in) ? 'fromemail' : 'sentfrom';
    		$emailer->email_uid = $site_id;
    		$emailer->email_sender($admin_email, 'email_request.inc.php', $subject);
    
    	}
    }
    
    $template->assign_vars(array(
    		'MESSAGE' => (isset($mes)) ? $mes : '',
    		'ERROR' => (isset($TPL_error_text)) ? $TPL_error_text : '',
    		'ADMIN_NICK' => $admin_nick,
    		'ADMIN_EMAIL' => $system->SETTINGS['adminmail'],
    		'SELLER_QUESTION' => (isset($_POST['sender_question'])) ? $_POST['sender_question'] : '',
    		'PAGE_TITLE' => $page_title,
    		'CAPCHA' => ($system->SETTINGS['spam_register'] == 2) ? recaptcha_get_html($system->SETTINGS['recaptcha_public']) : $spam_html,
    		'EMAIL' => $user->user_data['email']
    		));
    
    
    include 'header.php';
    $template->set_filenames(array(
    		'body' => 'email_request_support_form.tpl'
    		));
    $template->display('body');
    include 'footer.php';
    ?>
    
     
    Last edited by a moderator: Jul 8, 2013
  15. sanax

    sanax New Member

    Joined:
    Aug 4, 2013
    Messages:
    20
    Likes Received:
    0
    Great Mod!

    I'm getting the following error with the latest script:

     
  16. sanax

    sanax New Member

    Joined:
    Aug 4, 2013
    Messages:
    20
    Likes Received:
    0
    In the email_request_support.php it tries to include

    I don't have a includes/common.inc.php file in the latest version of WeBid.
     
  17. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,573
    Likes Received:
    549
    Then have a look around at what files you do have and change it to common.php change
    PHP:
    include 'includes/common.inc.php';
    to
    PHP:
    include 'common.php';
     
    Last edited: Aug 11, 2013
  18. Guest

    Guest Guest

    like to know why it is has been changed.
     
  19. DrJ

    DrJ Active Member

    Joined:
    Jun 17, 2013
    Messages:
    510
    Likes Received:
    61
    Several files have either gone through a name changed or have been moved to a new location in v1.1.0. I had just started with v1.0.6 when v1.1.0 came out. Talked about being confused! I ended up starting from scratch with my changes and have come along well using v.1.1.0. I also wondered about why they were changed and what the issues would be with upgrading but I decided it wasn't worth my time to ask why.
     
  20. Guest

    Guest Guest

    guess it not wort anyones time lol. but strange is it, :)
     

Share This Page