$ parse Error

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • $ parse Error

    Hallo,
    ich hab grad ne Fehlermeldung (ein Parse Error) in einer Datei aus nem phpBB Forum.

    Parse error: parse error, unexpected $ in /srv/www/htdocs/web0/html/forum/includes/prune.php on line 206

    Hier der Code aus der Datei:

    PHP-Code:
    <?php
    /***************************************************************************
    *                                 prune.php
    *                            -------------------
    *   begin                : Thursday, June 14, 2001
    *   copyright            : (C) 2001 The phpBB Group
    *   email                : [email]support@phpbb.com[/email]
    *
    *   $Id: prune.php,v 1.19.2.6 2003/03/18 23:23:57 acydburn Exp $
    *
    *
    ***************************************************************************/

    /***************************************************************************
     *
     *   This program 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.
     *
     ***************************************************************************/

    if ( !defined('IN_PHPBB') )
    {
       die(
    "Hacking attempt");
    }

    require(
    $phpbb_root_path 'includes/functions_search.'.$phpEx);

    function 
    prune($forum_id$prune_date$prune_all false)
    {
        global 
    $db$lang;

        
    $sql "SELECT *
            FROM " 
    PRUNE_TABLE "
            WHERE forum_id = 
    $forum_id";
        if ( !(
    $result $db->sql_query($sql)) )
        {
            
    message_die(GENERAL_ERROR'Could not read auto_prune table'''__LINE____FILE__$sql);
        }

        
    $row $db->sql_fetchrow($result);

        
    $prune_type = ( $prune_all ) ? PRUNE_DELETE $row['prune_type'];
        
    $move_to $row['move_to'];
        
    $prune_all = ($prune_all) ? '' 'AND t.topic_vote = 0 AND t.topic_type <> ' POST_ANNOUNCE;
        
    //
        // Those without polls and announcements ... unless told otherwise!
        //
        
    $sql "SELECT t.topic_id 
            FROM " 
    POSTS_TABLE " p, " TOPICS_TABLE " t
            WHERE t.forum_id = 
    $forum_id
                
    $prune_all 
                AND ( p.post_id = t.topic_last_post_id 
                    OR t.topic_last_post_id = 0 )"
    ;
        if ( 
    $prune_date != '' )
        {
            
    $sql .= " AND p.post_time < $prune_date";
        }

        if ( !(
    $result $db->sql_query($sql)) )
        {
            
    message_die(GENERAL_ERROR'Could not obtain lists of topics to prune'''__LINE____FILE__$sql);
        }

        
    $sql_topics '';
        while( 
    $row $db->sql_fetchrow($result) )
        {
            
    $sql_topics .= ( ( $sql_topics != '' ) ? ', ' '' ) . $row['topic_id'];
        }
        
    $db->sql_freeresult($result);
            
        if( 
    $sql_topics != '' )
        {
            if ( 
    $prune_type == PRUNE_MOVE || $prune_type == PRUNE_LOCK )
            {
                
    $move_sql = ( $prune_type == PRUNE_MOVE ) ? "forum_id = $move_to," '';

                
    $sql "UPDATE " TOPICS_TABLE "
                    SET 
    $move_sql topic_status = " TOPIC_LOCKED "
                    WHERE forum_id = 
    $forum_id
                        AND topic_id IN (
    $sql_topics)";
                if ( !
    $db->sql_query($sqlBEGIN_TRANSACTION) )
                {
                    
    message_die(GENERAL_ERROR'Could not move/lock topics during prune'''__LINE____FILE__$sql);
                }

                
    $pruned_topics $db->sql_affectedrows();
                
                if ( 
    $prune_type == PRUNE_MOVE )
                {
                    
    $sql "UPDATE " POSTS_TABLE "
                        SET forum_id = 
    $move_to
                        WHERE forum_id = 
    $forum_id
                            AND topic_id IN (
    $sql_topics)";
                    if ( !
    $db->sql_query($sqlBEGIN_TRANSACTION) )
                    {
                        
    message_die(GENERAL_ERROR'Could not move posts during prune'''__LINE____FILE__$sql);
                    }
                    
                    
    $pruned_posts $db->sql_affectedrows();
                    
                    
    sync('forum'$move_to);
                }
                
                return array (
    'topics' => $pruned_topics'posts' => $pruned_posts);
            }
            else
            {
                
    $sql "SELECT post_id
                    FROM " 
    POSTS_TABLE "
                    WHERE forum_id = 
    $forum_id
                        AND topic_id IN (
    $sql_topics)";
                if ( !(
    $result $db->sql_query($sql)) )
                {
                    
    message_die(GENERAL_ERROR'Could not obtain list of posts to prune'''__LINE____FILE__$sql);
                }
                
                
    $sql_post '';
                while ( 
    $row $db->sql_fetchrow($result) )
                {
                    
    $sql_post .= ( ( $sql_post != '' ) ? ', ' '' ) . $row['post_id'];
                }
                
    $db->sql_freeresult($result);

                if ( 
    $sql_post != '' )
                {
                    
    $sql "DELETE FROM " TOPICS_WATCH_TABLE "
                        WHERE topic_id IN (
    $sql_topics)";
                    if ( !
    $db->sql_query($sqlBEGIN_TRANSACTION) )
                    {
                        
    message_die(GENERAL_ERROR'Could not delete watched topics during prune'''__LINE____FILE__$sql);
                    }
                    
                    
    $sql "DELETE FROM " TOPICS_TABLE "
                        WHERE topic_id IN (
    $sql_topics)";
                    if ( !
    $db->sql_query($sql) )
                    {
                        
    message_die(GENERAL_ERROR'Could not delete topics during prune'''__LINE____FILE__$sql);
                    }

                            
    $pruned_topics $db->sql_affectedrows();

                            
    $sql "DELETE FROM " POSTS_TABLE "
                                WHERE post_id IN (
    $sql_post)";
                    if ( !
    $db->sql_query($sql) )
                    {
                        
    message_die(GENERAL_ERROR'Could not delete post_text during prune'''__LINE____FILE__$sql);
                    }

                    
    $pruned_posts $db->sql_affectedrows();
                    
                    
    $sql "DELETE FROM " POSTS_TEXT_TABLE "
                        WHERE post_id IN (
    $sql_post)";
                    if ( !
    $db->sql_query($sql) )
                    {
                        
    message_die(GENERAL_ERROR'Could not delete post during prune'''__LINE____FILE__$sql);
                    }

                    
    remove_search_post($sql_post);

                    return array (
    'topics' => $pruned_topics'posts' => $pruned_posts);
                }
    }

    //
    // Function auto_prune(), this function will read the configuration data from
    // the auto_prune table and call the prune function with the necessary info.
    //
    function auto_prune($forum_id 0)
    {
        global 
    $db$lang;

        
    $sql "SELECT *
            FROM " 
    PRUNE_TABLE "
            WHERE forum_id = 
    $forum_id";
        if ( !(
    $result $db->sql_query($sql)) )
        {
            
    message_die(GENERAL_ERROR'Could not read auto_prune table'''__LINE____FILE__$sql);
        }

        if ( 
    $row $db->sql_fetchrow($result) )
        {
            if ( 
    $row['prune_freq'] && $row['prune_days'] )
            {
                
    $prune_date time() - ( $row['prune_days'] * 86400 );
                
    $next_prune time() + ( $row['prune_freq'] * 86400 );

                
    prune($forum_id$prune_date);
                
    sync('forum'$forum_id);

                
    $sql "UPDATE " FORUMS_TABLE 
                    SET prune_next = 
    $next_prune 
                    WHERE forum_id = 
    $forum_id";
                if ( !
    $db->sql_query($sql) )
                {
                    
    message_die(GENERAL_ERROR'Could not update forum table'''__LINE____FILE__$sql);
                }
            }
        }

        return;
    }


    ?>
    Kann mir da jemand weiterhelfen?
    Schönen Dank

  • #2
    Poste die relevanten Codestellen (Zeile der Fehlermeldung +- 10 Zeilen)

    Gruss

    tobi
    Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

    [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
    Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

    Kommentar


    • #3
      lade die daten erneut herunter oder wende dich an die hersteller.
      mit so einem kinderkram wird dir wohl kaum geholfen.

      Kommentar


      • #4
        penizilin? Bitte was ? warum das denn?

        205 ist die letzte Zeile.

        Also hier:

        PHP-Code:
                if ( $row['prune_freq'] && $row['prune_days'] )
                {
                    
        $prune_date time() - ( $row['prune_days'] * 86400 );
                    
        $next_prune time() + ( $row['prune_freq'] * 86400 );

                    
        prune($forum_id$prune_date);
                    
        sync('forum'$forum_id);

                    
        $sql "UPDATE " FORUMS_TABLE 
                        SET prune_next = 
        $next_prune 
                        WHERE forum_id = 
        $forum_id";
                    if ( !
        $db->sql_query($sql) )
                    {
                        
        message_die(GENERAL_ERROR'Could not update forum table'''__LINE____FILE__$sql);
                    }
                }
            }

            return;
        }


        ?> 

        Kommentar


        • #5
          Zieh dir lieber gleich die neue Version.
          http://www.phpbb.com/phpBB/viewtopic.php?f=14&t=352966

          Kommentar


          • #6
            Also wenn ich deine }-Klammern zähle würde ich, ohne den Rest des Codes zu sehen vermuten, dass du eine } zuviel hast.
            PHP-Code:
            if ( $row['prune_freq'] && $row['prune_days'] )
                    {
                        
            $prune_date time() - ( $row['prune_days'] * 86400 );
                        
            $next_prune time() + ( $row['prune_freq'] * 86400 );

                        
            prune($forum_id$prune_date);
                        
            sync('forum'$forum_id);

                        
            $sql "UPDATE " FORUMS_TABLE 
                            SET prune_next = 
            $next_prune 
                            WHERE forum_id = 
            $forum_id";
                        if ( !
            $db->sql_query($sql) )
                        {
                            
            message_die(GENERAL_ERROR'Could not update forum table'''__LINE____FILE__$sql);
                        }
                    }
                    
            //die Klammer hier hätte das if bereits geschlossen
                
            return;

            Ansonsten wirklich mal auf der Page des Herstellers schauen und ggf neue Version herunterladen.

            Gruss

            tobi

            EDIT:

            Habe es gerade gesehen, die Klammer ist schon richtig. Schliesst ja das if und die letzte } die Funktion.

            Zuletzt geändert von jahlives; 02.01.2006, 12:20.
            Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

            [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
            Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

            Kommentar


            • #7
              Jetzt habe ich es ev gefunden.
              PHP-Code:
              if( $sql_topics != '' )
                  {
                      if ( 
              $prune_type == PRUNE_MOVE || $prune_type == PRUNE_LOCK )
                      {
                          
              $move_sql = ( $prune_type == PRUNE_MOVE ) ? "forum_id = $move_to," '';

                          
              $sql "UPDATE " TOPICS_TABLE "
                              SET 
              $move_sql topic_status = " TOPIC_LOCKED "
                              WHERE forum_id = 
              $forum_id
                                  AND topic_id IN (
              $sql_topics)";
                          if ( !
              $db->sql_query($sqlBEGIN_TRANSACTION) )
                          {
                              
              message_die(GENERAL_ERROR'Could not move/lock topics during prune'''__LINE____FILE__$sql);
                          }

                          
              $pruned_topics $db->sql_affectedrows();
                          
                          if ( 
              $prune_type == PRUNE_MOVE )
                          {
                              
              $sql "UPDATE " POSTS_TABLE "
                                  SET forum_id = 
              $move_to
                                  WHERE forum_id = 
              $forum_id
                                      AND topic_id IN (
              $sql_topics)";
                              if ( !
              $db->sql_query($sqlBEGIN_TRANSACTION) )
                              {
                                  
              message_die(GENERAL_ERROR'Could not move posts during prune'''__LINE____FILE__$sql);
                              }
                              
                              
              $pruned_posts $db->sql_affectedrows();
                              
                              
              sync('forum'$move_to);
                          }
                          
                          return array (
              'topics' => $pruned_topics'posts' => $pruned_posts);
                      }
                      else
                      {
                          
              $sql "SELECT post_id
                              FROM " 
              POSTS_TABLE "
                              WHERE forum_id = 
              $forum_id
                                  AND topic_id IN (
              $sql_topics)";
                          if ( !(
              $result $db->sql_query($sql)) )
                          {
                              
              message_die(GENERAL_ERROR'Could not obtain list of posts to prune'''__LINE____FILE__$sql);
                          }
                          
                          
              $sql_post '';
                          while ( 
              $row $db->sql_fetchrow($result) )
                          {
                              
              $sql_post .= ( ( $sql_post != '' ) ? ', ' '' ) . $row['post_id'];
                          }
                          
              $db->sql_freeresult($result);

                          if ( 
              $sql_post != '' )
                          {
                              
              $sql "DELETE FROM " TOPICS_WATCH_TABLE "
                                  WHERE topic_id IN (
              $sql_topics)";
                              if ( !
              $db->sql_query($sqlBEGIN_TRANSACTION) )
                              {
                                  
              message_die(GENERAL_ERROR'Could not delete watched topics during prune'''__LINE____FILE__$sql);
                              }
                              
                              
              $sql "DELETE FROM " TOPICS_TABLE "
                                  WHERE topic_id IN (
              $sql_topics)";
                              if ( !
              $db->sql_query($sql) )
                              {
                                  
              message_die(GENERAL_ERROR'Could not delete topics during prune'''__LINE____FILE__$sql);
                              }

                                      
              $pruned_topics $db->sql_affectedrows();

                                      
              $sql "DELETE FROM " POSTS_TABLE "
                                          WHERE post_id IN (
              $sql_post)";
                              if ( !
              $db->sql_query($sql) )
                              {
                                  
              message_die(GENERAL_ERROR'Could not delete post_text during prune'''__LINE____FILE__$sql);
                              }

                              
              $pruned_posts $db->sql_affectedrows();
                              
                              
              $sql "DELETE FROM " POSTS_TEXT_TABLE "
                                  WHERE post_id IN (
              $sql_post)";
                              if ( !
              $db->sql_query($sql) )
                              {
                                  
              message_die(GENERAL_ERROR'Could not delete post during prune'''__LINE____FILE__$sql);
                              }

                              
              remove_search_post($sql_post);

                              return array (
              'topics' => $pruned_topics'posts' => $pruned_posts);
                          }
                      } 
              // offenes if  if( $sql_topics != '' )
                  
              //offenes else
              // schliesst die Fkt 
              Hoffe das hilft Dir.

              Gruss

              tobi
              Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

              [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
              Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

              Kommentar


              • #8
                Danke jahlives, hast mir sehr geholfen

                => close

                Kommentar


                • #9
                  Mit einer vernünftigen Entwicklungsumgebung hätte dir der Fehler auffallen sollen z.B. hätte dir Zend auf der Seite einen roten Strich angezeigt (kostet allerdings 99 Dollar).

                  Also vllt mal etwas investieren, damit soclhe Probs in Zukunft der Vergangenheit angehören.

                  Gruss

                  tobi
                  Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

                  [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
                  Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

                  Kommentar


                  • #10
                    Eclipse kostet 99$ weniger und kann das auch.

                    Kommentar

                    Lädt...
                    X