Dotclear

Changeset 1967


Ignore:
Timestamp:
12/10/09 22:04:14 (13 years ago)
Author:
wattoo
Message:

Fix pb d'url en query string

Location:
plugins/commentIpGeo
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • plugins/commentIpGeo/CHANGELOG

    r1207 r1967  
     10.9 : 08/09/09 
     2  - Fix bugs 
     3  - Add {{tpl:commentIpGeoIsp}} to get the ISP of comment poster 
     4 
    150.8 : 06/06 
    26  - Add ipGeoCityLite database (installed on my own web server and requested by the plugins to get Country AND City). Wipmania is still available but is not the default setup (see about:config) 
  • plugins/commentIpGeo/_define.php

    r1630 r1967  
    1616     /* Description*/    "Add templates tags CommentIpGeo and CommentIpGeoFlag. It uses WIPmania.com or IpGeoCityLite, WorldIP - free geolocation databases", 
    1717     /* Author */        "Frederic PLE <dotclear@frederic.ple.name>", 
    18      /* Version */       '0.8', 
     18     /* Version */       '0.9', 
    1919     /* Permissions */   'admin' 
    2020); 
  • plugins/commentIpGeo/_install.php

    r1630 r1967  
    1313if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    1414 
    15 $db_flush = array('0.3','0.7'); 
     15$db_flush = array('0.3','0.7','0.9'); 
    1616 
    1717$m_version = $core->plugins->moduleInfo('commentIpGeo','version'); 
  • plugins/commentIpGeo/_public.php

    r1630 r1967  
    1515     $core->tpl->addValue('commentIpGeoFlag',array('tplCommentIpGeo','country_flag')); 
    1616     $core->tpl->addValue('commentIpGeoCity',array('tplCommentIpGeo','country_city')); 
     17     $core->tpl->addValue('commentIpGeoISP',array('tplCommentIpGeo','isp')); 
    1718     $core->tpl->addValue('commentDebug',array('tplCommentIpGeo','debug')); 
    1819     $core->addBehavior('publicHeadContent',array('tplCommentIpGeo','publicHeadContent')); 
  • plugins/commentIpGeo/class.commentIpGeo.php

    r1630 r1967  
    1818          else 
    1919               $ip_geo = netHttp::quickGet("http://frederic.ple.name/tools/inc_geoip.php?ip=" . $ip . "&from=" . urlencode(str_replace('http://','',$rs->core->blog->url))); 
    20           if ($ip_geo === false or $ip_geo === null) 
     20          if ($ip_geo === false or $ip_geo === null or strpos($ip_geo,'<') !== false) 
    2121               return false; 
    2222          else 
  • plugins/commentIpGeo/class.public.commentIpGeo.php

    r1630 r1967  
    3030          $rs = $c_rs->core->con->select($strReq); 
    3131          while($rs->fetch()) { 
    32                if ($rs->comment_ip_geo === false or $rs->comment_ip_geo === "" or $rs->comment_ip_geo === null or strstr($rs->comment_ip_geo,':') === false) { 
     32               if ($rs->comment_ip_geo === false or $rs->comment_ip_geo === "" or $rs->comment_ip_geo === null or strstr($rs->comment_ip_geo,':') === false or strstr($rs->comment_ip_geo,'<') === false) { 
    3333                    $ip_geo = commentIpGeo::ip2country($c_rs,$rs->comment_ip); 
    3434                    if ($ip_geo === false) { 
  • plugins/commentIpGeo/class.tpl.commentIpGeo.php

    r1630 r1967  
    1717    echo '<style type="text/css" media="all"> 
    1818  /*-------------------------Flags and languages--------------------------------*/ 
    19   .flags {background: url("' . $core->blog->url . '?pf=commentIpGeo/default-templates/flags.png") no-repeat top left; width:18px; height:12px; vertical-align:middle;} 
     19  .flags {background: url("' . $core->blog->url . ((substr($core->blog->url,-1) == '?') ? '' : '?') . 'pf=commentIpGeo/default-templates/flags.png") no-repeat top left; width:18px; height:12px; vertical-align:middle;} 
    2020</style> 
    21 <link rel="stylesheet" media="all" type="text/css" href="' . $core->blog->url . '?pf=commentIpGeo/default-templates/flags.css" /> 
     21<link rel="stylesheet" media="all" type="text/css" href="' . $core->blog->url . ((substr($core->blog->url,-1) == '?') ? '' : '?') . 'pf=commentIpGeo/default-templates/flags.css" /> 
     22<link rel="stylesheet" media="all" type="text/css" href="' . $core->blog->url . ((substr($core->blog->url,-1) == '?') ? '' : '?') . 'pf=commentIpGeo/default-templates/isp.css" /> 
    2223'; 
    2324  } 
     
    3839  static public function country_flag($attr) { 
    3940    return self::__process('"<img src=\\"" . $core->blog->url' . 
    40                ' . "?pf=commentIpGeo/default-templates/_.gif\\" ' . 
     41               ' . ((substr($core->blog->url,-1) == \'?\') ? \'\' : \'?\')' . 
     42               ' . "pf=commentIpGeo/default-templates/_.gif\\" ' . 
    4143               ' class=\\"flags flag-" . $_ctx->comments->getIpGeoCountryCode() . ' . 
    4244               '"\\" alt=\\"" . $_ctx->comments->getIpGeoCountryCode() . "-flag\\" />"'); 
     
    4749  } 
    4850 
     51  static public function isp($attr) { 
     52    return self::__process('"<img src=\\"" . $core->blog->url' . 
     53               ' . ((substr($core->blog->url,-1) == \'?\') ? \'\' : \'?\')' . 
     54               ' . "pf=commentIpGeo/default-templates/_isp.png\\" ' . 
     55               ' class=\\"isp isp-" . $_ctx->comments->getIpGeoIsp() . ' . 
     56               '"\\" alt=\\"" . $_ctx->comments->getIpGeoIsp() . "-ISP\\" />"'); 
     57  } 
     58 
    4959  static public function debug($attr) { 
    50     return '<!-- DEBUG :' . "\n" . '<?php echo $_ctx->comments->debug(); ?> -->'; 
     60    return '<?php 
     61      if ($core->blog->settings->commentIpGeo_debug) 
     62        echo "<!-- DEBUG :\n" . $_ctx->comments->debug() . " -->\n"; 
     63     ?>'; 
    5164  } 
    5265} 
  • plugins/commentIpGeo/rs.extensions.php

    r1630 r1967  
    1212 
    1313class rsExtCommentIpGeo { 
     14     public static function __process(&$rs,$i) { 
     15          global $core; 
     16          $t = explode(':',publicCommentIpGeo::$c_info[$rs->comment_id]['comment_ip_geo'],3); 
     17          return $t[$i - 1]; 
     18     } 
     19 
    1420     public static function getIpGeoCountryCode(&$rs) { 
    1521          global $core; 
    16           list($country,$city) = explode(':',publicCommentIpGeo::$c_info[$rs->comment_id]['comment_ip_geo'],2); 
    17           return $country; 
     22          return rsExtCommentIpGeo::__process($rs,1); 
    1823     } 
    1924      
    2025     public static function getIpGeoCountryCity(&$rs) { 
    2126          global $core; 
    22           list($country,$city) = explode(':',publicCommentIpGeo::$c_info[$rs->comment_id]['comment_ip_geo'],2); 
    23           return $city; 
     27          return rsExtCommentIpGeo::__process($rs,2); 
     28     } 
     29 
     30     public static function getIpGeoIsp(&$rs) { 
     31          global $core; 
     32          return rsExtCommentIpGeo::__process($rs,3); 
    2433     } 
    2534      
Note: See TracChangeset for help on using the changeset viewer.

Sites map