Author Topic: [MOD] Country Flag in Comment  (Read 26484 times)

0 Members and 1 Guest are viewing this topic.

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] Country Flag in Comment
« Reply #15 on: August 10, 2010, 04:34:48 PM »
@Mawenzi


1) The below image from what u can see from the black arrow gives each user that makes a comment a flag, now that flag corresponds to there IP, and mawenzi was kind enough to help out another member who wanted this MOD, i thoght i have fixed it but everytime a user makes a comment it goes from a flag to {comment_user_flag} until i refresh the page. Below the image is the code that mawezni created, its pretty simple i just put it in the details.php script, One minute i can see flags, then when i make a comment the flag vanishes and i am left with  {comment_user_flag} :(. Is there a problem inside the code by any chance or is just me i have done mistake? :-( 


Code: [Select]
//--- Kommentar-Autor COUNTRY FLAGS ---
    if (!class_exists("GeoIP"))
    {
      include(ROOT_PATH."includes/geoip.inc");
    }
    $gi = geoip_open(ROOT_PATH."includes/GeoIP.dat",GEOIP_STANDARD);
    $countries = array();
    $cid = geoip_country_code_by_addr($gi, $comment_row[$i]['comment_ip']);
    if (empty($cid)) $cid = "lan";
    $countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
    $comment_user_flag = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0>";
//--- Kommentar-Autor COUNTRY FLAGS ---

      $site_template->register_vars(array(
        "comment_id" => $comment_row[$i]['comment_id'],
        "comment_user_flag" => $comment_user_flag,

Thank u sir

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Country Flag in Comment
« Reply #16 on: August 10, 2010, 05:06:03 PM »
are you still using ajax comments? if so, you'll need add the same code inside ajaxcomments.php
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD] Country Flag in Comment
« Reply #17 on: August 10, 2010, 05:41:05 PM »
@ VANO

I really dont know what to say to u, if i say thank u it will not show u anything, if i say THANK U in capital letters it will display how much gratitude i have for u, thank u a million times, u r a fantastic and most remarkable individual and im not saying this for fun, i mean that. God bless u vano and i really hope that everyone who uses 4images shows the same respect and gratitude i have for u.

thank u so much vano more than i can show