Mi block funciona, pero estropea a otro :S
Publicado por lestatminiyo (9 intervenciones) el 29/06/2006 11:59:53
Wenas, soy principiante, y queria crear un block para que se pudiese cambiar de theme desde ahí... Funciona, pero el problema es, que el block de Survey que tengo más abajo, sale también con el mismo contenido que el block del theme...
<?php
if (eregi("block-tema.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
global $user, $userinfo, $Default_Theme, $cookie, $module_name, $content;
cookiedecode($user);
getusrinfo($user);
if ((is_user($user)) AND (strtolower($userinfo['username']) == strtolower($cookie[1])) AND ($userinfo['user_password'] == $cookie[2])) {
$content = "<center><form action=\"modules.php?name=Your_Account\" method=\"post\"><address><span style=\"font-style: normal\">Escoge un color:</span></address><select name=\"theme\">\n\n\n";
$handle=opendir('themes');
while ($file = readdir($handle)) {
if ( (!ereg("[.]",$file) AND file_exists("themes/$file/theme.php")) ) {
$themelist .= "$file ";
}
}
closedir($handle);
$themelist = explode(" ", $themelist);
sort($themelist);
for ($i=0; $i < sizeof($themelist); $i++) {
if($themelist[$i]!="") {
$content .= "<option value=\"$themelist[$i]\" ";
if((($userinfo[theme]=="") && ($themelist[$i]=="$Default_Theme")) || ($userinfo[theme]==$themelist[$i])) $content .= "selected";
$content .= ">$themelist[$i]\n";
}
}
if($userinfo[theme]=="") $userinfo[theme] = "$Default_Theme";
$content .= "</select><br>";
$content .= "<input type=\"hidden\" name=\"user_id\" value=\"$userinfo[user_id]\">\n";
$content .= "<input type=\"hidden\" name=\"op\" value=\"savetheme\">\n";
$content .= "<input type=\"submit\" value=\"Aplicar\">\n";
$content .= "</form>\n\n";
} else {
main($user);
}
?>
donde cometo el error?
<?php
if (eregi("block-tema.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
global $user, $userinfo, $Default_Theme, $cookie, $module_name, $content;
cookiedecode($user);
getusrinfo($user);
if ((is_user($user)) AND (strtolower($userinfo['username']) == strtolower($cookie[1])) AND ($userinfo['user_password'] == $cookie[2])) {
$content = "<center><form action=\"modules.php?name=Your_Account\" method=\"post\"><address><span style=\"font-style: normal\">Escoge un color:</span></address><select name=\"theme\">\n\n\n";
$handle=opendir('themes');
while ($file = readdir($handle)) {
if ( (!ereg("[.]",$file) AND file_exists("themes/$file/theme.php")) ) {
$themelist .= "$file ";
}
}
closedir($handle);
$themelist = explode(" ", $themelist);
sort($themelist);
for ($i=0; $i < sizeof($themelist); $i++) {
if($themelist[$i]!="") {
$content .= "<option value=\"$themelist[$i]\" ";
if((($userinfo[theme]=="") && ($themelist[$i]=="$Default_Theme")) || ($userinfo[theme]==$themelist[$i])) $content .= "selected";
$content .= ">$themelist[$i]\n";
}
}
if($userinfo[theme]=="") $userinfo[theme] = "$Default_Theme";
$content .= "</select><br>";
$content .= "<input type=\"hidden\" name=\"user_id\" value=\"$userinfo[user_id]\">\n";
$content .= "<input type=\"hidden\" name=\"op\" value=\"savetheme\">\n";
$content .= "<input type=\"submit\" value=\"Aplicar\">\n";
$content .= "</form>\n\n";
} else {
main($user);
}
?>
donde cometo el error?
Valora esta pregunta


0