PDA


View Full Version : [hack] Display enquiry form with link


Lionel
03-05-2007, 01:18 AM
The email vb has in file is not necessarily the email that someone who is adding a listing is using. It is not recommended to expose someone's email to email harvesters.

This will allow your member to safely include a contact email with their listing by using vbulletin sendmessage.php

Please note that all options for custom fields must be set to "no" for those categories that you want to use this for, so the email addresses do not get get parsed as links or BB code.

Step1

Go to vba Links directory and create a custom field text input single line and remember the field id. You will need it later.
Title:Email contact
Description: If you wish to be contacted about this listing, enter your email address here. Please note that this address will not be seen by the public. Instead they will have access to a contact form.
(the rest, you do to your taste)

Step 2

create 2 error phrases
a)directorymail_invalidid: There is no such listing in the directory.
b)directorymail_noemail: This directory listing has no email defined.

Step 3

Create a new template "adv_links_directory_mailform" and paste in the content of the attached text.

Step 4

open sendmessage.php and paste the entire copy of sendmessage.txt above the closing ?>
and replacing the line before last with where you want to send then after the email was sent (I redirect mine to link home, but could be whatever you want)

$vbulletin->url = REPLACE

MAKING SURE that you replaced the 3 instances of the XX in fieldXX with your field ID.

Step 5

Replace your "adv_links_showlink_custombits" template with (replacing XX with actual field id that youu created earlier and making sure to change the link to sendmessage.php according to yours)
<tr class="$bgclass">
<td>$field[title]:</td>
<td><if condition="$field[fieldid] == 'XX'"><a href="/forums/sendmessage.php?do=directorymail&linkid=$linkid"><span class="smallfont">Request more info from $link[name]</a></span>
<else />$field[value]</if></td>
</tr>

nostalgia
07-05-2007, 01:24 AM
Working great!!
Thanks! Lionel :)