Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/11/2003, 09:13
lg2loveguy
 
Fecha de Ingreso: noviembre-2003
Mensajes: 5
Antigüedad: 21 años
Puntos: 0
aki les pongo el codigo

hola...gracias por aberme dado esa respuesta, aunke sigo sin entender algunas cosillas, ya que no soy muy avanzado en MySQL. Para que veas mejor como funciona el modulo, aki te pongo la funcion "edituser" del index.php de "Your_Account"

Nota: lo que esta en azul, fue la adicion que hice para guardar el valor en el campo.

como no puedo poner el codigo entero, te puse solo la parte mas cercana. saludos!!!

-----------------------------------------------------------------------------------


echo "<tr><td bgcolor='$bgcolor2'>"._FORUMSDATE.":<br>"._FORUMSD ATEMSG."</td><td bgcolor='$bgcolor3'>";
echo "<input size='15' maxlength='14' type=\"text\" name=\"user_dateformat\" value=\"$userinfo[user_dateformat]\">";
echo "</td></tr>";

echo "<tr><td bgcolor='$bgcolor2'>"._SIGNATURE.":<br>"._OPTIONAL ."</td>"
."<td bgcolor='$bgcolor3'><textarea wrap=\"virtual\" cols=\"50\" rows=\"5\" name=\"user_sig\">$userinfo[user_sig]</textarea><br>"._255CHARMAX."</td></tr>"
."<tr><td bgcolor='$bgcolor2'>"._USERPHOTO.":<br>"._OPTIONAL ."</td>"
."<td bgcolor='$bgcolor3'><input type=\"text\" name=\"user_photo\" value=\"$userinfo[user_photo]\" size=\"50\" maxlength=\"255\"></td></tr>"

."<tr><td bgcolor='$bgcolor2'>"._EXTRAINFO.":<br>"._OPTIONAL ."</td>"
."<td bgcolor='$bgcolor3'><textarea wrap=\"virtual\" cols=\"50\" rows=\"5\" name=\"bio\">$userinfo[bio]</textarea><br>"._CANKNOWABOUT."</td></tr>"
."<tr><td bgcolor='$bgcolor2'>"._PASSWORD.":</td><br>"
."<td bgcolor='$bgcolor3'><input type=\"password\" name=\"user_password\" size=\"22\" maxlength=\"20\">&nbsp;&nbsp;&nbsp;<input type=\"password\" name=\"vpass\" size=\"22\" maxlength=\"20\"><br>"._TYPENEWPASSWORD."</td></tr>"
."<tr><td bgcolor='$bgcolor3' colspan='2' align='center'>"
."<input type=\"hidden\" name=\"username\" value=\"$userinfo[username]\">"
."<input type=\"hidden\" name=\"user_id\" value=\"$userinfo[user_id]\">"
."<input type=\"hidden\" name=\"op\" value=\"saveuser\">"
."<input type=\"submit\" value=\""._SAVECHANGES."\">"
."</form></td></tr></table>";
CloseTable();
include("footer.php");
} else {
main($user);
}
}

function saveuser($realname, $user_email, $femail, $user_website, $user_avatar, $user_icq, $user_aim, $user_yim, $user_msnm, $user_from, $user_occ, $user_interests, $newsletter, $user_viewemail, $user_allow_viewonline, $user_notify, $user_notify_pm, $user_popup_pm, $user_attachsig, $user_allowbbcode, $user_allowhtml, $user_allowsmile, $user_timezone, $user_dateformat, $user_sig, $bio, $user_password, $vpass, $username, $user_id) {
global $user, $cookie, $userinfo, $EditedMessage, $user_prefix, $db, $module_name, $minpass;
cookiedecode($user);
$check = $cookie[1];
$check2 = $cookie[2];
$sql = "SELECT user_id, user_password FROM ".$user_prefix."_users WHERE username='$check'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$vuid = $row[user_id];
$ccpass = $row[user_password];
$user_sig = htmlspecialchars($user_sig);
$user_email = check_html($user_email, nohtml);
$femail = check_html($femail, nohtml);
$user_website = check_html($user_website, nohtml);
$bio = check_html($bio, nohtml);
$user_avatar = check_html($user_avatar, nohtml);
$user_icq = check_html($user_icq, nohtml);
$user_aim = check_html($user_aim, nohtml);
$user_yim = check_html($user_yim, nohtml);
$user_msnm = check_html($user_msnm, nohtml);
$user_occ = check_html($user_occ, nohtml);
$user_from = check_html($user_from, nohtml);
$user_interests = check_html($user_interests, nohtml);
$realname = check_html($realname, nohtml);
$user_avatar = "gallery/$user_avatar";
if (($user_id == $vuid) AND ($check2 == $ccpass)) {
if (!eregi("http://", $user_website)) {
$user_website = "http://$user_website";
}
if ((isset($user_password)) && ("$user_password" != "$vpass")) {
echo "<center>"._PASSDIFFERENT."</center>";
} elseif (($user_password != "") && (strlen($user_password) < $minpass)) {
echo "<center>"._YOUPASSMUSTBE." $minpass "._CHARLONG."</center>";
} else {
if ($bio) { filter_text($bio); $bio = $EditedMessage; $bio = FixQuotes($bio); }
if ($user_password != "") {
cookiedecode($user);
$db->sql_query("LOCK TABLES ".$user_prefix."_users WRITE");
$user_password = md5($user_password);
$db->sql_query("UPDATE ".$user_prefix."_users SET name='$realname', user_email='$user_email', femail='$femail', user_website='$user_website', user_password='$user_password', bio='$bio', user_avatar='$user_avatar', user_icq='$user_icq', user_occ='$user_occ', user_from='$user_from', user_interests='$user_interests', user_sig='$user_sig', user_aim='$user_aim', user_yim='$user_yim', user_msnm='$user_msnm', newsletter='$newsletter', user_viewemail='$user_viewemail', user_allow_viewonline='$user_allow_viewonline', user_notify='$user_notify', user_notify_pm='$user_notify_pm', user_popup_pm='$user_popup_pm', user_attachsig='$user_attachsig', user_allowbbcode='$user_allowbbcode', user_allowhtml='$user_allowhtml', user_allowsmile='$user_allowsmile', user_timezone='$user_timezone', user_dateformat='$user_dateformat' WHERE user_id='$user_id'");

$sql = "SELECT user_id, username, user_password, storynum, umode, uorder, thold, noscore, ublockon, theme FROM ".$user_prefix."_users WHERE username='$username' AND user_password='$user_password'";
$result = $db->sql_query($sql);
if ($db->sql_numrows($result) == 1) {
$userinfo = $db->sql_fetchrow($result);
docookie($userinfo[user_id],$userinfo[username],$userinfo[user_password],$userinfo[storynum],$userinfo[umode],$userinfo[uorder],$userinfo[thold],$userinfo[noscore],$userinfo[ublockon],$userinfo[theme],$userinfo[commentmax]);
} else {
echo "<center>"._SOMETHINGWRONG."</center><br>";
}
$db->sql_query("UNLOCK TABLES");
} else {
$db->sql_query("UPDATE ".$user_prefix."_users SET name='$realname', user_email='$user_email', femail='$femail', user_website='$user_website', bio='$bio', user_avatar='$user_avatar', user_icq='$user_icq', user_occ='$user_occ', user_from='$user_from', user_interests='$user_interests', user_sig='$user_sig', user_aim='$user_aim', user_yim='$user_yim', user_msnm='$user_msnm', newsletter='$newsletter', user_viewemail='$user_viewemail', user_allow_viewonline='$user_allow_viewonline', user_notify='$user_notify', user_notify_pm='$user_notify_pm', user_popup_pm='$user_popup_pm', user_attachsig='$user_attachsig', user_allowbbcode='$user_allowbbcode', user_allowhtml='$user_allowhtml', user_allowsmile='$user_allowsmile', user_timezone='$user_timezone', user_dateformat='$user_dateformat' WHERE user_id='$user_id'");
}
Header("Location: modules.php?name=$module_name");
}
}
}