Ver Mensaje Individual
  #2 (permalink)  
Antiguo 08/03/2008, 10:17
Avatar de miguemangu
miguemangu
 
Fecha de Ingreso: marzo-2008
Mensajes: 14
Antigüedad: 16 años, 2 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]