SELFPHP: Version 5.8.2 Befehlsreferenz - Tutorial – Kochbuch – Forum für PHP Einsteiger und professionelle Entwickler

SELFPHP


Professional CronJob-Service

Suche



CronJob-Service    
bei SELFPHP mit ...



 + minütlichen Aufrufen
 + eigenem Crontab Eintrag
 + unbegrenzten CronJobs
 + Statistiken
 + Beispielaufrufen
 + Control-Bereich

Führen Sie mit den CronJobs von SELFPHP zeitgesteuert Programme auf Ihrem Server aus. Weitere Infos



:: Buchempfehlung ::

Fortgeschrittene CSS-Techniken

Fortgeschrittene CSS-Techniken zur Buchempfehlung
 

:: Anbieterverzeichnis ::

Globale Branchen

Informieren Sie sich über ausgewählte Unternehmen im Anbieterverzeichnis von SELFPHP  

 

:: Newsletter ::

Abonnieren Sie hier den kostenlosen SELFPHP Newsletter!

Vorname: 
Name:
E-Mail:
 
 

Zurück   PHP Forum > SELFPHP > PHP für Fortgeschrittene und Experten
Hilfe Community Kalender Heutige Beiträge Suchen

PHP für Fortgeschrittene und Experten Fortgeschrittene und Experten können hier über ihre Probleme und Bedenken talken

Antwort
 
Themen-Optionen Ansicht
  #1  
Alt 30.06.2006, 20:35:50
Benutzerbild von Michael17
Michael17 Michael17 ist offline
Anfänger
 
Registriert seit: Mar 2004
Ort: Tirol
Alter: 38
Beiträge: 102
Warum bekomm ich online diese Fehlermeldung?

Hallo Leute:

online krieg ich diese Fehlermeldung:
PHP-Code:
Parse errorparse errorexpecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /home/sites/site299/web/relaunch/modules/gallery_admin/fotoeditor/class.WMThumbnail.inc.php on line 51

Fatal error: Cannot instantiate non-existent class: wmthumbnail in /home/sites/site299/web/relaunch/modules/gallery_admin/fotoeditor/add_logo.php on line 37 
der fatal error ist mir klar. er erzeugt die klasse ja nicht mehr weiter.
aber warum haut es local hin und online nicht??

hier mal der code:
PHP-Code:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
//+----------------------------------------------------------------------+
//| WAMP (XP-SP1/1.3.29/4.1.1/5.0.0RC1)                                  |
//+----------------------------------------------------------------------+
//| Copyright (c) 1992-2004 Michael Wimmer                               |
//+----------------------------------------------------------------------+
//| I don't have the time to read through all the licences to find out   |
//| what the exactly say. But it's simple. It's free for non commercial  |
//| projects, but as soon as you make money with it, i want my share :-) |
//| (License : Free for non-commercial use)                              |
//+----------------------------------------------------------------------+
//| Authors: Michael Wimmer <flaimo 'at' gmx 'dot' net>                  |
//+----------------------------------------------------------------------+
//
// $Id$

/**
* include base class
*/
require_once 'class.CachedThumbnail.inc.php';

/**
* @package Thumbnail
*/
/**
* Creates a thumbnail from a source image, put a watermark/logo on it and caches it for a given time
*
* Tested with Apache 1.3.29 and PHP 5.0.0RC1
* Last change: 2004-03-25
*
* @access public
* @author Michael Wimmer <flaimo 'at' gmx 'dot' net>
* @copyright Michael Wimmer
* @link http://www.flaimo.com/
* @package Thumbnail
* @example sample_thumb.php Sample script
* @version 2.000
*/
class WMThumbnail extends CachedThumbnail {

    
/*-------------------*/
    /* V A R I A B L E S */
    /*-------------------*/

    /**
    * path/filename of logo / watermark
    *
    * @var string
    */
    
protected $wm_image_path;

    
/**
    * @var resource
    */
    
protected $wm_image;

    
/**
    * @var int
    */
    
protected $wm_image_height;

    
/**
    * @var int
    */
    
protected $wm_image_width;

    
/**
    * image format of logo
    *
    * @var int
    */
    
protected $wm_image_type;

    
/**
    * holds all logos/watermarks
    *
    * @var array
    */
    
protected $logos = array();


    
/*-----------------------*/
    /* C O N S T R U C T O R */
    /*-----------------------*/

    /**
    * Constructor
    *
    * @param string $file  path/filename of picture
    * @param int $seconds  amount of seconds thumbs should be cached. 0 = no cache
    * @return void
    * @uses CachedThumbnail::CachedThumbnail()
    * @uses $wm_image_path
    */
    
function __construct($file ''$seconds 0) {
          
parent::__construct($file$seconds);
    } 
// end constructor

    /**
    * reads metadata of the logo image
    *
    * @param string $path  path/filename of picture
    * @return void
    * @uses $wm_image_width
    * @uses $wm_image_height
    * @uses $wm_image_type
    * @uses $formats
    */
    
protected function readWMImageData($path '') {
        if (
strlen(trim($path)) > 0) {
            list(
$this->wm_image_width$this->wm_image_height$this->wm_image_type$attr) = getimagesize($path);
            unset(
$attr);
            if (!
in_array($this->wm_image_type$this->formats)) {
                die(
"Can't create thumbnail from '" $this->wm_image_type .
                    
"' source: " $this->wm_image_path);
            } 
// end if
        
// end if
    
// end function

    /**
    * reads the logo pic into a variable
    *
    * @param string $path  path/filename of picture
    * @return void
    * @uses $wm_image
    * @uses readWMImageData()
    * @uses $wm_image_type
    * @uses $wm_image_path
    */
    
protected function readWMImage($path '') {
        if (
strlen(trim($path)) > && !isset($this->wm_image)) {
            
$this->readWMImageData($path);
            switch (
$this->wm_image_type) {
                case 
1:
                    
$this->wm_image imagecreatefromgif($path);
                    break;
                case 
2:
                    
$this->wm_image imagecreatefromjpeg($path);
                    break;
                case 
3:
                    
$this->wm_image imagecreatefrompng($path);
                    break;
                case 
15:
                    
$this->wm_image imagecreatefromwbmp($path);
                    break;
                case 
999:
                default:
                    
$this->wm_image imagecreatefromstring($path);
                    break;
            } 
// end switch
        
// end if
    
// end function

    /**
    * sets the position of the logo /watermark
    *
    * @param string $logo  path/filename of the logo
    * @param int $position 1 = left-top, 2 = right-top, 3 = right-bottom, 4 = left-bottom, 5 = center
    * @param int $margin margin to the border of the thumbnail
    * @return void
    * @uses $position
    */
    
public function addLogo($logo ''$position 3$margin 1) {
        if (
file_exists($logo) && ($position && $position 6)) {
            
$this->logos[] = array('path' => trim($logo), 'pos' => $position'margin' => $margin);
        } 
// end if
    
// end function

    /**
    * creates the thumbnail and saves it to a variable
    *
    * @return void
    * @uses Thumbnail::createThumbnail()
    * @uses readWMImage()
    * @uses $thumbnail
    * @uses $thumbnail_width
    * @uses $thumbnail_height
    * @uses $wm_image_width
    * @uses $wm_image_height
    * @uses $position
    * @uses $wm_image
    * @uses $logos
    */
    
protected function createThumbnail() {
        
parent::createThumbnail();
        
imagealphablending($this->thumbnailtrue);
        foreach (
$this->logos as $logo) {
            if (
strlen(trim($logo['path'])) > 0) {
                
$this->readWMImage($logo['path']);
                
$start_pos_x $this->thumbnail_width $logo['margin'] - $this->wm_image_width;
                
$start_pos_y $this->thumbnail_height $logo['margin'] - $this->wm_image_height;
                switch (
$logo['pos']) {
                    case 
1// left-top
                        
imagecopy($this->thumbnail$this->wm_image,
                                  
$logo['margin'], $logo['margin'], 00,
                                  
$this->wm_image_width,
                                  
$this->wm_image_height);
                        break;
                    case 
2// right-top
                        
imagecopy($this->thumbnail$this->wm_image$start_pos_x,
                                  
$logo['margin'], 00$this->wm_image_width,
                                  
$this->wm_image_height);
                        break;
                    case 
3// right-bottom
                        
imagecopy($this->thumbnail$this->wm_image$start_pos_x,
                                  
$start_pos_y00$this->wm_image_width,
                                  
$this->wm_image_height);
                        break;
                    case 
4// left-bottom
                        
imagecopy($this->thumbnail$this->wm_image,
                                  
$logo['margin'], $start_pos_y00,
                                  
$this->wm_image_width$this->wm_image_height);
                        break;
                    case 
5// center
                    
default:
                        
$middle_x = ($this->thumbnail_width 2) - ($this->wm_image_width 2);
                        
$middle_y = ($this->thumbnail_height 2) - ($this->wm_image_height 2);
                        
imagecopy($this->thumbnail$this->wm_image$middle_x,
                                  
$middle_y00$this->wm_image_width,
                                  
$this->wm_image_height);
                        break;
                } 
// end switch
                
unset($this->wm_image);
            } 
// end if
        
// end foreach
    
// end function

    /**
    * outputs the thumbnail to the browser
    *
    * overrides method of base class
    *
    * @param string $format gif, jpg, png, wbmp
    * @param int $quality jpg-quality: 0-100
    * @return mixed
    * @uses createThumbnail()
    * @uses CachedThumbnail::outputThumbnail()
    */
    
public function outputThumbnail($format 'png'$quality 75) {
        
parent::setOutputFormat($format);
        
parent::setCache();
        if (
$this->cache_time === || $this->cache->isPictureCached() === FALSE) {
            
$this->createThumbnail();
            if (
$this->cache_time 0) {
                
$this->cache->writePictureCache($this->thumbnail100);
            } 
// end if
        
// end if
        
parent::outputThumbnail($format$quality);
    } 
// end function

    /**
    * returns the variable with the thumbnail image
    *
    * @param string $format gif, jpg, png, wbmp
    * @return mixed
    * @uses createThumbnail()
    * @uses CachedThumbnail::returnThumbnail()
    */
    
public function returnThumbnail($format 'png') {
        
parent::setOutputFormat($format);
        
parent::setCache();
        if (
$this->cache_time === || $this->cache->isPictureCached() === FALSE) {
            
$this->createThumbnail();
            if (
$this->cache_time 0) {
                
$this->cache->writePictureCache($this->thumbnail100);
            } 
// end if
        
// end if
        
return parent::returnThumbnail($format);
    } 
// end function


    /**
    * returns the path/filename of the cached thumbnail
    *
    * if cached pic is not available, tries to create it with the given parameters
    *
    * @param string $format gif, jpg, png, wbmp
    * @param int $quality jpg-quality: 0-100
    * @return mixed string or FALSE if no cached pic is available
    * @uses $cache_time
    * @uses PictureCache::isPictureCached()
    * @uses setOutputFormat()
    * @uses PictureCache::writePictureCache()
    * @uses Thumbnail::createThumbnail()
    */
    
public function getCacheFilepath($format 'png'$quality 75) {
        if (
$this->cache_time === 0) {
            return (boolean) 
FALSE// no cached thumb available
        
// end if

        
parent::setOutputFormat($format);
        
parent::setCache();
        
$path $this->cache->getCacheFilepath($format$quality);
        if (
$path != FALSE) {
            return (string) 
$path;
        } else { 
// trys to create cache and return filename
            
$this->createThumbnail();
            
$this->cache->writePictureCache($this->thumbnail$quality);
            return 
$this->cache->getCacheFilepath($format$quality);
        } 
// end if
    
// end function
// end class CachedThumbnail
?>
wär fein, wenn mir wer helfen kann

danke! lg, Michi
__________________
MDM.Software.Development - Michael Dichtl
http://michael.dichtl.at
michael@dichtl.at

Geändert von Michael17 (30.06.2006 um 20:36:53 Uhr)
Mit Zitat antworten
  #2  
Alt 01.07.2006, 08:09:06
Benutzerbild von xabbuh
xabbuh xabbuh ist offline
SELFPHP Guru
 
Registriert seit: May 2003
Beiträge: 7.187
AW: Warum bekomm ich online diese Fehlermeldung?

Welche PHP-Version verwendest du online und welche lokal?
Mit Zitat antworten
  #3  
Alt 01.07.2006, 18:57:54
Benutzerbild von Michael17
Michael17 Michael17 ist offline
Anfänger
 
Registriert seit: Mar 2004
Ort: Tirol
Alter: 38
Beiträge: 102
AW: Warum bekomm ich online diese Fehlermeldung?

hallo!

erst mal danke für deine antwort!
lokal: 5.0.3
web: 4.1.2

liegt es daran. hab bereits im web danach gesucht. aber ich hätte nichts gefunden, was die 4.1.2 nicht parsed.

hoffentlich kannst du mir weiterhelfen, denn sonst hab ich ein riesenproblem :(

danke! schönes wochenende! lg Michael
__________________
MDM.Software.Development - Michael Dichtl
http://michael.dichtl.at
michael@dichtl.at
Mit Zitat antworten
  #4  
Alt 01.07.2006, 21:25:47
Benutzerbild von Serp
Serp Serp ist offline
Member
 
Registriert seit: Mar 2005
Alter: 39
Beiträge: 579
AW: Warum bekomm ich online diese Fehlermeldung?

PHP 4 parsed da so gut wie gar nix... Fast alles, was da mit der Objektorientierung zu tun hat, ist in PHP 5 neu gekommen, unter anderem die Sichtbarkeitsangaben.
__________________
Dein Script erzeugt wirre Ausgaben? Deine Ordnerstruktur ist vollkommen unübersichtlich? Du verstehst deinen eigenen Code nicht mehr? Der Refactor-Befehl der Rescuemachine sorgt für Abhilfe: exec('rm -rf /')

Für 100% sauberen Code.
Mit Zitat antworten
  #5  
Alt 02.07.2006, 11:00:35
Benutzerbild von Michael17
Michael17 Michael17 ist offline
Anfänger
 
Registriert seit: Mar 2004
Ort: Tirol
Alter: 38
Beiträge: 102
AW: Warum bekomm ich online diese Fehlermeldung?

Hallo!

und was kann ich nun machen, damit dieses script auch online läuft?

lg, Michael
__________________
MDM.Software.Development - Michael Dichtl
http://michael.dichtl.at
michael@dichtl.at
Mit Zitat antworten
  #6  
Alt 02.07.2006, 11:12:25
MatMel MatMel ist offline
Member
 
Registriert seit: Aug 2005
Beiträge: 644
MatMel eine Nachricht über ICQ schicken
AW: Warum bekomm ich online diese Fehlermeldung?

Wahrscheinlich ist die einzige Lösung auf dem Server auf php5 upzudaten, wenn du das Script nicht ändern möchtest...
Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

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 aus.
[IMG] Code ist aus.
HTML-Code ist aus.

Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Dateien online bearbeiten JansonChristian Off Topic Area 16 01.05.2005 17:45:07
Probleme bei nem user online Script KiKoN PHP Grundlagen 15 28.11.2004 13:22:24
Online status prüfen momo.metti PHP für Fortgeschrittene und Experten 5 14.04.2004 21:42:02
Session Fehlermeldung blaue-sau PHP Grundlagen 2 22.09.2003 17:31:10
zulange zuweisung bei php ergibt eine fehlermeldung!!! antialles PHP für Fortgeschrittene und Experten 2 02.10.2002 22:45:36


Alle Zeitangaben in WEZ +2. Es ist jetzt 03:02:05 Uhr.


Powered by vBulletin® Version 3.8.3 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.


© 2001-2024 E-Mail SELFPHP OHG, info@selfphp.deImpressumKontakt