Results 1 to 15 of 15

Thread: Get an image banked?

  1. #1
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Get an image banked?

    I am trying to make an image that will show how many randoms your script has encountered. I have a problem though. How will I bank the image so that it will keep updating?

    Edit: I mean, how will I save the image so that not only the image is just there but I want it to keep updating with new info? Do I do an unending loop?
    Formerly known as Cut em2 it

  2. #2
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    What language are you programming in?
    Verrekte Koekwous

  3. #3
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Php
    Formerly known as Cut em2 it

  4. #4
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you have to make a dynamic image. you have to use the GD library and mysql. i figure you know that. this is the way i did it:

    PHP Code:
    $nav $_SERVER["REQUEST_URI"];
    $script $_SERVER["SCRIPT_NAME"];
    $nav ereg_replace("^$script"""$nav);
    $nav str_replace("%20"," ",$nav);
    $vars explode("/"$nav);
    $ID strtolower($vars[1]); 
    so when you go say my site: http://www.xcanadamanx.phpnet.us/sta...sigs.php/1.png it will read the 1. the $ID will be 1. and then you just do a mysql query and find the id 1 and get the infromation you need and then create the image.


    PHP Code:
    imagettftext($im,8.0,0,47,63,$black,$font,$Time);
    imagettftext($im,8.0,0,46,61,$white,$font,$Time);
    imagettftext($im,8.0,0,47,86,$black,$font,$OldB);
    imagettftext($im,8.0,0,46,84,$white,$font,$OldB);
    imagettftext($im,8.0,0,50,109,$black,$font,$OldC);
    imagettftext($im,8.0,0,49,107,$white,$font,$OldC);
    imagettftext($im,8.0,0,154,86,$black,$font,$OldE);
    imagettftext($im,8.0,0,153,84,$white,$font,$OldE);
    imagettftext($im,8.0,0,168,109,$black,$font,$OldLe);
    imagettftext($im,8.0,0,167,107,$white,$font,$OldLe);
    imagettftext($im,8.0,0,7,128,$white,$font,$User);
    header("Content-type: image/png");
    imagepng($im);
    imageDestroy($im); 
    hope this helps.

  5. #5
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    But I mean how do I get the script to automatically save the image?
    Formerly known as Cut em2 it

  6. #6
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    PHP Code:
    imagepng($im,file); 
    im guessing you mean this?saves the picture to file

  7. #7
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by XcanadamanX View Post
    PHP Code:
    imagepng($im,file); 
    im guessing you mean this?saves the picture to file
    This is also a thing that has puzzled me.

    How can a picture change? Because i am very interested in learning this too.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  8. #8
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    how can it change? maybe i dont understand because i just got up like 5 mins ago. could you rephrase it? do you mean how can you make it change or how does it change.

  9. #9
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    I have a php 5 book and it has an appendix. The appendix holds most of the functions in php.
    PHP Code:
    imagepng($im); 
    You see that it only has one parameter. I don't think you can save for some reason. Maybe there is a way to do it by accessing photobucket and doing it that way?
    Formerly known as Cut em2 it

  10. #10
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    go to php.net and look up imagepng

    heres the link: http://ca3.php.net/manual/en/function.imagepng.php

  11. #11
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Oh, sorry. My book isn't that in depth . Hmm, still, something's wrong. I am using get and post but it isn't working. I have one webpage that has a form, then it sends to the other page. For some reason it isn't working. I tried the trim function too... Like I would use a get variable to put in the script id. Can someone give me the code to do that, soz, I'm a noob

    Cut em2 it
    Formerly known as Cut em2 it

  12. #12
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Get and Post? show me the code. ill see what i can come up with.

  13. #13
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    MM, let me get it.

    Edit: And I've tried both get and post...

    PHP Code:
    <?
    function get_string_between($string, $start, $end){
            $string = " ".$string;
            $ini = strpos($string,$start);
            if ($ini == 0) return "";
            $ini += strlen($start);   
            $len = strpos($string,$end,$ini) - $ini;
            return substr($string,$ini,$len);
    }  
    header('Content-type: image/png');
    $that = $_GET["Script id"];
    $that = ltrim($that);
    $wherescript = "http://stats.srl-forums.com/index.php?action=view_script&id=".that;
    $curlclient = curl_init($wherescript);
    curl_setopt($curlclient, CURLOPT_RETURNTRANSFER, true);
    $data = curl_exec($curlclient); 
    $logins = get_string_between($data, 'Logged In : <strong>', '</strong>');
    $frogs = get_string_between($data, 'Frogs : <strong>', '</strong>');
    if ($frogs == "") {
       $frogs = "0";
    }
    $boxes = get_string_between($data, 'Boxes : <strong>', '</strong>');
    if ($boxes == "") {
       $boxes = "0";
    }
    $oldmen = get_string_between($data, 'Oldmen : <strong>', '</strong>');
    if ($oldmen == " ") {
       $oldmen = "0";
    }
    $worked = get_string_between($data, 'Worked  : <strong>', '</strong>');
    $name = get_string_between($data, 'Total Randoms Solved by ', '</td>');
    $lastconnection = get_string_between($data, 'Last Connection : <strong>', '</strong>');
    $im = imagecreatefrompng('http://i237.photobucket.com/albums/ff60/cut_em2/thing-1.png');
    $color = imagecolorallocate($im, 0, 0, 0);
    imagestring($im, 5, 55, 6, $name, $color);
    imagestring($im, 4, 11, 89, "Solved or encountered ".$oldmen." oldmen.", $color);
    imagestring($im, 4, 11, 49, "Logged in ".$logins." times.", $color);
    imagestring($im, 4, 11, 69, "Solved ".$boxes." boxes.", $color);
    imagestring($im, 4, 11, 109, "Solved ".$frogs." frogs.", $color);
    imagestring($im, 4, 11, 129, "Worked for".$worked, $color);
    imagestring($im, 4, 11, 149, "Last con.: ".$lastconnection, $color);
    imagepng($im);
    imagedestroy($im);
    echo("Your image has been saved at http://cutfiles.mygamesonline.org/". $that . ".png");
    ?>
    This is the non-form one.

    Here is the form one:

    PHP Code:
    <form action="curltest.php" method="get">
    Script Id: <input type="text" name="Script id" />
    <
    input type="submit" />
    </
    form
    Thanks,
    Cut em2 it
    Formerly known as Cut em2 it

  14. #14
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    first thing i saw:
    PHP Code:
    $wherescript "http://stats.srl-forums.com/index.php?action=view_script&id=".that
    shouldnt it be
    PHP Code:
    $wherescript "http://stats.srl-forums.com/index.php?action=view_script&id=".$that
    and
    PHP Code:
    imagepng($im); 
    should be
    PHP Code:
    imagepng($im,"http://cutfiles.mygamesonline.org/"$that ".png"); 

  15. #15
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Ahhh, whoops, let me check if it works now.
    Formerly known as Cut em2 it

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 14
    Last Post: 06-07-2013, 02:46 AM
  2. Cathy lobby fisher + banker and possibly cooker before banked
    By wired16 in forum RS3 Outdated / Broken Scripts
    Replies: 7
    Last Post: 07-29-2007, 10:02 AM
  3. Do i have to free an image thats set to another image?
    By NewToAutoing in forum OSR Help
    Replies: 14
    Last Post: 06-06-2007, 05:36 AM

Posting Permissions

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