Support Forums

Old 04-24-2006, 05:07 PM   #1
Don
Member
 
 
Join Date: Mar 2006
Location: United Kingdom
Posts: 89
Rep Power: 15
Don is on a distinguished road
Default Contact the Owner

V3.0.15 Developer

Hello,

when an ad is being viewed by a member, is it possible to have the Name and Email fields ready populated with the viewers details in the 'contact the owner' form in such a way that they can not be altered?

Thanks,
Don.
__________________
Thanks,

Don.
Version 3.1 Developer

May God bless you in mighty ways.
Don is offline  
Old 04-24-2006, 05:43 PM   #2
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,140
Rep Power: 118
Eric Barnes is a jewel in the rough
Default

I believe the only user information that is stored in the session is their userid and username. So you would have to create a new query on the viewlisting.php and get out the rest of their information then assign it to the template.

Probably something like this:
PHP Code:
$sSQL="SELECT firstname, email FROM ".PREFIX."users WHERE id='".$_SESSION['uid']."'";
$result=$db->query($sSQL);
$rs=$result->fetch();
$class_tpl->assign('user_firstname'$rs['firstname']);
$class_tpl->assign('user_email'$rs['email']); 
Then open the contact template and change the input fields:
<input name="name" type="text" size="{$smarty.const.FIELD_SIZE}" value="{$user_firstname|escape}" />

<input name="email" type="text" size="{$smarty.const.FIELD_SIZE}" value="{$user_email|escape}" />

To make them not be altered I believe you can add disabled to the form field:

<input name="email" type="text" size="{$smarty.const.FIELD_SIZE}" value="{$user_email|escape}" disabled="disabled" />

The only thing is I am not sure if they will actually send when submiting the form so you would need to test it.
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 04-24-2006, 05:56 PM   #3
Coder
 
Join Date: Mar 2006
Posts: 4,574
Rep Power: 111
Lhotch is just really niceLhotch is just really nice
Default

Perhaps that would be a good addition to 3.1? In admin have the ability to set the "contact owner" form auto use the senders registered e-mail addy/name.This of course would only be available if you have the site set so you had to be a registered user to contact the owner.
__________________
Larry.
Lhotch is offline  
Old 04-24-2006, 06:22 PM   #4
Senior Member
 
 
Join Date: Mar 2006
Posts: 110
Rep Power: 16
sleepy will become famous soon enough
Default

I agree with Lhotch. It would be nice to have this option via ADMIN.

sleepy
sleepy is offline  
Old 04-24-2006, 06:32 PM   #5
Don
Member
 
 
Join Date: Mar 2006
Location: United Kingdom
Posts: 89
Rep Power: 15
Don is on a distinguished road
Default

A good start...
The 'Contact Owner' form was populated with my name and email (neither could be changed...as requested). I sent a message. I was redirected to /contact.php with the 'contact Owner' form still showing. The name and email fields were now blank but the message was still showing. No email was sent.

Thanks,
Don.
__________________
Thanks,

Don.
Version 3.1 Developer

May God bless you in mighty ways.
Don is offline  
Old 04-25-2006, 09:35 AM   #6
Don
Member
 
 
Join Date: Mar 2006
Location: United Kingdom
Posts: 89
Rep Power: 15
Don is on a distinguished road
Default

Hi Larry / Eric

just wondering if there is any more I can try here

Thanks,
Don.
__________________
Thanks,

Don.
Version 3.1 Developer

May God bless you in mighty ways.
Don is offline  
Old 04-25-2006, 10:05 AM   #7
Coder
 
Join Date: Mar 2006
Posts: 4,574
Rep Power: 111
Lhotch is just really niceLhotch is just really nice
Default

Un-disable the fields and see if mail will send.
__________________
Larry.
Lhotch is offline  
Old 04-25-2006, 10:43 AM   #8
Don
Member
 
 
Join Date: Mar 2006
Location: United Kingdom
Posts: 89
Rep Power: 15
Don is on a distinguished road
Default

Hello Larry,

I removed "disabled="disabled" and it works great. If there is no way of disabling then so be it.

Thanks,
Don.
__________________
Thanks,

Don.
Version 3.1 Developer

May God bless you in mighty ways.
Don is offline  
Old 04-25-2006, 10:58 AM   #9
Coder
 
Join Date: Mar 2006
Posts: 4,574
Rep Power: 111
Lhotch is just really niceLhotch is just really nice
Default

What you could do is simply change the fields to be hidden so the user wont see them at all. And, if you really wanted to the user to see something just replace the input field itself with the value so it shows as just text instead of input field.
__________________
Larry.
Lhotch is offline  
Old 04-25-2006, 11:18 AM   #10
Don
Member
 
 
Join Date: Mar 2006
Location: United Kingdom
Posts: 89
Rep Power: 15
Don is on a distinguished road
Thumbs up

You the man, Larry.

That works a treat. Once again (and don't you just get sick of saying it) thanks.

Best wishes,
Don.
__________________
Thanks,

Don.
Version 3.1 Developer

May God bless you in mighty ways.
Don is offline  
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Contact The Owner gppromano v3.1 Modules & Modifications 1 01-19-2007 10:11 AM
Contact Owner Form SteM v3.1 Questions & Support 2 01-02-2007 09:47 AM
After Contact Owner CB v3.1 Questions & Support 3 09-09-2006 04:13 AM
Direct link to user listing in contact email SkGold v3.1 Questions & Support 2 07-10-2006 02:42 PM
Contact the Owner - make form optional fjarabeck v3.1 Modules & Modifications 2 05-14-2006 10:17 PM


All times are GMT -4. The time now is 11:44 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0