Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Neatsinaujina profilis

Parašė Mr NBA· 2008 Gru. 23 15:12:11
#1

Sveiki, kas gali būti, kad neatsinaujina profilis, tai turnūt klaida update_profile_include.php, gal galite jį pažiūrėti kas blogai?

P.S. profilis vadinasi ne profile.php, o vartotojas.php

Update_profile_include.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
+----------------------------------------------------*/
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_month'] != 0 && $_POST['user_day'] != 0 && $_POST['user_year'] != 0) {
   $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'])) : "";
$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'])) : "";
$konferencija = isNum($_POST['konferencija']) ? $_POST['konferencija'] : "0";
$komanda1 = $_POST['komanda1'];

if ($error == "") {
   if ($userdata['user_avatar'] == "" && !empty($_FILES['user_avatar'])) {
      $newavatar = $_FILES['user_avatar'];
      if (is_uploaded_file($newavatar['tmp_name']) && $newavatar['size'] <= 20000) {
         $avatarext = strrchr($newavatar['name'],".");
         if (eregi(".gif", $avatarext) || eregi(".jpg", $avatarext) || eregi(".png", $avatarext)) {
            $avatarname = substr($newavatar['name'], 0, strrpos($newavatar['name'], "."));
            $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);
            $size = getimagesize(IMAGES."avatars/".$avatarname);
            if ($size['0'] > 100 || $size['1'] > 100) {
               unlink(IMAGES."avatars/".$avatarname);
            }
         }
      }
   }
   
   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', konferencija='$konferencija', komanda1='$komanda1' 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");
   }
}
?>



Redagavo Mr NBA· 2008 Gru. 23 15:12:24

Parašė Enzo· 2008 Gru. 23 15:12:27
#2

redirect("edit_profile.php?update_profile=ok");

va kas negerai. Keičiam į:

redirect("vartotojas.php?update_profile=ok");

Parašė Mr NBA· 2008 Gru. 23 15:12:29
#3

bet edit_profile.php pas amne taip ir vadinasi, bet profile.php vadinasi vartotojas.php

Parašė JLS· 2008 Gru. 23 15:12:11
#4

ne cia klaida, klaida yra manau arba :
$komanda1 = $_POST['komanda1'];



arba :
$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', konferencija='$konferencija', komanda1='$komanda1' WHERE user_id='".$userdata['user_id']."'" );



pats dariau bet nzn kaip padaryti kad atsinaujintu profilis nes be sito : redirect("vartotojas.php?update_profile=ok"); atsinaujino gerai kai idejau megstamas konferencijas

Redagavo JLS· 2008 Gru. 23 15:12:06

Parašė Enzo· 2008 Gru. 23 16:12:39
#5

Kalėdinis Mr NBA parašė:
bet edit_profile.php pas amne taip ir vadinasi, bet profile.php vadinasi vartotojas.php


:D užsižiopsojau ir pramiegojau šitą dalyką :D

Parašė JLS· 2008 Gru. 23 16:12:51
#6

paziurekit jei galit man rodos ankstesniam poste parasyta, kur gali buti klaidu.

Parašė Mr NBA· 2008 Gru. 23 17:12:23
#7

Daugiau niekas nepabandysit?

Parašė Mr NBA· 2008 Gru. 24 09:12:58
#8

Sorry už flood, bet edit_profile.php radau dar 1 klaidą va:
Čia niekur nėra parašyta kad user_komanda1

<td class='tbl2' colspan='2'><b><center>Kita</center></b></td>
</tr>
<td class='tbl'>Komanda:</td>
<td class='tbl'><select name='belenkoks' class='textbox' style='width:100px;'>
<option value='0'>Atlanta</option>
<option value='1'>Boston</option>
<option value='2'>Charlotte</option>
<option value='3'>Chicago</option>
<option value='4'>Cleveland</option>
<option value='5'>DallasClippers</option>
<option value='6'>Denver</option>
<option value='7'>Detroit</option>
<option value='8'>Goden State</option>
<option value='9'>Houston</option>
<option value='10'>Indiana</option>
<option value='11'>Clippers</option>
<option value='12'>Lakers</option>
<option value='13'>Memphis</option>
<option value='14'>Miami</option>
<option value='15'>Milwaukee</option>
<option value='16'>Minnesota</option>
<option value='17'>New Jersey</option>
<option value='18'>New Orlean</option>
<option value='19'>New York</option>
<option value='20'>Orlando</option>
<option value='21'>Philadelphia</option>
<option value='22'>Phoenix</option>
<option value='23'>Portland</option>
<option value='24'>Sacramento</option>
<option value='25'>San Antonio</option>
<option value='26'>Oklahoma</option>
<option value='27'>Toronto</option>
<option value='28'>Utah</option>
<option value='29'>Washington</option>
</select></td>
</tr>



Parašė Mr NBA· 2008 Gru. 24 11:12:59
#9

Sorry už flood, bet edit_profile.php radau dar 1 klaidą va:
Čia niekur nėra parašyta kad user_komanda1

<td class='tbl2' colspan='2'><b><center>Kita</center></b></td>
</tr>
<td class='tbl'>Komanda:</td>
<td class='tbl'><select name='belenkoks' class='textbox' style='width:100px;'>
<option value='0'>Atlanta</option>
<option value='1'>Boston</option>
<option value='2'>Charlotte</option>
<option value='3'>Chicago</option>
<option value='4'>Cleveland</option>
<option value='5'>DallasClippers</option>
<option value='6'>Denver</option>
<option value='7'>Detroit</option>
<option value='8'>Goden State</option>
<option value='9'>Houston</option>
<option value='10'>Indiana</option>
<option value='11'>Clippers</option>
<option value='12'>Lakers</option>
<option value='13'>Memphis</option>
<option value='14'>Miami</option>
<option value='15'>Milwaukee</option>
<option value='16'>Minnesota</option>
<option value='17'>New Jersey</option>
<option value='18'>New Orlean</option>
<option value='19'>New York</option>
<option value='20'>Orlando</option>
<option value='21'>Philadelphia</option>
<option value='22'>Phoenix</option>
<option value='23'>Portland</option>
<option value='24'>Sacramento</option>
<option value='25'>San Antonio</option>
<option value='26'>Oklahoma</option>
<option value='27'>Toronto</option>
<option value='28'>Utah</option>
<option value='29'>Washington</option>
</select></td>
</tr>



Parašė sniuff· 2008 Gru. 24 11:12:28
#10

 name='belenkoks' cl




čia gal ?

Parašė Mr NBA· 2008 Gru. 24 11:12:36
#11

bandžiau pakeisti į user_komanda1 , vistiek nieko.