Thread: [MySql/Php]Goal Sigs[Release]

Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1 [MySql/Php]Goal Sigs[Release] 
    Z
    Z is offline
    Registered Member
    Z's Avatar
    Join Date
    Jun 2007
    Age
    24
    Posts
    1,391
    Thanks given
    6
    Thanks received
    30
    Rep Power
    853
    Here's a demo:


    Here's a complete goal:

    PS: SORRY THE DEMOS ARE FKED UP....I DELETED MY DATABASE
    Here's the script:
    Code:
    <?php 
    $nav = $_SERVER["REQUEST_URI"];
    $script = $_SERVER["SCRIPT_NAME"];
    $nav = ereg_replace("^$script", "", $nav);
    $nav = str_replace("%20"," ",$nav);
    $vars = explode("/", $nav);
    $per1 = substr($vars[3],0,strpos($vars[3],"."));
    $stat = strtolower($vars[1]);
    $pgoal = strtolower($vars[2]);
    $per = ucfirst(strtolower($per1));
    
    function getExperience($exp, $goal){
        $goal--;
        for($i = 1; $i <= $goal; $i++){
          $e += intval($i + 300 * pow(2, $i / 7));
        }
        return intval($e / 4) - $exp;
    }
    function getPercent($exp, $goal){
        $goal--;
        for($i = 1; $i <= $goal; $i++){
          $e += intval($i + 300 * pow(2, $i / 7));
        }	
        return round(($exp / intval($e / 4)) * 100 ,0);
    }
    
    $font="font.ttf";
    
    $bd_host = "";     // Database host
    $bd_usuario = "";       // Database username
    $bd_password = "";      // Database password
    $bd_base = "";            // Database name
    $con = mysql_connect($bd_host, $bd_usuario, $bd_password); mysql_select_db($bd_base, $con);
    $sql = "SELECT * FROM users WHERE playerName='$per'";
    
    $result = mysql_query($sql);
    $row = mysql_fetch_array($result);
    $attack = $row["Attacklvl"];
    $defence = $row["Defencelvl"];
    $strength = $row["Strengthlvl"];
    $hitpoints = $row["Hitpointslvl"];
    $range = $row["Rangelvl"];
    $prayer = $row["Prayerlvl"];
    $magic = $row["Magiclvl"];
    $cooking = $row["Cookinglvl"];
    $woodcutting = $row["Woodcuttinglvl"];
    $fletching = $row["Fletchinglvl"];
    $fishing = $row["Fishinglvl"];
    $firemaking = $row["Firemakinglvl"];
    $mining = $row["Mininglvl"];
    $herblore = $row["Herblorelvl"];
    $agility = $row["Agilitylvl"];
    $thieving = $row["Thievinglvl"];
    $slayer = $row["Slayerlvl"];
    $runecrafting = $row["Runecraftinglvl"];
    
    $AttackXp = $row["Attackxp"];
    $DefenceXp = $row["Defencexp"];
    $StrengthXp = $row["Strengthxp"];
    $HitpointsXp = $row["Hitpointsxp"];
    $RangeXp = $row["Rangexp"];
    $PrayerXp = $row["Prayerxp"];
    $MagicXp = $row["Magicxp"];
    $CookingXp = $row["Cookingxp"];
    $WoodcuttingXp = $row["Woodcuttingxp"];
    $FletchingXp = $row["Fletchingxp"];
    $FishingXp = $row["Fishingxp"];
    $FiremakingXp = $row["Firemakingxp"];
    $MiningXp = $row["Miningxp"];
    $HerbloreXp = $row["Herblorexp"];
    $AgilityXp = $row["Agilityxp"];
    $ThievingXp = $row["Thievingxp"];
    $SlayerXp = $row["SlayerXp"];
    $RunecraftingXp = $row["Runecraftingxp"];
    if ($stat == 'attack' ) {
    $lvl =  $attack;
    $xp  =  $AttackXp;
    } elseif($stat == 'defence'){
    $lvl =  $defence;
    $xp  =  $DefenceXp;
    } elseif($stat == 'strength'){
    $lvl =  $strength;
    $xp  =  $StrengthXp;
    } elseif($stat == 'hitpoints'){
    $lvl =  $hitpoints;
    $xp  =  $HitpointsXp;
    } elseif($stat == 'range'){
    $lvl =  $range;
    $xp  =  $RangeXp;
    } elseif($stat == 'prayer'){
    $lvl =  $prayer;
    $xp  =  $PrayerXp;
    } elseif($stat == 'magic'){
    $lvl =  $magic;
    $xp  =  $MagicXp;
    } elseif($stat == 'cooking'){
    $lvl =  $cooking;
    $xp  =  $CookingXp;
    } elseif($stat == 'woodcutting'){
    $lvl =  $woodcutting;
    $xp  =  $WoodcuttingXp;
    } elseif($stat == 'fletching'){
    $lvl =  $fletching;
    $xp  =  $FletchingXp;
    } elseif($stat == 'fishing'){
    $lvl =  $fishing;
    $xp  =  $FishingXp;
    } elseif($stat == 'firemaking'){
    $lvl =  $firemaking;
    $xp  =  $FiremakingXp;
    } elseif($stat == 'mining'){
    $lvl =  $mining;
    $xp  =  $MiningXp;
    } elseif($stat == 'herblore'){
    $lvl =  $herblore;
    $xp  =  $HerbloreXp;
    } elseif($stat == 'agility'){
    $lvl =  $agility;
    $xp  =  $AgilityXp;
    } elseif($stat == 'thieving'){
    $lvl =  $thieving;
    $xp  =  $ThievingXp;
    } elseif($stat == 'slayer'){
    $lvl =  $slayer;
    $xp  =  $SlayerXp;
    } elseif($stat == 'runecrafting'){
    $lvl =  $runecrafting;
    $xp  =  $RunecraftingXp;
    }
    $xp =   str_replace(",","",$xp);  
    $temp = getExperience($xp, $pgoal);	
    if ($temp < 0 ) { 
    $imgfile = './images/100.png';
    $imgfile2 = './images/'.$stat.'.png';
    $im_size = getimagesize($imgfile);
    $image_width = $im_size[0];
    $image_height = $im_size[1];
    $im = imagecreatetruecolor($image_width, $image_height);
    $im2 = imagecreatefrompng($imgfile);
    $im3 = imagecreatefrompng($imgfile2);
    $white = imagecolorallocate($im, 255, 255, 255);
    $black = imagecolorallocate($im, 0, 0, 0);
    imagecopy($im, $im2, 0, 0, 0, 0, $image_width, $image_height);
    imagedestroy($im2);	
    imagettftext($im, 8, 0, 205, 18, $black, $font, ucfirst(strtolower($stat)).' lvl: '.$lvl.' / '.$pgoal);
    imagettftext($im, 8, 0, 75, 19, $white, $font, "Goal Achived!");
    } else { 
    $imgfile = './images/main.png';
    $imgfile2 = './images/'.$stat.'.png';
    $bar = './images/bar.png';
    $im_size = getimagesize($imgfile);
    $image_width = $im_size[0];
    $image_height = $im_size[1];
    $im = imagecreatetruecolor($image_width, $image_height);
    $im2 = imagecreatefrompng($imgfile);
    $im3 = imagecreatefrompng($imgfile2);
    $im4 = imagecreatefrompng($bar);
    $white = imagecolorallocate($im, 255, 255, 255);
    $black = imagecolorallocate($im, 0, 0, 0);
    imagecopy($im, $im2, 0, 0, 0, 0, $image_width, $image_height);
    imagedestroy($im2);
    $percent = getPercent($xp, $pgoal);
    if ( $percent > 99) { $percent = 99; }
    if ( $percent < 0)  { $percent = 0; }
    imagecopy($im, $im4, 55, 8, 0, 0, (0.444444*$percent)+$percent, 14);
    imagedestroy($im4);
    imagettftext($im, 8, 0, 205, 13, $black, $font, ucfirst(strtolower($stat)).' lvl: '.$lvl.' / '.$pgoal);
    imagettftext($im, 8, 0, 205, 24, $black, $font, 'XP to go: '.number_format($temp));
    imagettftext($im, 9, 0, 100, 20, $white, $font, $percent.'%');
    
    }
    imagecopy($im, $im3, 15, 2, 0, 0, 25, 29);
    imagedestroy($im3);
    header("Content-type: image/png");
    imagepng($im);
    imagedestroy($im);
    ?>
    Save that as goalsig.php
    Download this file also:
    [Only registered and activated users can see links. ]

    Sorry about the size, added a random song from my brothers iTunes library so I could get me rapidpoint .

    This script took me a LONG time...so please give me the credits I deserve.


    PS: The background is a scaled version of Cursed's.

    Image will be used like this:
    Code:
    http://site.com/goalsig.php/skill/level/name.png
    Reply With Quote  
     

  2. #2  
    Z
    Z is offline
    Registered Member
    Z's Avatar
    Join Date
    Jun 2007
    Age
    24
    Posts
    1,391
    Thanks given
    6
    Thanks received
    30
    Rep Power
    853
    Dude.....You're kidding rite...
    Reply With Quote  
     

  3. #3  
    Diljot
    Guest
    Quote Originally Posted by Zack View Post
    Dude.....You're kidding rite...
    LOLOLOLOLOLOLOLOL
    Reply With Quote  
     

  4. #4  
    alley
    Guest
    nice, is there a way to make it so if you like go to a page and fill out- your name, and your level on a website and it generates the sig? i know there is a way but could you post a way?-
    Reply With Quote  
     

  5. #5  
    Z
    Z is offline
    Registered Member
    Z's Avatar
    Join Date
    Jun 2007
    Age
    24
    Posts
    1,391
    Thanks given
    6
    Thanks received
    30
    Rep Power
    853
    Alley, that's very very simple html
    Check out: [Only registered and activated users can see links. ] and click the html tutorial.
    Reply With Quote  
     

  6. #6  
    Registered Member

    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    30
    Posts
    12,429
    Thanks given
    155
    Thanks received
    3,924
    Rep Power
    5000
    dis got dem silab items???


    GJ Zack (cant rep you, repped you for the other thing you released not too long ago)

    Reply With Quote  
     

  7. #7  
    Z
    Z is offline
    Registered Member
    Z's Avatar
    Join Date
    Jun 2007
    Age
    24
    Posts
    1,391
    Thanks given
    6
    Thanks received
    30
    Rep Power
    853
    Ya, it gotz all dem
    Thanks for reply
    Reply With Quote  
     

  8. #8  
    alley
    Guest
    Quote Originally Posted by Zack View Post
    Alley, that's very very simple html
    Check out: [Only registered and activated users can see links. ] and click the html tutorial.
    zack you know your becoming number 1 to me
    Reply With Quote  
     

  9. #9  
    Z
    Z is offline
    Registered Member
    Z's Avatar
    Join Date
    Jun 2007
    Age
    24
    Posts
    1,391
    Thanks given
    6
    Thanks received
    30
    Rep Power
    853
    , thanks for reply lol.
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    Dec 2006
    Age
    24
    Posts
    3,076
    Thanks given
    3
    Thanks received
    23
    Rep Power
    738
    Nice you done well.
    Skanking whilst playing RuneScape >...


    [Only registered and activated users can see links. ][Only registered and activated users can see links. ]
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •