HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Flags are not displayed

My flags are not displayed at all.

Comments

  • What is the image linking to?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight said:
    What is the image linking to?

    src="/index.php?p=/plugins/IP2Location/design/flags/de.png"

  • There is your problem. The link is trying to go through the dispatcher (index.php) when it actually needs to serve the standard file. If you can get pretty URLs working, this will take care of itself.

    Otherwise, you will need to modify lines 815 and 204 to use the Img() function found in the render functions file. 185 for example:

    ' . Img('plugins/IP2Location/design/flags/' . strtolower($Data['countryCode']) . '.png', array('align' => 'absMiddle') . ' ' . $Location . '
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • impost0rimpost0r New
    edited April 2015

    Thanks. I got actually no real clue about PHP. Would you like to tell me which file has to be modified(it can't be the plugin's file, since it only got ~200 rows)? And what I need to paste into line 815? :pleased:

  • @impost0r said:
    Thanks. I got actually no real clue about PHP. Would you like to tell me which file has to be modified(it can't be the plugin's file, since it only got ~200 rows)? And what I need to paste into line 815? :pleased:

    File /plugins/IP2Location/class.ip2location.plugin.php.

    I accidentally swapped digits. You need to change lines 185 and 204.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • It might be easier to do pretty urls as @hgtonight said. If you have Apache running, and can run shell commands, try this:
    a2query -m rewrite
    It should say something like
    rewrite (enabled by site administrator)

    If not and you have sudo access, you can enable it with
    sudo a2enmod rewrite

    Once enabled, look in your config.php for
    $Configuration['Garden']['RewriteUrls'] and make it = TRUE;

    You may have to modify your .htaccess file if your base directory is different. Meaning if it's www.yoursite.com/forum then change the RewriteBase in .htaccess to /forum

  • @hgtonight said:
    There is your problem. The link is trying to go through the dispatcher (index.php) when it actually needs to serve the standard file. If you can get pretty URLs working, this will take care of itself.

    Otherwise, you will need to modify lines 815 and 204 to use the Img() function found in the render functions file. 185 for example:

    ' . Img('plugins/IP2Location/design/flags/' . strtolower($Data['countryCode']) . '.png', array('align' => 'absMiddle') . ' ' . $Location . '
    

    I didn't have any luck after copying and pasting this line to 185, in fact the whole forum stopped working. Sadly I don't have access to the Apache configuration for rewrites so I cannot use the Pretty URL option.

    Any help would be appreciated.

  • --- /ip2location-plugin-1-0-0/IP2Location/class.ip2location.plugin.php
    +++ /IP2Location/class.ip2location.plugin.php
    @@ -182,7 +182,7 @@
                echo '
                <dt>Location</dt>
                <dd>
    -               <img src="' . Url('plugins/IP2Location/design/flags/') . strtolower($Data['countryCode']) . '.png" align="absMiddle" /> ' . $Location . '
    +               ' . Img('plugins/IP2Location/design/flags/' . strtolower($Data['countryCode']) . '.png', array('align' => 'absMiddle')) . ' ' . $Location . '
                </dd>';
            }
        }
    @@ -201,7 +201,7 @@
    
                    $Content = '
                    <td>
    -                   <div title="' . $Location . '"><img src="' . Url('plugins/IP2Location/design/flags/') . strtolower($Data['countryCode']) . '.png" align="absMiddle" /> ' . $Data['countryName'] . '</div>
    +                   <div title="' . $Location . '">' . Img('plugins/IP2Location/design/flags/' . strtolower($Data['countryCode']) . '.png', array('align' => 'absMiddle')) . ' ' . $Data['countryName'] . '</div>
                    </td>';
                }
    

    Looks like I had missed a closing parenthesis in my original mod.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • TheSquareTheSquare New
    edited May 2015

    @hgtonight said:
    [snip..causing forum issues.]

    Looks like I had missed a closing parenthesis in my original mod.

    You sir are a PHP coding god. Works perfectly.

Sign In or Register to comment.