Seite 1 von 1
Frage wegen anderem Script
Verfasst: 27.05.2004 19:24
von Mutated!
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?
Verfasst: 27.05.2004 19:46
von Tuxman
Welches Script hast du denn...?
Verfasst: 27.05.2004 19:48
von Mutated!
eins von
www.klangwerk.at. Soll ich das script mal reinposten?
Verfasst: 28.05.2004 15:00
von Mutated!
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>";
}
//########################################################################################
?>
Verfasst: 28.05.2004 15:03
von Mutated!
Und ich möchte einen Link im "Forum für die Abstimmung" ganz unten haben, der zum "Formular für das Ergebnis" linkt.
Der 2. Link soll im Formular für das Ergebnis" ganz unten sein, der zum "Formular für die Abstimmung" verlinkt. Kannst du mir dabei helfen, diese 2 Links einzubauen?
Verfasst: 28.05.2004 20:10
von Mutated!
Hallo? Kann mir keiner helfen?