pragmaMx Support Forum

pragmaMx => Allgemeines => Thema gestartet von: rinaldo2000at am 17 Oktober 2003, 11:42:29

Titel: block-Amazon.php
Beitrag von: rinaldo2000at am 17 Oktober 2003, 11:42:29
Bin jetzt Partner von Amazon geworden und wollte nun meine neue ID in den Amazon Block einfügen........

  Amazon Block von Nuke.6.0

  <?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2001 by Francisco Burzi (fbc@mandrakesoft.com)         */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* 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.       */
/************************************************************************/

if (eregi("block-Amazon.php",$PHP_SELF)) {
    
Header("Location: index.php");
    die();
}

/***************************************************************/
/* To use this block you only need to download .jpg or .gif    */
/* images from amazon.com and copy them to the /images/amazon  */
/* directory, then edit the $amazon_id variable to fit your ID */
/* of the Associates program. If you don't change the ID, all  */
/* the comissions ($) will go to my account! You're adviced.   */
/* But if you want to help PHP-Nuke project, you can leave the */
/* $amazon_id variable intact.                                 */
/*                                                             */
/* You need to know that any image in the amazon's directory   */
/* has the same ASIN name as its filename given by Amazon. If  */
/* you don't know what this is, leave it as is or disable it.  */
/***************************************************************/

$amazon_id "Meine Amazon ID";

mt_srand((double)microtime()*1000000);
$imgs dir('images/amazon');
while (
$file $imgs->read()) {
    if (
eregi("gif"$file) || eregi("jpg"$file)) {
$imglist .= "$file ";
    }
}
closedir($imgs->handle);
$imglist explode(" "$imglist);
$a sizeof($imglist)-2;
$random mt_rand(0$a);
$image $imglist[$random];
$asin explode("."$image);
$content "<center><a href=\"http://www.amazon.com/exec/obidos/ASIN/$asin[0]/$amazon_id\" target=\"_blank\">";
$content .= "<img src=\"images/amazon/$image\" border=\"0\" alt=\"\"></center>";

?>


Natürlich wie könnte es auch sein hat der Block nicht funktioniert und es gab folgende fehlermeldungen!

Warning: dir(images/amazon): failed to open dir: No such file or directory in /home/vhosts/5000120906/rinaldo2000at.de/htdocs/mx/blocks/block- Amazon.php on line 37

Fatal error: Call to a member function on a non-object in /home/vhosts/5000120906/rinaldo2000at.de/htdocs/mx/blocks/block- Amazon.php on line 38


[Editiert am 17/10/2003 von rinaldo2000at]
Titel: Re: block-Amazon.php
Beitrag von: Biker am 17 Oktober 2003, 11:53:44
@Rinaldo

Hast Du denn den Block so benutzt, wie er da steht, oder bei "$amazon_id = "Meine Amazon ID";" Deine ID eingetragen???

....*malganzblödfrag*

Gruß
Bernd
 ;)
Titel: Re: block-Amazon.php
Beitrag von: rinaldo2000at am 17 Oktober 2003, 12:06:43
Hallo Bernd!

Nein ich habe selbstverständlich meine neue ID eingetragen dort wo jetzt steht   Meine Amazon ID habe das nur für dieses Forum so hingeschrieben,muß keiner wissen wie meine Partner ID ist.
Eigentlich kann man bei diesen Block nicht viel falsch machen da man hier eigentlich nur die Partner ID eintragen muß, jedoch funktioniert es bei mir leider nicht und es gibt besagte fehlermeldungen!
Übrigens Bernd, du hast einen privaten Gästebucheintrag im Musikportal! :D  :D  :D
Titel: Re: block-Amazon.php
Beitrag von: Future am 17 Oktober 2003, 12:35:12
 
ZitatWarning: dir(images/amazon): failed to open dir: No such file or directory

Existiert das Verzeichnis images/amazon überhaupt und hat es auch die richtigen CHMODS ?
Titel: Re: block-Amazon.php
Beitrag von: rinaldo2000at am 17 Oktober 2003, 12:46:21
  Das war der fehler!
Titel: Re: block-Amazon.php
Beitrag von: Future am 17 Oktober 2003, 12:51:42
Siehste ... so einfach ist das ;)
Titel: Re: block-Amazon.php
Beitrag von: Andi am 17 Oktober 2003, 13:02:30
 :D  :D
vielleicht sollte man wirklich mal die ganzen php-Fehlermeldungen in Deutsch übersetzen. Eigentlich steht doch alles da.

google macht aus:
Warning: dir(images/amazon): failed to open dir: No such file or directory  

das:
  Warnung:  dir(images/amazon):  konnte dir öffnen nicht:  Keine solche Akte oder Verzeichnis