1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[SchmitzIT] Animated Userflags

Discussion in 'Template Modifications [Archive]' started by SchmitzIT, Jan 27, 2011.

  1. SchmitzIT

    SchmitzIT Well-Known Member

    Disclaimer #1: These flags were not created by me. I got them from Cobro on vBulletin.org.
    Disclaimer #2: The template edits required were earlier suggested by Ims in his "Flags of Countries" and by Dismounted in his XenMoods thread. I merely rewrote their instructions somewhat to put the flags in.
    Disclaimer #3: I did not see this advertised yet, but if it has already been covered, I hereby apologize for the double-post.

    Instructions: Unzip the countryflags-zip files and upload it to your xf folder. The images will be placed in /styles/default/userflags.

    Then perform the following template edits.

    In template message_user_info find:

    Code:
    <dd><a href="http://maps.google.com/maps?q={xen:urlencode {xen:string censor, $user.location}}" target="_blank" rel="nofollow" itemprop="address" class="concealed">{xen:string censor, $user.location}</a></dd>
    
    Replace this with:

    Code:
    <dd><a href="http://maps.google.com/maps?q={xen:urlencode {xen:string censor, $user.location}}" target="_blank" rel="nofollow" itemprop="address" class="concealed">
             <img src="@imagePath/userflags/{xen:string censor, $user.location}.gif" alt="{xen:string censor, $user.location}" title="{xen:string censor, $user.location}" />
    </a></dd>
    
    In template member_view, find:

    Code:
                    <xen:if is="{$user.location}">
                        <dt>{xen:phrase location}:</dt>
                        <dd itemprop="address">{xen:string censor, $user.location}</dd>
                    </xen:if>
    
    Replace with:

    Code:
                    <xen:if is="{$user.location}">
                        <dt>{xen:phrase location}:</dt>
                        <dd itemprop="address"><img src="@imagePath/userflags/{xen:string censor, $user.location}.gif" alt="{xen:string censor, $user.location}" title="{xen:string censor, $user.location}" /></dd>
                    </xen:if>
    
    Finally, in template account_personal_details find:

    Code:
    <dd><input type="text" name="location" value="{$visitor.location}" id="ctrl_location" class="textCtrl OptOut" /></dd>
    
    Replace this with the content of the enclosed textfile.


    The first edits take care of displaying the image (can someone tell me what template message_user_info does exactly? I cannot seem to be able to find the edit I made there back anywhere. I listed it because it was also used by Ims.).

    The last edit replaces the original "location" textbox in the Personal Details page with a dropdown boox containing all the individual countries.
     

    Attached Files:

    Webby, ManuTdi, Ranger375 and 6 others like this.
  2. Ranger375

    Ranger375 Well-Known Member

    Is there a way I can keep the location field and use this with a custom "country" field?
     
    The8thLegion likes this.
  3. SchmitzIT

    SchmitzIT Well-Known Member

    I would assume so. I'll see if I can work on that, and at the same time avoid the template edits by instead employing hooks :)
     
    D.O.A. and Ranger375 like this.
  4. Brendon Meynell

    Brendon Meynell Active Member

    This does not work on the latest version of xF - the google maps stuff isn't in the templates.
     
  5. SchmitzIT

    SchmitzIT Well-Known Member

    As soon as I find some spare time inbetween paid work, I will see what I can do to get this up and running again.
     
    CapnLuffy likes this.

Share This Page