Foros del Web » Programando para Internet » PHP »

problema facil o eso creo?

Estas en el tema de problema facil o eso creo? en el foro de PHP en Foros del Web. mi web es muxagente.com.el problema que tengo es que en el segundo paso de registro me viene para cargar el icono y para cargar las ...
  #1 (permalink)  
Antiguo 08/03/2008, 10:17
Avatar de miguemangu  
Fecha de Ingreso: marzo-2008
Mensajes: 14
Antigüedad: 11 años, 11 meses
Puntos: 0
problema facil o eso creo?

mi web es muxagente.com.el problema que tengo es que en el segundo paso de registro me viene para cargar el icono y para cargar las imagenes(agregar nueva foto).que parte del codigo quito para quitar esos apartados.
codigo:
[SIZE="2"]<?php
include "./include/config.php";
include "./common.php";
include "./include/config_index.php";
include "./include/config_admin.php";
include "./include/class.lang.php";
include "./include/class.percent.php";
include "./include/class.images.php";
include "./include/functions_index.php";
include "./include/functions_auth.php";
include "./include/class.phpmailer.php";
include "./include/functions_mail.php";
include "./include/functions_users.php";
include "./include/functions_newsletter.php";
include "./include/functions_affiliate.php";
$user = auth_index_user();
RefreshAccount($user);
if (!$user[0]) header("location: " . $config["site_root"] . "/index.php");
$PHPmailer = new PHPMailer();
$multi_lang = new MultiLang($config, $dbconn);
$field_name = $multi_lang->DefaultFieldName();
$profile_percent = new Percent($config, $dbconn, $user[0]);
$sel = $_POST["sel"] ? $_POST["sel"] : $_GET["sel"];
switch ($sel)
{
case "1":
EditProfile(1);
break;
case "2":
EditProfile(2);
break;
case "3":
EditProfile(3);
break;
case "4":
EditProfile(4);
break;
case "5":
EditProfile(5);
break;
case "6":
EditProfile(6);
break;
case "7":
EditProfile(7);
break;
case "8":
EditProfile(8);
break;
case "save_1":
SaveProfile(1);
break;
case "save_2":
SaveProfile(2);
break;
case "save_3":
SaveProfile(3);
break;
case "save_4":
SaveProfile(4);
break;
case "save_5":
SaveProfile(5);
break;
case "save_6":
SaveProfile(6);
break;
case "save_7":
SaveProfile(7);
break;
case "save_8":
SaveProfile(8);
break;
case "save_9":
SaveProfile(9);
break;
case "upload_del":
UploadDelete();
break;
case "upload_view":
UploadView();
break;
default:
EditProfile(1);
}
function EditProfile($num, $err = "")
{
global $lang, $config, $config_index, $smarty, $dbconn, $user, $multi_lang, $field_name, $profile_percent, $PHPmailer, $IMG_TYPE_ARRAY, $AUDIO_TYPE_ARRAY, $VIDEO_TYPE_ARRAY;
Banners(GetRightModulePath(__file__));
LeftMenu();
IndexHomePage();
$id = $user[0];
$file_name = (isset($_SERVER["PHP_SELF"])) ? AfterLastSlash($_SERVER["PHP_SELF"]) : "registration.php";
$smarty->assign("active_user_info", GetActiveUserInfo($user));
if ($num == '1')
{
if ($user[3] != 1)
{
echo "<script> location.href='./homepage.php';</script>";
return;
}
$form = PersonalRegistrationForm($multi_lang, $field_name);
$form["header"] = $lang["subsection"]["personal_info"];
$form["next_link"] = $file_name . "?sel=2";
$form["site_link"] = "homepage.php";
} elseif ($num == '2')
{
$form = UploadTable();
$form["header"] = $lang["subsection"]["upload"];
$form["next_link"] = $file_name . "?sel=3";
$form["site_link"] = "homepage.php";
} elseif ($num == '3')
{
$form = DescriptionForm($multi_lang, $field_name);
$form["header"] = $lang["subsection"]["description"];
$form["next_link"] = $file_name . "?sel=4";
$form["site_link"] = "homepage.php";
} elseif ($num == '4')
{
$form = AnnonceForm($multi_lang, $field_name);
$form["header"] = $lang["subsection"]["notice"];
$form["next_link"] = $file_name . "?sel=5";
$form["site_link"] = "homepage.php";
} elseif ($num == '5')
{
$form = MyPersonalityForm($multi_lang, $field_name);
$form["header"] = $lang["subsection"]["personal"];
$form["next_link"] = $file_name . "?sel=6";
$form["site_link"] = "homepage.php";
} elseif ($num == '6')
{
$form = MyPortraitForm($multi_lang, $field_name);
$form["header"] = $lang["subsection"]["portreit"];
$form["next_link"] = $file_name . "?sel=7";
$form["site_link"] = "homepage.php";
} elseif ($num == '7')
{
$form = MyInterestsForm($multi_lang, $field_name);
$form["header"] = $lang["subsection"]["interest"] . " ( " . $lang["interests_opt"][1] . " / " . $lang["interests_opt"][2] . " / " . $lang["interests_opt"][3] . " )";
$form["next_link"] = $file_name . "?sel=8";
$form["site_link"] = "homepage.php";
} elseif ($num == '8')
{
$form = MyCriteriaForm($multi_lang, $field_name);
$form["header"] = $lang["subsection"]["criteria"];
$form["next_link"] = $file_name . "?sel=9";
$form["site_link"] = "homepage.php";
} elseif ($num == '9')
{
$form = HisInterestsForm($multi_lang, $field_name);
$form["header"] = $lang["subsection"]["match_interest"] . " ( " . $lang["interests_opt"][1] . " / " . $lang["interests_opt"][2] . " / " . $lang["interests_opt"][3] . " )";
$form["next_link"] = $file_name . "?sel=10";
$form["site_link"] = "homepage.php";
} elseif ($num == '10')
{
header("location: ./homepage.php");
echo "<script>location.href='./homepage.php'</script>";
}
$form["num"] = $num;
$form["action"] = $file_name;
$form["err"] = $err;
$smarty->assign("form", $form);
$smarty->assign("header", $lang["profile"]);
$smarty->assign("alt", $lang["alt"]);
$smarty->assign("script", "location");
$smarty->display(TrimSlash($config["index_theme_path"]) . "/registration_edit.tpl");
}
function SaveProfile($num)
{
global $lang, $config, $config_index, $smarty, $dbconn, $user, $multi_lang, $field_name, $profile_percent, $IMG_TYPE_ARRAY, $AUDIO_TYPE_ARRAY, $VIDEO_TYPE_ARRAY;
$id = intval($user[0]);
$data = $_POST;
if ($num == '1')
{
$err = SavePersonalRegistrationForm($data);
$page = 2;
} elseif ($num == '9')
{
$upload = $_FILES["upload"];
$upload_allow = $_POST["upload_allow"];
$upload_type = $_POST["upload_type"];
$id_file = $_POST["id_file"];
$user_comment = stripn(FormFilter($_POST["user_comment"]));
if (BadWordsCont($user_comment, 6)) $err = BadWordsCont($user_comment, 6);
elseif (check_filter($user_comment)) $err = $lang["err"]["info_finding_1"];
else
{
if ($id_file && !$upload["size"]) $dbconn->Execute("update " . USER_UPLOAD_TABLE . " set allow='" . $upload_allow . "', user_comment='" . addslashes($user_comment) . "' where id_user='" . $id . "' and id='" . $id_file . "'");
else $err = SaveUploadForm($data, $upload, $upload_type, $upload_allow, $id_file, $user_comment);
}
$page = 2;
if ($err)
{
EditProfile(2, $err);
return;
}
} elseif ($num == '2')
{
$info = $_POST["info"];
$spr = $_POST["spr"];
$err = SaveDescriptionForm($profile_percent, $data, $spr, $info);
$page = 4;
} elseif ($num == '3')
{
$err = SaveAnnonceForm($profile_percent, $data);
$page = 5;
} elseif ($num == '4')
{
$personal = $_POST["personal"];
$spr = $_POST["p_spr"];
$err = SaveMyPersonalityForm($profile_percent, $data, $spr, $personal);
$page = 6;
} elseif ($num == '5')
  #2 (permalink)  
Antiguo 08/03/2008, 10:17
Avatar de miguemangu  
Fecha de Ingreso: marzo-2008
Mensajes: 14
Antigüedad: 11 años, 11 meses
Puntos: 0
Re: problema facil o eso creo?

{
$portrait = $_POST["portrait"];
$spr = $_POST["port_spr"];
$err = SaveMyPortraitForm($profile_percent, $data, $spr, $portrait);
$page = 7;
} elseif ($num == '6')
{
$interests = $_POST["interests"];
$spr = $_POST["int_spr"];
$err = SaveMyInterestsForm($profile_percent, $data, $spr, $interests);
$page = 8;
} elseif ($num == '7')
{
$spr = $_POST["spr"];
$info = $_POST["info"];
$err = SaveMyCriteriaForm($profile_percent, $data, $spr, $info);
$page = 9;
} elseif ($num == '8')
{
$interests = $_POST["interests"];
$spr = $_POST["int_spr"];
$err = SaveHisInterestsForm($profile_percent, $data, $spr, $interests);
$page = 10;
}
if ($err)
{
EditProfile($num, $err);
} else
{
EditProfile($page);
}
return;
}
function UploadTable()
{
global $lang, $config, $config_index, $smarty, $dbconn, $user, $multi_lang, $field_name, $profile_percent;
$id = intval($user[0]);
$file_name = (isset($_SERVER["PHP_SELF"])) ? AfterLastSlash($_SERVER["PHP_SELF"]) : "registration.php";
$i = 0;
$rs = $dbconn->Execute("Select id, upload_path, allow, upload_type, user_comment from " . USER_UPLOAD_TABLE . " where id_user='" . $id . "' order by upload_type, id");
while (!$rs->EOF)
{
$row = $rs->GetRowAssoc(false);
$db_upload[$row["upload_type"]][$i]["id"] = $row["id"];
$db_upload[$row["upload_type"]][$i]["file_path"] = $row["upload_path"];
$db_upload[$row["upload_type"]][$i]["allow"] = $row["allow"];
$db_upload[$row["upload_type"]][$i]["user_comment"] = stripslashes($row["user_comment"]);
$rs->MoveNext();
$i++;
}
$settings = GetSiteSettings(array("photo_max_count", "photo_max_width", "photo_max_height", "photo_max_size", "icon_max_width", "icon_max_height", "icon_max_size", "icons_folder", "icons_default", "icon_male_default", "icon_female_default", "photos_folder", "photos_default", "use_image_resize"));
$strSQL = "select e.default_icon as icon_path_default from " . USERS_TABLE . " a left join " . USER_TYPES_SPR_TABLE . " e on e.id = a.gender where a.id='" . $id . "' ";
$rs = $dbconn->Execute($strSQL);
$settings["icon_path_default"] = $rs->fields[0];
if ($settings["use_image_resize"])
{
$data["icon_comment"] = str_replace("[size]", round($settings["icon_max_size"] / 1024), $lang["confirm"]["icon_upload_resize"]);
} else
{
$data["icon_comment"] = str_replace("[size]", round($settings["icon_max_size"] / 1024), $lang["confirm"]["icon_upload"]);
$data["icon_comment"] = str_replace("[width]", $settings["icon_max_width"], $data["icon_comment"]);
$data["icon_comment"] = str_replace("[height]", $settings["icon_max_height"], $data["icon_comment"]);
}
$rs = $dbconn->Execute("select icon_path, icon_path_temp from " . USERS_TABLE . " where id = '" . $id . "'");
$file = strlen($rs->fields[0]) ? $rs->fields[0] : $rs->fields[1];
$path = $config["site_path"] . $settings["icons_folder"] . "/" . $file;
if (file_exists($path) && strlen($file) > 0)
{
$data["icon_path"] = "." . $settings["icons_folder"] . "/" . $file;
$data["icon_del_link"] = "./" . $file_name . "?sel=upload_del&type_upload=icon";
}
if (!file_exists($path) || !strlen($file))
{
$file = $settings["icon_path_default"];
$data["icon_path"] = "." . $settings["icons_folder"] . "/" . $file;
}
if ($settings["use_image_resize"])
{
$data["photo_comment"] = str_replace("[size]", round($settings["photo_max_size"] / 1024), $lang["confirm"]["photo_upload_resize"]);
} else
{
$data["photo_comment"] = str_replace("[size]", round($settings["photo_max_size"] / 1024), $lang["confirm"]["photo_upload"]);
$data["photo_comment"] = str_replace("[width]", $settings["photo_max_width"], $data["photo_comment"]);
$data["photo_comment"] = str_replace("[height]", $settings["photo_max_height"], $data["photo_comment"]);
}
$i = 0;
if (count($db_upload['f']) > 0)
{
foreach ($db_upload['f'] as $photo)
{
if ($i >= $settings["photo_max_count"]) break;
$path = $config["site_path"] . $settings["photos_folder"] . "/" . $photo["file_path"];
$thumb_path = $config["site_path"] . $settings["photos_folder"] . "/thumb_" . $photo["file_path"];
if (file_exists($path) && strlen($photo["file_path"]) > 0) $data["photo"][$i]["file"] = "." . $settings["photos_folder"] . "/" . $photo["file_path"];
if (file_exists($thumb_path) && strlen($photo["file_path"]) > 0) $data["photo"][$i]["thumb_file"] = "." . $settings["photos_folder"] . "/thumb_" . $photo["file_path"];
if (!file_exists($path) || !strlen($photo["file_path"]))
{
$data["photo"][$i]["file"] = "." . $settings["photos_folder"] . "/" . $settings["photos_default"];
$data["photo"][$i]["thumb_file"] = $data["photo"][$i]["file"];
}
$data["photo"][$i]["allow"] = $photo["allow"];
$data["photo"][$i]["id"] = $photo["id"];
if (file_exists($path) || strlen($photo["file_path"]))
{
$data["photo"][$i]["del_link"] = "./" . $file_name . "?sel=upload_del&id_file=" . $photo["id"] . "&type_upload=f";
$data["photo"][$i]["view_link"] = "./" . $file_name . "?sel=upload_view&id_file=" . $photo["id"] . "&type_upload=f";
$data["photo"][$i]["user_comment"] = stripslashes($photo["user_comment"]);
}
$i++;
}
}
if (count($db_upload['f']) < $settings["photo_max_count"])
{
$count = count($db_upload['f']);
for ($i = $count; $i < $settings["photo_max_count"]; $i++)
{
$data["photo"][$i]["file"] = "." . $settings["photos_folder"] . "/" . $settings["photos_default"];
$data["photo"][$i]["thumb_file"] = $data["photo"][$i]["file"];
$data["photo"][$i]["allow"] = 1;
$data["photo"][$i]["id"] = "";
$data["photo"][$i]["del_link"] = "";
}
}
$smarty->assign("data_9", $data);
return;
}
function UploadDelete()
{
global $smarty, $dbconn, $config, $config_admin, $lang, $user;
$id_file = $_GET["id_file"];
$type_upload = $_GET["type_upload"];
DeleteUploadedFiles($type_upload, $id_file);
EditProfile(2);
return;
}
function UploadView()
{
global $smarty, $dbconn, $config, $config_admin, $lang, $user;
IndexHomePage();
$id = intval($user[0]);
$id_file = $_GET["id_file"];
$rs = $dbconn->Execute("Select a.upload_path, b.login, a.upload_type, a.user_comment from " . USER_UPLOAD_TABLE . " a left join " . USERS_TABLE . " b on a.id_user = b.id where a.id='" . $id_file . "'");
$data["upload_type"] = $rs->fields[2];
$data["user_comment"] = stripslashes($rs->fields[3]);
$data["file_name"] = $rs->fields[0];
switch ($data["upload_type"])
{
case "f":
$folder = GetSiteSettings("photos_folder");
break;
case "a":
$folder = GetSiteSettings("audio_folder");
break;
case "v":
$folder = GetSiteSettings("video_folder");
break;
}
$data["file_path"] = $config["server"] . $config["site_root"] . $folder . "/" . $data["file_name"];
$smarty->assign("data", $data);
$smarty->assign("button", $lang["button"]);
$smarty->display(TrimSlash($config["index_theme_path"]) . "/myprofile_upload_view.tpl");
exit;
}
?>[/SIZE]
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:52.