ich würde gern die Trailvotes erweitern, sprich nachher die Anzeige.
ZB eine Sortierung einfügen nach Anmeldedatum oder eine zusätzliche Spalte einfügen, wo das Anmeldedatum ersichtlich ist.
Leider find ich mich im quellcode nicht zurrecht.
verwendete ilch Version: 1.1 P
betroffene Homepage: caelum-et-infernum.eu
<?php # ilch Copyright by: Manuel # # Trialvotes v1.6.1 Copyright by: sassers.de # defined ('main') or die ( 'no direct access' ); $title = $allgAr['title'].' :: TrialVotes'; $hmenu = 'Trialvoting'; $design = new design ( $title , $hmenu ); $design->header(); $tpl = new tpl ( 'trialvote' ); $tpl->out(0); if ( !loggedin() ) {}else{ $uid = $_SESSION['authid']; #------------------------------------------------------------------------------- ### Prüfen ob es Gruppen gibt, die Erlaubnis haben zu Voten... #------------------------------------------------------------------------------- $resultGroupVoteAllowed = db_query("SELECT * FROM prefix_groups WHERE voteAllowed = 1"); $mengeGVA = db_num_rows($resultGroupVoteAllowed); if($mengeGVA>=1) { #------------------------------------------------------------------------------- ### Es gibt Gruppen mit Voterecht... ### Abfrage ob User in Gruppe mit Voterecht ist #------------------------------------------------------------------------------- $abfCheck = "SELECT * FROM prefix_user, prefix_groups, prefix_groupusers WHERE prefix_user.id = $uid AND prefix_user.recht != '-3' AND prefix_groups.voteAllowed = 1 AND prefix_groupusers.uid = prefix_user.id AND prefix_groupusers.gid = prefix_groups.id"; $ergCheck = db_query($abfCheck); if (db_num_rows($ergCheck)>=1) ## User ist in einer oder mehreren Gruppen mit Voterecht { #------------------------------------------------------------------------------- ### Trialmember abfragen ### Votes erstellen... #------------------------------------------------------------------------------- $abf = "SELECT * FROM prefix_user WHERE recht = '-3'"; $erg = db_query($abf); while($row = db_fetch_object($erg)) { $ar = array ( 'TRIALMEMBER' => $row->name, 'TRIALID' => $row->id); $uuid = $row->id; $abf1 = 'SELECT * FROM prefix_trialvotes WHERE voteby = "'.$uid.'" AND trialid = "'.$uuid.'"'; $erg1 = db_query($abf1); if (db_num_rows($erg1)==1) { $tpl->set('Option_Ja', "<img src=\"include/images/trialvotes/votenja_g.png\" border=\"0\">"); $tpl->set('Option_Nein', "<img src=\"include/images/trialvotes/votenein_g.png\" border=\"0\">"); $tpl->set('Option_Ent', "<img src=\"include/images/trialvotes/voteent_g.png\" border=\"0\">"); } else { $tpl->set('Option_Ja', "<a href=\"index.php?trialvote-vote-1-$uuid\"><img src=\"include/images/trialvotes/votenja.png\" border=\"0\"></a>"); $tpl->set('Option_Nein', "<a href=\"index.php?trialvote-vote-2-$uuid\"><img src=\"include/images/trialvotes/votenein.png\" border=\"0\"></a>"); $tpl->set('Option_Ent', "<a href=\"index.php?trialvote-vote-3-$uuid\"><img src=\"include/images/trialvotes/voteent.png\" border=\"0\"></a>"); } $tpl->set_ar_out($ar,1); } } else { $tpl = new tpl ( 'trialvote' ); echo "<h3>Du hast nicht die benötigten Rechte!</h3>"; $tpl->out(2); } } #------------------------------------------------------------------------------- ### Es gibt K E I N E Gruppen mit Voterecht... ### Alle Member dürfen Voten! #------------------------------------------------------------------------------- else { $abf = "SELECT * FROM prefix_user WHERE recht = '-3' ORDER by regist DESC,prefix_user.posts ASC"; $erg = db_query($abf); while($row = db_fetch_object($erg)) { $ar = array ( 'TRIALMEMBER' => $row->name, 'TRIALID' => $row->id); $uuid = $row->id; $abf1 = 'SELECT * FROM prefix_trialvotes WHERE voteby = "'.$uid.'" AND trialid = "'.$uuid.'"'; $erg1 = db_query($abf1); if (db_num_rows($erg1)==1) { $tpl->set('Option_Ja', "<img src=\"include/images/trialvotes/votenja_g.png\" border=\"0\">"); $tpl->set('Option_Nein', "<img src=\"include/images/trialvotes/votenein_g.png\" border=\"0\">"); $tpl->set('Option_Ent', "<img src=\"include/images/trialvotes/voteent_g.png\" border=\"0\">"); } else { $tpl->set('Option_Ja', "<a href=\"index.php?trialvote-vote-1-$uuid\"><img src=\"include/images/trialvotes/votenja.png\" border=\"0\"></a>"); $tpl->set('Option_Nein', "<a href=\"index.php?trialvote-vote-2-$uuid\"><img src=\"include/images/trialvotes/votenein.png\" border=\"0\"></a>"); $tpl->set('Option_Ent', "<a href=\"index.php?trialvote-vote-3-$uuid\"><img src=\"include/images/trialvotes/voteent.png\" border=\"0\"></a>"); } $tpl->set_ar_out($ar,1); } } $tpl->out(2); #------------------------------------------------------------------------------- ### Aktionen #------------------------------------------------------------------------------- switch($menu->get(1)) { case vote : $voteID = intval($menu->get(2)); $trialID = intval($menu->get(3)); $votetime = time(); # -------------------- # Manipulationsversuch abfangen... # -------------------- $abf = "SELECT * FROM prefix_user WHERE recht = '-3' AND id = '$trialID'"; $erg = db_query($abf); if (db_num_rows($erg)==1) { $abf = 'SELECT * FROM prefix_trialvotes WHERE voteby = "'.$uid.'" AND trialid ="'.$trialID.'"'; $erg = db_query($abf); if (db_num_rows($erg)!=1) { if($voteID==1){ // Vote ja db_query("INSERT INTO `prefix_trialvotes`(`trialid`,`ja`,`voteby`,`votetime`) VALUES ('".$trialID."','1','".$uid."','".$votetime."')"); wd ("index.php?trialvote", "Vielen Dank für dein Vote..." , 1.5 ); } if($voteID==2){ // Vote nein db_query("INSERT INTO `prefix_trialvotes`(`trialid`,`nein`,`voteby`,`votetime`) VALUES ('".$trialID."','1','".$uid."','".$votetime."')"); wd ("index.php?trialvote", "Vielen Dank für dein Vote..." , 1.5 ); } if($voteID==3){ // Vote ent db_query("INSERT INTO `prefix_trialvotes`(`trialid`,`ent`,`voteby`,`votetime`) VALUES ('".$trialID."','1','".$uid."','".$votetime."')"); wd ("index.php?trialvote", "Vielen Dank für dein Vote..." , 1.5 ); } } $tpl->out(3); } else { $tpl = new tpl ( 'trialvote' ); echo "<h3>Manipulationsversuch! Dies ist kein Trialmember!</h3>"; $tpl->out(3); } break; case details : $tpl = new tpl ( 'trialvote_details' ); $trialID = intval($menu->get(2)); # -------------------- # Manipulationsversuch abfangen... # -------------------- $abf = "SELECT * FROM prefix_user WHERE recht = '-3' AND id = '$trialID'"; $erg = db_query($abf); if (db_num_rows($erg)==1) { $erg = db_query("SELECT name FROM prefix_user WHERE id = ".$trialID." LIMIT 1"); while ($row = db_fetch_object($erg)) { $trialname = $row->name; $resultALL = db_query("SELECT * FROM prefix_trialvotes WHERE trialid = '".$trialID."' "); $mengeALL = db_num_rows($resultALL); $resultJA = db_query("SELECT ja FROM prefix_trialvotes WHERE trialid = '".$trialID."' AND ja = '1'"); $mengeJA = db_num_rows($resultJA); $resultNEIN = db_query("SELECT nein FROM prefix_trialvotes WHERE trialid = '".$trialID."' AND nein = '1'"); $mengeNEIN = db_num_rows($resultNEIN); $resultENT = db_query("SELECT ent FROM prefix_trialvotes WHERE trialid = '".$trialID."' AND ent = '1'"); $mengeENT = db_num_rows($resultENT); $resultmember = db_query("SELECT DISTINCT id FROM prefix_user WHERE recht != '-3'"); $mengemember = db_num_rows($resultmember); if($mengeJA==1) { $mengeJ = "1 Ja Stimme";} else { $mengeJ = "$mengeJA Ja Stimmen";} if($mengeNEIN==1) { $mengeN = "1 Nein Stimme";} else { $mengeN = "$mengeNEIN Nein Stimmen";} if($mengeENT==1) { $mengeE = "1 Enthaltung";} else { $mengeE = "$mengeENT Enthaltungen";} $tpl->set('vote_all', $mengeALL); $tpl->set('vote_ja', $mengeJ); $tpl->set('vote_nein', $mengeN); $tpl->set('vote_ent', $mengeE); $tpl->set('notrials', $mengemember); $tpl->set('name', $trialname); if($mengeJA<=0 && $mengeNEIN<=0 && $mengeENT<=0 ) { $JAsatz2 = 0; $NEINsatz2 = 0; $ENTsatz2 = 0; } else { $JAsatz = $mengeALL/100; $JAsatz2 = $mengeJA/$JAsatz; $JAsatz2 = round($JAsatz2, 0); $NEINsatz = $mengeALL/100; $NEINsatz2 = $mengeNEIN/$NEINsatz; $NEINsatz2 = round($NEINsatz2, 0); $ENTsatz = $mengeALL/100; $ENTsatz2 = $mengeENT/$ENTsatz; $ENTsatz2 = round($ENTsatz2, 0); } $tpl->set('proz:ja', $JAsatz2); $tpl->set('proz:nein', $NEINsatz2); $tpl->set('proz:ent', $ENTsatz2); $tpl->out(0); if(is_admin ($uid) or is_coadmin($uid)) { $tpl->set('WOOT', TRUE); $abf = "SELECT * FROM prefix_trialvotes, prefix_user WHERE prefix_trialvotes.trialid = $trialID AND prefix_user.id = prefix_trialvotes.voteby"; $erg = db_query($abf); while($row = db_fetch_object($erg)) { $voteByName = $row->name; $zeit = $row->votetime; $voteja = $row->ja; $votenein = $row->nein; $voteent = $row->ent; $zeit1 = date("d.m.Y ",$zeit); $zeit1 .= date("H:i",$zeit); if($voteja==1) { $voteergebnis = "<img src=\"include/images/trialvotes/thumbs_up.gif\" border=\"0\">"; } if($votenein==1) { $voteergebnis = "<img src=\"include/images/trialvotes/thumbs_down.gif\" border=\"0\">"; } if($voteent==1) { $voteergebnis = "<img src=\"include/images/trialvotes/thumbs_left.gif\" border=\"0\">"; } $ar = array ( 'TRIALID' => $trialID, 'VOTEERGEBNIS' => $voteergebnis, 'VOTEZEIT' => $zeit1, 'VOTEBY' => $voteByName); $tpl->set_ar_out($ar,1); } } } } else { $tpl = new tpl ( 'trialvote' ); echo "<h3>Manipulationsversuch! Dies ist kein Trialmember!</h3>"; $tpl->out(2); } break; } $tpl = new tpl ( 'trialvote_hinweis' ); $tpl->out(0); } $design->footer(); ?>
Diesen Abfrage Code
$abf = "SELECT * FROM prefix_user WHERE recht = '-3' ORDER by regist DESC,prefix_user.posts ASC";
ignoriert er, also die sortierung
Zuletzt modifiziert von magicmarkus am 27.08.2015 - 15:51:59