Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Keine Aktion gewählt"
#1
Hallo,

ich möchte mr selber eine Aktion "Belagern" machen. Jetzt müsste er ja beim drücken von "Belagern" auf die nächste Seite gehen. Das ist aber nicht so. Es kommt nur die Fehlermeldung:
"Keine Aktion gewählt".
Kann mir einer erklären wieso das so ist?

Reply
#2
zeig mal den code.

Reply
#3
game_place_command.tpl
Code:
{if !empty($error)}
    <div style="color:red; font-size:large">{$error}</div>
{/if}

<h3>Befehle erteilen</h3>

<form name="units" action="game.php?village={$village.id}&amp;screen=place&amp;try=confirm" method="post">
    <table>
        <tr>
            {assign var=counter value=0}
            {foreach from=$group_units key=group_name item=value}
                <td width="150" valign="top">
                    <table class="vis" width="100%">
                        {foreach from=$group_units.$group_name item=dbname}
                            {* Counter um 1 erhöhren für den Tab für die Input Felder *}
                            {math assign=counter equation="x + y" x=$counter y=1}
                            <tr>
                                <td>
                                    <a href="javascript:popup('popup_unit.php?unit={$dbname}', 520, 520)"><img src="graphic/unit/{$dbname}.png" title="{$cl_units->get_name($dbname)}" alt="" /></a> <input name="{$dbname}" type="text" size="5" tabindex="{$counter}" value="{$values.$dbname}" /> <a href="javascript:insertUnit(document.forms[0].{$dbname}, {$units.$dbname})">({$units.$dbname})</a>
                                </td>
                            </tr>
                        {/foreach}
                    </table>
                </td>
            {/foreach}
        </tr>
    </table>
    
    <table>
        <tr>
            <td rowspan="2">
                x: <input type="text" name="x" value="{$values.x}" size="5" />
                y: <input type="text" name="y" value="{$values.y}" size="5" />
            </td>
            <td valign="top"></td>
            <td valign="top"></td>
            <td rowspan="2"><input class="attack" name="attack" type="submit" value="Angreifen" style="font-size: 10pt;" /></td>
            <td rowspan="2"><input class="support" name="support" type="submit" value="Unterstützen" style="font-size: 10pt;" /></td>
      <td rowspan="2"><input class="beleaguer" name="beleaguer" type="submit" value="Belagern" style="font-size: 10pt;" /></td>
        </tr>
    </table>
</form>

<h3>Truppenbewegungen</h3>
{* Eigene losgeschickte Angriffe *}
{if count($my_movements)>0}
<table class="vis">
    <tr>
        <th width="250">Deine Truppen</th>
        <th width="160">Ankunft</th>
        <th width="80">Ankunft in</th>
    </tr>
    {foreach from=$my_movements item=array}
        <tr>
            <td>
                <a href="game.php?village={$village.id}&amp;screen=info_command&amp;id={$array.id}&amp;type=own">
                <img src="graphic/command/{$array.type}.png"> {$array.message}
                </a>
            </td>
            <td>{$array.end_time|format_date}</td>
            {if $array.arrival_in<0}
                <td>{$array.arrival_in|format_time}</td>
            {else}
                <td><span class="timer">{$array.arrival_in|format_time}</span></td>
            {/if}
            {if $array.can_cancel}
                <td><a href="game.php?village={$village.id}&amp;screen=place&amp;action=cancel&amp;id={$array.id}&amp;h={$hkey}">abbrechen</a></td>
            {/if}
        </tr>
    {/foreach}
</table>
{/if}


{* Andere Angriffe auf das aktuelle Dorf *}
{if count($other_movements)>0}
<table class="vis">
    <tr>
        <th width="250">Ankommende Truppen</th>
        <th width="160">Ankunft</th>
        <th width="80">Ankunft in</th>
    </tr>
    {foreach from=$other_movements item=array}
        <tr>
            <td>
                <a href="game.php?village={$village.id}&amp;screen=info_command&amp;id={$array.id}&amp;type=other">
                <img src="graphic/command/{$array.type}.png"> {$array.message}
                </a>
            </td>
            <td>{$array.end_time|format_date}</td>
            {if $array.arrival_in<0}
                <td>{$array.arrival_in|format_time}</td>
            {else}
                <td><span class="timer">{$array.arrival_in|format_time}</span></td>
            {/if}
        </tr>
    {/foreach}
</table>
{/if}
game_place_confirm.tpl:
Code:
{if $type=="attack"}
    <h2>Angriff</h2>
{elseif $type=="support"}
    <h2>Unterstützung</h2>
{else}
  <h2>Belagerung</h2>  
{/if}

<form action="game.php?village={$village.id}&amp;screen=place&amp;action=command&amp;h={$hkey}" method="post" onSubmit="this.submit.disabled=true;">
    <input type="hidden" name="{$type}" value="true">
    <input type="hidden" name="x" value="{$values.x}">
    <input type="hidden" name="y" value="{$values.y}">
    
    <table class="vis" width="300">
        <tr><th colspan="2">Befehl</th></tr>
        <tr><td>Ziel:</td><td><a href="game.php?village={$village.id}&amp;screen=info_village&amp;id={$info_village.id}">{$info_village.name} ({$values.x}|{$values.y}) K{$info_village.continent}</a></td></tr>
        <tr><td>Spieler:</td><td><a href="game.php?village={$village.id}&amp;screen=info_player&amp;id={$info_village.userid}">{$info_user.username}</a></td></tr>
        <tr><td>Dauer:</td><td>{$unit_runtime|format_time}</td></tr>
        <tr><td>Ankunft:</td><td>{$arrival|format_date}</td></tr>
    </table>
    <br>
    <table class="vis">
        <tr>
            {foreach from=$cl_units->get_array("dbname") item=dbname key=name}
                <th width="50"><img src="graphic/unit/{$dbname}.png" title="{$name}" alt="" /></th>
            {/foreach}
        </tr>
        <tr>
            {foreach from=$cl_units->get_array("dbname") item=dbname key=name}
                {if $send_units.$dbname>0}
                    <td>{$send_units.$dbname}</td>
                {else}
                    <td class="hidden">0</td>
                {/if}
            {/foreach}
        </tr>
    </table>
    <br />
    {foreach from=$cl_units->get_array("dbname") item=dbname key=name}
        <input type="hidden" name="{$dbname}" value="{$send_units.$dbname}">
    {/foreach}
    {* Falls auch Katapulte ausgewählt wurde *}
    {if $send_units.unit_catapult>0 && $type!='support'}
        <table class="vis">
            <tr>
                <th>Gebäude angreifen:</th>
                <td>
                    <select name="building" size="1">
                        {foreach from=$cl_builds->get_array("dbname") item=dbname key=id}
                            {if !in_array("catapult_protection", $cl_builds->get_specials($dbname))}
                                <option label="{$cl_builds->get_name($dbname)}" value="{$dbname}">{$cl_builds->get_name($dbname)}</option>
                            {/if}
                        {/foreach}
                    </select>
                </td>
            </tr>
        </table>
    {/if}
  {if $type=="beleaguer"}
    {if $send_units.unit_catapult=0 OR $send_units.unit_ram=0}
    Bitte Rammbock und/oder Katapult auswählen <a href="game.php?village={village.id}&screen=place">zurück</a>
    {/if}
  {/if}
    <br />
    <input name="submit" type="submit" onload="this.disabled=false;" value="OK" style="font-size: 10pt;">
</form>
Ich weiß, game_place_confirm ist noch nicht fertig, aber ich habe die Tests ohne Rammbock/Katapult gemacht.

Reply
#4
Soweit ich mich erinnere wird die $type variable vom PHP-Code auf gültigkeit überprüft.
Reply
#5
Und wo wird das gemacht?

Reply
#6
In einem verschlüsseltem Teil ;-)
Reply




Users browsing this thread: 3 Guest(s)