Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Probelma taisant Power Fusion Forum

Parašė SaZz· 2011 Spa. 24 10:10:36
#1

Prašiau pagalbos Lt modai saite bet deje tokių neatsirado kurie padėt galėjo
Taigi esu ant php lyg ir naujokas na bent jau pažengęs naujokas arba besimokantis na bet tiek to.

Taigi kokia gi problema?

Bandžiau pridėti ant Power Fusion Forum skype laukelį kad žmonės galėtu dadėti ar redaguoti savo skype.

Kadangi naujokas bandžiau viską pateikti pagal šuos pvz kurie jau buvo usercp.php faile :)

   echo "<div><img src='".THEME."images/bullet.gif' alt='' /><span>&nbsp;</span><a href='".FUSION_SELF."?editavatar=".$user_id."'>".$locale['CP113']."</a></div>\n";




Ir

} else if (isset($_GET['editpassword']) && isnum($_GET['editpassword']) && $_GET['editpassword'] == $user_id) {

include LOCALE.LOCALESET."edit_profile.php";
include LOCALE.LOCALESET."user_fields.php";

   
   if (isset($_GET['update_profile'])) {

   $user_name = trim(eregi_replace(" +", " ", $_POST['user_name']));
    $user_email = trim(stripinput($_POST['user_email']));
    $user_new_password = trim(stripinput($_POST['user_new_password']));
    $user_new_password2 = trim(stripinput($_POST['user_new_password2']));



if (iADMIN) {
   $user_new_admin_password = trim(stripinput($_POST['user_new_admin_password']));
   $user_new_admin_password2 = trim(stripinput($_POST['user_new_admin_password2']));
} else {
   $user_new_admin_password = "";
}

if ($user_name == "" || $user_email == "") {
   $error .= $locale['430']."<br />\n";
} else {
   if (preg_check("/^[-0-9A-Z_@\s]+$/i", $user_name)) {
      if ($user_name != $user_data['user_name']) {
         $result = dbquery("SELECT user_name FROM ".DB_USERS." WHERE user_name='".$user_name."' AND user_id<>'".$userdata['user_id']."'");
         if (dbrows($result)) {
            $error .= $locale['432']."<br />\n";
         }
      }
   } else {
      $error .= $locale['431']."<br />\n";
   }
   
   if (preg_check("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $user_email)) {
      if ($user_email != $user_data['user_email']) {
         if ((isset($_POST['user_password'])) && md5(md5($_POST['user_password'])) == $user_data['user_password']) {
            $result = dbquery("SELECT user_email FROM ".DB_USERS." WHERE user_email='".$user_email."'");
            if (dbrows($result)) {
               $error .= $locale['434']."<br />\n";
            }
         } else {
            $error .= $locale['437']."<br />\n";
         }
      }
   } else {
      $error .= $locale['433']."<br />\n";
   }
}


if ($user_new_password) {
   if ((isset($_POST['user_password'])) && md5(md5($_POST['user_password'])) == $user_data['user_password']) {
      if ($user_new_password2 != $user_new_password) {
         $error .= $locale['435']."<br />";
      } else {
         if (!preg_match("/^[0-9A-Z@]{6,20}$/i", $user_new_password)) {
            $error .= $locale['436']."<br />\n";
         }
         if ((md5(md5($user_new_password)) == md5(md5($user_new_admin_password))) || (md5(md5($user_new_password)) == $user_data['user_admin_password'])) {
            $error .= $locale['439']."<br><br>\n";
         }
      }
   } else {
      $error .= $locale['437']."<br />\n";
   }
}

if (iADMIN && $user_new_admin_password) {
   if ($user_data['user_admin_password']) {
      if ((!isset($_POST['user_admin_password'])) || md5(md5($_POST['user_admin_password'])) != $user_data['user_admin_password']) {
         $error .= $locale['441']."<br />\n";
      }
   }
   if (!$error) {
      if ($user_new_admin_password2 != $user_new_admin_password) {
         $error .= $locale['438']."<br />";
      } else {
         if (!preg_match("/^[0-9A-Z@]{6,20}$/i", $user_new_admin_password)) {
            $error .= $locale['440']."<br />\n";
         }
         if ((md5(md5($user_new_admin_password)) == md5(md5($user_new_password))) || (md5(md5($user_new_admin_password)) == $user_data['user_password'])) {
            $error .= $locale['439']."<br><br>\n";
         }
      }
   }
}

$user_hide_email = isnum($_POST['user_hide_email']) ? $_POST['user_hide_email'] : "1";

    if ($user_new_password) { $new_pass = " user_password='".md5(md5($user_new_password))."', "; } else { $new_pass = " "; }
   if (iADMIN && $user_new_admin_password) { $new_admin_pass = " user_admin_password='".md5(md5($user_new_admin_password))."', "; } else { $new_admin_pass = " "; }

    $result = dbquery("UPDATE ".DB_USERS." SET user_name='$user_name',".$new_pass.$new_admin_pass."user_email='$user_email', user_hide_email='$user_hide_email' WHERE user_id='".$user_data['user_id']."'");
    redirect("".FUSION_SELF."?editpassword=".$_GET['editpassword']."");
    }

   set_title($locale['CP116']." - ".$settings['sitename']);
   
    echo "<form name='inputform' method='post' action='".FUSION_SELF."?editpassword=".$_GET['editpassword']."&amp;update_profile'>\n";
    echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
   echo "<tr><td class='tbl2' colspan='2'><b>".$locale['CP116']."</b></td></tr>\n";
   echo "</table>\n";
   
   echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl1'>\n";
   echo "<tr>\n<td align='center' colspan='2' class='tbl'>".$locale['CP203']."<br /><br />\n</td>\n</tr>\n";
   
   echo "<tr>\n<td class='tbl'>".$locale['u001'].":<span style='color:#ff0000'>Vardas</span></td>\n";
    echo "<td class='tbl'><input type='text' name='user_name' value='".$user_data['user_name']."' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td class='tbl'>".$locale['420']."Slaptažodis:</td>\n";
    echo "<td class='tbl'><input type='password' name='user_password' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td class='tbl'>".$locale['u003']."Naujas slaptažodis:</td>\n";
    echo "<td class='tbl'><input type='password' name='user_new_password' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td class='tbl'>".$locale['u004']."Pakartoti slaptažodį:</td>\n";
    echo "<td class='tbl'><input type='password' name='user_new_password2' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
    echo "</tr>\n<tr>\n";
    if (iADMIN) {
       if ($user_data['user_admin_password']) {
      echo "<td class='tbl2'>".$locale['421']."Admin slaptažodis:</td>\n";
      echo "<td class='tbl2'><input type='password' name='user_admin_password' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
      echo "</tr>\n<tr>\n";
   }
   echo "<td class='tbl2'>".$locale['422']."Admin naujas slaptažodis:</td>\n";
   echo "<td class='tbl2'><input type='password' name='user_new_admin_password' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td class='tbl2'>".$locale['423']."Pakartoti slaptažodį:</td>\n";
   echo "<td class='tbl2'><input type='password' name='user_new_admin_password2' maxlength='20' class='textbox' style='width:200px;' /></td>\n";
   echo "</tr>\n<tr>\n";
    }
    echo "<td class='tbl'>".$locale['u005'].":<span style='color:#ff0000'>el-paštas</span></td>\n";
    echo "<td class='tbl'><input type='text' name='user_email' value='".$user_data['user_email']."' maxlength='100' class='textbox' style='width:200px;' /></td>\n";
    echo "</tr>\n<tr>\n";
    echo "<td class='tbl'>".$locale['u006']."Slėpti el-paštą:</td>\n";
    echo "<td class='tbl'><label><input type='radio' name='user_hide_email' value='1'".($user_data['user_hide_email'] == "1" ? " checked='checked'" : "")." />".$locale['u007']."</label> ";
    echo "<label><input type='radio' name='user_hide_email' value='0'".($user_data['user_hide_email'] == "0" ? " checked='checked'" : "")." />".$locale['u008']."</label></td>\n";
    echo "</tr>\n";
   
   echo "<tr>\n<td align='center' colspan='2' class='tbl'><br />\n";
    echo "<input type='hidden' name='user_hash' value='".$user_data['user_password']."' />\n";
    echo "<input type='submit' name='' value='".$locale['CP201']."' class='button' /></td>\n";
   echo "</tr>\n</table>\n</form>\n";




Taigi pamastydamas lyg ir turėtu būti viskas gerai jeigu padarytčiau tokio poat tipo kodą pakeisčiau pritaikidamas skype laukeliui :D

Taigi

echo "<div><img src='".THEME."images/bullet.gif' alt='' /><span>&nbsp;</span><a href='".FUSION_SELF."?user_skype=".$user_id."'>"Skype"</a></div>\n";





O kitam kode idėjau skype bbcode user_skype_include.php esantį kodą ir laukelį kur būtu galima įrašyti skype ir jį išsaugot :D

} else if (isset($_GET['user_skype']) && isnum($_GET['user_skype']) && $_GET['user_skype'] == $user_id) {

include LOCALE.LOCALESET."user_fields.php";
include LOCALE.LOCALESET."edit_profile.php";

// Display user field input
if ($profile_method == "input") {
   $user_skype = isset($user_data['user_skype']) ? $user_data['user_skype'] : "";
   if ($this->isError()) { $user_skype = isset($_POST['user_skype']) ? stripinput($_POST['user_skype']) : $user_skype; }
   
   echo "<tr>\n";
   echo "<td class='tbl".$this->getErrorClass("user_skype")."'><label for='user_skype'>".$locale['uf_skype'].$required."</label></td>\n";
   echo "<td class='tbl".$this->getErrorClass("user_skype")."'>";
   echo "<input type='text' id='user_skype' name='user_skype' value='".$user_skype."' maxlength='16' class='textbox' style='width:200px;' />";
   echo "</td>\n</tr>\n";

   if ($required) { $this->setRequiredJavaScript("user_skype", $locale['uf_skype_error']); }
   
// Display in profile
} elseif ($profile_method == "display") {
   if ($user_data['user_skype']) {
      echo "<tr>\n";
      echo "<td class='tbl1'>".$locale['uf_skype']."</td>\n";
      echo "<td align='right' class='tbl1'><a href='skype:".$user_data['user_skype']."?add'>".$user_data['user_skype']."</a></td>\n";
      echo "</tr>\n";
   }
   
// Insert or update
} elseif ($profile_method == "validate_insert"  || $profile_method == "validate_update") {
   // Get input data
   if (isset($_POST['user_skype']) && ($_POST['user_skype'] != "" || $this->_isNotRequired("user_skype"))) {
      // Set update or insert user data
      $this->_setDBValue("user_skype", stripinput(trim($_POST['user_skype'])));
   } else {
      $this->_setError("user_skype", $locale['uf_skype_error'], true);   
   }
}

   set_title($locale['CP116']." - ".$settings['sitename']);
   
    echo "<form name='inputform' method='post' action='".FUSION_SELF."?user_skype=".$_GET['user_skype']."&amp;update_profile'>\n";
    echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border' style='margin: 0em 0em 0.8em 0em'>\n";
   echo "<tr><td class='tbl2' colspan='2'><b>".$locale['CP116']."</b></td></tr>\n";
   echo "</table>\n";
   
   echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl1'>\n";
   echo "<tr>\n<td align='center' colspan='2' class='tbl'>".$locale['CP203']."<br /><br />\n</td>\n</tr>\n";
   
   echo "<tr>\n<td class='tbl'>".$locale['u001'].":<span style='color:#ff0000'>Skype</span></td>\n";
    echo "<td class='tbl'><input type='text' name='user_skype' value='".$user_data['user_skype']."' maxlength='30' class='textbox' style='width:200px;' /></td>\n";
    echo "</tr>\n<tr>\n";
    echo "</tr>\n";

    echo "<input type='submit' name='' value='".$locale['CP201']."' class='button' /></td>\n";
   echo "</tr>\n</table>\n</form>\n";





Deje klaidų kaip ir tikėjausi yra gavau šią klaidą 500 HTTP klaida (Internal Server Error): Serveriui bandant įvykdyti užklausą susidurta su nenumatyta būsena.:D

Kadangi aš dar mokausi gal padėtumėte kas,šuo atveju?
Paaiškintumėte dar jei nesunku (kas,kur,kodėl):)
Pvz: gal yra kitas bųdas viską taip pat padaryti :) ar dar ką lauksiu su nekantrumu atsakymų :)


Pridedu pilną be klaidų usercp.php failą

Redagavo SaZz· 2011 Spa. 24 10:10:35