Last active
August 29, 2015 13:57
-
-
Save kyyberi/9702279 to your computer and use it in GitHub Desktop.
List latest issues from GitHub (PHP)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>Puuttuuko metodi? Löytyikö bugi?</h3> | |
<p>Mikäli mielestäsi puuttuu jokin metodi, tee siitä <a href="https://github.com/kyyberi/avoindata-net/issues" target="top">'bugiraportti' GitHubiin<img class="extlink" src="/images/link.png"/></a>. Sitä ennen tarkista ettei joku ole jo ilmoittanut samasta asiasta. </p> | |
<div id="tab-container" class="tab-container"> | |
<ul class='etabs'> | |
<?php $data = json_decode(file_get_contents('https://api.github.com/repos/kyyberi/avoindata-net/issues'));?> | |
<li class='tab'><a href="#tabs1-open">Avoimet bugit (<?php echo sizeof($data);?>)</a></li> | |
<?php | |
$data2 = json_decode(file_get_contents('https://api.github.com/repos/kyyberi/avoindata-net/issues?state=closed')); | |
?> | |
<li class='tab'><a href="#tabs1-closed">Käsitellyt bugit (<?php echo sizeof($data2);?>)</a></li> | |
</ul> | |
<div id="tabs1-open"> | |
<h4>Viimeisimmät avoimet ilmoitetut bugit</h4> | |
<p>Listassa 20 viimeisintä avointa ilmoitettua bugia. Täydellinen listaus <a href="https://github.com/kyyberi/avoindata-net/issues" target="top">GitHubissa.<img class="extlink" src="/images/link.png"/></a><p/> | |
<ul class="list1" style="margin-left:20px;"> | |
<?php | |
$count = 1; | |
$sdata = sizeof($data); | |
if($sdata != '0'){ | |
foreach ($data as $issue) { | |
if($count <= 20){ | |
$title = $issue->title; | |
if(strlen($title) > 70){ | |
$title = substr($title, 0, strrpos(substr($title, 0, 70), ' ')); | |
$title .= "..."; | |
} | |
$iurl = $issue->html_url; | |
$handle = $issue->user->login; | |
$idate = $issue->updated_at; | |
$gurl = $issue->user->html_url; | |
$comments = $issue->comments; | |
$datearr = date_parse($idate); | |
$udate = $datearr['year'].".".$datearr['month'].".".$datearr['day']; | |
echo "<li><a target='new' href='".$iurl."'>".$title."</a><img class='extlink' src='/images/link.png'/>"; | |
echo "<br/><span class='date' style='color:#797676;font-size:0.9em;'>".$udate."</span> - "; | |
echo "<span class='handle'><a style='color:#797676;text-decoration:none;font-size:0.9em;' href='".$gurl."'>".$handle."</a></span> - "; | |
if($comments == '1'){ | |
echo "<span style='color:#797676;font-size:0.9em;'>".$comments." kommentti</span>"; | |
} | |
elseif($comments == '0'){ | |
echo "<span style='color:#797676;font-size:0.9em;'>ei kommentteja</span>"; | |
}else{ | |
echo "<span style='color:#797676;font-size:0.9em;'>".$comments." kommenttia</span>"; | |
} | |
echo "</li>"; | |
$count++; | |
} | |
} | |
}else{ | |
echo "<li>Ei uusia bugeja.</li>"; | |
} | |
?> | |
</ul> | |
</div> | |
<div id="tabs1-closed"> | |
<?php | |
echo "<h4>Viimeisimmät käsitellyt bugit</h4>"; | |
echo "<p>Listassa 20 viimeisintä käsiteltyä bugia. Täydellinen listaus <a target='top' href='https://github.com/kyyberi/avoindata-net/issues'>GitHubissa.<img class='extlink' src='/images/link.png'/></a><p/>"; | |
echo "<ul class='list1' style='margin-left:20px;'>"; | |
$count = 1; | |
foreach ($data2 as $issue) { | |
if($count <= 20){ | |
$title = $issue->title; | |
if(strlen($title) > 70){ | |
$title = substr($title, 0, strrpos(substr($title, 0, 70), ' ')); | |
$title .= "..."; | |
} | |
$iurl = $issue->html_url; | |
$handle = $issue->user->login; | |
$idate = $issue->updated_at; | |
$gurl = $issue->user->html_url; | |
$comments = $issue->comments; | |
$datearr = date_parse($idate); | |
$udate = $datearr['year'].".".$datearr['month'].".".$datearr['day']; | |
echo "<li><a target='new' href='".$iurl."'>".$title."</a><img class='extlink' src='/images/link.png'/>"; | |
echo "<br/><span class='date' style='color:#797676;font-size:0.9em;'>".$udate."</span> - "; | |
echo "<span class='handle'><a style='color:#797676;text-decoration:none;font-size:0.9em;' href='".$gurl."'>".$handle."</a></span> - "; | |
if($comments == '1'){ | |
echo "<span style='color:#797676;font-size:0.9em;'>".$comments." kommentti</span>"; | |
} | |
elseif($comments == '0'){ | |
echo "<span style='color:#797676;font-size:0.9em;'>ei kommentteja</span>"; | |
}else{ | |
echo "<span style='color:#797676;font-size:0.9em;'>".$comments." kommenttia</span>"; | |
} | |
echo "</li>"; | |
$count++; | |
} | |
} | |
?> | |
</ul> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment