include("includes/rating_config.php");
function getRating($id){
$total = 0;
$rows = 0;
$sel = mysql_query("SELECT rating_num FROM ratings WHERE rating_id = '$id'");
if(mysql_num_rows($sel) > 0){
while($data = mysql_fetch_assoc($sel)){
$total = $total + $data['rating_num'];
$rows++;
}
$perc = ($total/$rows) * 20;
//$newPerc = round($perc/5)*5;
//return $newPerc.'%';
$newPerc = round($perc,2);
return $newPerc.'%';
} else {
return '0%';
}
}
function outOfFive($id){
$total = 0;
$rows = 0;
$sel = mysql_query("SELECT rating_num FROM ratings WHERE rating_id = '$id'");
if(mysql_num_rows($sel) > 0){
while($data = mysql_fetch_assoc($sel)){
$total = $total + $data['rating_num'];
$rows++;
}
$perc = ($total/$rows);
return round($perc,2);
//return round(($perc*2), 0)/2; // 3.5
} else {
return '0';
}
}
function getVotes($id){
$sel = mysql_query("SELECT rating_num FROM ratings WHERE rating_id = '$id'");
$rows = mysql_num_rows($sel);
if($rows == 0){
$votes = '0 Stimmen';
}
else if($rows == 1){
$votes = '1 mal gestimmt';
} else {
$votes = $rows.' stimmen';
}
return $votes;
}
function pullRating($id,$show5 = false, $showPerc = false, $showVotes = false, $static = NULL){
// Check if they have already voted...
$text = '';
$sel = mysql_query("SELECT id FROM ratings WHERE IP = '".$_SERVER['REMOTE_ADDR']."' AND rating_id = '$id'");
if(mysql_num_rows($sel) > 0 || $static == 'novote' || isset($_COOKIE['has_voted_'.$id])){
if($show5 || $showPerc || $showVotes){
$text .= '
';
}
if($show5){
$text .= 'Punkte '.outOfFive($id).'/5';
}
if($showPerc){
$text .= ' ('.getRating($id).')';
}
if($showVotes){
$text .= ' ('.getVotes($id).')';
}
if($show5 || $showPerc || $showVotes){
$text .= '
';
}
return $text.'
';
} else {
if($show5 || $showPerc || $showVotes){
$text .= '
';
}
if($show5){
$show5bool = 'true';
$text .= 'Punkte '.outOfFive($id).'/5';
} else {
$show5bool = 'false';
}
if($showPerc){
$showPercbool = 'true';
$text .= ' ('.getRating($id).')';
} else {
$showPercbool = 'false';
}
if($showVotes){
$showVotesbool = 'true';
$text .= ' ('.getVotes($id).')';
} else {
$showVotesbool = 'false';
}
if($show5 || $showPerc || $showVotes){
$text .= '
';
}
return $text.'
';
}
}
// Added in version 1.5
// Fixed sort in version 1.7
function getTopRated($limit, $table, $idfield, $namefield){
$result = '';
$sql = "SELECT COUNT(ratings.id) as rates,ratings.rating_id,".$table.".".$namefield." as thenamefield,ROUND(AVG(ratings.rating_num),2) as rating
FROM ratings,".$table." WHERE ".$table.".".$idfield." = ratings.rating_id GROUP BY rating_id
ORDER BY rates DESC,rating DESC LIMIT ".$limit."";
$sel = mysql_query($sql);
$result .= '
'."\n";
while($data = @mysql_fetch_assoc($sel)){
$result .= '- '.$data['thenamefield'].' ('.$data['rating'].')
'."\n";
}
$result .= '
'."\n";
return $result;
}
?>
Bild Löschen
}}?>
Vorschau-Video zur Sendung
Video Löschen
}}?>
Am:
Donnerstag
01.01.1970 um 01:00
Bis :
Donnerstag
01.01.1970 um 01:00
Bis zur Sendung sind es noch genau:
Es führt euch durch die Sendung
Moderator
Bewerte den Inhalt der Sendung
echo pullRating($setid,true,true,true); ?>
Radio hören
Nächste Sendung
Menü
Statistiken
» 1 Online
» 1 Heute
» 1 Gestern
» 2 Woche
» 11 Monat
» 1870 Jahr
» 80948 Gesamt
Rekord: 333 (28.01.2015)
Unser Programm
$aktuz = time();
if ($_REQUEST['id'] == 1)
{
$sendezeit = time()+604800;
}
elseif ($_REQUEST['id'] == 2)
{
$sendezeit = time()+1209600;
}
elseif ($_REQUEST['id'] == 3)
{
$sendezeit = time()+9999999999999999999;
}
elseif ($_REQUEST['id'] == 4)
{
$sendezeit = time()+86400;
}
else
{
$sendezeit = time()+9999999999999999999;
}
$d = 0;
$abfragepzeige1 = "SELECT * FROM sendeplan WHERE start >= $aktuz AND start <= $sendezeit ORDER BY start ASC ";
$ergebniszeige1 = mysql_query($abfragepzeige1);
while($rowzeige = mysql_fetch_object($ergebniszeige1))
{
$start = $rowzeige->start;
$ende = $rowzeige->ende;
$beschreibung = $rowzeige->beschreibung;
$ueberschrift = $rowzeige->ueberschrift;
$moderator = $rowzeige->user_id;
$bild = $rowzeige->bild;
$sid = $rowzeige->s_id;
$datum = date("d.m.Y",$start);
$startda = date("d.m.Y",$start);
$aktu = date("d.m.Y",$aktuz);
if ($startda == $aktu)
{
$anzeigedatum = "Heute";
}
else
{
$anzeigedatum = date("d.m.Y",$start);
}
$uhrzeit = date("H:i",$start);
$sql = mysql_query("SELECT * FROM users WHERE id = '$moderator'");
$rowzeige = mysql_fetch_object($sql);
$modid = $rowzeige->id;
$modname = $rowzeige->username;
$avatars = $rowzeige->avatar;
$anzeigezeit = date("H:i",$start);
$modiname = $rowzeige->modiname;
$vorname = $rowzeige->vorname;
if(empty($bild))
{
$bild = "sendebild.jpg";
}
if(empty($modiname))
{
$modiname = "Noch keinen angegeben";
}
$date = "$datum";
$tag = date("l",strtotime($date));
switch($tag){
case "Monday":
$tag = "Montag";
break;
case "Tuesday":
$tag = "Dienstag";
break;
case "Wednesday":
$tag = "Mittwoch";
break;
case "Thursday":
$tag = "Donnerstag";
break;
case "Friday":
$tag = "Freitag";
break;
case "Saturday":
$tag = "Samstag";
break;
case "Sunday":
$tag = "Sonntag";
break;
}
$date = strtotime("$datum $uhrzeit");
$remaining = $date - time();
$days_remaining = floor($remaining / 86400);
$hours_remaining = floor(($remaining % 86400) / 3600);
$mins_remaining = floor(($remaining % 86400 % 3600) / 60);
?>
-
Donnerstag
}?>
if ($headerlinks != '') {?>
}?>