Hallo liebe Leute! Ich habe eben einen Block geschrieben, der auch Wunderbar funktionieren sollte... Tut er auch... Aber: Sobald ich eingeloggt bin, komme ich nicht mehr auf meinen Account... Sprich es erscheint alles so, (z.B. Who`s Online Block) als wäre man nicht eingeloggt! Der Fehler steckt 100 % ig im CD_Block! Ich habe Euch den Quelltext mal angefügt! Wo ist der Fehler!! PLEASE HELP AND THANXXX!
Chris
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2001 by Chris Delabona */
/* http://www.dreamride.de */
/* 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. */
/************************************************************************/
/************************************************************************/
/* Filename: Block Random CD! */
/* Original Author:Chris Delabona http://www.dreamride.de */
/* Tested With PHP NUKE 5.5 */
/************************************************************************/
if (eregi("block-RandomCD.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$blocks_modules[cd_random] = array(
'title' => "cd_random",
'func_display' => 'cd_random',
'func_add' => '',
'func_update' => '',
'text_type' => 'cd_random',
'text_type_long' => '',
'text_content' => "cd_random",
'support_nukecode' => false,
'allow_create' => false,
'allow_delete' => false,
'form_url' => false,
'form_content' => false,
'form_refresh' => false
);
global $user, $prefix, $modname, $abpath, $imagepath, $id;
$modname="CD_Tips";
include "modules/$modname/conf.php";
mt_srand((double)microtime()*1000000);
if (is_user($user))
$total = mysql_fetch_array(mysql_query("SELECT COUNT(id) AS total FROM cd_archiv"));
else
$total = mysql_fetch_array(mysql_query("SELECT COUNT(id) AS total FROM cd_archiv"));
$p = mt_rand(0,($total[total] - 1));
$pic = mysql_fetch_array(mysql_query("SELECT id, interpret, titel, image from cd_archiv LIMIT $p,1"));
#$pic[description] = htmlentities($pic[description]);
if (file_exists("".$abpath."/".$pic[image].""))
$box = "<center><a href=\"modules.php?name=CD_Tips&fct=show1&id=".$pic[id]."\"><img src=\"".$imagepath."/".$pic[image]."\" width=\"120\" border=\"0\" alt=\"$pic[description]\">";
$box2 = "<br>".$pic[interpret]."<br>".$pic[titel]."</center></a>";
$content = "$box.$box2";
?>
Hab den Fehler gefunden! Der Block funzt jetzt! Könnt Ihr Euch unter http://www.ravequeen.de angucken!
Fette Greeez
Chris
Ja und wo oder was war der Fehler???
Dein Block würde ja vielleicht auch andere User interessieren!...
cu Yogi
und Frohe Ostern :)
Kein Problem! Hier nochmal die überarbeitet Version des Blockes! Der Fehler lag (wie üblich) in den globalen Variablen!
Hier ist die Lösung des ganzen:
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2001 by Chris Delabona */
/* http://www.dreamride.de */
/* 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. */
/************************************************************************/
/************************************************************************/
/* Filename: Block Random CD! */
/* Original Author:Chris Delabona http://www.dreamride.de */
/* Tested With PHP NUKE 5.5 */
/************************************************************************/
if (eregi("block-RandomCD.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$blocks_modules[cd_random] = array(
'title' => "cd_random",
'func_display' => 'cd_random',
'func_add' => '',
'func_update' => '',
'text_type' => 'cd_random',
'text_type_long' => '',
'text_content' => "cd_random",
'support_nukecode' => false,
'allow_create' => false,
'allow_delete' => false,
'form_url' => false,
'form_content' => false,
'form_refresh' => false
);
global $modname, $abpath;
$modname="CD_Tips";
include "modules/$modname/conf.php";
mt_srand((double)microtime()*1000000);
if (is_user($user))
$total = mysql_fetch_array(mysql_query("SELECT COUNT(id) AS total FROM cd_archiv"));
else
$total = mysql_fetch_array(mysql_query("SELECT COUNT(id) AS total FROM cd_archiv"));
$p = mt_rand(0,($total[total] - 1));
$pic = mysql_fetch_array(mysql_query("SELECT id, interpret, titel, image from cd_archiv LIMIT $p,1"));
$pic[interpret] = htmlentities($pic[interpret]);
if (file_exists("".$abpath."/".$pic[image].""))
$content = "<center><a href=\"modules.php?name=CD_Tips&fct=show1&id=".$pic[id]."\"><img src=\"".$imagepath."/".$pic[image]."\" width=\"120\" border=\"0\" alt=\"$pic[interpret]\"></a>";
$content .= "<br>".$pic[interpret]."<br>".$pic[titel]."</center>";
?>