├── .htaccess ├── assets ├── fonts │ ├── Lato-Bold.ttf │ └── Lato-Regular.ttf ├── icons │ ├── dark │ │ ├── key-icon.png │ │ ├── zcash-icon.png │ │ ├── github-icon.png │ │ └── mobile-icon.png │ └── default │ │ ├── bitcoin.png │ │ ├── globe.png │ │ ├── coinbase.png │ │ ├── facebook.png │ │ ├── github-logo.png │ │ ├── hacker-news.png │ │ ├── mobile-phone.png │ │ ├── zcash-icon.png │ │ ├── reddit-big-logo.png │ │ ├── vintage-key-outline.png │ │ └── rsz_twitter-black-shape.png ├── css │ └── style.css └── js │ └── script.js ├── README.md ├── LICENSE ├── index.html └── script.php /.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine on 2 | RewriteRule ^(.*)\.png script.php 3 | 4 | Options -Indexes -------------------------------------------------------------------------------- /assets/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /assets/icons/dark/key-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/dark/key-icon.png -------------------------------------------------------------------------------- /assets/icons/dark/zcash-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/dark/zcash-icon.png -------------------------------------------------------------------------------- /assets/icons/default/bitcoin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/default/bitcoin.png -------------------------------------------------------------------------------- /assets/icons/default/globe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/default/globe.png -------------------------------------------------------------------------------- /assets/icons/dark/github-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/dark/github-icon.png -------------------------------------------------------------------------------- /assets/icons/dark/mobile-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/dark/mobile-icon.png -------------------------------------------------------------------------------- /assets/icons/default/coinbase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/default/coinbase.png -------------------------------------------------------------------------------- /assets/icons/default/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/default/facebook.png -------------------------------------------------------------------------------- /assets/icons/default/github-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/default/github-logo.png -------------------------------------------------------------------------------- /assets/icons/default/hacker-news.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/default/hacker-news.png -------------------------------------------------------------------------------- /assets/icons/default/mobile-phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/default/mobile-phone.png -------------------------------------------------------------------------------- /assets/icons/default/zcash-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/default/zcash-icon.png -------------------------------------------------------------------------------- /assets/icons/default/reddit-big-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/default/reddit-big-logo.png -------------------------------------------------------------------------------- /assets/icons/default/vintage-key-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/default/vintage-key-outline.png -------------------------------------------------------------------------------- /assets/icons/default/rsz_twitter-black-shape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onlineth/Keybase.io-Card-PHP/HEAD/assets/icons/default/rsz_twitter-black-shape.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Keybase Card 2 | A way to share your Keybase profile online easily through an image implemented through PHP. 3 | 4 | ### Install 5 | Simply clone this repository on an Apache-based web server with PHP support and it'll be up in no time. 6 | 7 | # Keybase.io Card Examples 8 | 9 | ### Default Theme: 10 | 11 | ![Default Theme Card](https://keybase.onlineth.com/online.png?theme=default) 12 | 13 | ### Clean Theme: 14 | 15 | ![Clean Theme Card](https://keybase.onlineth.com/online.png?theme=clean) 16 | 17 | *This one's transparent* 18 | 19 | ### Dark Theme: 20 | 21 | ![Dark Theme Card](https://keybase.onlineth.com/online.png?theme=dark) 22 | 23 | ## 128 Fingerprint Length 24 | 25 | These are also available 26 | 27 | ![Default Theme Card 128 BIT](https://keybase.onlineth.com/online.png?theme=default&bit=128) 28 | 29 | # License 30 | 31 | This project is licensed under the [MIT License](https://github.com/onlineth/Keybase.io-Card-Node.js/blob/master/LICENSE) 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Thomas Hein 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/css/style.css: -------------------------------------------------------------------------------- 1 | .vertical-center { margin-top: 3%; } 2 | .container-fluid { margin-right: auto; margin-left: auto; max-width: 550px; } 3 | .spinner { display: inline-block; opacity: 0; width: 0; -webkit-transition: opacity 0.25s, width 0.25s; -moz-transition: opacity 0.25s, width 0.25s; -o-transition: opacity 0.25s, width 0.25s; transition: opacity 0.25s, width 0.25s; } 4 | .has-spinner.active .spinner { opacity: 1; width: auto; } 5 | .has-spinner.btn-mini.active .spinner { width: 10px; } 6 | .has-spinner.btn-small.active .spinner { width: 13px; } 7 | .has-spinner.btn.active .spinner { width: 16px; } 8 | .has-spinner.btn-large.active .spinner { width: 19px; } 9 | .glyphicon-refresh-animate { -animation: spin .7s infinite linear; -ms-animation: spin .7s infinite linear; -webkit-animation: spinw .7s infinite linear; -moz-animation: spinm .7s infinite linear; } 10 | @keyframes spin { 11 | from { transform: scale(1) rotate(0deg); } 12 | to { transform: scale(1) rotate(360deg); } 13 | } 14 | @-webkit-keyframes spinw { 15 | from { -webkit-transform: rotate(0deg); } 16 | to { -webkit-transform: rotate(360deg); } 17 | } 18 | @-moz-keyframes spinm { 19 | from { -moz-transform: rotate(0deg); } 20 | to { -moz-transform: rotate(360deg); } 21 | } 22 | .theme-header { text-align: left } -------------------------------------------------------------------------------- /assets/js/script.js: -------------------------------------------------------------------------------- 1 | //SSL! 2 | if (window.location.protocol != "https:") 3 | window.location.href = "https:" + window.location.href.substring(window.location.protocol.length); 4 | 5 | //Clear anything and focus on the input box 6 | $('#maininput').val(''); 7 | $('#maininput').focus(); 8 | 9 | //Check to see if there is any paramaters and if so, check to see if it's a username 10 | if(window.location.href.substring(window.location.href.lastIndexOf("/") + 1) != '') { 11 | if (window.location.href.substring(window.location.href.lastIndexOf("#") + 1) != window.location.href) { 12 | if (window.location.href.substring(window.location.href.lastIndexOf("#") + 1)) { 13 | if ((window.location.href.substr(window.location.href.length-1)) != "#") { 14 | $('#maininput').val(window.location.href.substring(window.location.href.lastIndexOf("#") + 1)); 15 | start(); 16 | } 17 | } 18 | } 19 | } 20 | 21 | //Bind the Go button and bind the enter key on the input box 22 | $('#GO').click(function() { 23 | start(); 24 | }); 25 | $('#maininput').keypress(function(e) { 26 | if (e.which == 13) { 27 | start(); 28 | } 29 | }); 30 | 31 | //Check to see if the url has changed 32 | window.onpopstate = function (event) { 33 | if (event.state) { 34 | //This script changed the url 35 | } else { 36 | //The user chaned the url 37 | if(window.location.href.substring(window.location.href.lastIndexOf("/") + 1) != '') { 38 | $('#maininput').val(window.location.href.substring(window.location.href.lastIndexOf("/") + 2)); 39 | start(); 40 | } 41 | } 42 | } 43 | 44 | //Bind Fingerprint Bit Pills 45 | $('#bit64').click(function() { 46 | $('#bit64').addClass('active'); 47 | $('#bit128').removeClass('active'); 48 | start(); 49 | }) 50 | $('#bit128').click(function() { 51 | $('#bit128').addClass('active'); 52 | $('#bit64').removeClass('active'); 53 | start(); 54 | }) 55 | 56 | //Start (close alert box, update image urls, add code, link images, and update url) 57 | function start(){ 58 | $('#alertBox').hide(); 59 | $('#GO').addClass('active'); 60 | if ($('#bit128').hasClass('active')) { 61 | var bit = "&bit=128"; 62 | var width = 210; 63 | var height = 58; 64 | } else { 65 | var bit = ""; 66 | var width = 255; 67 | var height = 68; 68 | } 69 | document.getElementById('default-theme-card').src='https://keybase.onlineth.com/'+$("#maininput").val()+'.png?theme=default'+bit; 70 | document.getElementById('clean-theme-card').src='https://keybase.onlineth.com/'+$("#maininput").val()+'.png?theme=clean'+bit; 71 | document.getElementById('dark-theme-card').src='https://keybase.onlineth.com/'+$("#maininput").val()+'.png?theme=dark'+bit; 72 | 73 | $('#default-theme-code').val('keybase.io profile for '+$('); 74 | $('#clean-theme-code').val('keybase.io profile for '+$('); 75 | $('#dark-theme-code').val('keybase.io profile for '+$('); 76 | $('#default-theme-card-a').attr("href", 'https://keybase.io/'+$("#maininput").val()); 77 | $('#clean-theme-card-a').attr("href", 'https://keybase.io/'+$("#maininput").val()); 78 | $('#dark-theme-card-a').attr("href", 'https://keybase.io/'+$("#maininput").val()); 79 | history.pushState('', $("#maininput").val() + ' Keybase.io Card', location.protocol + '//' + location.host + location.pathname + '#' + $("#maininput").val()); 80 | } 81 | 82 | //Show images 83 | function checkImageLoad() { 84 | $('#cards').show('400'); 85 | $('#GO').removeClass('active'); 86 | } 87 | 88 | //Show an error message 89 | function reportError(message) { 90 | $('#GO').removeClass('active'); 91 | $('#alertMessage').html(message); 92 | $('#alertBox').show('400'); 93 | } 94 | 95 | //Image didn't load 96 | function imgError() { 97 | reportError("There was an error (probably the username you typed in doesn't exist)."); 98 | $('#cards').hide(); 99 | } 100 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Keybase.io Card 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |

Keybase Card

20 | A way to share your keybase profile online easily through an image 21 |
22 |
23 |
24 | 25 | 26 | 30 | 31 |
32 | 41 | 87 |
88 |
89 |
90 | 94 |
95 |
96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /script.php: -------------------------------------------------------------------------------- 1 | them[0] == NULL) { 64 | die('ERROR: This person doesn\'t exist'); 65 | } 66 | 67 | $url_to_avatar = $processed->them[0]->pictures->primary->url; 68 | $fingerprint_128bit = strtoupper($processed->them[0]->public_keys->primary->key_fingerprint); 69 | $fingerprint_64bit = strtoupper(chunk_split(substr(($fingerprint_128bit), -16), 4, ' ')); 70 | $fingerprint_128bit = chunk_split($fingerprint_128bit, 4, ' '); 71 | 72 | 73 | $number_devices = count(get_object_vars($processed->them[0]->devices)); 74 | $proofs = $processed->them[0]->proofs_summary->by_presentation_group; 75 | $twitter_proof = property_exists($proofs, "twitter"); 76 | $github_proof = property_exists($proofs, "github"); 77 | $reddit_proof = property_exists($proofs, "reddit"); 78 | $website_proof = property_exists($proofs, "dns"); 79 | $coinbase_proof = property_exists($proofs, "coinbase"); 80 | $hackernews_proof = property_exists($proofs, "hackernews"); 81 | $facebook_proof = property_exists($proofs, "facebook"); 82 | $bitcoin_aviable = property_exists($processed->them[0]->cryptocurrency_addresses, "bitcoin"); 83 | $zcash_aviable = property_exists($processed->them[0]->cryptocurrency_addresses, "zcash"); 84 | 85 | /////////////////////////////////////////////////////////////////// 86 | 87 | //setting the image header in order to proper display the image 88 | header("Content-Type: image/png"); 89 | //and allow cors 90 | header('Access-Control-Allow-Origin: *'); 91 | header('Access-Control-Allow-Methods: GET, POST'); 92 | header("Access-Control-Allow-Headers: X-Requested-With"); 93 | 94 | // Create the image 95 | if($bit64) { 96 | $img_width = 420; 97 | $img_height = 116; 98 | } else { 99 | $img_width = 510; 100 | $img_height = 136; 101 | } 102 | $canvas = imagecreatetruecolor($img_width, $img_height); 103 | 104 | //Set background color 105 | switch ($theme) { 106 | case 'clean': 107 | $backgroundColor = imagecolorallocatealpha($canvas, 0, 0, 0, 127); 108 | break; 109 | 110 | case 'dark': 111 | $backgroundColor = imagecolorallocate($canvas, 0, 0, 0); 112 | break; 113 | default: 114 | $backgroundColor = imagecolorallocate($canvas, 238, 238, 238); 115 | break; 116 | } 117 | imagefill($canvas, 0, 0, $backgroundColor); 118 | 119 | //computed colors 120 | $black = imagecolorallocate($canvas, 0, 0, 0); 121 | $white = imagecolorallocate($canvas, 255, 255, 255); 122 | $blue = imagecolorallocate($canvas, 51, 160, 255); 123 | $orange = imagecolorallocate($canvas, 255, 111, 33); 124 | $silver = imagecolorallocate($canvas, 192, 192, 192); 125 | 126 | ///////////////////////////////////////////////////////////// 127 | 128 | //add avatar from keybase.io 129 | if ($bit64) { 130 | $avatar_img_scale = 100; 131 | } else { 132 | $avatar_img_scale = 120; 133 | } 134 | if (substr($url_to_avatar, -3) == 'png') { 135 | $user_avatar = imagecreatefrompng($url_to_avatar); 136 | } else { 137 | $user_avatar = imagecreatefromjpeg($url_to_avatar); 138 | } 139 | $scaled_user_avatar = imagescale($user_avatar, $avatar_img_scale); 140 | imagecopy($canvas, $scaled_user_avatar, 8, 8, 0, 0, $avatar_img_scale, $avatar_img_scale); 141 | 142 | 143 | //If a username is long, change the look of the card 144 | if($bit64) { 145 | $keybase_start = 114; 146 | $username_start_short = 256; 147 | $username_start_long = 240; 148 | } else { 149 | $keybase_start = 134; 150 | $username_start_short = 278; 151 | $username_start_long = 260; 152 | } 153 | if(strlen($username) < 12) { 154 | 155 | //add "keybase.io/"" 156 | if ($theme == 'dark') { 157 | imagettftext($canvas, 21, 0, $keybase_start, 36, $white, 'assets/fonts/Lato-Regular.ttf', 'keybase.io/'); 158 | } else { 159 | imagettftext($canvas, 21, 0, $keybase_start, 36, $black, 'assets/fonts/Lato-Regular.ttf', 'keybase.io/'); 160 | } 161 | 162 | //now add the username 163 | imagettftext($canvas, 21, 0, $username_start_short, 36, $orange, 'assets/fonts/Lato-Bold.ttf', $username); 164 | 165 | } else { 166 | 167 | //add "keybase.io/"" 168 | if ($theme == 'dark') { 169 | imagettftext($canvas, 19, 0, $keybase_start, 32, $white, 'assets/fonts/Lato-Regular.ttf', 'keybase.io/'); 170 | } else { 171 | imagettftext($canvas, 19, 0, $keybase_start, 32, $black, 'assets/fonts/Lato-Regular.ttf', 'keybase.io/'); 172 | } 173 | 174 | //now add the username 175 | imagettftext($canvas, 18, 0, $username_start_long, 32, $orange, 'assets/fonts/Lato-Bold.ttf', $username); 176 | 177 | } 178 | 179 | 180 | //add the key for the fingerprint 181 | if ($bit64) { 182 | $key_start = 114; 183 | $keybase_text_start = 140; 184 | } else { 185 | $key_start = 134; 186 | $keybase_text_start = 160; 187 | } 188 | if ($theme == 'dark') { 189 | $key_icon = imagecreatefrompng('assets/icons/dark/key-icon.png'); 190 | } else { 191 | $key_icon = imagecreatefrompng('assets/icons/default/vintage-key-outline.png'); 192 | } 193 | imagecopyresampled($canvas, $key_icon, $key_start, 48, 0, 0, 20, 20, 50, 50); 194 | 195 | //now add the 64 bit fingerprint 196 | if ($bit64) { 197 | imagettftext($canvas, 18, 0, $keybase_text_start, 66, $blue, 'assets/fonts/Lato-Regular.ttf', $fingerprint_64bit); 198 | } else { 199 | imagettftext($canvas, 18, 0, $keybase_text_start, 66, $blue, 'assets/fonts/Lato-Regular.ttf', substr($fingerprint_128bit,0,-26)); 200 | $fingerprint_128bit_p2 = substr($fingerprint_128bit, 24); 201 | imagettftext($canvas, 18, 0, $keybase_text_start-6, 90, $blue, 'assets/fonts/Lato-Regular.ttf', $fingerprint_128bit_p2); 202 | } 203 | 204 | //////////////////////////////////////////////////////////////////////////////////////////////////// 205 | 206 | //set initial x position, increase by 15 207 | if ($bit64) { 208 | $proof_x_position = 114; 209 | $device_list_height = 100; 210 | $proof_height = 80; 211 | } else { 212 | $proof_x_position = 134; 213 | $device_list_height = 122; 214 | $proof_height = 102; 215 | } 216 | 217 | //add # of devices w/ icon 218 | if($number_devices) { 219 | if ($theme == 'dark') { 220 | imagettftext($canvas, 20, 0, $proof_x_position, $device_list_height, $white, 'assets/fonts/Lato-Regular.ttf', $number_devices); 221 | $device_icon = imagecreatefrompng('assets/icons/dark/mobile-icon.png'); 222 | } else { 223 | imagettftext($canvas, 20, 0, $proof_x_position, $device_list_height, $black, 'assets/fonts/Lato-Regular.ttf', $number_devices); 224 | $device_icon = imagecreatefrompng('assets/icons/default/mobile-phone.png'); 225 | } 226 | if ($number_devices <= 9) { 227 | $proof_x_position += 16; 228 | imagecopyresampled($canvas, $device_icon, $proof_x_position, $proof_height, 0, 0, 20, 20, 50, 50); 229 | } else { 230 | $proof_x_position += 30; 231 | imagecopyresampled($canvas, $device_icon, $proof_x_position, $proof_height, 0, 0, 20, 20, 50, 50); 232 | } 233 | $proof_x_position += 25; 234 | } 235 | 236 | //add twitter 237 | if ($twitter_proof) { 238 | $twitter_icon = imagecreatefrompng('assets/icons/default/rsz_twitter-black-shape.png'); 239 | imagecopyresampled($canvas, $twitter_icon, $proof_x_position, $proof_height, 0, 0, 20, 20, 50, 50); 240 | $proof_x_position = $proof_x_position + 25; 241 | } 242 | 243 | //add github 244 | if ($github_proof) { 245 | if ($theme == 'dark') { 246 | $github_icon = imagecreatefrompng('assets/icons/dark/github-icon.png'); 247 | } else { 248 | $github_icon = imagecreatefrompng('assets/icons/default/github-logo.png'); 249 | } 250 | imagecopyresampled($canvas, $github_icon, $proof_x_position, $proof_height, 0, 0, 20, 20, 50, 50); 251 | $proof_x_position = $proof_x_position + 25; 252 | } 253 | 254 | //add reddit 255 | if($reddit_proof) { 256 | $reddit_icon = imagecreatefrompng('assets/icons/default/reddit-big-logo.png'); 257 | imagecopyresampled($canvas, $reddit_icon, $proof_x_position, $proof_height, 0, 0, 20, 20, 50, 50); 258 | $proof_x_position = $proof_x_position + 25; 259 | } 260 | 261 | //add coinbase 262 | if($coinbase_proof){ 263 | $coinbase_icon = imagecreatefrompng('assets/icons/default/coinbase.png'); 264 | imagecopyresampled($canvas, $coinbase_icon, $proof_x_position, $proof_height, 0, 0, 20, 20, 50, 50); 265 | $proof_x_position = $proof_x_position + 25; 266 | } 267 | 268 | //add hacker news 269 | if($hackernews_proof) { 270 | $hacker_news_icon = imagecreatefrompng('assets/icons/default/hacker-news.png'); 271 | imagecopyresampled($canvas, $hacker_news_icon, $proof_x_position, $proof_height, 0, 0, 20, 20, 50, 50); 272 | $proof_x_position = $proof_x_position + 25; 273 | } 274 | 275 | //add facebook 276 | if($facebook_proof) { 277 | $facebook_icon = imagecreatefrompng('assets/icons/default/facebook.png'); 278 | imagecopyresampled($canvas, $facebook_icon, $proof_x_position, $proof_height, 0, 0, 20, 20, 50, 50); 279 | $proof_x_position = $proof_x_position + 25; 280 | } 281 | 282 | //add globe (websites) 283 | if($website_proof) { 284 | $globe_icon = imagecreatefrompng('assets/icons/default/globe.png'); 285 | imagecopyresampled($canvas, $globe_icon, $proof_x_position, $proof_height, 0, 0, 20, 20, 50, 50); 286 | $proof_x_position = $proof_x_position + 25; 287 | } 288 | 289 | //add bitcoin 290 | if($bitcoin_aviable) { 291 | $bitcoin_icon = imagecreatefrompng('assets/icons/default/bitcoin.png'); 292 | imagecopyresampled($canvas, $bitcoin_icon, $proof_x_position, $proof_height, 0, 0, 20, 20, 50, 50); 293 | $proof_x_position = $proof_x_position + 25; 294 | } 295 | 296 | //add zcash 297 | if ($zcash_aviable) { 298 | if ($theme == 'dark') { 299 | $zcash_icon = imagecreatefrompng('assets/icons/dark/zcash-icon.png'); 300 | } else { 301 | $zcash_icon = imagecreatefrompng('assets/icons/default/zcash-icon.png'); 302 | } 303 | imagecopyresampled($canvas, $zcash_icon, $proof_x_position, $proof_height, 0, 0, 20, 20, 50, 50); 304 | $proof_x_position = $proof_x_position + 25; 305 | } 306 | 307 | ///////////////////////////////////////////////////////////////////////////////////////////// 308 | 309 | //add a border 310 | if ($theme == 'default') { 311 | drawBorder($canvas, $silver); 312 | } 313 | 314 | //outputs the image as png 315 | imagesavealpha($canvas, true); 316 | imagepng($canvas); 317 | 318 | //frees any memory associated with the image 319 | imagedestroy($canvas); 320 | --------------------------------------------------------------------------------