pragmaMx Support Forum

Archive => veraltete bzw. unsupportete Systeme und Module => Alt Archive => PHPNuke 5.2-6.0 & VKP 5.5 => Thema gestartet von: wolli am 23 Oktober 2002, 22:27:18

Titel: Global ???
Beitrag von: wolli am 23 Oktober 2002, 22:27:18
in den theme.php`s sind 4 $bgcolor angaben eingebracht....

wenn ich diese um $bgcolor5=#fffff erweitere und diese dann in der themesidebox abteilung so ."<td bgcolor=\"$bgcolor5\">\n" einbaue reagiert das theme nicht darauf, wenn ich jedoch ."<td bgcolor=\"$bgcolor1\">\n"nehme sind die farben so wie in $bgcolor1 eingestellt....

vorher habe ich global $bgcolor1,$bgcolor5; eingestellt....

$bgcolor5  wird allerdings nicht erkannt....

wo sind sonst noch global einstellungen zu treffen ???

danke für antworten

gruß wolli





[Editiert am 23/10/2002 von wolli]
Titel: Re: Global ???
Beitrag von: Micro am 23 Oktober 2002, 22:33:13
Variablen müssen innerhalb von Funktionen nochmals auf Global gesetzt werden, da diese dort sonst nur als "lokal" behandelt werden.
Titel: Re: Global ???
Beitrag von: wolli am 23 Oktober 2002, 22:35:41
ich habe es so eingebaut...geht aber nicht

function themesidebox($title, $content) {
    global $bgcolor1,$bgcolor5;
echo "<!----- Side Box ----->\n"
       ."<table bgcolor=\"#000000\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" width=\"150\">\n"
   ."<tr>\n"
   ."<td bgcolor=\"$bgcolor1\" align=\"left\">\n"
   ."<font class=\"content\" color=\"#363636\">$title</font>\n"
   ."</td>\n"
   ."</tr>\n"
   ."<tr valign=\"top\">\n"
   ."<td bgcolor=\"$bgcolor5\">\n"
   ."$content\n"
   ."</td>\n"
   ."</tr>\n"
   ."</table>\n"
   ."<br>\n\n\n";
}

Titel: Re: Global ???
Beitrag von: Micro am 23 Oktober 2002, 22:43:05
hmm.. setz die Variable mal am Anfang der theme.php auch auf global.
Da findest Du an sich auch noch mehr davon
Titel: Re: Global ???
Beitrag von: wolli am 23 Oktober 2002, 22:45:20
ghet auch nicht...

Titel: Re: Global ???
Beitrag von: Andi am 23 Oktober 2002, 22:49:50
Zitat....wenn ich diese um $bgcolor5=#fffff  erweitere und diese......

Steht der String #fffff  nicht in Anführungszeichen?

Titel: Re: Global ???
Beitrag von: wolli am 23 Oktober 2002, 22:52:53
$bgcolor5 = "#ffffff";

habs nur falsch abgeschrieben....

im original sind die "" da...
Titel: Re: Global ???
Beitrag von: wolli am 23 Oktober 2002, 22:55:48
das komische an der sache ist ja, dass wenn ich mit $bgcolor 1-4 arbeite

etwa so

function themesidebox($title, $content) {
    global $bgcolor1,$bgcolor4;
echo "<!----- Side Box ----->\n"
       ."<table bgcolor=\"#000000\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" width=\"150\">\n"
   ."<tr>\n"
   ."<td bgcolor=\"$bgcolor1\" align=\"left\">\n"
   ."<font class=\"content\" color=\"#363636\">$title</font>\n"
   ."</td>\n"
   ."</tr>\n"
   ."<tr valign=\"top\">\n"
   ."<td bgcolor=\"$bgcolor4\">\n"
   ."$content\n"
   ."</td>\n"
   ."</tr>\n"
   ."</table>\n"
   ."<br>\n\n\n";
}
läuft alles


nur wenn ich eine neue $bgcolor einbaue ght es nicht.....????
Titel: Re: Global ???
Beitrag von: Micro am 23 Oktober 2002, 23:04:19
Zitathmm.. setz die Variable mal am Anfang der theme.php auch auf global.
Da findest Du an sich auch noch mehr davon

Ich zitiere mich mal selber:
Im Ganzen THEMA musst Du die Variable global setzen und nicht nur in der Funktion
Titel: Re: Global ???
Beitrag von: wolli am 23 Oktober 2002, 23:06:57
hab ich schon....

geht wirklich nicht...

sieht so aus

$bgcolor1 = "#ffedab";
$bgcolor2 = "#333366";
$bgcolor3 = "#606099";
$bgcolor4 = "#ffffff";
$bgcolor5 = "cacaca";
$textcolor1 = "#FF0000";
$textcolor2 = "#000000";

bis auf $bgcolor5 ist alles original
Titel: Re: Global ???
Beitrag von: Micro am 23 Oktober 2002, 23:08:11
*patsch*

Der Aufruf kommt doch aus einer anderen Funktion.
Setze da den Wert auch noch Global.
Is etwas wirr zwar, aber lässt sich net ändern.
Titel: Re: Global ???
Beitrag von: Micro am 23 Oktober 2002, 23:09:15
Ja geht so und natürlich auch vorher die ganzen Variablen global setzen.


global $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $bgcolor5;
global $css_link, $css_vlink, $css_alink, $textcolor1, $textcolor2, $thename, $tbl1_width;
$thename = basename(dirname(__FILE__)); # $thename = "vkp_modules_1"; //aktueller Pfad des Themas

$css_link = "#6876BE";
$css_vlink = "#6876BE";
$css_alink = "#d5ae83";

$bgcolor1 = "#ffffff";
$bgcolor2 = "#FFCF0E";
$bgcolor3 = "#ffffff";
$bgcolor4 = "#6876BE";
$bgcolor5 = "#ffffff";   //Kommentare Tabellenhintergrund
$textcolor1 = "#000000";
$textcolor2 = "#000000";
Titel: Re: Global ???
Beitrag von: wolli am 23 Oktober 2002, 23:17:29
jepp  nun tut sich was ...

ich danke euch

gruß wolli

[Editiert am 23/10/2002 von wolli]