This commit is contained in:
Jay 2015-06-30 01:06:38 -07:00
commit eaf9040119
28 changed files with 4003 additions and 0 deletions

97
bgimage.php Executable file
View file

@ -0,0 +1,97 @@
<?php
// random background image
$champName = ''; // stores final champion name which is a part of background image name. initializes value
// lists champion names. count from 0
$champs[0] = "Aatrox"; $champs[1] = "Ahri"; $champs[2] = "Akali"; $champs[3] = "Alistar";
$champs[4] = "Amumu"; $champs[5] = "Anivia"; $champs[6] = "Annie"; $champs[7] = "Ashe";
$champs[8] = "Azir"; $champs[9] = "Blitzcrank"; $champs[10] = "Brand"; $champs[11] = "Braum";
$champs[12] = "Caitlyn"; $champs[13] = "Cassiopeia"; $champs[14] = "Chogath"; $champs[15] = "Corki";
$champs[16] = "Darius"; $champs[17] = "Diana"; $champs[18] = "DrMundo"; $champs[19] = "Draven";
$champs[20] = "Elise"; $champs[21] = "Evelynn"; $champs[22] = "Ezreal"; $champs[23] = "FiddleSticks";
$champs[24] = "Fiora"; $champs[25] = "Fizz"; $champs[26] = "Galio"; $champs[27] = "Gangplank";
$champs[28] = "Garen"; $champs[29] = "Gnar"; $champs[30] = "Gragas"; $champs[31] = "Graves";
$champs[32] = "Hecarim"; $champs[33] = "Heimerdinger"; $champs[34] = "Irelia"; $champs[35] = "Janna";
$champs[36] = "JarvanIV"; $champs[37] = "Jax"; $champs[38] = "Jayce"; $champs[39] = "Jinx";
$champs[40] = "Kalista"; $champs[41] = "Karma"; $champs[42] = "Karthus"; $champs[43] = "Kassadin";
$champs[44] = "Katarina"; $champs[45] = "Kayle"; $champs[46] = "Kennen"; $champs[47] = "Khazix";
$champs[48] = "KogMaw"; $champs[49] = "Leblanc"; $champs[50] = "LeeSin"; $champs[51] = "Leona";
$champs[52] = "Lissandra"; $champs[53] = "Lucian"; $champs[54] = "Lulu"; $champs[55] = "Lux";
$champs[56] = "Malphite"; $champs[57] = "Malzahar"; $champs[58] = "Maokai"; $champs[59] = "MasterYi";
$champs[60] = "MissFortune"; $champs[61] = "Mordekaiser"; $champs[62] = "Morgana"; $champs[63] = "Nami";
$champs[64] = "Nasus"; $champs[65] = "Nautilus"; $champs[66] = "Nidalee"; $champs[67] = "Nocturne";
$champs[68] = "Nunu"; $champs[69] = "Olaf"; $champs[70] = "Orianna"; $champs[71] = "Pantheon";
$champs[72] = "Poppy"; $champs[73] = "Quinn"; $champs[74] = "Rammus"; $champs[75] = "RekSai";
$champs[76] = "Renekton"; $champs[77] = "Rengar"; $champs[78] = "Riven"; $champs[79] = "Rumble";
$champs[80] = "Ryze"; $champs[81] = "Sejuani"; $champs[82] = "Shaco"; $champs[83] = "Shen";
$champs[84] = "Shyvana"; $champs[85] = "Singed"; $champs[86] = "Sion"; $champs[87] = "Sivir";
$champs[88] = "Skarner"; $champs[89] = "Sona"; $champs[90] = "Soraka"; $champs[91] = "Swain";
$champs[92] = "Syndra"; $champs[93] = "Talon"; $champs[94] = "Taric"; $champs[95] = "Teemo";
$champs[96] = "Thresh"; $champs[97] = "Tristana"; $champs[98] = "Trundle"; $champs[99] = "Tryndamere";
$champs[100] = "TwistedFate"; $champs[101] = "Twitch"; $champs[102] = "Udyr"; $champs[103] = "Urgot";
$champs[104] = "Varus"; $champs[105] = "Vayne"; $champs[106] = "Veigar"; $champs[107] = "Velkoz";
$champs[108] = "Vi"; $champs[109] = "Viktor"; $champs[110] = "Vladimir"; $champs[111] = "Volibear";
$champs[112] = "Warwick"; $champs[113] = "MonkeyKing"; /*Wukong*/ $champs[114] = "Xerath"; $champs[115] = "XinZhao";
$champs[116] = "Yasuo"; $champs[117] = "Yorick"; $champs[118] = "Zac"; $champs[119] = "Zed";
$champs[120] = "Ziggs"; $champs[121] = "Zilean"; $champs[122] = "Zyra";
// lists number of champion skins. count from 0. orders same as $champs
/*
champs who have Fnatic skin: Corki, Karthus, Janna, Jarvan IV, Gragas
champs who have Football skin: Alistar, Gragas, Lucian, Maokai, Twisted Fate
champs who have Pentakill Band skin: Mordekaiser, Olaf, Sona, Yorick, Karthus
champs who have SKT T1 skin: Jax, Lee Sin, Vayne, Zed, Zyra
champs who have TPA skin: Mundo, NuNu, Ezreal, Orianna, Shen
*/
$skinNum[0] = "2"; $skinNum[1] = "5"; $skinNum[2] = "6"; $skinNum[3] = "7";
$skinNum[4] = "7"; $skinNum[5] = "5"; $skinNum[6] = "8"; $skinNum[7] = "6";
$skinNum[8] = "1"; $skinNum[9] = "7"; $skinNum[10] = "4"; $skinNum[11] = "1";
$skinNum[12] = "6"; $skinNum[13] = "4"; $skinNum[14] = "5"; $skinNum[15] = "7";
$skinNum[16] = "4"; $skinNum[17] = "2"; $skinNum[18] = "7"; $skinNum[19] = "3";
$skinNum[20] = "3"; $skinNum[21] = "4"; $skinNum[22] = "7"; $skinNum[23] = "7";
$skinNum[24] = "3"; $skinNum[25] = "4"; $skinNum[26] = "4"; $skinNum[27] = "6";
$skinNum[28] = "6"; $skinNum[29] = "1"; $skinNum[30] = "8"; $skinNum[31] = "5";
$skinNum[32] = "4"; $skinNum[33] = "5"; $skinNum[34] = "4"; $skinNum[35] = "6";
$skinNum[36] = "6"; $skinNum[37] = "8"; $skinNum[38] = "2"; $skinNum[39] = "1";
$skinNum[40] = "1"; $skinNum[41] = "4"; $skinNum[42] = "5"; $skinNum[43] = "4";
$skinNum[44] = "7"; $skinNum[45] = "7"; $skinNum[46] = "5"; $skinNum[47] = "2";
$skinNum[48] = "8"; $skinNum[49] = "4"; $skinNum[50] = "6"; $skinNum[51] = "4";
$skinNum[52] = "2"; $skinNum[53] = "2"; $skinNum[54] = "4"; $skinNum[55] = "5";
$skinNum[56] = "6"; $skinNum[57] = "5"; $skinNum[58] = "4"; $skinNum[59] = "5";
$skinNum[60] = "7"; $skinNum[61] = "4"; $skinNum[62] = "6"; $skinNum[63] = "2";
$skinNum[64] = "5"; $skinNum[65] = "3"; $skinNum[66] = "6"; $skinNum[67] = "5";
$skinNum[68] = "6"; $skinNum[69] = "4"; $skinNum[70] = "5"; $skinNum[71] = "6";
$skinNum[72] = "6"; $skinNum[73] = "2"; $skinNum[74] = "6"; $skinNum[75] = "1";
$skinNum[76] = "6"; $skinNum[77] = "2"; $skinNum[78] = "5"; $skinNum[79] = "3";
$skinNum[80] = "8"; $skinNum[81] = "5"; $skinNum[82] = "6"; $skinNum[83] = "6";
$skinNum[84] = "5"; $skinNum[85] = "6"; $skinNum[86] = "4"; $skinNum[87] = "6";
$skinNum[88] = "3"; $skinNum[89] = "5"; $skinNum[90] = "4"; $skinNum[91] = "3";
$skinNum[92] = "2"; $skinNum[93] = "3"; $skinNum[94] = "3"; $skinNum[95] = "7";
$skinNum[96] = "3"; $skinNum[97] = "6"; $skinNum[98] = "4"; $skinNum[99] = "6";
$skinNum[100] = "8"; $skinNum[101] = "6"; $skinNum[102] = "3"; $skinNum[103] = "3";
$skinNum[104] = "3"; $skinNum[105] = "5"; $skinNum[106] = "8"; $skinNum[107] = "1";
$skinNum[108] = "3"; $skinNum[109] = "3"; $skinNum[110] = "6"; $skinNum[111] = "4";
$skinNum[112] = "7"; $skinNum[113] = "4"; $skinNum[114] = "3"; $skinNum[115] = "5";
$skinNum[116] = "2"; $skinNum[117] = "2"; $skinNum[118] = "1"; $skinNum[119] = "2";
$skinNum[120] = "4"; $skinNum[121] = "4"; $skinNum[122] = "3";
$maxNumOfSkins = 0; // initializes max number of skins of a champion
$rand = rand(0,count($champs)-1); // randomly chooses a champion. gets its max number of skins. count() counts from 1
// instead of if...else if...else
for($i=0; $i<=count($champs)-1; $i++){
if($i == $rand){
$champName = $champs[$i];
$maxNumOfSkins = $skinNum[$i];
}
}
$randSkin = rand(0,$maxNumOfSkins);
$final = $champName.'_'.$randSkin.'.jpg';
echo $final; // include(): add this in css stylesheet
// setcookie('bgimage', $final, time() + (86400 * 30), "/");
?>

73
css/nprogress.css Executable file
View file

@ -0,0 +1,73 @@
/* Make clicks pass-through */
#nprogress {
pointer-events: none;
}
#nprogress .bar {
background: #29d;
position: fixed;
z-index: 1031;
top: 0;
left: 0;
width: 100%;
height: 2px;
}
/* Fancy blur effect */
#nprogress .peg {
display: block;
position: absolute;
right: 0px;
width: 100px;
height: 100%;
box-shadow: 0 0 10px #29d, 0 0 5px #29d;
opacity: 1.0;
-webkit-transform: rotate(3deg) translate(0px, -4px);
-ms-transform: rotate(3deg) translate(0px, -4px);
transform: rotate(3deg) translate(0px, -4px);
}
/* Remove these to get rid of the spinner */
#nprogress .spinner {
display: block;
position: fixed;
z-index: 1031;
top: 15px;
right: 15px;
}
#nprogress .spinner-icon {
width: 27px; /*initial: 18px; */
height: 27px; /*initial: 18px; */
box-sizing: border-box;
border: solid 5px transparent; /* solid 2px transparent; */
border-top-color: #29d;
border-left-color: #29d;
border-radius: 50%;
-webkit-animation: nprogress-spinner 400ms linear infinite;
animation: nprogress-spinner 400ms linear infinite;
}
.nprogress-custom-parent {
overflow: hidden;
position: relative;
}
.nprogress-custom-parent #nprogress .spinner,
.nprogress-custom-parent #nprogress .bar {
position: absolute;
}
@-webkit-keyframes nprogress-spinner {
0% { -webkit-transform: rotate(0deg); }
100% { -webkit-transform: rotate(360deg); }
}
@keyframes nprogress-spinner {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

482
css/summoner.css Executable file
View file

@ -0,0 +1,482 @@
*{
font-family: Tahoma,Verdana,Segoe,sans-serif
}
html {
overflow-y:scroll;
}
html,body {
width:100%;
height:100%;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,form,fieldset,p,button {
margin:0;
padding:0;
}
body {
min-width:880px;
max-width:100%;
max-height:0px;
background-color:#000;
background-attachment: fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.input-form {
padding:10px;
font-weight:bold;
text-align:center;
}
label {
font-family: Copperplate,"Copperplate Gothic Light",fantasy;
font-size:18px;
color: #fff;
text-shadow:-1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000;
}
img {
cursor: pointer;
}
/*
.input-form{
text-align:center;
margin:10% auto 0;
padding:10px;
font-weight:bold;
}*/
.title {
font-family: Copperplate,"Copperplate Gothic Light",fantasy;
text-shadow:-1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000;
font-size:20px;
color:#fff;
text-decoration:none;
}
.input-form-name {
font-family: Arial, sans-serif;
border: solid 3px #404040;
padding:6px 3px;
text-indent:3px;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
width:170px;
opacity: 0.8;
filter:Alpha(opacity=80); /* IE8 and earlier versions supports */
}
.input-form-region {
font-family: Arial, sans-serif;
border:solid 3px #404040;
padding:6px 3px;
width:170px;
border-radius: 3px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
opacity: 0.8;
filter:Alpha(opacity=80); /* IE8 and earlier versions supports */
}
/* input-form-submit source: http://bradsknutson.com/blog/css-button-with-sliding-background-color/ */
.input-form-submit {
color: #404040;
background: #FFF;
padding: 6px 15px;
margin: 25px;
font-family: "Arial Black","Arial Bold",Gadget,sans-serif;
border: 3px solid #404040;
font-size: 12px;
font-weight: bold;
letter-spacing: 1px;
text-transform: uppercase;
border-radius: 2px;
display: inline-block;
text-align: center;
cursor: pointer; /*
box-shadow: inset 0 0 0 0 #31302B;
-webkit-transition: all ease 0.8s;
-moz-transition: all ease 0.8s;
transition: all ease 0.8s;
/*border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
*/
opacity: 0.8;
filter:Alpha(opacity=80); /* IE8 and earlier versions supports */
}
/*
.input-form-submit:hover{
box-shadow: inset 150px 0 0 0 #31302B;
color: #FFF;
}
*/
.input-form-submit:hover {
background-color: #404040;
color: #FFF;
}
.result {
font-family: "Trebuchet MS","Lucida Grande","Lucida Sans Unicode","Lucida Sans",Tahoma,sans-serif;
margin:-5px auto;
padding: 10px;
text-align:left;
font-size:14px;
color:#000;
width:750px;
background: rgba(255, 255, 255, 0.3);
border:3px solid #404040;
border-radius: 2px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
}
.summoner-icon {
border:1px solid #404040;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
margin: 5px;
}
.summoner-name {
position:absolute;
font-size:30px;
cursor: pointer;
}
#status_dot {
font-size:35px;
text-shadow:-1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000;
cursor:pointer;
}
#active-text {
position:absolute;
margin-top:75px;
font-size:12px;
color:#202020;
vertical-align:center;
}
.summoner-level {
position:absolute;
margin-left:-35px;
margin-top:75px;
font-family: "Trebuchet MS","Lucida Grande","Lucida Sans Unicode","Lucida Sans",Tahoma,sans-serif;
background: #fff;
color:#000;
font-size:11px;
padding:1px 4px;
border-radius: 2px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
background: rgba(255, 255, 255, 0.6);
cursor:pointer;
text-align:right;
}
.summoner-revision_date {
position:absolute;
margin-top:75px;
font-size:12px;
color:#202020;
vertical-align:center;
}
.summoner-recent {
border: 1px solid #505050;
background: rgba(255, 255, 255, 0.5);
padding: 15px;
margin: 5px 5px; /* box vertical whitespace */
padding-top: 0px;
margin-top:0px;
padding-bottom: 5px;
}
.summoner-recent_belt {
margin:0px 5px;
border:1px solid #404040;
border-bottom-color: transparent;
opacity: 0.7;
filter:Alpha(opacity=70); /* IE8 and earlier versions supports */
text-indent:5px;
}
.seemore_belt {
margin:0px 5px 5px 5px;
border:1px solid #404040;
border-top-color: transparent;
opacity: 0.7;
filter:Alpha(opacity=70); /* IE8 and earlier versions supports */
text-indent:5px;
}
.summoner-champion_pic {
width:75px;
height:75px;
border-radius: 50%;
margin-top:2px;
margin-left:-10px;
margin-right:-10px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border: 1px #404040 solid;
}
.summoner-spell1,.summoner-spell2 {
width:34px;
height:34px;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
position:absolute;
margin-left:15px;
margin-top:3px;
border:1px solid #404040;
}
.summoner-spell2 {
margin-top:43px;
}
.table-col0 {
position:absolute;
margin-top:-70px;
margin-left:130px;
line-height:150%;
text-align:center;
}
.table-col1 {
position:absolute;
margin-top:-65px;
margin-left:200px;
text-align:center;
font-size:11px;
font-weight:bold;
text-align:center;
line-height:150%;
}
.table-col1-level {
color:#303030;
font-weight:normal;
}
.table-col0-kda_ratio {
color:#fff;
font-weight:bold;
font-size:9px;
background-color:rgb(0, 81, 255); /*386088*/
padding:0 3px;
text-align:center;
}
.table-col0-kda {
text-align:center;
font-size:11px;
font-weight:bold;
}
#table-col0-kill {
color:#242442;
}
.table-col0-slash {
color:#000;
font-size:10px;
font-weight:normal;
}
#table-col0-death {
color:#8B0000;
}
#table-col0-assist {
color:#242442;
}
.table-col0-kill_title {
line-height:200%;
color:#C50101;
font-weight:bold;
font-size:11px;
text-align:center;
}
.gold {
color:#FFFC00;
text-shadow:-1px 0 #202020, 0 1px #202020, 1px 0 #202020, 0 -1px #202020;
}
a[title]:hover:after {
content: attr(title);
padding: 2px 4px;
font-family: Consolas,monaco,monospace;
color: #707070;
font-size:11px;
text-align:center;
position: absolute;
z-index: 20;
white-space: pre-line;
max-width:250px;
margin-right:10px;
-moz-box-shadow: 0px 0px 4px #222;
-webkit-box-shadow: 0px 0px 4px #222;
box-shadow: 0px 0px 4px #222;
background-color: #000;
opacity: 0.90;
filter:Alpha(opacity=90); /* IE8 and earlier versions supports */
}
a[title].tier:hover:after {
margin-left:565px;
margin-top:90px;
}
a[title].spell1:hover:after, a[title].spell2:hover:after {
margin-left:40px;
width:150px;
}
a[title].spell2:hover:after {
margin-top:40px;
}
a[title].gold_a:hover:after {
width:160px;
margin-top:-90px;
}
a[title].kill_title:hover:after {
width:100px;
margin-top:-10px;
}
a[title].damage:hover:after {
width:200px;
}
a[title].ward:hover:after {
width:95px;
}
a[title].item:hover:after {
width:170px;
margin-left:-10px;
margin-top:30px;
}
.itemlist {
position:absolute;
margin-top:-55px;
margin-left:300px;
}
.itembox {
border-radius:5px;
border:1px solid #404040;
}
#ward {
font-size:11px;
color:#0B4C0B;
text-align:center;
font-weight:bold;
}
.ip_earned {
position:absolute;
margin-top:-50px;
min-width:50px;
margin-left:660px;
font-size:11px;
color:#766C03;
font-weight:bold;
text-align:center;
}
.blueTeam {
border:2px solid rgb(82, 82, 255);
border-radius: 5%;
-webkit-border-radius: 5%;
-moz-border-radius: 5%;
margin-right:-2px;
}
.redTeam {
border:2px solid rgb(255, 82, 82);
border-radius: 5%;
-webkit-border-radius: 5%;
-moz-border-radius: 5%;
margin-right:-2px;
}
.footer {
cursor:default;
margin-top:10%;
text-align:center;
font-size:12px;
color:#fff;
text-shadow:-1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000;
}
.total_damage {
position:absolute;
margin-top:-60px;
margin-left:600px;
font-size:11px;
color:#E24D00;
text-align:center;
font-weight:bold;
}
#damage-text {
color:#303030;
font-weight:normal;
font-size:10px;
}
#status {
line-height:300%;
font-size:12px;
text-shadow:-1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000;
color:#20E22A;
font-weight:normal;
}
#signup {
color:#ff0;
font-weight:bold;
text-decoration:none;
/*text-shadow:none;*/
}
#t_and_c {
line-height:200%;
font-size:11px;
text-decoration:none;
color:rgb(140, 140, 140);
}
#t_and_c:hover {
color:#fff;
}
#copyright {
font-size:11px;
}
#developer_name {
text-decoration:none;
color:#0ff;
font-weight:bold;
line-height:500%;
}
#developer_name:hover {
color:#fff;
}

BIN
img/black.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

BIN
img/blank.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
img/blank_notuse.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

BIN
img/empty.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

BIN
img/favicon.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
img/gold.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
img/noitem.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
img/null.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

BIN
img/tier/BRONZE.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
img/tier/CHALLENGER.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
img/tier/DIAMOND.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
img/tier/GOLD.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
img/tier/MASTER.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
img/tier/PLATINUM.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
img/tier/SILVER.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
img/tier/UNRANKED.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
img/triplebar.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

573
index.php Executable file
View file

@ -0,0 +1,573 @@
<?php
/**
* League Of Legends Summoner Search
*
* This is League Of Legends Summoner Search Description
*
* @author Juyoung Lee
* @copyright 2015 lolsearch.tk
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version 1.0
*/
// quora.com/How-do-I-use-the-League-of-Legends-API-What-langauge-do-I-need-to-know-to-make-something-that-looks-up-summoners-like-LoLKing-or-LoLNexus
class Summoner {
/**
* The League of Legends API Key
*
* @var string
*/
const API_KEY = '66ea8d47-903a-4d41-ad8a-93ac89964ceb';
/**
* The API Base URL
*
* @var string
*/
const API_URL = 'https://na.api.pvp.net/api/lol/';
}
/**
* get summoner name by summoner id
*
* @param $summonerId summoner id
* @return mixed summonerName
*/
function getSummonerName($summonerId)
{
$apiKey = Summoner::API_KEY;
$json = file_get_contents('https://na.api.pvp.net/api/lol/static-data/na/v1.2/champion/'. $summonerId .'?api_key=' . $apiKey);
$link = json_decode($json);
return $link->key;
}
/**
* get item name and description by item id
*
* @param $itemId item id
* @return $item item name and description
*/
function getItemText($itemId) {
$json = file_get_contents(Summoner::API_URL.'static-data/na/v1.2/item/'.$itemId.'?api_key='.Summoner::API_KEY);
$link = json_decode($json);
$item = $link->name . '
'.$link->description;
$item = str_replace("<br>", '
', $item);
$item = strip_tags($item);
return $item;
}
function itemDescription($itemId)
{
$itemId_json = file_get_contents('https://na.api.pvp.net/api/lol/static-data/na/v1.2/item/'.$itemId.'?api_key='.Summoner::API_KEY);
$itemId_result = json_decode($itemId_json);
$first_result = $itemId_result->name . '
'.$itemId_result->description;
$replace_breakline = str_replace(array("<br>"), '
', $first_result);
$replace_space = strip_tags($replace_breakline);
return $replace_space;
}
$apiKey = Summoner::API_KEY;
$inputSummonerName = $_GET['userName'];
$inputSummonerName = str_replace(" ", "", $inputSummonerName);
$summonerName = strtolower($inputSummonerName);
$summonerId = 0;
$summonerJson = file_get_contents('https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/' . $summonerName . '?api_key=' . $apiKey, true);
$summoner = json_decode($summonerJson)->$summonerName;
$summonerId = $summoner->id;
$summonerName = $summoner->name;
$summonerRevisionDate = $summoner->revisionDate;
$summonerLevel = $summoner->summonerLevel;
$profileId = $summoner->profileIconId;
?>
<?php
$read = file("./txt/counter.txt");
$count = trim($read[0]);
$sum_count = $count + 1;
$fp = fopen("./txt/counter.txt", "w");
fwrite($fp, $sum_count);
fclose($fp);
$count_collected = $sum_count;
$ip_collected = $_SERVER['REMOTE_ADDR'];
$date_collected = date('YmdHis', time());
$summonerName_collected = $summonerName;
if(!$summonerName_collected)
{
$summonerName_collected = 'NULL';
}
$result_collected = $count_collected . '-' . $summonerName_collected . '-' . $date_collected . '-' . $ip_collected . PHP_EOL;
$fp = fopen("./txt/track.txt", "a");
fputs($fp, $result_collected);
fclose($fp);
?>
<html>
<head>
<title>Summoner <?php if($summonerName){ echo '- ' . $summonerName;} ?> - urgo.tk</title>
<meta http-equiv="Content-Type" content="text/html; utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script src="./js/jquery-1.10.2.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="./js/nprogress.js"></script>
<script src="./js/summoner.js"></script>
<link rel="shortcut icon" href="./img/favicon.ico"/>
<link rel="stylesheet" href="./css/nprogress.css"/>
<link rel="stylesheet" href="./css/summoner.css"/>
</head>
<body style="background-image: url('http://ddragon.leagueoflegends.com/cdn/img/champion/splash/<?php include('bgImage.php'); echo '\')'; ?>">
<?php
/* if you want specific background,
<body style="background-image: url('http://ddragon.leagueoflegends.com/cdn/img/champion/splash/<?php echo 'Heimerdinger_0.jpg\')'; ?>">
IF NOT,
<body style="background-image: url('http://ddragon.leagueoflegends.com/cdn/img/champion/splash/<?php include('bgImage.php'); echo '\')'; ?>">
*/
?>
<script>
NProgress.start();var interval=setInterval(function(){NProgress.inc()},7e3);jQuery(window).load(function(){clearInterval(interval),NProgress.done()}),jQuery(window).unload(function(){NProgress.start()});
</script>
<div class="input-form" style="<?php
if(!$summonerName){
echo "margin:20% auto 0;";
}
else{
echo "margin:0% auto 0;";
}
?>">
<div class="title" style="font-size:12px;"><a class="title" href="./">URGO.TK</a> for NA</div>
<form action="./">
<label for="name">Summoner Name</label>
<input type="text" name="userName" tabindex="1" id="name" class="input-form-name" placeholder="Summoner Name" value="<?php echo $summonerName; ?>" maxlength="25"></input>
&nbsp;&nbsp;&nbsp; <!-- [TAB] -->
<label for="region">Region</label>
<select name="region" tabindex="2" id="region" class="input-form-region">
<option value="BR" disabled>Brazil</option>
<option value="EUNE" disabled>EU Nordic &amp; East</option>
<option value="EUW" disabled>EU West</option>
<option value="KR" disabled>Korea</option>
<option value="LAN" disabled>Latin America North</option>
<option value="LAS" disabled>Latin America South</option>
<option value="NA" selected="selected">North America</option>
<option value="OCE" disabled>Oceania</option>
<option value="RU" disabled>Russia</option>
<option value="TR" disabled>Turkey</option>
</select>
<input type="submit" value="Submit" id="submit" class="input-form-submit" onclick="summonerLookUp();" >
<form>
</div>
<?php
if(!$summonerName && strlen($inputSummonerName) > 0){
echo '<div class="result">SORRY, ERROR OCCURRED DUE TO ONE OR MORE FOLLOWING REASONS
<span style="color:#FF1C1C; font-size:15px; "><br/>:Bad request<br/>:Unauthorized<br/>:No summoner data found for any specified inputs<br/>:Rate limit exceeded<br/>:Internal server error<br/>:Service unavailable<br/>:You are special <span style="font-size:12px;">&hearts;</span></span>
</div>
</body>
</html>';
exit;
} else if($summonerName){
?>
<?php
// calculate reivison date
$epoch = microtime(true);
$epochDiffSeconds = $epoch - ($summonerRevisionDate / 1000);
$epochMinutes = floor( ($epochDiffSeconds / 60) % 60 );
$epochHours = floor( ($epochDiffSeconds / 3600) );
$epochDays = floor( $epochHours / 24 );
$statusDotColor = "00A500"; // 00A500 green
$epochString = " active ";
if($epochDays > (365 * 2))
{
$epochString .= "several years ";
$statusDotColor = "272727"; // 272727 gray
}
else if($epochDays > 365)
{
$epochString .= "over a year ";
$statusDotColor = "272727"; // 272727 gray
}
else if($epochDays > 180)
{
$epochString .= "over 6 months ";
$statusDotColor = "272727";
}
else if($epochDays > 90)
{
$epochString .= "over 3 months ";
$statusDotColor = "f00";
}
else if($epochDays > 30)
{
$epochString .= "over a month ";
$statusDotColor = "f00";
}
else if($epochDays > 1)
{
$epochString .= $epochDays . " days ";
$statusDotColor = "E5AE00";
}
else if($epochDays == 1)
{
$epochString .= " a day ";
$statusDotColor = "E5AE00"; //e76000 orange
}
if($epochDays < 2 && $epochHours > 1)
{
$epochString .= $epochHours . " hrs ";
//$statusDotColor = "E5AE00"; //e5ae00 yellow
}
else if($epochDays < 2 && $epochHours == 1)
{
$epochString .= " an hr ";
}
if($epochDays == 0 && $epochMinutes > 1)
{
$epochString .= $epochMinutes . " mins ";
}
else if($epochDays == 0 && $epochMinutes == 1)
{
$epochString .= " one min ";
}
$epochString .= "ago";
if($epochDiffSeconds < (60 * 5) )
{
$epochString = "active now";
}
?>
<div class="result">
<!-- // http://ddragon.leagueoflegends.com/cdn/4.21.1/img/profileicon/0.png -->
<image height="90" width="90" src="http://ddragon.leagueoflegends.com/cdn/5.6.1/img/profileicon/<?php print $profileId; ?>.png" onerror="imgError(this);" class="summoner-icon" />
<span class="summoner-name"><?php print $summonerName . '<span style="cursor:default;">&nbsp;</span><span id="status_dot" style="color:#' . $statusDotColor . '";>&#8226;</span>' ?></span>
<span class="summoner-level"><?php print $summonerLevel; ?></span>
<span title="" id="active-text">
<?php
echo $epochString;
?>
</span>
<?php
$json_tier = file_get_contents('https://na.api.pvp.net/api/lol/na/v2.5/league/by-summoner/'. $summonerId .'/entry?api_key=' . $apiKey);
$tier_result = json_decode($json_tier) -> $summonerId;
$summonerTier = $tier_result[0]->tier;
$summonerDivision = $tier_result[0]->entries[0]->division;
if (!$summonerTier){ $summonerTier = 'UNRANKED'; }
/*
if($summonerId == "36821462")
{
$summonerTier = 'CHALLENGER';
$summonerDivision = '';
}
*/
$summonerTier = ucfirst(strtolower($summonerTier));
?>
<a title="<?php echo $summonerTier. ' '. $summonerDivision; ?>" class="tier"><span style="float:right;" title=""><img src="./img/tier/<?php echo $summonerTier; ?>.png" height=100 /></span></a>
<br/>
<?php
// items/spells guide: https://developer.riotgames.com/discussion/riot-games-api/show/I0Al5bbl
$result_recent = file_get_contents('https://na.api.pvp.net/api/lol/na/v1.3/game/by-summoner/'. $summonerId .'/recent?api_key=' . $apiKey);
$recent = json_decode($result_recent);
// foreach( $recent->games as $recentSummary){ var_dump($recentSummary->stats->championsKilled); }
foreach( $recent->games as $recentSummary){
$FINAL_STATS_WIN = $recentSummary->stats->win;
$FINAL_CHAMPIONID = $recentSummary->championId;
$FINAL_STATS_WIN == 1 ? $letterWin = 'VICTORY' : $letterWin ='DEFEAT';
$subType = str_replace(array('_','1x1','2x2','3x3','5x5','6x6'), ' ', ucfirst(strtolower($recentSummary->subType)));
if($recentSummary->subType == 'NONE'){
$subType = 'Custom';
}
$result_champ_name_static_data = file_get_contents('https://na.api.pvp.net/api/lol/static-data/na/v1.2/champion/'. $FINAL_CHAMPIONID .'?api_key=' . $apiKey);
$champName = json_decode($result_champ_name_static_data);
?>
<?php
$timePlayedMinute = gmdate('i', $recentSummary->stats->timePlayed );
$timePlayedSecond = gmdate('s', $recentSummary->stats->timePlayed );
?>
<div class="summoner-recent_belt" style="background-color:<?php if ($letterWin == 'VICTORY' ){echo '#54AAE2';}else{ echo '#EA6358';} ?>;"><?php echo $subType . '&nbsp;<span style="font-size:11px;">'; echo date('M j Y g:s A', $recentSummary->createDate / 1000); echo '</span><span style="float:right"><span style="font-size:11px;vertical-align:center;">' . $timePlayedMinute. 'm ' . $timePlayedSecond . 's' .'</span>&nbsp;'. $letterWin . '&nbsp;</span>'; ?></div>
<div class="summoner-recent" style="background-color:<?php if ($letterWin == 'VICTORY' ){echo 'rgba(140, 237, 253, 0.4)';}else{ echo 'rgba(255, 202, 202, 0.4)';} ?>;">
<a title="<?php print $champName->name.': '.$champName->title; ?> " ><img class="summoner-champion_pic" src="http://ddragon.leagueoflegends.com/cdn/5.6.1/img/champion/<?php echo $champName->key; ?>.png" onerror="imgError(this);" title=""/></a>
<?php
$json_spell1 = file_get_contents('https://na.api.pvp.net/api/lol/static-data/na/v1.2/summoner-spell/'. $recentSummary->spell1 .'?api_key=' . $apiKey);
$summonerSpell1 = json_decode($json_spell1) ;
$json_spell2 = file_get_contents('https://na.api.pvp.net/api/lol/static-data/na/v1.2/summoner-spell/'. $recentSummary->spell2 .'?api_key=' . $apiKey);
$summonerSpell2 = json_decode($json_spell2) ;
$spell1Name = $summonerSpell1 -> name;
$spell2Name = $summonerSpell2 -> name;
$spell1Key = $summonerSpell1 -> key;
$spell2Key = $summonerSpell2 -> key;
$spell1Description = $summonerSpell1 -> description;
$spell2Description = $summonerSpell2 -> description;
?>
<a title="<?php print $spell1Name; ?>
<?php print $spell1Description; ?>" class="spell1"><img class="summoner-spell1" onerror="imgError(this);" src="http://ddragon.leagueoflegends.com/cdn/5.6.1/img/spell/<?php print $spell1Key; ?>.png" title=""/></a>
<a title="<?php print $spell2Name; ?>
<?php print $spell2Description; ?>" class="spell2" ><img class="summoner-spell2" onerror="imgError(this);" src="http://ddragon.leagueoflegends.com/cdn/5.6.1/img/spell/<?php print $spell2Key; ?>.png" title=""/></a>
<?php
$recentSummary->stats->championsKilled ? $championsKilled = $recentSummary->stats->championsKilled : $championKilled = 0;
$recentSummary->stats->numDeaths ? $numDeaths = $recentSummary->stats->numDeaths : $numDeaths = 0;
$recentSummary->stats->assists ? $assists = $recentSummary->stats->assists : $assists = 0;
echo '<div class="table-col0">
<div class="table-col0-kda">
<span id="table-col0-kill">'.$championsKilled.' </span>
<span class="table-col0-slash">/</span>
<span id="table-col0-death">'.$numDeaths.'</span>
<span class="table-col0-slash"> /</span>
<span id="table-col0-assist">'.$assists.'</span>
</div>'
.'<div class="table-col0-kda_ratio">';
if($championsKilled > 0 && $numDeaths == 0)
{
echo 'Perfect ';
}
else if($numDeaths > 0)
{
echo number_format( (($championsKilled + $assists) / $numDeaths), 2).':1 ';
}
else
{
echo $championsKilled + $assists . '.00:0 ';
}
echo 'KDA</div>';
$killTitle = '';
if($recentSummary->stats->firstBlood > 0) $killTitle = 'First Blood';
if($recentSummary->stats->doubleKills > 0) $killTitle = 'Double Kill';
if($recentSummary->stats->tripleKills > 0) $killTitle = 'Triple Kill';
if($recentSummary->stats->quadraKills > 0) $killTitle = 'Quadra Kill';
if($recentSummary->stats->pentaKills > 0) $killTitle = 'Penta Kill';
echo '<div class="table-col0-kill_title" title="">'. $killTitle . '</div></div><div class="table-col1">
<div class="table-col1-level">Level '.$recentSummary->stats->level.'</div>';
$recentSummary->stats->neutralMinionsKilledYourJungle ? $inTeamJungle = $recentSummary->stats->neutralMinionsKilledYourJungle : $inTeamJungle = 0;
$recentSummary->stats->neutralMinionsKilledEnemyJungle ? $inEnemyJungle = $recentSummary->stats->neutralMinionsKilledEnemyJungle : $inEnemyJungle = 0;
$recentSummary->stats->minionsKilled ? $minionsKilled = $recentSummary->stats->minionsKilled : $minionsKilled = 0;
$recentSummary->stats->goldEarned ? $goldEarned = $recentSummary->stats->goldEarned : $goldEarned = 0;
echo '<a style="line-height:120%;" title="total gold: '.number_format($goldEarned) .'
minions ';
if($minionsKilled) {
echo $minionsKilled;
}
else {
echo '0';
}
echo' + monsters ';
$neutralMinionsKilled = $recentSummary->stats->neutralMinionsKilled;
if($neutralMinionsKilled)
{
echo $neutralMinionsKilled.'
'. $inTeamJungle . ' (in Team\'s Jungle)
' . $inEnemyJungle . ' (in Enemy Jungle)
';
}
else
{
echo '0';
}
$minionGoldEarned = 0;
$minionGoldEarned = $minionsKilled + $neutralMinionsKilled;
echo 'CS/min: ' . number_format(($minionGoldEarned) / ($recentSummary->stats->timePlayed / 60), 2).'
" class="gold_a">
<div class="gold" title=""><img width=20 src="./img/gold.png" onerror="imgError(this);" style="vertical-align:middle;cursor:default;" title=""/>'.number_format(($goldEarned / 100), 1) .'k ('. ($minionGoldEarned) . ')</div></a>
<div id="ward">
<a class="ward" title="ward placed:';
$wardPlaced = 0;
$wardKilled = 0;
$wardPlaced = $recentSummary->stats->wardPlaced;
$wardKilled = $recentSummary->stats->wardKilled;
if($wardPlaced)
{
echo number_format($wardPlaced);
}
else{
echo 0;
}
echo '
ward killed:';
if($wardKilled)
{
echo number_format($wardKilled).'">';
}
else{
echo '0">';
}
echo '<span title="">Ward ' . number_format($wardPlaced). ' / ' . number_format($wardKilled).'
</span>
</a>
</div>
</div>';
?>
<div style="position:absolute;">
<a class="item" title="<?php if($recentSummary->stats->item0){echo itemDescription($recentSummary->stats->item0);} ?>" style="position:absolute;margin-top:-55px;margin-left:300px;">
<?php if($recentSummary->stats->item0){ ?><img width=34 height=34 title="" src=" <?php echo 'http://ddragon.leagueoflegends.com/cdn/5.6.1/img/item/'.$recentSummary->stats->item0.'.png'; ?>" onerror="imgError(this);" style="border-radius:5px;border:1px solid #404040;" /><?php } ?>
</a>
<a class="item" title="<?php if($recentSummary->stats->item1){echo itemDescription($recentSummary->stats->item1);}?>" style="position:absolute;margin-top:-55px;margin-left:340px;">
<?php if($recentSummary->stats->item1){ ?><img width=34 height=34 title="" src=" <?php echo 'http://ddragon.leagueoflegends.com/cdn/5.6.1/img/item/'.$recentSummary->stats->item1.'.png'; ?>" onerror="imgError(this);" style="border-radius:5px;border:1px solid #404040;" /><?php } ?>
</a>
<a class="item" title="<?php if($recentSummary->stats->item2){echo itemDescription($recentSummary->stats->item2);} ?>" style="position:absolute;margin-top:-55px;margin-left:380px;">
<?php if($recentSummary->stats->item2){ ?><img width=34 height=34 title="" src=" <?php echo 'http://ddragon.leagueoflegends.com/cdn/5.6.1/img/item/'.$recentSummary->stats->item2.'.png'; ?>" onerror="imgError(this);" style="border-radius:5px;border:1px solid #404040;" /><?php } ?>
</a>
<a class="item" title="<?php if($recentSummary->stats->item3){echo itemDescription($recentSummary->stats->item3);} ?>" style="position:absolute;margin-top:-55px;margin-left:420px;">
<?php if($recentSummary->stats->item3){ ?><img width=34 height=34 title="" src=" <?php echo 'http://ddragon.leagueoflegends.com/cdn/5.6.1/img/item/'.$recentSummary->stats->item3.'.png'; ?>" onerror="imgError(this);" style="border-radius:5px;border:1px solid #404040;" /><?php } ?>
</a>
<a class="item" title="<?php if($recentSummary->stats->item4){echo itemDescription($recentSummary->stats->item4);} ?>" style="position:absolute;margin-top:-55px;margin-left:460px;">
<?php if($recentSummary->stats->item4){ ?><img width=34 height=34 title="" src=" <?php echo 'http://ddragon.leagueoflegends.com/cdn/5.6.1/img/item/'.$recentSummary->stats->item4.'.png'; ?>" onerror="imgError(this);" style="border-radius:5px;border:1px solid #404040;" /><?php } ?>
</a>
<a class="item" title="<?php if($recentSummary->stats->item5){echo itemDescription($recentSummary->stats->item5);} ?>" style="position:absolute;margin-top:-55px;margin-left:500px;">
<?php if($recentSummary->stats->item5){ ?><img width=34 height=34 title="" src=" <?php echo 'http://ddragon.leagueoflegends.com/cdn/5.6.1/img/item/'.$recentSummary->stats->item5.'.png'; ?>" onerror="imgError(this);" style="border-radius:5px;border:1px solid #404040;" /><?php } ?>
</a>
<a class="item" title="<?php if($recentSummary->stats->item6){echo itemDescription($recentSummary->stats->item6);} ?>" style="position:absolute;margin-top:-55px;margin-left:540px;">
<?php if($recentSummary->stats->item6){ ?><img width=34 height=34 title="" src=" <?php echo 'http://ddragon.leagueoflegends.com/cdn/5.6.1/img/item/'.$recentSummary->stats->item6.'.png'; ?>" onerror="imgError(this);" style="border-radius:5px;border:1px solid #404040;" /><?php } ?>
</a>
</div>
<?php
$recentSummary->stats->totalDamageDealtToChampions? $totalDealToChamp = $recentSummary->stats->totalDamageDealtToChampions : $totalDealToChamp = 0;
$recentSummary->stats->totalDamageDealt ? $totalDeal = $recentSummary->stats->totalDamageDealt : $totalDeal = 0;
echo'
<div class="total_damage">
<a class="damage" title="total damage to champions:'.number_format($totalDealToChamp).'
total damage:'.number_format($totalDeal).'"><span title="" id="damage-text">Damage</span><br/>
<span title="">'.number_format($totalDealToChamp).'
<br/>
'.number_format($totalDeal).'
</span>
</a></div>';
$recentSummary->ipEarned? $ipEarned = $recentSummary->ipEarned : $ipEarned = 0;
echo '<div class="ip_earned">+' . $ipEarned . ' IP</div>'; ?>
</div>
<?php
}
?>
<div style="text-align:right;font-size:10px;color:#202020;"><?php echo date('M j Y g:s A') . ' Last Updated&nbsp;&nbsp;'; ?></div>
<!-- Create cookies to save summoner names submitted -->
<?php } // end brace of no error result ?>
<!--<button onClick="window.print()">Print this page</button>-->
<!--<p style="text-align:center;">Print Completed <?php //echo date('m/d/Y h:i:s a', time()); ?></p> -->
</div>
</div>
<div class="footer">
<?php
$statusJson = file_get_contents('http://status.leagueoflegends.com/shards/na');
$statusLink = json_decode($statusJson);
$status = $statusLink->services[0]->status;
echo '<div id="status">current status: NA1 '.$status.'</div>';
?>
<div>interested in League Of Legends? <a id="signup" href="http://signup.leagueoflegends.com/?ref=518b51965e02a423691390" target="_blank">Sign up</a></div>
<div><a id="t_and_c" href="https://developer.riotgames.com/terms#statement" target="_blank">API Terms & Conditions</a></div>
<div><br/>
<div id="copyright">&copy; 2015 <a id="developer_name" href="https://www.facebook.com/profile.php?id=100008396495978" target="_blank" style="">Juyoung Lee</a> & League Of Legends API</div>
</body>
</html>

6
js/jquery-1.10.2.min.js vendored Executable file

File diff suppressed because one or more lines are too long

20
js/summoner.js Executable file
View file

@ -0,0 +1,20 @@
function summonerLookUp(){var a="";a=$("#name").val().replace(/\s/g,"").trim().toLowerCase(),""!==a&&(location.href=location.pathname+"?userName="+a)}
function imgError(image){
image.onerror = "";
image.src = "./img/black.png";
return true;
}
function imgDelete(image){
image.onerror = "";
image.src = "./img/null.png";
return true;
}

407
league.php Executable file
View file

@ -0,0 +1,407 @@
<?php
/**
*
* League Of Legends API
*
* League Of Legends API class
*
*
* @author Juyoung Lee
* @since 02.28.2015
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @version 1.0
*/
class LeagueOfLegends {
/**
* The API Base URL
*/
const API_URL = 'https://na.api.pvp.net/api/lol/';
/**
* The API Static Data Base URL
*/
const API_STATIC_DATA_URL = 'https://global.api.pvp.net/api/lol/static-data/na/v1.2/';
/**
* The API Image Base URL
*/
const API_IMAGE_BASE_URL = 'http://ddragon.leagueoflegends.com/cdn/5.3.3/img/';
/**
* The League of Legends API Key
*
* @var string
*/
private $_apiKey = '66ea8d47-903a-4d41-ad8a-93ac89964ceb';
/**
* Default constructor
*
* @return void
*/
public function __construct() { }
/**
* Get the API key
*
* @return string
*/
private function getApiKey() {
return $_apiKey;
}
/**
* Set summoner objects
* <trim and lowercase included>
*
* @param string $summonerNames Summoner name
* @return mixed
*/
private function setSummoner($summonerNames) {
$summonerNames = preg_replace('/\s+/', '', $summonerNames);
$summonerNames = strtolower($summonerNames);
$json = file_get_contents(self::API_URL.'na/v1.4/summoner/by-name/'.$summonerNames .'?api_key='.$this->_apiKey, true);
return json_decode($json)->$summonerNames;
}
/**
* Get a summoner object
* <Possible objects: id, name, profileIconId, revisionDate, summonerLevel>
*
* @param string $summonerNames Summoner name
* @param string $obj An object to call
* @return mixed
*/
public function getSummonerObject($summonerNames, $obj) {
$json = file_get_contents(self::API_URL.'na/v1.4/summoner/by-name/'.$summonerNames .'?api_key='.$this->_apiKey, true);
return json_decode($json)->$summonerNames->$obj;
}
/**
* Get summoner id by summoner name
*
* @param string $p Summoner name
* @return mixed
*/
public function getSummonerId($p) {
return $this->setSummoner($p)->id;
}
/**
* Get summoner name registered by summoner name
*
* @param string $p Summoner name
* @return mixed
*/
public function getSummonerName($p) {
return $this->setSummoner($p)->name;
}
/**
* Get ID of the summoner icon by summoner name
*
* @param string $p Summoner name
* @return mixed
*/
public function getSummonerIconId($p) {
return $this->setSummoner($p)->profileIconId;
}
/**
* Get the image link of the summoner icon by profile icon id
* <Call this function inside src of img tag>
*
* @param string $p Profile Icon ID
* @return mixed
*/
public function getSummonerIconImageLink($p) {
return self::API_IMAGE_BASE_URL.'profileicon/'.$p.'.png';
}
/**
* Get Date in epho milliseconds summoner was last modified
* by summoner name
*
* @param string $p Summoner name
* @return mixed
*/
public function getSummonerRevisionDate($p) {
return $this->setSummoner($p)->revisionDate;
}
/**
* Get Date in epho milliseconds summoner was last modified
* by summoner name
*
* @param string $p Summoner name
* @return string
*/
public function getSummonerRevisionDateFormat($p) {
$summonerRevisionDate = $this->setSummoner($p)->revisionDate;
$epoch = microtime(true);
$epochDiffSeconds = $epoch - ($summonerRevisionDate / 1000);
$epochMinutes = floor( ($epochDiffSeconds / 60) % 60 );
$epochHours = floor( ( $epochDiffSeconds / 3600 ) % 24 );
$epochDays = floor( $epochHours / 24 );
$epochString = ' active ';
if( $epochDays > (365 * 2) )
{
$epochString .= 'over '. floor( ($epochDays / 365) % 365 ).' years ';
}
else if($epochDays > 365)
{
$epochString .= 'over a year ';
}
else if($epochDays > 60)
{
$epochString .= 'over '. floor( ($epochDays / 30) % 30 ).' months ';
}
else if($epochDays > 30)
{
$epochString .= 'over a month ';
}
else if($epochDays > 1)
{
$epochString .= $epochDays . ' days ';
}
else if($epochDays == 1)
{
$epochString .= ' a day ';
}
if($epochDays < 2 && $epochHours > 1)
{
$epochString .= $epochHours . ' hours ';
}
else if($epochDays < 2 && $epochHours == 1)
{
$epochString .= ' an hour ';
}
if($epochDays == 0 && $epochMinutes > 1)
{
$epochString .= $epochMinutes . ' minutes ';
}
else if($epochDays == 0 && $epochMinutes == 1)
{
$epochString .= ' one minute ';
}
$epochString .= 'ago';
if( $epochDiffSeconds < (60 * 5) )
{
$epochString = 'active now';
}
return $epochString;
}
/**
* Get summoner level
*
* @param string $p Summoner name
* @return mixed
*/
public function getSummonerLevel($p) {
return $this->setSummoner($p)->summonerLevel;
}
/**
* Get summoner tier
*
* @param string $p Summoner ID
* @return string
*/
public function getSummonerTier($p) {
$json = file_get_contents(self::API_URL.'na/v2.5/league/by-summoner/'. $p .'/entry?api_key='.$this->_apiKey);
$link = json_decode($json) -> $p;
$summonerTier = $link[0]->tier;
$summonerTier = ucfirst(strtolower($summonerTier));
$summonerDivision = $link[0]->entries[0]->division;
return $summonerTier;
}
/**
* Get summoner tier
*
* @param string $p Summoner ID
* @return mixed
*/
public function getSummonerDivision($p) {
$json = file_get_contents(self::API_URL.'na/v2.5/league/by-summoner/'. $p .'/entry?api_key='.$this->_apiKey);
$link = json_decode($json) -> $p;
return $link[0]->entries[0]->division;
}
/**
* Retrieves a champion by its id
*
* @param string $championId Champion ID
* @return mixed
*/
private function setChampionData($championId) {
$json = file_get_contents(self::API_STATIC_DATA_URL.'champion/'.$championId .'?api_key='.$this->_apiKey, true);
return json_decode($json);
}
/**
* Get champion title by champion id
*
* @param string $p Champion ID
* @return mixed
*/
public function getChampionTitle($p) {
return $this->setChampionData($p)->title;
}
/**
* Get champion name by champion id
*
* @param string $p Champion ID
* @return mixed
*/
public function getChampionName($p) {
return $this->setChampionData($p)->name;
}
/**
* Get champion key by champion id
*
* @param string $p Champion ID
* @return mixed
*/
public function getChampionKey($p) {
return $this->setChampionData($p)->key;
}
/**
* Get the champion link of the item by champion id
* <Call this function inside src of img tag>
*
* @param string $p Champion ID
* @return mixed
*/
public function getChampionImageLink($p) {
return self::API_IMAGE_BASE_URL.'champion/'.$this->getChampionKey($p).'.png';
}
/**
* Set item data objects by item id
*
* @param string $ItemId Item ID
* @return mixed
*/
private function setItemData($ItemId) {
$json = file_get_contents(self::API_STATIC_DATA_URL.'item/'.$ItemId .'?api_key='.$this->_apiKey, true);
return json_decode($json);
}
/**
* Get item plain text by item id
*
* @param string $p Item ID
* @return mixed
*/
public function getItemPlainText($p) {
return $this->setItemData($p)->plaintext;
}
/**
* Get item description by item id
*
* @param string $p Item ID
* @return mixed
*/
public function getItemDescription($p) {
$val = $this->setItemData($p)->description;
$val = str_replace("<br>", '
', $val);
return strip_tags($val);
}
/**
* Get item name and its description by item id
*
* @param string $p Item ID
* @return mixed
*/
public function getItemNameWithDescription($p) {
$val = $this->setItemData($p)->description;
$val = str_replace("<br>", '
', $val);
return $this->setItemData($p)->name . '
' . strip_tags($val);
}
/**
* Get item name by item id
*
* @param string $p Item ID
* @return mixed
*/
public function getItemName($p) {
return $this->setItemData($p)->name;
}
/**
* Get the image link of the item by item id
* <Call this function inside src of img tag>
*
* @param string $p Item ID
* @return mixed
*/
public function getItemImageLink($p) {
return self::API_IMAGE_BASE_URL.'item/'.$p.'.png';
}
/**
* Retrieves summoner spell by its unique id
*
* @param string $SpellId Spell ID
* @return mixed
*/
private function setSummonerSpell($spellId) {
$json = file_get_contents(self::API_STATIC_DATA_URL.'summoner-spell/'.$spellId .'?api_key='.$this->_apiKey, true);
return json_decode($json);
}
/**
* Get spell image link
*
* @param string $p Spell ID
* @return mixed
*/
public function getSpellImageLink($p) {
return self::API_IMAGE_BASE_URL.'spell/'.$this->setSummonerSpell($p)->key.'.png';
}
/**
* Get spell name
*
* @param string $p Spell ID
* @return mixed
*/
public function getSpellName($p) {
return $this->setSummonerSpell($p)->name;
}
/**
* Get spell description
*
* @param string $p Spell ID
* @return mixed
*/
public function getSpellDescription($p) {
return $this->setSummonerSpell($p)->description;
}
}
?>

1
riot.txt Executable file
View file

@ -0,0 +1 @@
9328c227-b9a2-4a02-a482-bb30d08d6b32

1
txt/counter.txt Executable file
View file

@ -0,0 +1 @@
2308

33
txt/note.txt Executable file
View file

@ -0,0 +1,33 @@
/*
if($recentSummary->stats->team == 100)
{
echo ' <img width=22 height=22 class="blueTeam" src="http://ddragon.leagueoflegends.com/cdn/5.2.1/img/champion/'.$champName->key. '.png"/>';
}
for($i = 0; $i <12; $i++)
{
if($recentSummary->fellowPlayers[$i]->teamId)
{
if($recentSummary->fellowPlayers[$i]->teamId == 100)
{
echo ' <img width=22 height=22 class="blueTeam" src="http://ddragon.leagueoflegends.com/cdn/5.2.1/img/champion/'.getSummonerName($recentSummary->fellowPlayers[$i]->championId). '.png"/>';
}
}
}
if($recentSummary->stats->team == 200)
{
echo ' <img width=22 height=22 class="blueTeam" src="http://ddragon.leagueoflegends.com/cdn/5.2.1/img/champion/'.$champName->key. '.png"/>';
}
for($i = 0; $i < 12; $i++)
{
if($recentSummary->fellowPlayers[$i]->teamId)
{
if($recentSummary->fellowPlayers[$i]->teamId == 200)
{
echo ' <img width=22 height=22 class="redTeam" src="http://ddragon.leagueoflegends.com/cdn/5.2.1/img/champion/'.getSummonerName($recentSummary->fellowPlayers[$i]->championId). '.png"/>';
}
}
}
*/

2310
txt/track.txt Executable file

File diff suppressed because it is too large Load diff