Welcome to Pawncraft!

Want to become a part of our growing community? Sign up Today!

Sign Up
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. we are running version 1.12
    | Join us at IP: pawncraft.co.uk |
    Dismiss Notice
  3. There is trouble with our mail service and we are looking into it. For a backup solution mail will come from pawncraft@pfts.se and no-reply@pfts.se //StarScore
    Dismiss Notice

Calling all Tech Heads (PHP Coders)

Discussion in 'Banter' started by MrHobbits, 24 Jan 2012.

  1. MrHobbits

    MrHobbits The Angry Panda Staff Member

    24 Sep 2010
    Likes Received:
    So here's the deal, I want to put Votifier on my website.

    I've talked to a plugin developer for the scripting system I use and he's pretty much at a loss. He doesnt understand exactly how it all works.

    I've got a piece of demo code that you can thunk your heads on and see if you can figure it out.

    If you can use this code as a springpad to get a SIMPLE PHP enabled website together, consisting of a landing page where they enter in their MC username, and a 'submit' button to make it send that data over to the pawncraft listener.

    If we can develop this simple page, that would be awesome. There also might be a small financial kickback if that helps interest you. :)

    Code samples:
    // Details of the vote.
    $str = "VOTE\n" .
          "mcserverstatus\n" .
          "ryanshawty\n" .
          "\n" .
    // Fill in empty space to make the encrypted block 256 bytes.
    $leftover = (256 - strlen($str)) / 2;
    while ($leftover > 0) {
        $str .= "\x0";
    // The public key, this is an example.
    $key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsbqjZCrHLKC5EyJQixqUjOQmjnLyKcfOduP3mgk4jRUnnZNkmFyHelMrGVl0gaBuIckOdHQvQi1zFckvQ2X4OOfhVreIdh7HuYmPvxXUFUytnIaUEtS37BKA3WFmPNhRsflPgX9Ci/z32rLZrl8Cf9s19JFYM0ffTaz0sGGqK7mDp2ImsPnsbnyBRCT3hhF00VupKJFWeN3FXLBSzh9CK2Rdh3ibZAsS+wmCGOi4S+iWNKKY2hHD/Ap7oFAiBW9jkY+McmZmvJnhjl6P551gYR076ClHMsW9fmxujaCmTkAP2TwzuZmsfgtmO1CQsouxhDvxbsozUxeHXl9ACQbIuwIDAQAB";
    $key = wordwrap($key, 65, "\n", true);
    $key = <<<EOF
    -----BEGIN PUBLIC KEY-----
    -----END PUBLIC KEY-----
    // Encrypt the string.
    openssl_public_encrypt($str, $encrypted, $key);
    // Establish a connection to Votifier.
    $socket = fsockopen("", "8192", $errno, $errstr, 2);
    if (!$socket) {
        die("Failed to connect to Votifier.");
    // Send the contents of the encrypted block to Votifier.
    fwrite($socket, $encrypted);
  2. MrHobbits

    MrHobbits The Angry Panda Staff Member

    24 Sep 2010
    Likes Received:
    Sigh... bump for wishfulness?
  3. the_amber_trap

    the_amber_trap Calm down so I can be the angry one. Staff Member

    23 Nov 2010
    Likes Received:
    I'm not smart in this area, sorry. I really wish I could help.

Share This Page