foxhound |
|
---|---|
I am trying to create a new plugin which adds additional fields to a user profile. I have gotten it so far that when I edit the user profile the fields are there and actually contain the data I insert to the DB upon plugin install. But I can for the life of me not figure out how to set the plugin up so that if the field value is changed it actually saves this new data when the user presses "submit". I have created a php for the hooks to "do" when the user updates the profile:
Thanks in advance! Added 4 hours later: So here is the edit part of the plugin: if (!defined('SED_CODE')) { die('Wrong URL.'); } $userid = sed_import('id','G','INT'); $sub_sql = sed_sql_query("SELECT user_subscr_end_date, user_subscr_date_stamp, user_subscriber_status FROM $db_users WHERE user_id='$userid'"); if (sed_sql_numrows($sub_sql) > 0) { $sub = sed_sql_fetcharray($sub_sql); $sub_end = $sub['user_subscr_end_date']; $sub_stamp = $sub['user_subscr_date_stamp']; $sub_status = $sub['user_subscriber_status']; $sub_stamp = strtotime($sub_end); } $t->assign(array( "USERS_EDIT_SUBSCRIPDATE" => "<input type=\"text\" class=\"text\" name=\"subscr_end_date\" value=\"".htmlspecialchars($sub['user_subscr_end_date'])."\" size=\"8\" maxlength=\"10\" />", "USERS_EDIT_SUBSCRIPSTATUS" => "<input type=\"text\" class=\"text\" name=\"subscriber_status\" value=\"".htmlspecialchars($sub['user_subscriber_status'])."\" size=\"1\" maxlength=\"1\" />" ));
And here is the update.done part of the plugin: defined('SED_CODE') or die('Wrong URL'); $userid = sed_import('id','G','INT'); $sub_sql_u2 = sed_sql_query("UPDATE $db_users SET user_subscr_end_date='".sed_sql_prep($sub_end)."', user_subscr_date_stamp='".sed_sql_prep($sub_stamp)."', user_subscriber_status='".sed_sql_prep($sub_status)."', user_auth='' WHERE user_id=$userid"); Now, I have tried about a few million different sql queries trying to perform the update and everything fails. My DB values are never updated when I change them in the user edit page. Added 8 hours later: I tried a few dozen other different values for " <img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
|
|
Bu gönderi foxhound tarafından düzenlendi (2015-12-15 08:03, 9 yıllar önce) |