Więcej Komunikatorów
|
Marvin-Nekromanta |
Dodany dnia 31.08.2006 16:34:13
|
Początkujący
Postów: 109
Data rejestracji: 15.08.2006 20:58
|
Witam.
Dziś postanowiłem rozszerzyć Profil Użytkownika o kilka komunikatorów. Zmodyfikowałem plik edit_profile.php, plik profile.php, pliki językowe, update_profile_include.php, oraz dodałem tabelę w Bazie. Komunikatory które dodałem to Spik (user_spik) i Stefan (user_stefan). Wszystko już mam, lecz gdy wpisuję w profilu dane do pół Spik lub Stefan po aktualizacji profilu dane znikają. Oto kody edit_profile.php oraz profile.php:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."members-profile.php";
include LOCALE.LOCALESET."user_fields.php";
if (isset($_POST['update_profile'])) require_once INCLUDES."update_profile_include.php";
opentable($locale['440']);
if (iMEMBER) {
if ($userdata['user_birthdate']!="0000-00-00") {
$user_birthdate = explode("-", $userdata['user_birthdate']);
$user_day = number_format($user_birthdate['2']);
$user_month = number_format($user_birthdate['1']);
$user_year = $user_birthdate['0'];
} else {
$user_day = 0; $user_month = 0; $user_year = 0;
}
$theme_files = makefilelist(THEMES, ".|..", true, "folders");
array_unshift($theme_files, "Default");
$offset_list = "";
for ($i=-13;$i<17;$i++) {
if ($i > 0) { $offset="+".$i; } else { $offset=$i; }
$offset_list .= "<option".($offset == $userdata['user_offset'] ? " selected" : "").">$offset</option>\n";
}
echo "<form name='inputform' method='post' action='".FUSION_SELF."' enctype='multipart/form-data'>\n";
echo "<table align='center' cellspacing='0' cellpadding='0'>\n";
if (isset($update_profile)) {
if (!isset($error)) {
echo "<tr>\n<td colspan='2' class='tbl'>".$locale['441']."<br><br>\n</td>\n</tr>\n";
} else {
echo "<tr>\n<td colspan='2' class='tbl'>".$locale['442']."<br><br>\n$error<br></td>\n</tr>\n";
unset($error);
}
}
echo "<tr>
<td class='tbl'>".$locale['u001']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><input type='text' name='user_name' value='".$userdata['user_name']."' maxlength='30' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td class='tbl'>".$locale['u003']."</td>
<td class='tbl'><input type='password' name='user_newpassword' maxlength='20' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td class='tbl'>".$locale['u004']."</td>
<td class='tbl'><input type='password' name='user_newpassword2' maxlength='20' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td class='tbl'>".$locale['u005']."<span style='color:#ff0000'>*</span></td>
<td class='tbl'><input type='text' name='user_email' value='".$userdata['user_email']."' maxlength='100' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td class='tbl'>".$locale['u006']."</td>
<td class='tbl'><input type='radio' name='user_hide_email' value='1'".($userdata['user_hide_email'] == "1" ? " checked" : "").">".$locale['u007']."
<input type='radio' name='user_hide_email' value='0'".($userdata['user_hide_email'] == "0" ? " checked" : "").">".$locale['u008']."</td>
</tr>
<tr>
<td class='tbl'>".$locale['u009']."</td>
<td class='tbl'><input type='text' name='user_location' value='".$userdata['user_location']."' maxlength='50' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td class='tbl'>".$locale['u010']." <class='small2'>(dd/mm/yyyy)</span></td>
<td class='tbl'><select name='user_day' class='textbox'>\n<option> </option>\n";
for ($i=1;$i<=31;$i++) echo "<option".($user_day == $i ? " selected" : "").">$i</option>\n";
echo "<select name='usermonth' class='textbox'>
<option".($user_month == $locale['sty'] ? " selected" : "").">".$locale['1']."</option>
<option".($user_month == $locale['lut'] ? " selected" : "").">".$locale['2']."</option>
<option".($user_month == $locale['mar'] ? " selected" : "").">".$locale['3']."</option>
<option".($user_month == $locale['kwi'] ? " selected" : "").">".$locale['4']."</option>
<option".($user_month == $locale['maj'] ? " selected" : "").">".$locale['5']."</option>
<option".($user_month == $locale['cze'] ? " selected" : "").">".$locale['6']."</option>
<option".($user_month == $locale['lip'] ? " selected" : "").">".$locale['7']."</option>
<option".($user_month == $locale['sie'] ? " selected" : "").">".$locale['8']."</option>
<option".($user_month == $locale['wrz'] ? " selected" : "").">".$locale['9']."</option>
<option".($user_month == $locale['paz'] ? " selected" : "").">".$locale['10']."</option>
<option".($user_month == $locale['lis'] ? " selected" : "").">".$locale['11']."</option>
<option".($user_month == $locale['gru'] ? " selected" : "").">".$locale['12']."</option>
</select>
<select name='user_year' class='textbox'>\n<option> </option>\n";
for ($i=1950;$i<=2006;$i++) echo "<option".($user_year == $i ? " selected" : "").">$i</option>\n";
echo "</select>
</td>
</tr>
<tr>
<td class='tbl'>".$locale['u013']."</td>
<td class='tbl'><input type='text' name='user_aim' value='".$userdata['user_aim']."' maxlength='100' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td class='tbl'>".$locale['u011']."</td>
<td class='tbl'><input type='text' name='user_icq' value='".$userdata['user_icq']."' maxlength='15' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td class='tbl'>".$locale['u012']."</td>
<td class='tbl'><input type='text' name='user_msn' value='".$userdata['user_msn']."' maxlength='100' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td class='tbl'>".$locale['u021']."</td>
<td class='tbl'><input type='text' name='user_yahoo' value='".$userdata['user_yahoo']."' maxlength='100' class='textbox' style='width:200px;'></td>
</tr>
[color=red]<td class='tbl'>".$locale['spik']."</td>
<td class='tbl'><input type='text' name='user_spik' value='".$userdata['user_spik']."' maxlength='100' class='textbox' style='width:200px;'></td>
</tr>
<td class='tbl'>".$locale['stefan']."</td>
<td class='tbl'><input type='text' name='user_stefan' value='".$userdata['user_stefan']."' maxlength='100' class='textbox' style='width:200px;'></td>[/color]
</tr>
<tr>
<td class='tbl'>".$locale['u014']."</td>
<td class='tbl'><input type='text' name='user_web' value='".$userdata['user_web']."' maxlength='100' class='textbox' style='width:200px;'></td>
</tr>
<tr>
<td class='tbl'>".$locale['u015']."</td>
<td class='tbl'><select name='user_theme' class='textbox' style='width:100px;'>
".makefileopts($theme_files, $userdata['user_theme'])."
</select></td>
</tr>
<tr>
<td class='tbl'>".$locale['u016']."</td>
<td class='tbl'><select name='user_offset' class='textbox' style='width:100px;'>
$offset_list</select></td>
</tr>\n";
if (!$userdata['user_avatar']) {
echo "<tr>
<td class='tbl'>".$locale['u017']."</td>
<td class='tbl'>
<input type='file' name='user_avatar' enctype='multipart/form-data' class='textbox' style='width:200px;'><br>
<span class='small2'>".$locale['u018']."</span>
</td>
</tr>\n";
}
echo "<tr>
<td valign='top' class='tbl'>".$locale['u020']."</td>
<td class='tbl'>
<textarea name='user_sig' rows='5' class='textbox' style='width:295px'>".$userdata['user_sig']."</textarea><br>
<input type='button' value='b' class='button' style='font-weight:bold;width:25px;' onClick=\"addText('user_sig', '[b]', '[/b]');\">
<input type='button' value='i' class='button' style='font-style:italic;width:25px;' onClick=\"addText('user_sig', '[i]', '[/i]');\">
<input type='button' value='u' class='button' style='text-decoration:underline;width:25px;' onClick=\"addText('user_sig', '[u]', '[/u]');\">
<input type='button' value='url' class='button' style='width:30px;' onClick=\"addText('user_sig', '[url]', '[/url]');\">
<input type='button' value='mail' class='button' style='width:35px;' onClick=\"addText('user_sig', '[mail]', '[/mail]');\">
<input type='button' value='img' class='button' style='width:30px;' onClick=\"addText('user_sig', '[img]', '[/img]');\">
<input type='button' value='center' class='button' style='width:45px;' onClick=\"addText('user_sig', '[center]', '[/center]');\">
<input type='button' value='small' class='button' style='width:40px;' onClick=\"addText('user_sig', '[small]', '[/small]');\">
</td>
</tr>
<tr>
<td align='center' colspan='2' class='tbl'><br>\n";
if ($userdata['user_avatar']) {
echo $locale['u017']."<br>\n<img src='".IMAGES."avatars/".$userdata['user_avatar']."'><br>
<input type='checkbox' name='del_avatar' value='y'> ".$locale['u019']."
<input type='hidden' name='user_avatar' value='".$userdata['user_avatar']."'><br><br>\n";
}
echo "<input type='hidden' name='user_hash' value='".$userdata['user_password']."'>
<input type='submit' name='update_profile' value='".$locale['460']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
} else {
echo "<center><br>\n".$locale['03']."<br>\n<br></center>\n";
closetable();
}
require_once "side_right.php";
require_once "footer.php";
?>
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."members-profile.php";
include LOCALE.LOCALESET."user_fields.php";
if (!isset($lookup) || !isNum($lookup)) fallback("index.php");
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='$lookup'");
if (dbrows($result)) { $data = dbarray($result); } else { redirect("index.php"); }
opentable
($locale['420'].$data['user_name']);
echo "<table align='center' cellpadding='0' cellspacing='0'>
<tr>\n<td class='tbl2' colspan='3'><b>".$locale['421']."</b></td>\n\n</tr>
<tr>\n<td align='center' width='150' rowspan='8' class='tbl'>\n";
echo ($data['user_avatar'] ? "<img src='".IMAGES."avatars/".$data['user_avatar']."'>" : $locale['u046'])."\n</td>\n";
echo "<tr>\n<td class='tbl'>".$locale['0']."</td>\n<td class='tbl'>\n";
echo ($data['0'] ? $data['user_0'] : $locale['0'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['0']."</td>\n<td class='tbl'>\n";
echo ($data['0'] ? $data['user_0'] : $locale['0'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' colspan='3'><b>".$locale['jego']."</b></td>\n\n</tr>\n";
echo "<td width='125' class='tbl'>".$locale['u005']."</td>\n<td class='tbl'>\n";
echo ($data['user_hide_email'] != "1" || iADMIN ? "<a href='mailto:".str_replace("@","@",$data['user_email'])."'>".str_replace("@","@",$data['user_email'])."</a>" : $locale['u047'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u014']."</td>\n<td class='tbl'>";
if ($data['user_web']) {
$urlprefix = !strstr($data['user_web'], "http://") ? "http://" : "";
echo "<a href='".$urlprefix.$data['user_web']."' target='_blank'>".$data['user_web']."</a></td>\n</tr>\n";
} else {
echo $locale['u048']."</td>\n</tr>\n";
}
echo "<tr>\n<td class='tbl'>".$locale['0']."</td>\n<td class='tbl'>\n";
echo ($data['0'] ? $data['user_0'] : $locale['0'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['0']."</td>\n<td class='tbl'>\n";
echo ($data['0'] ? $data['user_0'] : $locale['0'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['0']."</td>\n<td class='tbl'>\n";
echo ($data['0'] ? $data['user_0'] : $locale['0'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['0']."</td>\n<td class='tbl'>\n";
echo ($data['0'] ? $data['user_0'] : $locale['0'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' colspan='3'><b>".$locale['onim']."</b></td>\n\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u009']."</td>\n<td class='tbl'>\n";
echo ($data['user_location'] ? $data['user_location'] : $locale['u048'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl2' colspan='3'><b>".$locale['kom1']."</b></td>\n\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u013']."</td>\n<td class='tbl'>\n";
echo ($data['user_aim'] ? $data['user_aim'] : $locale['u048'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u011']."</td>\n<td class='tbl'>\n";
echo ($data['user_icq'] ? $data['user_icq'] : $locale['u048'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u012']."</td>\n<td class='tbl'>\n";
echo ($data['user_msn'] ? $data['user_msn'] : $locale['u048'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u021']."</td>\n<td class='tbl'>\n";
echo ($data['user_yahoo'] ? $data['user_yahoo'] : $locale['u048'])."</td>\n</tr>\n";
[color=red]echo "<tr>\n<td class='tbl'>".$locale['spik']."</td>\n<td class='tbl'>\n";
echo ($data['user_spik'] ? $data['user_spik'] : $locale['u048'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['stefan']."</td>\n<td class='tbl'>\n";
echo ($data['user_stefan'] ? $data['user_stefan'] : $locale['u048'])."</td>\n</tr>\n";[/color]
echo "<tr>\n<td class='tbl2' colspan='3'><b>".$locale['422']."</b></td>\n\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u040']."</td>\n<td class='tbl' colspan='2'>\n";
echo showdate("longdate", $data['user_joined'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u041']."</td>\n<td class='tbl' colspan='2'>\n";
echo dbcount("(shout_id)", "shoutbox", "shout_name='".$data['user_id']."'")."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u042']."</td>\n<td class='tbl' colspan='2'>\n";
echo dbcount("(comment_id)", "comments", "comment_name='".$data['user_id']."'")."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u043']."</td>\n<td class='tbl' colspan='2'>\n";
//echo dbcount("(post_id)", "posts", "post_author='".$data['user_id']."'")."</td>\n</tr>\n";
echo $data['user_posts']."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u044']."</td>\n<td class='tbl' colspan='2'>\n";
echo ($data['user_lastvisit'] != 0 ? showdate("longdate", $data['user_lastvisit']) : $locale['u049'])."</td>\n</tr>\n";
echo "<tr>\n<td class='tbl'>".$locale['u045']."</td>\n<td class='tbl' colspan='2'>\n";
echo getuserlevel($data['user_level'])."</td>\n</tr>\n";
if ($data['user_groups']) {
echo "<tr>\n<td class='tbl2' colspan='3'><b>".$locale['423']."</b></td>\n\n</tr>\n<tr>\n<td class='tbl' colspan='3'>\n";
$user_groups = (strpos($data['user_groups'], ".") == 0 ? explode(".", substr($data['user_groups'], 1)) : explode(".", $data['user_groups']));
for ($i = 0;$i < count($user_groups);$i++) {
echo getgroupname($user_groups[$i]);
if ($i != (count($user_groups)-1)) echo ", ";
}
echo "</td>\n</tr>\n";
}
if ($data['user_id'] != $userdata['user_id']) {
echo "<tr><td align='center' colspan='3' class='tbl'><br>\n<a href='messages.php?msg_send=".$data['user_id']."'>".$locale['u060']."</a>\n";
echo "</td>\n</tr>\n";
}
echo "</table>\n";
closetable();
require_once "side_right.php";
require_once "footer.php";
?>
Z góry dziękuję za odpowiedz.
PS. Szukałem i nic nie znalazłem. Przepraszam jeżeli czegoś zapomniałem.
Zmiany są na czerwono zaznaczone.
Edytowane przez Marvin-Nekromanta dnia 01.09.2006 10:46:54
|
|
|
|
Wścibski Gość |
Dodany dnia 06.01.2025 03:55:03
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
artur123 |
Dodany dnia 31.08.2006 18:51:54
|
Przedszkolak
Postów: 79
Data rejestracji: 09.05.2006 15:09
|
Siema, Jeszcze powinieneś edytować plik viewthread.php i dodać w nim wyświetlanie statusu usera w spiku i stefanie. |
|
|
|
pawkow |
Dodany dnia 31.08.2006 19:30:05
|
Bywalec
Postów: 538
Data rejestracji: 05.06.2005 08:27
|
(...) oraz dodałem tabelę w Bazie (...)
A po co dodałes tabelę, skoro wszystko masz w tabeli _users ?? Powinienneś był dodać pola.
Zapraszam na motoklimat.pl - Baza wiedzy o samochodach, modele, spalanie, specyfikacje.
|
|
|
|
Marvin-Nekromanta |
Dodany dnia 31.08.2006 20:31:57
|
Początkujący
Postów: 109
Data rejestracji: 15.08.2006 20:58
|
Hej!
Sorry. Bląd językowy chodziło mi o to że dodałem pola w Bazie, a nie tabele. Dzięki @pawkow.
@artur123: viewthread.php zmodyfikowałem, ale nie zamieściłem, bo trochę duży jest, a profile.php i edit_profile już dość miejsca zająły. Aha problem dotyczy oczywiście strony: http://radoslawgr...funpic.de/ .
Edytowane przez Marvin-Nekromanta dnia 31.08.2006 20:33:13
|
|
|
|
pawkow |
Dodany dnia 31.08.2006 21:00:03
|
Bywalec
Postów: 538
Data rejestracji: 05.06.2005 08:27
|
gdzie jest zawartość update_profile_include.php ??
Zapraszam na motoklimat.pl - Baza wiedzy o samochodach, modele, spalanie, specyfikacje.
|
|
|
|
Marvin-Nekromanta |
Dodany dnia 31.08.2006 21:43:34
|
Początkujący
Postów: 109
Data rejestracji: 15.08.2006 20:58
|
Tutaj:
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location: ../index.php"); exit; }
if (!iMEMBER) fallback("index.php");
$error = ""; $set_avatar = "";
$username = trim(eregi_replace(" +", " ", $_POST['user_name']));
if ($username == "" || $_POST['user_email'] == "") {
$error .= $locale['480']."<br>\n";
} else {
if (!preg_match("/^[-0-9A-Z_@\s]+$/i", $username)) $error .= $locale['481']."<br>\n";
if ($username != $userdata['user_name']) {
$result = dbquery("SELECT user_name FROM ".$db_prefix."users WHERE user_name='$username'");
if (dbrows($result) != 0) $error = $locale['482']."<br>\n";
}
if (!preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $_POST['user_email'])) $error .= $locale['483']."<br>\n";
if ($_POST['user_email'] != $userdata['user_email']) {
$result = dbquery("SELECT user_email FROM ".$db_prefix."users WHERE user_email='".$_POST['user_email']."'");
if (dbrows($result) != 0) $error = $locale['484']."<br>\n";
}
}
if ($_POST['user_newpassword'] != "") {
if ($_POST['user_newpassword2'] != $_POST['user_newpassword']) {
$error .= $locale['485']."<br>";
} else {
if ($_POST['user_hash'] == $userdata['user_password']) {
if (!preg_match("/^[0-9A-Z@]{6,20}$/i", $_POST['user_newpassword'])) {
$error .= $locale['486']."<br>\n";
}
} else {
$error .= $locale['487']."<br>\n";
}
}
}
$user_hide_email = isNum($_POST['user_hide_email']) ? $_POST['user_hide_email'] : "1";
$user_location = isset($_POST['user_location']) ? stripinput(trim($_POST['user_location'])) : "";
if ($_POST['user_day'] != "--" && $_POST['user_month'] != "--" && $_POST['user_year'] != "----") {
$user_birthdate = (isNum($_POST['user_year']) ? $_POST['user_year'] : "0000")
."-".(isNum($_POST['user_month']) ? $_POST['user_month'] : "00")
."-".(isNum($_POST['user_day']) ? $_POST['user_day'] : "00");
} else {
$user_birthdate = "0000-00-00";
}
$user_aim = isset($_POST['user_aim']) ? stripinput(trim($_POST['user_aim'])) : "";
$user_icq = isset($_POST['user_icq']) ? stripinput(trim($_POST['user_icq'])) : "";
$user_msn = isset($_POST['user_msn']) ? stripinput(trim($_POST['user_msn'])) : "";
$user_yahoo = isset($_POST['user_yahoo']) ? stripinput(trim($_POST['user_yahoo'])) : "";
[color=red]$user_spik = isset($_POST['user_spik']) ? stripinput(trim($_POST['user_spik'])) : "";
$user_stefan = isset($_POST['user_stefan']) ? stripinput(trim($_POST['user_stefan'])) : "";[/color]
$user_web = isset($_POST['user_web']) ? stripinput(trim($_POST['user_web'])) : "";
$user_theme = stripinput($_POST['user_theme']);
$user_offset = is_numeric($_POST['user_offset']) ? $_POST['user_offset'] : "0";
$user_sig = isset($_POST['user_sig']) ? stripinput(trim($_POST['user_sig'])) : "";
if ($error == "") {
$newavatar = $_FILES['user_avatar'];
if ($userdata['user_avatar'] == "" && !empty($newavatar['name']) && is_uploaded_file($newavatar['tmp_name'])) {
$avatarext = strrchr($newavatar['name'],".");
$avatarname = substr($newavatar['name'], 0, strrpos($newavatar['name'], "."));
if (preg_match("/^[-0-9A-Z_\[\]]+$/i", $avatarname) && preg_match("/(\.gif|\.GIF|\.jpg|\.JPG|\.png|\.PNG)$/", $avatarext) && $newavatar['size'] <= 30720) {
$avatarname = $avatarname."[".$userdata['user_id']."]".$avatarext;
$set_avatar = "user_avatar='$avatarname', ";
move_uploaded_file($newavatar['tmp_name'], IMAGES."avatars/".$avatarname);
chmod(IMAGES."avatars/".$avatarname,0644);
if ($size = @getimagesize(IMAGES."avatars/".$avatarname)) {
if ($size['0'] > 100 || $size['1'] > 100) {
unlink(IMAGES."avatars/".$avatarname);
$set_avatar = "";
} elseif (!verify_image(IMAGES."avatars/".$avatarname)) {
unlink(IMAGES."avatars/".$avatarname);
$set_avatar = "";
}
} else {
unlink(IMAGES."avatars/".$avatarname);
$set_avatar = "";
}
}
}
if (isset($_POST['del_avatar'])) {
$set_avatar = "user_avatar='', ";
unlink(IMAGES."avatars/".$userdata['user_avatar']);
}
if ($user_newpassword != "") { $newpass = " user_password=md5('$user_newpassword'), "; } else { $newpass = " "; }
$result = dbquery("UPDATE ".$db_prefix."users SET user_name='$username',".$newpass."user_email='".$_POST['user_email']."', user_hide_email='$user_hide_email', user_location='$user_location', user_birthdate='$user_birthdate', user_aim='$user_aim', user_icq='$user_icq', user_msn='$user_msn', user_yahoo='$user_yahoo', user_web='$user_web', user_theme='$user_theme', user_offset='$user_offset', ".$set_avatar."user_sig='$user_sig' WHERE user_id='".$userdata['user_id']."'");
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='".$userdata['user_id']."'");
if (dbrows($result) != 0) {
$userdata = dbarray($result);
redirect("edit_profile.php?update_profile=ok");
}
}
?>
Na czerwono zaznaczyłem zmiany.
Edytowane przez Marvin-Nekromanta dnia 01.09.2006 10:44:14
|
|
|
|
pawkow |
Dodany dnia 31.08.2006 21:48:54
|
Bywalec
Postów: 538
Data rejestracji: 05.06.2005 08:27
|
podaj adres stronki, nie będę analizował każdej linijki, zobaczę co jest, rejestrne sie i sie naprawi. Jak ja dodawałem pola, to zawsze działało, więc i tu zadziała.
Zapraszam na motoklimat.pl - Baza wiedzy o samochodach, modele, spalanie, specyfikacje.
|
|
|
|
Marvin-Nekromanta |
Dodany dnia 31.08.2006 21:58:35
|
Początkujący
Postów: 109
Data rejestracji: 15.08.2006 20:58
|
Proszę oto adres:
http://radoslawwg...funpic.de/
Dzięki, że pomagasz.
Edytowane przez Marvin-Nekromanta dnia 31.08.2006 21:59:45
|
|
|