Lavalair WML Mods

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Lavalair WML Mods

    Please add all your WML mods for lavalair in here thanks......

    Regards
    Pieter Bezuidenhout
    BakGat
    Code:
    class Counter {
    public:
      void Count();
      int  ReadDisplay();
    private:
      int  CurrentCount;
    };








    Back up my hard drive? How do I put it in reverse?
    My Community
    BakGat
    sigpic

    #2
    IP to Country

    Heres my WML version working 100% for me....

    Add into core.php

    PHP Code:
    //////////////////////Country 
    function iptocountry($ip) {
        
    $numbers preg_split"/\./"$ip);
        include(
    "../ip_files/".$numbers[0].".php");
        
    $code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]);
        foreach(
    $ranges as $key => $value){
            if(
    $key<=$code){
                if(
    $ranges[$key][0]>=$code){$two_letter_country_code=$ranges[$key][1];break;}
                }
        }
        if (
    $two_letter_country_code==""){$two_letter_country_code="unkown";}
        return 
    $two_letter_country_code;
    }
    function 
    country_name($two_letter_country_code)
        {
         include(
    "ip_files/countries.php");
        
    $country_name=$countries[$two_letter_country_code][0];
       return 
    $country_name;
        }
    function 
    show_flag($two_letter_country_code)
          {
         
    $file_to_check='./ip_flags/'.strtolower($two_letter_country_code).'.gif';
         if (
    file_exists($file_to_check)){
                    
    $FLAG'<img src="'.$file_to_check.'" alt="'.$two_letter_country_code.'"/>';
                    }else{
                    
    $FLAG'<img src="./ip_flags/noflag.gif" alt="'.$two_letter_country_code.'"/>';
                    }
           return 
    $FLAG;
           }
    //////////////////////Operator theyr using?
    function ip()
    {
    if(
    $_SERVER["REMOTE_ADDR"]){$ip=$_SERVER["REMOTE_ADDR"];}
    else{
    $ip=$_SERVER["HTTP_X_FORWARDED_FOR"];}
    if(
    strpos($ip,",")){
    $exp_ip=explode(",",$ip);
    $ip=$exp_ip[0];
    }
    return 
    $ip;
    }

    function 
    ipinrange($ip$range1$range2)
    {
    $ip=ip2long($ip);
    $range1=ip2long($range1);
    $range2=ip2long($range2);
    return ((
    $ip >= $range1) && ($ip <= $range2));
    }
    function 
    network($ip,$opt)
    {
    $result=mysql_query("SELECT * FROM network ORDER BY subone, subtwo");
    while(
    $ranges=mysql_fetch_array($result)){
    if(
    ipinrange($ip$ranges[1], $ranges[2])){
    if(
    is_file("flags/".$ranges["flag"])&&$opt==1){
    $flag="<img src=\"flags/".$ranges["flag"]."\" alt=\"".$ranges["flag"]."\"/><br/>";
    }
    return 
    $flag.$ranges["isp"]." ".$ranges["country"];
    }
    }

    Add into index.php in viewuser were you want to display it...

    PHP Code:
     ////////////////////////////////////////
    $uipadd mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
    $IPaddress=$uipadd[0];
    $two_letter_country_code=iptocountry($IPaddress);
    echo 
    "<b>Flag:</b> <img src=\"../flags/$two_letter_country_code.gif\" alt=\"*\" /><br/>\n";
    echo 
    "<b>Country:</b> $two_letter_country_code<br/>";
    //////////////////////////////////////// 
    Enjoi
    Attached Files
    Last edited by bOrN2pwn; 17.01.10, 05:43.
    BakGat
    Code:
    class Counter {
    public:
      void Count();
      int  ReadDisplay();
    private:
      int  CurrentCount;
    };








    Back up my hard drive? How do I put it in reverse?
    My Community
    BakGat
    sigpic

    Comment

    Working...
    X