Support Forums

Old 02-24-2007, 08:49 AM   #1
Senior Member
 
free2take's Avatar
 
Join Date: Mar 2006
Location: Ireland
Posts: 228
Rep Power: 19
free2take is a jewel in the rough
Default Extra Registration Fields - How did you hear about us ?

Hi there,

I'd like to use one of the extra registration fields to catch info regarding how people came by the site as there is no point in spending money on advertising if it can't measured.

My idea was to use one of these fields to house a drop down with values like Word Of Mouth, Billboard, Radio Advertisement, Flyer, Other etc etc

A nice but not essential would be that, if other was selected I'd like to allow the user to type the explanation in a text box which would appear.

Trouble is these fields seem to be single line text only.

Anyone know a neat way of doing this ?

Many thanks,
Mully
__________________
v4.08

Last edited by free2take; 02-25-2007 at 02:21 PM.
free2take is offline   Reply With Quote
Old 02-27-2007, 08:59 AM   #2
Senior Member
 
free2take's Avatar
 
Join Date: Mar 2006
Location: Ireland
Posts: 228
Rep Power: 19
free2take is a jewel in the rough
Default

Ok found a solution for the bulk of this.

Basically I piggyback the extra field and change it into a drop down box and create a small function to define the values there in.

1)In includes/functions.php add the following lines:
PHP Code:
/* Get an array of recommendations */
function getrby()
{
    
$rby = array(
    array(
name => "Family \ Friends"),
    array(
name => "Billboard"),
    array(
name => "Flyer"));
      return 
$rby;

If you want other options just ad them in here i.e.
PHP Code:
array(name => "Website Link"), 
I placed this code after the function getStates(), it is just used to define what appears in the drop down list.

2) In lanuage/english.php add the following entry
PHP Code:
define("LANG_RECOMMENDED_BY""Other"); 
3)In userjoin.php add the following:
PHP Code:
        //now the recommended by
        
$rby=getrby();
        
$class_tpl->assign('showrby'$rby); 
I put this in after the //now get the country and states section

This passes the dropdown values you listed in the getrby() function to the userjoin template.

4)Your active template folder /user/userjoin.tpl.php
Modify the extra listings section as
PHP Code:
{if $dis_extra=="Y"}
        <
tr>
            <
td class="formleft">{if $req_extra=="Y"}<span class='required'>{$smarty.const.LANG_STAR}</span>{/if}{$extra_text}{$smarty.const.LANG_COLON}</td>
            <
td class="formright">
                   <
select name="extra" id="extra">
                 <
option value="none">{$smarty.const.LANG_RECOMMENDED_BY}</option>
                {
section name=entry loop=$showrby}
                <
option value="{$showrby[entry].name}"{if $extra==$showrby[entry].nameselected="SELECTED"{/if}>{$showrby[entry].name}</option>
                {/
section}
                   </
select>
            </
td>
        </
tr>
          {/if} 
Hey presto whatever is picked from the drop down will be put in the extra column of your user table and you can get an idea which marketing works and which doesn't.

Make sure you change the description of the extra field in your admin panel and make it visible etc on your registration form.

Haven't worked out how to pop up an additional box though I'd like the user to be able to type in a vlaue if other was selected, any ideas ?

All the best,
Mully
__________________
v4.08
free2take is offline   Reply With Quote
Old 02-27-2007, 01:24 PM   #3
Moderator
 
Chaslie's Avatar
 
Join Date: Mar 2006
Location: Great Ocean Road - Australia
Posts: 745
Rep Power: 28
Chaslie will become famous soon enough
Default

Quote:
Haven't worked out how to pop up an additional box though I'd like the user to be able to type in a vlaue if other was selected, any ideas ?
Couldn't you just repeat what you have already done except made it a text input instead of a select box? Then call this field, 'If other, please state below'. Also make this field not-mandatory.

That means you would have a select box (already done) place an accompanying text input.
__________________
Chaslie
V4.1 dev


68 Classifieds Important Links
Customer Area | Issue Tracker | User Manuals & Documentation

HTML Help
W3 Schools
Chaslie is offline   Reply With Quote
Old 02-27-2007, 02:51 PM   #4
Senior Member
 
free2take's Avatar
 
Join Date: Mar 2006
Location: Ireland
Posts: 228
Rep Power: 19
free2take is a jewel in the rough
Smile

I had thought about this before and was thinking of using one of the remaiing extra fields again i.e. extra field 2.

Guess I could go down this route, I thought it would be nice to have the dynamic element to it though.
__________________
v4.08
free2take is offline   Reply With Quote

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
Using Extra user registration info BigOrange v3.1 Questions & Support 4 03-06-2007 05:47 PM
Extra fields bug? Sinisa v3.1 Questions & Support 8 01-24-2007 03:20 PM
Location of extra fields Acpjax v3.1 Questions & Support 4 10-25-2006 03:03 PM


All times are GMT -4. The time now is 09:40 PM.


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