Hallo!
Ich hab eine Frage: Ich habe ein Umfrage Script, nicht von euch und möchte in dieses Script 2 Links einbauen, weiß aber nicht wie das geht weil dess php ist und ich nur html kann. Macht ihr überhaupt sowas oder nur bei phpbb Angelegenheiten?
Frage wegen anderem Script
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
eins von www.klangwerk.at. Soll ich das script mal reinposten?
Also hier der Code des Umfrage Scripts:
Code: Alles auswählen
<?
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
$umfrage = "datas/fragen.txt";
$comp_adr = "datas/ips.txt";
$votes = "datas/votes.txt";
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
$nl = chr(13) . chr(10);
$readquery = file($umfrage);
$frage = array_pop($readquery);
$anzvotes = array_pop($readquery);
$anzvotes = chop($anzvotes);
$anz_opts = count($readquery);
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
$anz1 = "10";
$anz2 = "66.66";
$anz3 = "33.33";
$anz4 = "100";
$anz5 = "50";
$bezeichnung1 = "bedgfg";
$bezeichnung2 = "dsfghnung";
$bezeichnung3 = "bdsfgsdfg";
$bezeichnung4 = "dfgsdfgdsfg";
$bezeichnung5 = "dfg fghdsf dhgf";
$width1= 90/100*$anz1+1;
$width2= 90/100*$anz2+1;
$width3= 90/100*$anz3+1;
$width4= 90/100*$anz4+1;
$width5= 90/100*$anz5+1;
// # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
// #######################################################################################
// Abstimmung absenden ####################################################################
if($action == "vote")
{
if(!$antwort)
{
$do = "logic";
}
else
{
$address = getenv("REMOTE_ADDR");
$ips = file($comp_adr);
$anz_ips = count($ips);
for($a=0;$a<$anz_ips;$a++)
{
$ips[$a] = chop($ips[$a]);
if($ips[$a] == "$address")
{
$found = "notyet";
break;
}
}
if($found != "notyet")
{
$ip_anhaengen = fopen("$comp_adr","a");
flock($ip_anhaengen,2);
fputs($ip_anhaengen, "$address$nl");
flock($ip_anhaengen,3);
fclose($ip_anhaengen);
$null = 0;
$hits = file($votes);
for($c=0;$c<$anz_opts;$c++)
{
$hits[$c] = chop($hits[$c]);
$nr = $c + 1;
if($nr == "$antwort")
{
$hits[$c] = $hits[$c] + 1;
}
else
{
$hits[$c] = $hits[$c] + $null;
}
}
$write_hits = fopen("$votes","w");
flock($write_hits,2);
for($d=0;$d<$anz_opts;$d++)
{
fputs($write_hits, "$hits[$d]$nl");
}
flock($write_hits,3);
fclose($write_hits);
}
}
}
//########################################################################################
// main logik ###############################################################################
if($do == "logic")
{
$show = "errorform";
}
else
{
$ipes = file($comp_adr);
$anz_ipes = count($ipes);
$ip=getenv("REMOTE_ADDR");
for($b=0;$b<$anz_ipes;$b++)
{
$ipes[$b] = chop($ipes[$b]);
if($ipes[$b] == "$ip")
{
$visit = "already";
break;
}
}
if($visit == "already")
{
$show = "resultform";
}
else
{
$show = "abstimmform";
}
}
// #######################################################################################
// Formular für das Ergebnis #################################################################
if($show == "resultform")
{
$abstimmung = file($votes);
$anz_abstimmung = count($abstimmung);
$summe = 0;
for($aba=0;$aba<$anz_abstimmung;$aba++) { $summe = $summe + $abstimmung[$aba]; }
if($anzvotes <= $summe)
{
for($abb=0;$abb<$anz_abstimmung;$abb++)
{
$percent[$abb] = 100/$summe*$abstimmung[$abb];
$percent[$abb] = round($percent[$abb],2);
$width[$abb] = 90/100*$percent[$abb] + 1;
}
echo "<b><table style=\"background-image:url(../images/bg_arena.gif); border-style:solid;border-width:1px;border-color:#000000\">
<tr>
<td colspan=2 align=center><div style=\"font-family:Comic Sans MS;font-size:8pt;font-weight:bold\"><b> $frage </div></td>\n </tr>";
for($wre=0;$wre<$anz_opts;$wre++)
{
$mglkt = explode("|",$readquery[$wre]);
echo "<tr>
<td align=right><div style=\"font-family:Comic Sans MS;font-size:8pt\"><b>$mglkt[0]</div></td>
<td><b><div style=\"font-family:Comic Sans MS;font-size:8pt\"><b><img src=\"gifs/$mglkt[1].gif\" alt=\"$percent[$wre]%\" height=\"12\" width=\"$width[$wre]\"> $percent[$wre]%</div></td>\n</tr>";
}
echo "<tr>
<td align=center colspan=2><div style=\"font-family:Comic Sans MS;font-size:8pt;font-weight:bold\"><b>Stimmen: $summe (100%)</div></td>\n</tr>
</tr><tr>
\n</table>";
}
else
{
echo " <table style=\"background-image:url(../images/bg_arena.gif); border-style:solid;border-width:1px;border-color:#000000\">
<tr>
<td align=center><div style=\"font-family:Comic Sans MS;font-size:10pt\"><b>Umfrage</div></td>
</tr><tr>
<td> </td>
</tr><tr>
<td align=center><div style=\"font-family:Comic Sans MS;font-size:8pt\"><b>Die Ergebnisse sind zur Zeit nicht verfügbar.<br>Bitte besuche diese Seite etwas später noch einmal!</div></td>
</tr>
</table>";
}
}
//########################################################################################
// Formular für Fehler beim Ausfüllen ###########################################################
if($show == "errorform")
{
echo " <table style=\"background-image:url(../images/bg_arena.gif); border-style:solid;border-width:1px;border-color:#000000\">
<tr>
<td align=center><div style=\"font-family:Comic Sans MS;font-size:10pt\"><b>Umfrage</div></td>
</tr><tr>
<td> </td>
</tr><tr>
<td><div style=\"font-family:Comic Sans MS;font-size:8pt\"><b>Bitte gebe deine Stimme ab!</div></td>
</tr><tr>
<td> </td>
</tr><tr>
<td align=center><input type=button style=\"background-image:url(../images/bg_arena.gif); border-color:#000000; border-style:solid;border-width:1px;cursor:hand\" value=\"zurück\" onClick=\"javascript:history.back();\"></td></td>
</tr>
</table>";
}
//########################################################################################
// Formular für die Abstimmung ###############################################################
if($show == "abstimmform")
{
echo "<form method=post>
<input type=hidden name=action value=vote>
<TABLE style=\"background-image:url(../images/bg_arena.gif);border-style:solid;border-width:1px;border-color:#000000\">\n";
echo "<TR>
<TR>
<td width=10> </td>
<td align=center><div style=\"font-family:Comic sans MS;font-size:10pt\"><b>Umfrage</div></td>
<td width=10> </td>
</TR><TR>
<td colspan=3 align=center><b><div style=\"font-family:Comic Sans MS;font-size:8pt;font-weight:bold\"><b> $frage </div></td>
</TR><TR>
<td> </td>
<TD align=center>
<table>\n";
for($wra=0;$wra<$anz_opts;$wra++)
{
$no = $wra+1;
$mglkt = explode("|",$readquery[$wra]);
echo "<tr>
<td><b><input type=radio style=\"background-image:url(../images/bg_arena.gif); border-style:solid;border-width:1px\" name=\"antwort\" value=\"$no\"> </td>
<td><b><div style=\"font-family:Comic Sans MS;font-size:8pt\">$mglkt[0]</div></td>\n</tr>";
}
echo "
</table></TD>
<td> </td>
<TR>
<td align=center colspan=3><b><input type=submit style=\"background-image:url(../images/bg_arena.gif) ;border-style:solid;border-width:1px;cursor:hand\" value=\"abstimmen\"></td></tr>
</TR>
</TABLE>
</form>";
}
//########################################################################################
?>