Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Parse error: syntax error
Gman
post 7.07.2013, 21:36:14
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 29.06.2013

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


Błąd: Parse error: syntax error, unexpected '$image' (T_VARIABLE) on line 5

  1. else if ( ini_get( "allow_url_fopen" ) == 1 )
  2. {
  3. if ( !copy( $thumbnail_link, $upload_path.$thumb_name ) )
  4. {
  5. list( $img_width, $img_height, $img_type, $img_attr ) = image $image = "";
  6. switch ( $img_type )
  7. {
  8. case 1 :
  9. $image = imagecreatefromgif( $thumbnail_link );
  10. $ext = ".gif";
  11. break;
  12. case 2 :
  13. $image = imagecreatefromjpeg( $thumbnail_link );
  14. $ext = ".jpg";
  15. break;
  16. case 3 :
  17. $image = imagecreatefrompng( $thumbnail_link );
  18. $ext = ".png";
  19. }
  20. $resource = @imagecreatetruecolor( $img_width, $img_height );
  21. if ( function_exists( "imageantialias" ) )
  22. {
  23. @imageantialias( $resource, true );
  24. }
  25. @imagecopyresampled( $resource, $image, 0, 0, 0, 0, $img_width, $img_height, $img_width, $img_height );
  26. @imagedestroy( $image );
  27. }
  28. $thumb_name = $video_uniq_id."-1".$ext;
  29. $img_type = 2;
  30. default :
  31. switch ( $img_type )
  32. {
  33. case 1 :
  34. @imagegif( $resource, $upload_path.$thumb_name );
  35. break;
  36. case 2 :
  37. @imagejpeg( $resource, $upload_path.$thumb_name );
  38. break;
  39. case 3 :
  40. }
  41. @imagepng( $resource, $upload_path.$thumb_name );
  42. break;
  43. if ( $resource === "" )
  44. {
  45. $error = 1;
  46. }
  47. }
  48. return $upload_path.$thumb_name;
  49.  
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 12)
--AmbitnyCzłowiek--
post 7.07.2013, 23:45:21
Post #2





Goście







  1. list( $img_width, $img_height, $img_type, $img_attr ) = image $image = "";

nie powinno być
  1. $image = list( $img_width, $img_height, $img_type, $img_attr )

aczkolwiek pewny nie jestem, spróbować możesz
Go to the top of the page
+Quote Post
--AmbitnyCzłowiek--
post 7.07.2013, 23:48:35
Post #3





Goście







to znaczy
  1. list( $img_width, $img_height, $img_type, $img_attr ) = $image ;

przepraszam za pomyłke
Go to the top of the page
+Quote Post
Gman
post 10.07.2013, 15:44:38
Post #4





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 29.06.2013

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


Nie musisz przepraszać, to ja dziękuję za zainteresowanie tematem. smile.gif

Zmieniłem linijkę tak jak poradziłeś i teraz wyskoczył kolejny błąd:
Parse error: syntax error, unexpected 'default' (T_DEFAULT) on line 30
Go to the top of the page
+Quote Post
nospor
post 10.07.2013, 15:50:29
Post #5





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Toz masz jak wol napisane, ze nie spodziewaja sie tam DEFAUTL. CZego nie rozumiesz?


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
Gman
post 10.07.2013, 15:56:46
Post #6





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 29.06.2013

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


Rozumiem co oznacza ten błąd, ale nie wiem co poprawić w kodzie aby to działało. smile.gif
Go to the top of the page
+Quote Post
nospor
post 10.07.2013, 15:58:56
Post #7





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




facepalmxd.gif
Skoro tego DEFGAULT sie tam nie spodziewali to go poprostu wywal

default : - ta linijka ma w magiczny sposob zniknac ....


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
Gman
post 10.07.2013, 16:14:40
Post #8





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 29.06.2013

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


Po usunięciu fragmentu default otrzymuję błąd w innej funkcji.
Fatal error: Call-time pass-by-reference has been removed on line 6

Kod
function do_main( &$video_details, $url, $show_warnings = true )
{
    $video_data = get_info( $url );
    if ( $video_data != false )
    {
        video_details( $video_data, $url, &$video_details );
    }
    else
    {
        if ( $show_warnings && $xml_error_msg != "" )
        {
            echo "<div class=\"info_msg_err\">".$xml_error_msg."</div>";
        }
        $video_details = array( );
    }
}
Go to the top of the page
+Quote Post
nospor
post 10.07.2013, 16:16:25
Post #9





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Ty pisales ten kod? Ktos ci go dal? Wywal &


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
Gman
post 15.07.2013, 18:55:40
Post #10





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 29.06.2013

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


Skrypt kupiłem prywatnie, co się później okazało, że jest zakodowany przez IonCube 7. Postanowiłem go odkodować i to zapewne jest przyczyną rozsypanego kodu.

Usunąłem & w parametrach funkcji. Problem dalej następuje.

sad.gif

sad.gif

Jakieś sugestie?
Go to the top of the page
+Quote Post
samouk
post 15.07.2013, 19:00:23
Post #11





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 15.07.2013

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


a gdzie masz teraz i jaki błąd?
Go to the top of the page
+Quote Post
Gman
post 24.07.2013, 00:27:56
Post #12





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 29.06.2013

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


syntax error, unexpected '$image' (T_VARIABLE) on line 5

W tej linijce czegoś brakuje.
Go to the top of the page
+Quote Post
valkirek
post 24.07.2013, 13:20:25
Post #13





Grupa: Zarejestrowani
Postów: 117
Pomógł: 6
Dołączył: 24.07.2013

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


Tak to jest jak sie kupuje skrypty za 10 zlotych:D

masz blad tutaj:
  1. list( $img_width, $img_height, $img_type, $img_attr ) = image

?

Przeciez jak byk widac, ze brakuje srednika na koncu...

I tez sie zastanawiam czy "image" jest zdefiniowana czy jest to po prostu zmienna i powinno byc = $image;
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 15:50