1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Registration Referrer Member AutoComplete

Registration Referrer Template mod

  1. KozmoK

    KozmoK Active Member

    KozmoK submitted a new resource:

    Registration Referrer - Registration Referrer Template mod

    Read more about this resource...
     
  2. DRE

    DRE Well-Known Member

    What's a registration referrer member?
     
  3. KozmoK

    KozmoK Active Member

    Its a custom registration field


    Well, on my site - I like to reward people who send people to my site, so I want them to fill it out to credit the propper people if they purchase a subscription.

    So - with this mod, it allows them to find the member properly.
     
  4. DRE

    DRE Well-Known Member

    That sounds pretty cool but can you please consider including screenshots of what this looks like?
     
  5. KozmoK

    KozmoK Active Member

    I had made two versions of this, one with the db edits, and php file edits, and found that the template edit is much easier for the novice so I removed the ones with php edits/sql.
     
    Last edited: Jul 30, 2013
  6. Warning

    Warning Member

    @KozmoK Please help with me..
     
  7. KozmoK

    KozmoK Active Member

    Ok I reverted and tested it, it worked fine:

    Here is the first 26 lines of "custom_field_edit" Green is inserted, and red is altered, black is existing.... if it still doesnt work, please paste these lines from your template here...i'm sure it something simple.

    <dl class="ctrlUnit customFieldEdit{$field.field_id}">
    <dt>
    <label for="ctrl_custom_field_{$field.field_id}">{$field.title}:</label>
    <xen:if is="{$field.required}"><dfn>{xen:phrase required}</dfn></xen:if>
    </dt>
    <dd>

    <xen:if is="{$field.field_id} == 'Referrer'">
    <input type="search" name="custom_fields[{$field.field_id}]"
    value="{$field.field_value}"
    placeholder="{xen:phrase name}..." results="0" class="textCtrl AutoComplete"
    data-validatorname="custom_field_{$field.field_id}"
    data-autoSubmit="true" />

    <xen:elseif is="{$field.field_type} == 'textbox'" />
    <input type="text" name="custom_fields[{$field.field_id}]" value="{$field.field_value}"
    id="ctrl_custom_field_{$field.field_id}"
    data-validatorname="custom_field_{$field.field_id}"
    class="textCtrl" maxlength="{xen:if $field.max_length, $field.max_length}"
    />

    <xen:elseif is="{$field.field_type} == 'textarea'" />
    <textarea name="custom_fields[{$field.field_id}]"
    id="ctrl_custom_field_{$field.field_id}"
    data-validatorname="custom_field_{$field.field_id}"
    class="textCtrl Elastic">{$field.field_value}</textarea>
    <xen:elseif is="{$field.field_type} == 'radio'" />
     
    Last edited: Jul 30, 2013
  8. Warning

    Warning Member

    Template custom_field_edit :(

    Code:
    <dl class="ctrlUnit">
    
        <dt>
            <label for="ctrl_custom_field_{$field.field_id}">{$field.title}:</label>
            <xen:if is="{$field.required}"><dfn>{xen:phrase required}</dfn></xen:if>
        </dt>
        <dd>
            <xen:if is="{$field.field_type} == 'textbox'">
                <input type="text" name="custom_fields[{$field.field_id}]" value="{$field.field_value}"
                    id="ctrl_custom_field_{$field.field_id}"
                    data-validatorname="custom_field_{$field.field_id}"
                    class="textCtrl" maxlength="{xen:if $field.max_length, $field.max_length}"
                />
            <xen:elseif is="{$field.field_type} == 'textarea'" />
                <textarea name="custom_fields[{$field.field_id}]"
                    id="ctrl_custom_field_{$field.field_id}"
                    data-validatorname="custom_field_{$field.field_id}"
                    class="textCtrl Elastic">{$field.field_value}</textarea>
            <xen:elseif is="{$field.field_type} == 'radio'" />
                <ul class="checkboxColumns">
                <xen:if is="!{$field.required}">
                    <li><label><input type="radio" name="custom_fields[{$field.field_id}]" value="" {xen:checked '{$field.field_value} == ""'} /> <span class="muted">{xen:phrase no_selection}</span></label></li>
                </xen:if>
                <xen:foreach loop="$field.fieldChoices" key="$choice" value="$text">
                    <li><label><input type="radio" name="custom_fields[{$field.field_id}]" value="{$choice}" {xen:checked '{$field.field_value} == {$choice}'} /> {xen:raw $text}</label></li>
                </xen:foreach>
                </ul>
            <xen:elseif is="{$field.field_type} == 'select'" />
                <select name="custom_fields[{$field.field_id}]" id="ctrl_custom_field_{$field.field_id}" class="textCtrl">
                <xen:if is="!{$field.required} OR !{$field.hasValue}">
                    <option value="">&nbsp;</option>
                </xen:if>
                <xen:foreach loop="$field.fieldChoices" key="$choice" value="$text">
                    <option value="{$choice}" {xen:selected '{$field.field_value} == {$choice}'}>{xen:raw $text}</option>
                </xen:foreach>
                </select>
            <xen:elseif is="{$field.field_type} == 'checkbox'" />
                <ul class="checkboxColumns">
                <xen:foreach loop="$field.fieldChoices" key="$choice" value="$text">
                    <li><label><input type="checkbox" name="custom_fields[{$field.field_id}][{$choice}]" value="{$choice}" {xen:checked 'isset({$field.field_value.{$choice}})'} /> {xen:raw $text}</label></li>
                </xen:foreach>
                </ul>
            <xen:elseif is="{$field.field_type} == 'multiselect'" />
                <select name="custom_fields[{$field.field_id}][]" id="ctrl_custom_field_{$field.field_id}" class="textCtrl" size="7" multiple="multiple">
                <xen:if is="!{$field.required} OR !{$field.hasValue}">
                    <option value="">&nbsp;</option>
                </xen:if>
                <xen:foreach loop="$field.fieldChoices" key="$choice" value="$text">
                    <option value="{$choice}" {xen:selected 'isset({$field.field_value.{$choice}}'}>{xen:raw $text}</option>
                </xen:foreach>
                </select>
            </xen:if>
    
            <xen:if hascontent="true"><p class="explain"><xen:contentcheck>{xen:raw $field.description}</xen:contentcheck></p></xen:if>
            <input type="hidden" name="custom_fields_shown[]" value="{$field.field_id}" />
        </dd>
    </dl>
     
  9. Cal

    Cal Well-Known Member

    Yeah...way confused. :cry:
     
  10. KozmoK

    KozmoK Active Member

    I dont see where you edited it at all... oh crap, Im running 1.2 RC 2

    I wonder if that matters?

    all's I did was insert the green lines above, and altered that red one - dont know how to make it simpler then that.
     
  11. Warning

    Warning Member

    I edited template ..RED

    <dl class="ctrlUnit">
    <dt>
    <label for="ctrl_custom_field_{$field.field_id}">{$field.title}:</label>
    <xen:if is="{$field.required}"><dfn>{xen:phrase required}</dfn></xen:if>
    </dt>
    <dd>

    <xen:if is="{$field.field_id} == 'ReferrerForum'">
    <input type="search" name="custom_fields[{$field.field_id}]"
    value="{$field.field_value}"
    placeholder="{xen:phrase name}..." results="0" class="textCtrl AutoComplete"
    data-validatorname="custom_field_{$field.field_id}"
    data-autoSubmit="true" />

    <xen:if is="{$field.field_type} == 'textbox'">
    <input type="text" name="custom_fields[{$field.field_id}]" value="{$field.field_value}"
    id="ctrl_custom_field_{$field.field_id}"
    data-validatorname="custom_field_{$field.field_id}"
    class="textCtrl" maxlength="{xen:if $field.max_length, $field.max_length}"
    />
    <xen:elseif is="{$field.field_type} == 'textarea'" />
    <textarea name="custom_fields[{$field.field_id}]"
    id="ctrl_custom_field_{$field.field_id}"
    data-validatorname="custom_field_{$field.field_id}"
    class="textCtrl Elastic">{$field.field_value}</textarea>
    <xen:elseif is="{$field.field_type} == 'radio'" />
    <ul class="checkboxColumns">
    <xen:if is="!{$field.required}">
    <li><label><input type="radio" name="custom_fields[{$field.field_id}]" value="" {xen:checked '{$field.field_value} == ""'} /> <span class="muted">{xen:phrase no_selection}</span></label></li>
    </xen:if>
    <xen:foreach loop="$field.fieldChoices" key="$choice" value="$text">
    <li><label><input type="radio" name="custom_fields[{$field.field_id}]" value="{$choice}" {xen:checked '{$field.field_value} == {$choice}'} /> {xen:raw $text}</label></li>
    </xen:foreach>
    </ul>
    <xen:elseif is="{$field.field_type} == 'select'" />
    <select name="custom_fields[{$field.field_id}]" id="ctrl_custom_field_{$field.field_id}" class="textCtrl">
    <xen:if is="!{$field.required} OR !{$field.hasValue}">
    <option value="">&nbsp;</option>
    </xen:if>
    <xen:foreach loop="$field.fieldChoices" key="$choice" value="$text">
    <option value="{$choice}" {xen:selected '{$field.field_value} == {$choice}'}>{xen:raw $text}</option>
    </xen:foreach>
    </select>
    <xen:elseif is="{$field.field_type} == 'checkbox'" />
    <ul class="checkboxColumns">
    <xen:foreach loop="$field.fieldChoices" key="$choice" value="$text">
    <li><label><input type="checkbox" name="custom_fields[{$field.field_id}][{$choice}]" value="{$choice}" {xen:checked 'isset({$field.field_value.{$choice}})'} /> {xen:raw $text}</label></li>
    </xen:foreach>
    </ul>
    <xen:elseif is="{$field.field_type} == 'multiselect'" />
    <select name="custom_fields[{$field.field_id}][]" id="ctrl_custom_field_{$field.field_id}" class="textCtrl" size="7" multiple="multiple">
    <xen:if is="!{$field.required} OR !{$field.hasValue}">
    <option value="">&nbsp;</option>
    </xen:if>
    <xen:foreach loop="$field.fieldChoices" key="$choice" value="$text">
    <option value="{$choice}" {xen:selected 'isset({$field.field_value.{$choice}}'}>{xen:raw $text}</option>
    </xen:foreach>
    </select>
    </xen:if>
    </xen:if>

    <xen:if hascontent="true"><p class="explain"><xen:contentcheck>{xen:raw $field.description}</xen:contentcheck></p></xen:if>
    <input type="hidden" name="custom_fields_shown[]" value="{$field.field_id}" />
    </dd>
    </dl>
     
  12. KozmoK

    KozmoK Active Member

    You didnt edit the "<xen:if is="{$field.field_type} == 'textbox'">" as I did above....

    it should be:

    <xen:elseif is="{$field.field_type} == 'textbox'" />

    please notice the elseif difference and the /> at the end


    and dont put the extra end </xen:if> - I never said to add that.
     
    Last edited: Jul 30, 2013
    Warning likes this.
  13. KozmoK

    KozmoK Active Member

    Here is a screenshot of the View Custom Change:

    custom_field_edit.PNG
     
    Warning and 0xym0r0n like this.
  14. Warning

    Warning Member

    Thanks you .. :D
     
  15. MistyMeanor

    MistyMeanor Active Member

    Hi KozmoK

    Thank you for this modification. I have a question: how can I display the same icon you've set for this referrer field?

    Thank you!
     
  16. KozmoK

    KozmoK Active Member

    It should be that way automatically if you set the input type = "search" . Its not showing a magnifying glass?
     
  17. MistyMeanor

    MistyMeanor Active Member

    No, it isn't.

    I'm using a custom style, maybe because of that?
     
  18. KozmoK

    KozmoK Active Member

    try switching to the default and see if its there :) I see it in mine.
     
  19. Do we have to create a custom profile field for this to work?
     
  20. KozmoK

    KozmoK Active Member

    Yes
     

Share This Page