Antwort
 
LinkBack Themen-Optionen Thema bewerten Ansicht
  #1  
Alt 30.05.08, 13:27
Forum Newbie
 
Registriert seit: 26.05.08
Alter: 18
Beiträge: 28

[plzHelp]POST Variablen... Wenn Hide dann ok, wenn Unhide dann NICHTS


Hallo @ll,
jetzt dachte ich mein Plugin ist V 1.2.7 das sollte also reichen....

Jetzt stelle ich die Seite, die das Plugin beinhaltet, auf "unhide" und schon klappt nichts mehr.

Es handelt sich um einen Minimal-Taschenrechner mit Funktionen Plus, Minus, Mal, Geteilt und Zins-rechnung...
Das ganze arbeitet mit POST-Variablen und x-Forms die per for-schleife generiert werden...
POST weil das einfach zum Demonstrieren der Variabilität von T3 dienen soll.

Jetzt ist meine Frage, wieso funktioniert mein Plugin wenn das gesammte HIDE ist, aber wenn es UNHIDE ist nicht mehr?

PHP-Code:
<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2008 Oliver Lippert <oliver.lippert@david-bs.de>
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

require_once(PATH_tslib.'class.tslib_pibase.php');


/**
 * Plugin 'Small Calculator' for the 'ol_calculator' extension.
 *
 * @author    Oliver Lippert <oliver.lippert@david-bs.de>
 * @package    TYPO3
 * @subpackage    tx_olcalculator
 */
class tx_olcalculator_pi1 extends tslib_pibase {
    var 
$prefixId      'tx_olcalculator_pi1';        // Same as class name
    
var $scriptRelPath 'pi1/class.tx_olcalculator_pi1.php';    // Path to this script relative to the extension dir.
    
var $extKey        'ol_calculator';    // The extension key.
    
var $pi_checkCHash true;
    
    
/**
     * The main method of the PlugIn
     *
     * @param    string        $content: The PlugIn content
     * @param    array        $conf: The PlugIn configuration
     * @return    The content that is displayed on the website
     */
    
function main($content,$conf)    {
        
$this->conf=$conf;
        
$this->pi_setPiVarDefaults();
        
$this->pi_loadLL();
        
    
        if( !isset(
$_POST['zahl']) )
            
$aktZahl 0;
        else
              
$aktZahl $_POST['zahl'];
         
         if( !isset(
$_POST['zahl2']) )
            
$zahl2 0;
        else
              
$zahl2 $_POST['zahl2'];
         
         if( !isset(
$_POST['nextAkt']) )
            
$nextAkt "+";
        else
              
$nextAkt $_POST['nextAkt'];
         
         if( 
"reset" == $_POST['zahl2'] )
         {
            
$aktZahl 0;
            
$zahl2 0;
            
$nextAkt "+";
        }
          if( isset(
$_POST['wahl']) )
              
//taste wurde gedrückt
          
{
            if( 
false != strchr"0123456789"$_POST['wahl'] ) /* 0 < count( explode( $_POST['wahl'], "0123456789" ) )*/ )
            {
                
$aktZahl $aktZahl*10+$_POST['wahl'];
                
$aktZahl "hier";
            }
            else if( 
"=" != $_POST['wahl'] )
                
//'-' wurde gedrückt
            
{
                 
$aktZahl "hier";
                if( 
$zahl2 != )
                    
//    
                     
$zahl2 $this->calculate$nextAkt$aktZahl$zahl2 );
                else
                    
//erste operatorwahl
                    
$zahl2 $_POST['zahl']; //zahl in Hidden-Fenster übertragen
                    
                
$aktZahl 0;//aktuelle zahl löschen
                
$nextAkt $_POST['wahl']; //nächste aktion ist $_POST['wahl']    
            
}
            else
                
//ergebnis anzeigen
            
{
                 
$aktZahl "hier";
                
$aktZahl $this->calculate$nextAkt$aktZahl$zahl2 );
                
                
$aktZahl round$aktZahl);
                
$zahl2 0;
                 
$nextAkt "+";
                 
                 
$zahl2 "reset";
            }
            
        }
        
        
$content .= '<form action="'$this->cObj->currentPageUrl() .'" method="POST">
                        <input type="hidden" value="'
.$aktZahl.'" name="zahl">
                        <input type="hidden" value="'
.$zahl2.'" name="zahl2">
                        <input type="hidden" value="'
.$nextAkt.'" name="nextAkt">
                        <input type="hidden" value="=" name="wahl">
                        <input type="submit" value="=" name="=" style="width:30px;height:170px;margin:0px;padding:0px;float:left;">
                    </form>
                    <input type="text" value="'
.$aktZahl.'" name="zahl" style="width: 90px;margin-top: 1px;">';
        
        
$alpha "123456789-0+*/‰";
        
        for( 
$i 0$i 15$i++ )
        {
            
$content .= '<form action="'$this->cObj->currentPageUrl() .'" method="POST">
                        <input type="hidden" value="'
.$aktZahl.'" name="zahl">
                        <input type="hidden" value="'
.$zahl2.'" name="zahl2">
                        <input type="hidden" value="'
.$nextAkt.'" name="nextAkt">
                        <input type="hidden" value="'
.$alpha[$i].'" name="wahl">
                        <input type="submit" value="'
.$alpha[$i].'" name="'.$alpha[$i].'" class="tx_calculator_button">
                    </form>'
;
            
            
//if( user_functions->modulo( $i, 3 ) == 0 )
            
if( $i != 14 && ($i+1)%== )
                
$content .= '<br /><br />';
            if( 
$i == )
                
$content .= '<br />';
        }
        
//Inoff-Version: 1.08.28
        
$content .= '<br /><br /><p class="version">Version: 1.02.07<br/>&copy; \'08 DAVID GmbH</p>';
    
        return 
$this->pi_wrapInBaseClass($content);
    }
    
    function 
calculate$nextAkt$aktZahl$zahl2 )
    {
        if( 
$nextAkt == "-" )
            
//wenn die letztgewählte aktion '-' war
            
$aktZahl $zahl2 $aktZahl
        else if( 
$nextAkt == "+" )
            
//wenn die letztgewählte aktion '+' war
            
$aktZahl $zahl2 $aktZahl
        else if( 
$nextAkt == "*" )
            
//wenn die letztgewählte aktion '*' war
            
$aktZahl $zahl2 $aktZahl
        else if( 
$nextAkt == "/" )
            
//wenn die letztgewählte aktion '/' war
            
$aktZahl $zahl2 $aktZahl;
        else if( 
$nextAkt == "‰" )
            
//wenn die letztgewählte aktion 'Zinsen' war
        
{
            
$einProz $zahl2 100;
            
            
$aktZahl $einProz $aktZahl;
        }
        
        return 
$aktZahl;
    }
}



if (
defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/ol_calculator/pi1/class.tx_olcalculator_pi1.php'])    {
    include_once(
$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/ol_calculator/pi1/class.tx_olcalculator_pi1.php']);
}

?>
Danke für jede antwort, es drängt nich... Ich mach wochenende
__________________
Das Pferd gab es schon immer und so wird es auch bleiben,das Auto ist nur eine vorübergehende Modeerscheinung || Früher war alles noch besser, ich mein: bei den Lochkarten hatte man wenigstens noch den durchblick
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #2  
Alt 02.06.08, 07:19
Forum Newbie
 
Registriert seit: 26.05.08
Alter: 18
Beiträge: 28

Oh... das ist ja echt ma was, da schauen ja sogar die geeks komisch wa?

Oder habe ich mich einfach falsch ausgedrückt...

Über die Suche habe ich nichts gefunden, und Internetseiten wo sowas stehen könnte wüsst ich auch nicht...
Was könnt ich sons noch falsch machen :?
__________________
Das Pferd gab es schon immer und so wird es auch bleiben,das Auto ist nur eine vorübergehende Modeerscheinung || Früher war alles noch besser, ich mein: bei den Lochkarten hatte man wenigstens noch den durchblick
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #3  
Alt 04.06.08, 09:15
Forum Newbie
 
Registriert seit: 26.05.08
Alter: 18
Beiträge: 28

Naja dann kann ich das Thema wohl abschreiben :sad:
__________________
Das Pferd gab es schon immer und so wird es auch bleiben,das Auto ist nur eine vorübergehende Modeerscheinung || Früher war alles noch besser, ich mein: bei den Lochkarten hatte man wenigstens noch den durchblick
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #4  
Alt 04.06.08, 10:22
Forum Stammgast
 
Registriert seit: 13.05.06
Alter: 31
Beiträge: 286

Das Problem könnte damit zusammenhängen, dass du eine "cachebare" Extension erstellt hast. Wenn man aber POST-Variablen verarbeiten will, wäre es besser, mit einem USER_INT - Plugin zu arbeiten, sonst können komische Effekte auftreten. Dieses könnte auch der Grund sein, warum es bei einer versteckten Seite funktioniert (ich vermute mal, dass diese nicht gecached werden) und bei einer sichtbaren Seite nicht.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Gelöst NewLoginBox: Wenn nicht eingeloggt dann... cyRus-tC Alle anderen Extensions 0 23.01.08 17:40
Link nur dann einblenden, wenn Inhalt befüllt ist Mister Fu TYPO3 4.x Fragen und Probleme 0 12.12.07 09:18
Wenn PIDiR dann Ausgabe des Navtitels cyRus-tC TYPO3 4.x Fragen und Probleme 4 18.06.07 17:17
Wenn Menüpunkt aktiv dann andere ausblenden d_mahony TYPO3 4.x Fragen und Probleme 3 12.01.07 12:54
Wenn Seite X dann Text Y cyRus-tC TYPO3 4.x Fragen und Probleme 4 06.01.07 20:47


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:10 Uhr.


Powered by vBulletin® Version 3.7.3 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0