Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [LoveCMS] Gdzieś jest błąd, ale nie wiadomo gdzie...
Babcia@Stefa
post
Post #1





Grupa: Zarejestrowani
Postów: 654
Pomógł: 17
Dołączył: 19.03.2006
Skąd: z kosmosu ;)

Ostrzeżenie: (0%)
-----


Witam, mam problem z kodem który w Eval() wyrzuca błąd:

Cytat
Parse error: syntax error, unexpected T_VARIABLE in /var/www/www/private/lovecms/system/class/tpl.class.php(140) : eval()'d code on line 1


Wycinek kodu:

  1. <?php
  2. while(list($key,) = each(${$array_name}[$i]))
  3.                {
  4.                    if(${$array_name}[$i]['type'] == 'php')
  5.                    {
  6.                        if($key == 'content')
  7.                        {
  8.                            $foobar = stripslashes(${$array_name}[$i][$key]);
  9.                            echo '<h2>' .$foobar. '</h2>';
  10.                            ob_start();
  11.                            eval($foobar);
  12.                            $chronoz = ob_get_contents();
  13.                            ob_end_clean();
  14.                            $temp_code = str_replace($this -> start . $key . $this -> end, $chronoz, $temp_code);
  15.                        }
  16.                        else
  17.                        {
  18.                            $temp_code = str_replace($this -> start . $key . $this -> end, ${$array_name}[$i][$key], $temp_code);
  19.                        }
  20.                    }
  21.                    else
  22.                    {
  23.                        $temp_code = str_replace($this -> start . $key . $this -> end, stripslashes(${$array_name}[$i][$key]), $temp_code);
  24.                    }
  25.                }
  26. ?>


A tu kod który trafia do Eval():

  1. <?php
  2. $all_content = @mysql_query("SELECT * FROM " . DB_PREFIX . "content ORDER BY title ASC");
  3. print '<ul>';
  4. while($page = @mysql_fetch_assoc($all_content))
  5. {
  6. print '<li><a href="' . LOVE_URL . '/modules/content/?id=' . $page['id'] . '">' . stripslashes($page['title']) . '</a></li>';
  7. }
  8. print '</ul>';
  9. ?>


Oraz drugi który trafia do Eval():
  1. <?php
  2. $main = mysql_query("SELECT * FROM " . DB_PREFIX . "colmenu_mnu WHERE parent = '0' ORDER BY weight ASC");
  3. $rows = mysql_num_rows($main);
  4. if($rows > 0) {
  5.  
  6.    $mid = 0; // Used to determine the Active menu
  7.    $pid = 0; // Used to determine the Parent menu
  8.  
  9.    if( isset($_GET['mid']) ) {
  10.        $mid = intval($_GET['mid']);
  11.        if( isset($_GET['pid']) ) { $pid = intval($_GET['pid']); }
  12.    }
  13.  
  14.    print '<ul id="mainlevel">';
  15.    
  16.    while($foo = @mysql_fetch_assoc($main))    {
  17.  
  18.        print '<li><a href="' . LOVE_URL . $foo['link'] . '&mid=' . $foo['id'] .'&pid='. $foo['id'] . '" class="mainlevel" ';
  19.    
  20.        if( $mid == $foo['id'] ) { print 'id="active_menu"'; }
  21.  
  22.        print '>' . stripslashes($foo['name']) . '</a>';
  23.  
  24.        if( $pid == $foo['id'] ) {
  25.  
  26.            $bar = @mysql_query("SELECT * FROM " . DB_PREFIX . "colmenu_mnu WHERE parent = '" . $foo['id'] . "' ORDER BY weight ASC");
  27.            $whoda = mysql_num_rows($bar);
  28.  
  29.            if( $whoda > 0) {
  30.  
  31.                print '<ul>';
  32.                
  33.                while($subfoo = @mysql_fetch_assoc($bar)) {
  34.  
  35.                    print '<li><a href="' . LOVE_URL . $subfoo['link'] . '&mid=' . $subfoo['id'] . '&pid=' . $subfoo['parent'] . '" class="mainlevel" ';
  36.  
  37.                    if( $mid == $subfoo['id'] ) { print 'id="active_menu"'; }
  38.  
  39.                    print '>' . stripslashes($subfoo['name']) . '</a>';
  40.  
  41.                }
  42.    
  43.                print '</ul>';
  44.  
  45.            }
  46.        }
  47.    
  48.        print '</li>';
  49.    }
  50.    
  51.    print '</ul>';
  52. }
  53. else
  54. {
  55.    print 'No items.';
  56. }
  57. ?>


Nie mam zielonego pojęcia gdzie jest błąd, proszę o pomoc.
Kod jest z LoveCMS.

Pozdrawiam, WebNuLL

Ten post edytował erix 12.06.2009, 20:56:23
Powód edycji: [erix] przeniosłem
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 15:55