Jump to content
MakeWebGames

banner issue


Raven1992

Recommended Posts

Hey Make Web Games i got a banner that my friend made for me from another forums free of charge as you can see it got the users online count and it in my signerture but I need to know how can i show how many users are online on my signerture page and how do i embedded the link inside of it so people can click on it would like help please on it here the banner for it

[ATTACH=CONFIG]1644[/ATTACH]

and here the link that got to be embedded onto it for the user show count to appear and as I dunno where to start as I just got the banner today

http://www.hothhotel.eu

tdUajan.gif.f01586a1fe56bdfe836ce14621fb828f.gif

Link to comment
Share on other sites

Well, i didn't think he'd deliver - but he did.

 

  • Ensure you have GD library installed.
  • Make sure you have CURL installed.
  • Make sure you have the gif in the same directory as the .php script and name it "hothhotel.gif"
  • Make sure your .php script can be accessed by the public.

 

<?php

$strPageToScrape = "http://www.hothhotel.eu/index";

$objCurl = curl_init();
curl_setopt($objCurl, CURLOPT_URL, $strPageToScrape);
curl_setopt($objCurl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($objCurl, CURLOPT_CONNECTTIMEOUT, 0);
$strPage = curl_exec($objCurl);
curl_close($objCurl);

$arrMatch = array();
preg_match("/<span class=\"stats-fig\">[0-9]*<\/span>/", 
          $strPage,
          $arrMatch);

if( empty($arrMatch) ) {
   $intPlayersOnline = "-";
} else {
   $intPlayersOnline = abs( filter_var($arrMatch[0], FILTER_SANITIZE_NUMBER_INT) );
}

//Create the image
try {
   $objImage = imagecreatefromgif("hothhotel.gif");
   $text  = imagecolorallocate($objImage, 255, 255, 255);
   imagestring($objImage, 5, 450, 10, $intPlayersOnline, $text);
   Header('Content-Type: image/gif');
   imagegif($objImage);
   imagedestroy($objImage);
} catch (Exception $objException) {
   Header('Content-Type: image/gif');
   echo file_get_contents('hothhotel.gif');
}

 

For those interested, I didn't do this for money. I did this for something way better than money. Here; I present to you my payment.

Here is me proposing the deal;

qDMgNdA.png

Payment has been attached to this post. Enjoy.

A sneak preview;

attachment.php?attachmentid=1647&d=1410292321

(Holy Sh**. That was fun xD)

// Will code for selfies with "sniko" sign and shoe on head.

2022878955_Picture1.jpg.82c510e32e30e5d41c87c8d0a9300515.jpg

1499672967_Picture2.jpg.b62180764c63073822a17b7361e67164.jpg

1754850336_Picture3.jpg.4097d326383d5ed964a2e080e9c6401a.jpg

609109098_Picture4.jpg.7fec7d42d90b750c62ddc3e00e88d7ea.jpg

1920652950_Picture5.jpg.fd69fdc48f1e6b2f363db56c26bbd155.jpg

333213956_Picture6.jpg.7a53869fe178e7d0d38dec7099816ac1.jpg

1534858748_Picture7.jpg.74bd5a22d12da07bd49a0de0f4622ec3.jpg

346579618_Picture8.jpg.4370046f11c146b01e7c4997b0502ae9.jpg

188028833_Picture9.jpg.dedf17d130fd822d55665c8991ed80ae.jpg

1867173676_Picture10.jpg.3d009f3d9c3ecaf894f2d391b3c7b2c8.jpg

Link to comment
Share on other sites

Well, i didn't think he'd deliver - but he did.

 

  • Ensure you have GD library installed.
  • Make sure you have CURL installed.
  • Make sure you have the gif in the same directory as the .php script and name it "hothhotel.gif"
  • Make sure your .php script can be accessed by the public.

 

<?php

$strPageToScrape = "http://www.hothhotel.eu/index";

$objCurl = curl_init();
curl_setopt($objCurl, CURLOPT_URL, $strPageToScrape);
curl_setopt($objCurl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($objCurl, CURLOPT_CONNECTTIMEOUT, 0);
$strPage = curl_exec($objCurl);
curl_close($objCurl);

$arrMatch = array();
preg_match("/<span class=\"stats-fig\">[0-9]*<\/span>/", 
          $strPage,
          $arrMatch);

if( empty($arrMatch) ) {
   $intPlayersOnline = "-";
} else {
   $intPlayersOnline = abs( filter_var($arrMatch[0], FILTER_SANITIZE_NUMBER_INT) );
}

//Create the image
try {
   $objImage = imagecreatefromgif("hothhotel.gif");
   $text  = imagecolorallocate($objImage, 255, 255, 255);
   imagestring($objImage, 5, 450, 10, $intPlayersOnline, $text);
   Header('Content-Type: image/gif');
   imagegif($objImage);
   imagedestroy($objImage);
} catch (Exception $objException) {
   Header('Content-Type: image/gif');
   echo file_get_contents('hothhotel.gif');
}

 

For those interested, I didn't do this for money. I did this for something way better than money. Here; I present to you my payment.

Here is me proposing the deal;

qDMgNdA.png

Payment has been attached to this post. Enjoy.

A sneak preview;

attachment.php?attachmentid=1647&d=1410292321

(Holy Sh**. That was fun xD)

// Will code for selfies with "sniko" sign and shoe on head.

haha this was the best deal ever

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...