Als iemand die hoes van SftP even raadt, dan kunt u het allen hier aanschouwen !
$beginwaarde = 500;
$eindwaarde = 601;
$postidarray = array();
$arrayteller = "0";
$select = "select * from wp_posts";
$query = mysql_query($select);
$records = mysql_num_rows($query);
while ($list = mysql_fetch_object($query)) {
if(substr($list->post_title, 0, 1) == “#”) {
$uitslagposttitle = substr($list->post_title, 1, 3);
if($uitslagposttitle > $beginwaarde and $uitslagposttitle < $eindwaarde) {
$postidarray[$arrayteller] = $list->ID; // echo $uitslagposttitle; echo “
“;
$arrayteller++;
}
}
}
$aantal = count($postidarray);
for($t=0;$t<$aantal;$t++) {
// echo $postidarray[$t]; echo "
“;
}
// Hele punten
$geradenteller1 = “0”;
$select1 = “select * from wp_postmeta where meta_key = ‘Geraden door’ order by meta_value”;
$query1 = mysql_query($select1);
$records1 = mysql_num_rows($query1);
while ($list1 = mysql_fetch_object($query1)) {
$postid1 = $list1->post_id;
// if(in_array($postid1,$postidarray)) {
// $naamlaatstgeraden = $list1->meta_value;
// }
if(in_array($postid1,$postidarray)) {
if(strtolower($naam) == strtolower($list1->meta_value)) {
$geradenteller1++;
$geradenarray1[$naam] = $geradenteller1;
} else {
$naam = $list1->meta_value;
$geradenteller1 = “1”;
$geradenarray1[$naam] = $geradenteller1;
}
}
}
// Halve punten
$geradenteller2 = “0”;
$select2 = “select * from wp_postmeta where meta_key = ‘Half geraden door’ order by meta_value”;
$query2 = mysql_query($select2);
$records2 = mysql_num_rows($query2);
while ($list2 = mysql_fetch_object($query2)) {
$postid2 = $list2->post_id;
if(in_array($postid2,$postidarray)) {
if(strtolower($naam) == strtolower($list2->meta_value)) {
$geradenteller2 = $geradenteller2 + 0.5;
$geradenarray2[$naam] = $geradenteller2;
} else {
$naam = $list2->meta_value;
$geradenteller2 = “0.5”;
$geradenarray2[$naam] = $geradenteller2;
}
}
}
// Extra halve punten
$geradenteller3 = “0”;
$select3 = “select * from wp_postmeta where meta_key = ‘Extra half punt’ order by meta_value”;
$query3 = mysql_query($select3);
$records3 = mysql_num_rows($query3);
while ($list3 = mysql_fetch_object($query3)) {
$postid3 = $list3->post_id;
if(in_array($postid3,$postidarray)) {
if(strtolower($naam) == strtolower($list3->meta_value)) {
$geradenteller3 = $geradenteller3 + 0.5;
$geradenarray3[$naam] = $geradenteller3;
} else {
$naam = $list3->meta_value;
$geradenteller3 = “0.5”;
$geradenarray3[$naam] = $geradenteller3;
}
}
}
//Bepalen wie het laatst geraden heeft
$select = “select * from wp_postmeta where meta_key = ‘Geraden door’ order by post_id”;
$query = mysql_query($select);
$records = mysql_num_rows($query);
while ($list = mysql_fetch_object($query)) {
$postid = $list->post_id;
if(in_array($postid,$postidarray)) {
$naamlaatstgeraden = $list->meta_value;
}
}
//Optellen hele en halve en extra halve punten
$aantalposts = “0”;
foreach ($geradenarray1 as $label1 => $inhoud1) {
$geradenarray[$label1] = $geradenarray1[$label1] + $geradenarray2[$label1] + $geradenarray3[$label1];
$aantalposts = $aantalposts + $geradenarray1[$label1] + $geradenarray2[$label1];
}
if(isset($geradenarray)) {
arsort($geradenarray);
}
echo “
$teller. | $label* | $label | $inhoud |
“;
//echo “$naamlaatstgeraden heeft de laatste hoes geraden
“;
echo “Totaal $totaalaantal punten”;
?>
0 reacties tot nog toe ↓
Nog geen reacties. Ga je gang !
You must log in om een reactie achter te laten.