[WEB] HTML5 Skin Viewer

Discussion in 'Bukkit Tools' started by earthiverse, Feb 14, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    coolrob335

    that is because you haven't defined an account to get the skin from, so it goes to the default skin of earthiverse. To solve this, add "?user=<account name>" to the end of your url
     
  2. Offline

    ChrisX930

    i know, but if I use this (for example : http://triavolution.de/TriaCraft/skin2/?user=ChrisX930 ) I'll get the same error...
     
  3. Offline

    coolrob335

    Have you modified the files in "/skin2/"? what i'd suggest trying is re-downloading and uploading the skin viewer again, see if anything changes
     
  4. Offline

    ChrisX930

    i dont have modified any file. I`ve used the original-files again, but i get this error again.
     
  5. Offline

    ChrisX930

    anyone a idea?
     
  6. Offline

    earthiverse

  7. Offline

    axi92

    How do i import the skins i just have one folder the standard folder but how to get the skins from the players on the server???????????????
     
  8. Offline

    earthiverse

    ... I'm not sure what you're trying to do.
    It grabs the skins from the minecraft server, so if you want it from the players on your server, use their usernames.
     
  9. Offline

    coolrob335

    the isometric skin viewer looks awesome! and so does the block viewer :D can't wait for them to come out
     
  10. Offline

    coolo1

    This is awesome! I have added it to my website but &refresh will not refresh it to my current skin, even deleting my whole folder from the skins section does not refresh it, but I know I have updated it becuase it is on minecraft.net. Please help!
     
  11. Offline

    earthiverse

    chmod +x rmdir.php and backend.php (It needs permissions to delete folders.)
    chmod 666 to images/skins (It needs permissions to read/write here.)
     
  12. Offline

    coolo1

    Hmm... I don't know what I did but it is fixed now... chmod is for Linux right? or is it for Windows too?
    Also the bottom of the Hat is backwards and the sides of the body are mixed up.
     
  13. Offline

    xcanner

    Is it possible to "scale" the skin, e.g. if you open it in a small window.
     
  14. Offline

    earthiverse

    Yeah, just use iframes. It scales to the window, so if you resize and refresh it'll render as a new size.
     
  15. Offline

    Super Jamie

    This is brilliant. Not just because it's useful, but because the web needs more developers like you who make practical applications of open standards HTML5 and help us all move away from proprietary, poorly-written, single-vendor solutions like Flash.
     
  16. Offline

    cky2250

  17. Offline

    earthiverse

    Thanks much. I think I've got it right again, using this skin [​IMG] as the basis and comparing it to what I can obtain from f5 and the inventory screen.
    So, skin2.zip is updated to properly render skins. (I think I've finally got it this time c: !)

    I might take a look at it. Mine uses Stats 2.0 and only Stats 2.0, though.
    I want to develop/someone else to develop a good Stats plug-in (When I say plugin, I mean the one that attaches to bukkit), though. Maybe if it hasn't been done by summer, I'll move forward creating my own.
    I haven't done any Java programming at all and I don't have the time to learn it at the moment.
     
  18. Offline

    coolrob335

    Hello again :3, would there be a way to redirect the users, as I have a short url set up (http://skins.crob.co) which redirects and passes the subdomains, so e.g. http://skins.crob.co/earthiverse redirects to http://coolrob335.kodingen.com/skins/?user=/earthiverse, however the "/" before is a bit of a problem, so would there be a way for me to edit the code and redirect "/<username>" to "<username>"?
    (it does work with the "/" before IF the skin is already in the /skins/ folder on the server)

    Also, for the isometric skin, there is no /backend/, so just shows flat images - http://coolrob335.kodingen.com/iskin/ - no matter what user you put in

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 9, 2016
  19. Offline

    earthiverse

    That sounds like a server-specific problem with how you set up redirecting, and not related to the script at all. Find out where that extra slash is coming from.
    I don't know how you have it set up, but take a look at http://net.tutsplus.com/tutorials/other/using-htaccess-files-for-pretty-urls/, specifically the section under apache. .htaccess is the best way of redirecting I know of.

    It's not dependent on any php other than getting the skin from the minecraft site, and redirecting it through your own server (DOM security errors, and such), it's mostly javascript.

    If you wanted it to work with something like view.php?user=earthiverse, try this:
    view.php - see example: http://earthiverse.ath.cx/tests/isometric_skin/view.php?user=gnarlywhale
    PHP:
    <?php
    if(isset($_GET['user'])) {
        
    $user htmlentities($_GET['user'],ENT_QUOTES);
    } else {
        
    $user "earthiverse"//default user
    }
    ?>
    <!DOCTYPE html>
    <head>
    <meta charset="utf-8" />
    <style>
    * {margin:0; padding:0;}
    div {display:inline-block;}
    .minecraft_head .head {display:none;}
    .minecraft_model .head {display:none;}
    .minecraft_head:hover .hat {display:none;}
    .minecraft_model:hover .hat {display:none;}
    .minecraft_head:hover .head {display:inline-block;}
    .minecraft_model:hover .head {display:inline-block;}
    .scratch {display:none;}
    </style>
    <script src="minecraft_skin.js" type="text/javascript"></script>
    <title><?php echo $user ?>'s Minecraft Skin [Isometric]</title>
    </head>
    <body>
    <div class="minecraft_head">
        <canvas class="hat" id="hat"></canvas>
        <canvas class="head" id="head"></canvas>
        <script type="text/javascript">
            draw_hat('hat','<?php echo $user ?>',25);
            draw_head('head','<?php echo $user ?>',25);
        </script>
    </div>
    <br />
    <div class="minecraft_model">
        <canvas class="scratch" id="scratch_hat"></canvas><canvas class="hat" id="model_hat"></canvas>
        <canvas class="scratch" id="scratch"></canvas><canvas class="head" id="model"></canvas>
        <script type="text/javascript">
            draw_model('model_hat','scratch_hat','<?php echo $user ?>',10,'true'); // true = hat
            draw_model('model','scratch','<?php echo $user ?>',10,'false'); // false = no hat
        </script>
    </div>
    </body>
     
  20. Offline

    Doctacosa

    I haven't commented on this yet, but I just want to say "good job"! The 3D viewer is awesome, and I love how it's able to display out of the game a skin as you'd expect to see it. Being able to rotate it at will is a nice bonus!

    I've been working on integrating this on my message board, and it was simple enough to do. The only real change I did was to make the animation less processor-intensive so it still runs smoothly on my 7 years old laptop. Once I push that board update, each member's profile registerered with our Minecraft server will proudly display the player's skin! :)
     
  21. Offline

    marcus

    thanks this works for me! But is there anyway to rotate the player so he looks to the left instead of to the right?
     
  22. Offline

    cky2250

    Love this project.
     
  23. Offline

    earthiverse

    I don't have much free time right now as I have a midterm and a couple assignments to do for school, but I should have time next week. If it's not done in a week or two, just send me a message or something and I'll get working on it, or get back to you why I'm not. c:
    It should only take ~1 hour to modify, the whole script for drawing the isometric skin is only ~50 lines.
     
  24. Offline

    marcus

    Thank you!
     
  25. Offline

    marcus

    hey its been a while now, just wondering how is it going?
     
  26. Offline

    cky2250

    do you think there would be a way, to use $_SERVER['SERVER_ADDR'] somewhere in the code to not allow people to use the code form an outside source. But sill be able to view the photos. like put it around the grab image code.
     
  27. Offline

    earthiverse

    Just finished it, sorry it took so long.
    http://dl.dropbox.com/u/431832/isometric_skin.zip is updated.
    Examples are in the index.html file.

    if anyone's using it, the function changed in the slightest way. the hat on/off is now true/false instead of 'true'/'false' (boolean instead of string).

    I don't know anything about this, sorry. Do you have a website you can link me to that explains it?
     
  28. Offline

    cky2250

    earthiverse

    Just an idea. Might have to be a httpd config setting, to make it forbidden to use the php file from an outside source.
     
  29. Offline

    marcus

    no problem! Thanks a lot!
     
  30. Offline

    earthiverse

    So, I've looked in to it a little bit more and you can't block iframes from appearing.
    You can sort of block them with javascript (http://stackoverflow.com/questions/5881139/how-to-block-iframe-call)

    You could get a referrer-based system through php to only allow the page to be viewed when the referrer is your own website, but that would not work for all browsers / users and would possibly alienate some users. Also, it still might not work if someone just i-framed your website.

    If anyone has a suggestion, I'm all ears.
     
Thread Status:
Not open for further replies.

Share This Page