A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Title Test - Stikked
From Testme, 6 Years ago, written in PHP.
Embed
  1. <?php
  2. putenv('GDFONTPATH=' . realpath('.'));
  3. function tryFont($name){
  4.         $rp=realpath('.');
  5.         if(imageftbbox(12,0,$name,"M")[5]==0){
  6.                 $name=$rp."/".$name.".ttf";
  7.                 if(imageftbbox(12,0,$name,"M")[5]==0){
  8.                         return null;
  9.                 }
  10.         }
  11.         return $name;
  12. }
  13.  
  14. $SCALE=1.25;
  15. $WIDTH=530*$SCALE;
  16. $HEIGHT=150*$SCALE;
  17. $im=imagecreatetruecolor($WIDTH,$HEIGHT);
  18. $BACKGROUND_COLOR=imagecolorallocate($im,33,33,36);
  19. $FONT_1=tryFont("OpenSans-Semibold");
  20. $FONT_1_SIZE=14*$SCALE;
  21. $FONT_2=tryFont("OpenSans-Light");
  22. $FONT_2_SIZE=24*$SCALE;
  23. $FONT_3=tryFont("OpenSans-Semibold");
  24. $FONT_3_SIZE=10*$SCALE;
  25. $FONT_4=tryFont("OpenSans-Semibold");
  26. $FONT_4_SIZE=8*$SCALE;
  27. $FONT_WATERMARK=tryFont("OpenSans-Light");
  28. $FONT_WATERMARK_SIZE=8*$SCALE;
  29. $TEXT_COLOR_DL=imagecolorallocate($im,126,178,109);
  30. $TEXT_COLOR_UL=imagecolorallocate($im,31,120,193);
  31. $TEXT_COLOR_PING=imagecolorallocate($im,239,132,60);
  32. $TEXT_COLOR_JIT=imagecolorallocate($im,226,77,66);
  33. $TEXT_COLOR_2=imagecolorallocate($im,216,217,218);
  34. $TEXT_COLOR_3=imagecolorallocate($im,186,187,188);
  35. $TEXT_COLOR_4=imagecolorallocate($im,186,187,188);
  36. $TEXT_COLOR_WATERMARK=imagecolorallocate($im,160,160,160);
  37. $POSITION_Y_1=24*$SCALE;
  38. $POSITION_Y_2=78*$SCALE;
  39. $POSITION_Y_3=118*$SCALE;
  40. $POSITION_Y_4=146*$SCALE;
  41. $POSITION_Y_WATERMARK=146*$SCALE;
  42. $POSITION_X_DL=68*$SCALE;
  43. $POSITION_X_UL=200*$SCALE;
  44. $POSITION_X_PING=330*$SCALE;
  45. $POSITION_X_JIT=460*$SCALE;
  46. $POSITION_X_ISP=4*$SCALE;
  47. $DL_TEXT="DOWNLOAD";
  48. $UL_TEXT="UPLOAD";
  49. $PING_TEXT="PING";
  50. $JIT_TEXT="JITTER";
  51. $MBPS_TEXT="Mbps";
  52. $MS_TEXT="ms";
  53. $WATERMARK_TEXT="7xSVR SPEEDTEST";
  54.  
  55. $id=$_GET["id"];
  56. include_once('../telemetry/telemetry_settings.php');
  57. $conn=null; $q=null;
  58. $ispinfo=null; $dl=null; $ul=null; $ping=null; $jit=null;
  59. if($db_type=="mysql"){
  60.         $conn = new mysqli($MySql_hostname, $MySql_username, $MySql_password, $MySql_databasename);
  61.         $q = $conn->prepare("select ispinfo,dl,ul,ping,jitter from speedtest_users where id=?");
  62.         $q->bind_param("i",$id);
  63.         $q->execute();
  64.         $q->bind_result($ispinfo,$dl,$ul,$ping,$jit);
  65.         $q->fetch();
  66. }else if($db_type=="sqlite"){
  67.         $conn = new PDO("sqlite:$Sqlite_db_file") or die();
  68.         $q=$conn->prepare("select ispinfo,dl,ul,ping,jitter from speedtest_users where id=?") or die();
  69.         $q->execute(array($id)) or die();
  70.         $row=$q->fetch() or die();
  71.         $ispinfo=$row["ispinfo"];
  72.         $dl=$row["dl"];
  73.         $ul=$row["ul"];
  74.         $ping=$row["ping"];
  75.         $jitter=$row["jitter"];
  76.         $conn=null;
  77. }else if($db_type=="postgresql"){
  78.     $conn_host = "host=$PostgreSql_hostname";
  79.     $conn_db = "dbname=$PostgreSql_databasename";
  80.     $conn_user = "user=$PostgreSql_username";
  81.     $conn_password = "password=$PostgreSql_password";
  82.     $conn = new PDO("pgsql:$conn_host;$conn_db;$conn_user;$conn_password") or die();
  83.         $q=$conn->prepare("select ispinfo,dl,ul,ping,jitter from speedtest_users where id=?") or die();
  84.         $q->execute(array($id)) or die();
  85.         $row=$q->fetch() or die();
  86.         $ispinfo=$row["ispinfo"];
  87.         $dl=$row["dl"];
  88.         $ul=$row["ul"];
  89.         $ping=$row["ping"];
  90.         $jitter=$row["jitter"];
  91.         $conn=null;
  92. }else die();
  93.  
  94. $ispinfo=json_decode($ispinfo,true)["processedString"];
  95. $dash=strrpos($ispinfo,"-");
  96. if(!($dash===FALSE)){
  97.         $ispinfo=substr($ispinfo,$dash+2);
  98.         $par=strrpos($ispinfo,"(");
  99.         if(!($par===FALSE)) $ispinfo=substr($ispinfo,0,$par);
  100. }else $ispinfo="";
  101.  
  102. $dlBbox=imageftbbox($FONT_1_SIZE,0,$FONT_1,$DL_TEXT);
  103. $ulBbox=imageftbbox($FONT_1_SIZE,0,$FONT_1,$UL_TEXT);
  104. $pingBbox=imageftbbox($FONT_1_SIZE,0,$FONT_1,$PING_TEXT);
  105. $jitBbox=imageftbbox($FONT_1_SIZE,0,$FONT_1,$JIT_TEXT);
  106. $dlMeterBbox=imageftbbox($FONT_2_SIZE,0,$FONT_2,$dl);
  107. $ulMeterBbox=imageftbbox($FONT_2_SIZE,0,$FONT_2,$ul);
  108. $pingMeterBbox=imageftbbox($FONT_2_SIZE,0,$FONT_2,$ping);
  109. $jitMeterBbox=imageftbbox($FONT_2_SIZE,0,$FONT_2,$jit);
  110. $mbpsBbox=imageftbbox($FONT_3_SIZE,0,$FONT_3,$MBPS_TEXT);
  111. $msBbox=imageftbbox($FONT_3_SIZE,0,$FONT_3,$MS_TEXT);
  112. $watermarkBbox=imageftbbox($FONT_WATERMARK_SIZE,0,$FONT_WATERMARK,$WATERMARK_TEXT);
  113. $POSITION_X_WATERMARK=$WIDTH-$watermarkBbox[4]-4*$SCALE;
  114.  
  115. imagefilledrectangle($im, 0, 0, $WIDTH, $HEIGHT, $BACKGROUND_COLOR);
  116. imagefttext($im,$FONT_1_SIZE,0,$POSITION_X_DL-$dlBbox[4]/2,$POSITION_Y_1,$TEXT_COLOR_DL,$FONT_1,$DL_TEXT);
  117. imagefttext($im,$FONT_1_SIZE,0,$POSITION_X_UL-$ulBbox[4]/2,$POSITION_Y_1,$TEXT_COLOR_UL,$FONT_1,$UL_TEXT);
  118. imagefttext($im,$FONT_1_SIZE,0,$POSITION_X_PING-$pingBbox[4]/2,$POSITION_Y_1,$TEXT_COLOR_PING,$FONT_1,$PING_TEXT);
  119. imagefttext($im,$FONT_1_SIZE,0,$POSITION_X_JIT-$jitBbox[4]/2,$POSITION_Y_1,$TEXT_COLOR_JIT,$FONT_1,$JIT_TEXT);
  120. imagefttext($im,$FONT_2_SIZE,0,$POSITION_X_DL-$dlMeterBbox[4]/2,$POSITION_Y_2,$TEXT_COLOR_2,$FONT_2,$dl);
  121. imagefttext($im,$FONT_2_SIZE,0,$POSITION_X_UL-$ulMeterBbox[4]/2,$POSITION_Y_2,$TEXT_COLOR_2,$FONT_2,$ul);
  122. imagefttext($im,$FONT_2_SIZE,0,$POSITION_X_PING-$pingMeterBbox[4]/2,$POSITION_Y_2,$TEXT_COLOR_2,$FONT_2,$ping);
  123. imagefttext($im,$FONT_2_SIZE,0,$POSITION_X_JIT-$jitMeterBbox[4]/2,$POSITION_Y_2,$TEXT_COLOR_2,$FONT_2,$jit);
  124. imagefttext($im,$FONT_3_SIZE,0,$POSITION_X_DL-$mbpsBbox[4]/2,$POSITION_Y_3,$TEXT_COLOR_3,$FONT_3,$MBPS_TEXT);
  125. imagefttext($im,$FONT_3_SIZE,0,$POSITION_X_UL-$mbpsBbox[4]/2,$POSITION_Y_3,$TEXT_COLOR_3,$FONT_3,$MBPS_TEXT);
  126. imagefttext($im,$FONT_3_SIZE,0,$POSITION_X_PING-$msBbox[4]/2,$POSITION_Y_3,$TEXT_COLOR_3,$FONT_3,$MS_TEXT);
  127. imagefttext($im,$FONT_3_SIZE,0,$POSITION_X_JIT-$msBbox[4]/2,$POSITION_Y_3,$TEXT_COLOR_3,$FONT_3,$MS_TEXT);
  128. imagefttext($im,$FONT_4_SIZE,0,$POSITION_X_ISP,$POSITION_Y_4,$TEXT_COLOR_4,$FONT_4,$ispinfo);
  129. imagefttext($im,$FONT_WATERMARK_SIZE,0,$POSITION_X_WATERMARK,$POSITION_Y_WATERMARK,$TEXT_COLOR_WATERMARK,$FONT_WATERMARK,$WATERMARK_TEXT);
  130.  
  131. header('Content-Type: image/png');
  132. imagepng($im);
  133.  
  134. ?>