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

Country Flags by IP Address 1.3.5

Shows member's country flag based on their IP Address

  1. Snog

    Snog Well-Known Member

    Snog submitted a new resource:

    Country Flags by IP Address - Shows member's country flag based on their IP Address

    Read more about this resource...
     
    Slind likes this.
  2. Snog

    Snog Well-Known Member

    For those that don't know how to tell if BC Math is installed and available to PHP, bring up your PHP Info page. Look for something like this...

    bcmath.jpg
     
  3. Slind

    Slind Active Member

    Juhu! I so glad that there is finally an addon for country flags which has no complicated requirements. Unfortunately I don't really fall in love with the flag icons, maybe we can see a different set in the future or multiple to select from :)

    I really like these ones for example: https://github.com/lafeber/world-flags-sprite

    How do you like them?
     
  4. Paul

    Paul Well-Known Member

  5. Slind

    Slind Active Member

    Snog likes this.
  6. Snog

    Snog Well-Known Member

    People are free to use whatever flags they want.

    You just need to match the names of the flags to what is in the snog_flags.css template.
     
  7. Slind

    Slind Active Member

    yeah I figured, just don't want to redo it with every update :)
     
  8. Snog

    Snog Well-Known Member

    Unless there's a bug found or XF changes something that causes the add-on to stop working, I don't anticipate any updates. ;)
     
  9. Slind

    Slind Active Member

    great, small, simple, clean and very useful.
     
    Snog likes this.
  10. Snog

    Snog Well-Known Member

    I wasn't ignoring you. I wanted to test what you're showing.

    This isn't a problem with the flag display. It's a problem with the Status Ribbon mod. It happens with any field, even the in default XF template. Fields are pushed over, that's what causes the flag to drop lower and if the message count was a large number, it would drop lower also....
    compare.jpg
     
    Paul likes this.
  11. Paul

    Paul Well-Known Member

    Many thanks Snog for checking it out for me :)

    Interestingly, have woken up this morning to find my error log full of errors.... however it seems all from the same user. I have checked and there's nothing different in his setup as opposed to everyone elses.. He is a registered user on the board.

    Code:
    ErrorException: Undefined index: country - library/Snog/CountryFlags/Listener/Visitor.php:39
    Generated By: kevlar, Today at 5:54 AM
    Stack Trace
    #0 /home/pinball/public_html/community/library/Snog/CountryFlags/Listener/Visitor.php(39): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/pinball/p...', 39, Array)
    #1 [internal function]: Snog_CountryFlags_Listener_Visitor::visitor(Object(XenForo_Visitor))
    #2 /home/pinball/public_html/community/library/XenForo/CodeEvent.php(90): call_user_func_array(Array, Array)
    #3 /home/pinball/public_html/community/library/XenForo/Visitor.php(461): XenForo_CodeEvent::fire('visitor_setup', Array)
    #4 /home/pinball/public_html/community/library/XenForo/Session.php(274): XenForo_Visitor::setup(510, Array)
    #5 /home/pinball/public_html/community/library/XenForo/Controller.php(291): XenForo_Session::startPublicSession(Object(Zend_Controller_Request_Http))
    #6 /home/pinball/public_html/community/library/XenForo/Controller.php(304): XenForo_Controller->_setupSession('Preview')
    #7 /home/pinball/public_html/community/library/XenForo/FrontController.php(346): XenForo_Controller->preDispatch('Preview', 'XenForo_Control...')
    #8 /home/pinball/public_html/community/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #9 /home/pinball/public_html/community/index.php(13): XenForo_FrontController->run()
    #10 {main}
    Request State
    array(3) {
    ["url"] => string(273) "http://www.pinballinfo.com/community/threads/new-driverboard-installed-now-flipper-coil-melted-why.11045/preview?_xfRequestUri=%2Fcommunity%2Ffind-new%2F256784%2Fposts&_xfNoRedirect=1&_xfToken=510%2C1397278319%2C10342126ad87df5a722fbd8df02a5de8a3c19735&_xfResponseType=json"
    ["_GET"] => array(4) {
    ["_xfRequestUri"] => string(32) "/community/find-new/256784/posts"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(55) "510,1397278319,10342126ad87df5a722fbd8df02a5de8a3c19735"
    ["_xfResponseType"] => string(4) "json"
    }
    ["_POST"] => array(0) {
    }
    }
    
    Just to add - i see where you are coming from with respect to the ribbon. I have changed to "covering ribbon" and this seems to fix the problem, whilst not making that much of a difference to the layout :)
     
    Last edited: Apr 12, 2014
  12. Falkor

    Falkor Member

  13. Snog

    Snog Well-Known Member

    I'm totally unable to duplicate the problem. Could you send the IP address for that user to me via PC?

    And so far as the online status, you can also use 'Below Avatar' with the 'Rank Ribbons' fix set to yes.
     
    Last edited: Apr 12, 2014
  14. Slind

    Slind Active Member

    is the addon open source and I'm allowed to create a git repo that I can merge possible future updates?
     
  15. Snog

    Snog Well-Known Member

    My code that interfaces to XenForo is not open source.

    However, the code in the Listener/Includes directory (the DB reader) is open source and covered by the Apache 2.0 license which allows me to add my own license terms and conditions to my work. You can obtain the DB reader that is in the Listener/Includes directory at the MaxMind web site.
     
  16. Slind

    Slind Active Member

    thanks :) Is it normal that I need to confirm the template changes? What about the member list, there is only a css import yet?
     
  17. Snog

    Snog Well-Known Member

    I'm not sure why people are having to confirm template changes. The 3 sites I've installed this on never asked for that so I don't know where it's coming from. What version of XF are you running?

    What do you mean by member list and css import?
     
    Last edited: Apr 12, 2014
  18. Slind

    Slind Active Member

    this is how my member_list_item looks like, I only find the css import, but nothing else:

    HTML:
    <xen:require css="xenforo_member_list_item.css" />
    <xen:if is="{$xenOptions.snog_countryflags_list}"><xen:require css="snog_flags.css" /></xen:if>
    
    <li class="primaryContent memberListItem{xen:if $extended, ' extended'}"{xen:if $id, ' id="{$id}"'}>
    
        <xen:avatar user="$user" size="s" class="{xen:if $noOverlay, 'NoOverlay'}" />
    
        <xen:if is="{$extraTemplate}"><div class="extra">{xen:raw $extraTemplate}</div></xen:if>
    
        <div class="member">
       
            <xen:if is="{$user.user_id}">
           
                <h3 class="username"><xen:username user="$user" rich="true" class="StatusTooltip{xen:if $noOverlay, ' NoOverlay'}" title="{xen:string censor, $user.status}" /></h3>
               
                <div class="userInfo">
                    <div class="userBlurb dimmed">{xen:helper userBlurb, $user}</div>
                    <dl class="userStats pairsInline">
                        <dt title="{xen:phrase total_messages_posted_by_x, 'name={$user.username}'}">{xen:phrase messages}:</dt> <dd>{xen:number $user.message_count}</dd>
                        <dt title="{xen:phrase number_of_times_something_posted_by_x_has_been_liked, 'name={$user.username}'}">{xen:phrase likes_received}:</dt> <dd>{xen:number $user.like_count}</dd>
                        <dt>{xen:phrase trophy_points}:</dt> <dd title="{xen:phrase trophy_points}">{xen:number $user.trophy_points}</dd>
                    </dl>
                </div>
               
            <xen:elseif is="{$guestHtml}" />
                <h3 class="username guest dimmed">{xen:raw $guestHtml}</h3>
            <xen:else />
                <h3 class="username guest dimmed">{xen:phrase guest}</h3>
            </xen:if>
           
            <xen:if hascontent="true">
                <div class="contentInfo"><xen:contentcheck>{xen:raw $contentTemplate}</xen:contentcheck></div>
            </xen:if>
           
        </div>
       
    </li>
     
  19. Snog

    Snog Well-Known Member

    What version of XF are you running?

    What is shown in your template is a Template Modification using the TMS in 1.2/1.3. It shouldn't appear in your actual template.
     
  20. Slind

    Slind Active Member

    1.2.5
     

Share This Page